**** Merged r40612 from MCS ****
[mono.git] / mcs / gmcs / ChangeLog
1 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2
3         * expression.cs (New.DoResolve): Add complex core type reduction.
4         (New.Constantify): Converts complex core type syntax like 'new int ()'
5         to simple constant.
6         
7 2005-02-14  Raja R Harinath  <rharinath@novell.com>
8
9         * decl.cs (EntryType.EntryType): New constructor to create an
10         updated copy of a cache entry.
11         (MemberCache.AddMethods): Use it.
12         (MemberCache.ClearDeclaredOnly): Remove.
13         (MemberCache.MemberCache): Update.
14
15 2005-02-11  Miguel de Icaza  <miguel@novell.com>
16
17         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
18         variable.  This one is represents the actual low-level declaration
19         of the method, as opposed to the semantic level `IsStatic'.   
20
21         An anonymous method which is hosted into a static method might be
22         actually an instance method.  IsStatic would reflect the
23         container, while MethodIsStatic represents the actual code
24         generated.
25
26         * expression.cs (ParameterReference): Use the new MethodIsStatic
27         instead of IsStatic.
28
29         * anonymous.cs (AnonymousMethod.Compatible): Pass the
30         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
31         set on the current EmitContext. 
32
33         * expression.cs (Cast): Overload DoResolveLValue so we can pass
34         resolve our casted expression as an LValue.  This triggers the
35         proper LValue processing that is later required by Assign.
36
37         This fixes 72347.
38
39         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
40
41 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
42
43         C# 2.0 Fixed buffer implementation
44
45         * anonymous.cs: Update after RegisterHelperClass renaming.
46
47         * attribute.cs (AttributeTester.fixed_buffer_cache):
48         Cache of external fixed buffers.
49         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
50         implementation if field is fixed buffer else null.
51
52         * class.cs
53         (TypeContainer.AddField): Accept FieldMember instead of Field.
54         (FieldBase.IsFieldClsCompliant): Extracted code from
55         VerifyClsCompliance descendant customization.
56         (FixedField): New class handles fixed buffer fields.
57         (FixedFieldExternal): Keeps information about imported fixed
58         buffer.
59         (IFixedField): Make access to internal or external fixed buffer
60         same.
61
62         * cs-parser.jay: Add fixed buffer parsing.
63
64         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
65         buffer.
66
67         * expression.cs (Indirection): Extended implementation to accept
68         fixed buffer field.
69         (PointerArithmetic.Emit): Get element from fixed buffer as well.
70         (ElementAccess.MakePointerAccess): Get type as parameter.
71         (DoResolve): Add fixed buffer field expression conversion.
72         (DoResolveLValue): Ditto.
73         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
74         (ArrayPtr): Derives from FixedBufferPtr.
75         (ArrayPtr.Emit): Add extra emit for array elements.
76
77         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
78
79         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
80         for compiler generated types.
81         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
82
83         * statement.cs (Fixed): Refactored to be easier add fixed buffer
84         and consume less memory.
85         (Fixed.Resolve): Add fixed buffer case.
86
87         * typemanager.cs (compiler_generated_attr_ctor,
88         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
89         (HasElementType): Add our own implementation to work on every
90         runtime.
91
92 2005-02-11  Miguel de Icaza  <miguel@novell.com>
93
94         * anonymous.cs (CaptureContext): Track whether `this' has been
95         referenced.   
96
97         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
98         only captured `this' if it was implicitly done (instance
99         methods/variables were used). 
100
101         * codegen.cs (EmitContext.CaptureThis): New method to flag that
102         `this' must be captured.
103
104 2005-01-30  Miguel de Icaza  <miguel@novell.com>
105  
106         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
107         is null it means that there has been no need to capture anything,
108         so we just create a sibling.
109
110         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
111
112         Just a partial fix.  The other half is fairly elusive.
113         
114 2005-02-10  Raja R Harinath  <rharinath@novell.com>
115
116         Fix #52586, cs0121-4.cs.
117         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
118         and return a hashtable.
119         (MemberCache.ClearDeclaredOnly): New.
120         (MemberCache.MemberCache): Update to change.  Make a deep copy of
121         the method_hash of a base type too.
122         (MemberCache.AddMethods): Adapt to having a deep copy of the base
123         type methods.  Overwrite entries with the same MethodHandle so
124         that the ReflectedType is correct.  The process leaves in base
125         virtual functions and their overrides as distinct entries.
126         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
127         matters since it was boxed in a ArrayList before.
128         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
129         modifier.
130         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
131         case of a virtual function and its override (choose the overload
132         as better).
133         (Invocation.OverloadResolve): Avoid 'override' members during
134         'applicable_type' calculation.
135
136 2005-03-28  Raja R Harinath  <rharinath@novell.com>
137
138         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
139         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
140         GetTypeHandle.  It is possible for a reflected type to derive from
141         a TypeBuilder (e.g., int[] derives from the TypeBuilder
142         System.Array during mscorlib compilation).
143         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
144         contain a method_hash, don't create one either.  Don't create a
145         deep copy of the base cache's method_hash.
146         (MemberCache.SetupCache): Rename back from DeepCopy.
147         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
148         already initialized.  If we see an override function, add its
149         underlying base virtual function to the member_hash too.
150
151 2005-02-09  Raja R Harinath  <rharinath@novell.com>
152
153         Combine two near-redundant caches.
154         * typemanager.cs (method_params): Rename from method_internal_params.
155         (TypeManager.GetParameterData): New.  Replace
156         Invocation.GetParameterData.
157         (TypeManager.LookupParametersByBuilder): Remove.
158         * expression.cs (Invocation.method_parameter_cache): Remove.
159         (Invocation.GetParameterData): Remove.
160         Update to changes.
161         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
162         Update to changes.
163
164 2005-02-08  Raja R Harinath  <rharinath@novell.com>
165
166         Fix #72015.
167         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
168         TypeManager.multicast_delegate_type is null, resolve it by looking
169         up "System.MulticastDelegate".
170         * rootcontext.cs (RootContext.ResolveCore): Simplify.
171
172 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
173             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
174             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
175
176         Fix cs0164.cs.
177         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
178         (LabeledStatement.AddReference): New.  Set 'referenced'.
179         (Goto.Resolve): Use it.
180
181 2005-02-05  John Luke  <john.luke@gmail.com>
182
183         * driver.cs: remove duplicate -doc line in Usage ()
184
185 2005-02-04  Raja R Harinath  <rharinath@novell.com>
186
187         * location.cs (Location.AddFile): Fix CS2002 error report.
188
189 2005-02-02  Martin Baulig  <martin@ximian.com>
190
191         * delegate.cs (Delegate.DefineType): Report an internal error if
192         TypeManager.multicast_delegate_type is null.  See bug #72015 for
193         details.        
194
195 2005-02-02  Raja R Harinath  <rharinath@novell.com>
196
197         Fix a crasher in a variant of #31984.
198         * const.cs (Constant.CheckBase): New override that defers the
199         new-or-override check in case the base type hasn't been populated
200         yet.
201         (Constant.Define): Ensure the new-or-override check is performed.
202
203 2005-02-01  Duncan Mak  <duncan@ximian.com>
204
205         * const.cs (LookupConstantValue): Check that `ce' is not null
206         before calling GetValue ().
207
208 2005-02-01  Raja R Harinath  <rharinath@novell.com>
209
210         Fix test-334.cs (#69519).
211         * cs-parser.jay (using_alias_directive): Pass in an expression to
212         NamespaceEntry.UsingAlias.
213         (using_namespace_directive): Pass in an expression to
214         NamespaceEntry.Using.
215         (namespace_name): Don't flatten to a string.
216         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
217         (NamespaceEntry.AliasEntry.Resolve): Lookup using
218         ResolveAsTypeStep.
219         (NamespaceEntry.UsingEntry): Likewise.
220         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
221         changes.
222         (NamespaceEntry.LookupForUsing): Remove.
223         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
224         names.
225         (NamespaceEntry.Lookup): Remove support for dotted names.
226
227 2005-02-01  Raja R Harinath  <rharinath@novell.com>
228
229         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
230         split into two.
231         (NamespaceEntry.ImplicitParent): Compute on demand.
232         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
233         parallels the current.
234         (NamespaceEntry.LookupForUsing): Use it.
235         (NamespaceEntry.Lookup): If the current namespace-entry is
236         implicit, don't search aliases and using tables.
237
238 2005-02-01  Raja R Harinath  <rharinath@novell.com>
239
240         Fix #31984.
241         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
242         BaseCache here.
243         (TypeContainer.BaseCache): Compute on demand.
244         (TypeContainer.FindMembers): Define constants and types if they're
245         not already created.
246         (FieldMember.Define): Move resetting of ec.InUnsafe before error
247         check.
248         * const.cs (Constant.Define): Make idempotent.
249
250 2005-01-29  Miguel de Icaza  <miguel@novell.com>
251
252         * pending.cs: Produce better code (no nops produced by using Ldarg
253         + value).
254         
255         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
256         i - 1' it should be arg + 1.
257
258         Fixes bug #71819.
259
260 2005-01-28  Raja R Harinath  <rharinath@novell.com>
261
262         * attribute.cs (Attribute.CheckAttributeType): Make private
263         non-virtual.
264         (Attribute.ResolveType): Make virtual.
265         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
266         handling of RootContext.Tree.Types.
267
268 2005-01-27  Raja R Harinath  <rharinath@novell.com>
269
270         Update attribute-handling to use the SimpleName/MemberAccess
271         mechanisms.
272         * cs-parser.jay (attribute): Pass in an expression to the
273         constructors of Attribute and GlobalAttribute.
274         * attribute.cs (Attribute): Take an expression for the name.
275         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
276         passed in attribute name expression.
277         (Attribute.CheckAttributeType): Use it.
278         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
279         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
280         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
281         argument to prevent error messages if the lookup fails.
282
283 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
284
285         * expression.cs (Indirection): Implemented IVariable interface
286         to support indirection in AddressOf operator.
287         (PointerArithmetic.Emit): Add optimalization for case where
288         result can be precomputed.
289
290 2005-01-26  Martin Baulig  <martin@ximian.com>
291
292         * class.cs (TypeContainer.AttributeTargets): Return the correct
293         AttributeTargets depending on our `Kind' instead of throwing an
294         exception; fixes #71632.
295
296 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
297
298         Fix #71257
299         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
300         constant members.
301
302 2005-03-17  Martin Baulig  <martin@ximian.com>
303
304         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
305         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
306
307 2005-03-17  Martin Baulig  <martin@ximian.com>
308
309         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
310         to bool so we can return an error condition.
311         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
312         returned an error.
313
314 2005-03-17  Martin Baulig  <martin@ximian.com>
315
316         * generic.cs (TypeMananager.IsIEnumerable): New public method.
317
318         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
319         converting from an array-type of T to `IEnumerable<T>'.
320
321 2005-03-16  Martin Baulig  <martin@ximian.com>
322
323         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
324         (Nullable.LiftedUnaryMutator): New public class.
325
326         * expression.cs (UnaryMutator.DoResolve): Added support for
327         Nullable Types.
328
329 2005-03-14  Martin Baulig  <martin@ximian.com>
330
331         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
332
333 2005-03-14  Martin Baulig  <martin@ximian.com>
334
335         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
336         the comparision operators `<', `>', `<=' and `>='.
337
338 2005-03-13  Martin Baulig  <martin@ximian.com>
339
340         * generic.cs
341         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
342         avoid confusion with the `NullLiteral'.
343         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
344
345 2005-03-13  Martin Baulig  <martin@ximian.com>
346
347         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
348         comparing arbitrary types with the null literal.
349
350 2005-03-13  Martin Baulig  <martin@ximian.com>
351
352         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
353         boolean operators '&&', '||', '&' and '|'.
354         (Nullable.OperatorTrueOrFalse): New public class.
355
356         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
357         instead of a `StaticCallExpr'; added support for nullables.
358
359 2005-03-10  Martin Baulig  <martin@ximian.com>
360
361         * expression.cs
362         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
363         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
364
365 2005-03-07  Martin Baulig  <martin@ximian.com>
366
367         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
368         it work if `expr' is not an IMemoryLocation.
369         (Nullable.Lifted): Implement IMemoryLocation.
370         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
371         target type.
372
373 2005-03-05  Martin Baulig  <martin@ximian.com>
374
375         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
376         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
377         (Nullable): Added support for lifted unary and binary operators.
378
379         * expression.cs (Unary.DoResolve): Added support for nullable types.
380         (Binary.DoResolve): Likewise.
381         (Conditional.DoResolve): Likewise.
382
383 2005-03-02  Martin Baulig  <martin@ximian.com>
384
385         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
386
387         * class.cs (ClassPart.SetParameterInfo): Override this.
388         (PartialContainer.SetParameterInfo): Override this.
389         (TypeContainer.CheckConstraints): New protected method.
390         (PartialContainer.CheckConstraints): Override this and check
391         whether the same contraints were specified in all parts of a
392         partial generic type definition.
393         (PartialContainer.UpdateConstraints): New public method.
394
395         * generic.cs (TypeParameter.UpdateConstraints): New public method.
396
397 2005-03-02  Martin Baulig  <martin@ximian.com>
398
399         Committing a patch from Carlos Alberto Cortez to fix #72887.
400
401         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
402         casts from `T []' to `int []'.
403
404 2005-03-02  Martin Baulig  <martin@ximian.com>
405
406         * generic.cs (TypeManager.IsEqual): Make this symmetric.
407
408         * expression.cs (Binary.ResolveOperator): When resolving a
409         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
410         `=='.  Fixes #71866.  See gen-127.cs.
411
412 2005-03-02  Martin Baulig  <martin@ximian.com>
413
414         * class.cs (TypeContainer.DoDefineMembers): We also need a default
415         static constructor in static classes.
416
417 2005-03-02  Martin Baulig  <martin@ximian.com>
418
419         * generic.cs
420         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
421         (Nullable.LiftedConversion): Added support for user-defined
422         conversions.
423
424         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
425
426         * cs-parser.jay: Use ComposedCast everywhere instead of
427         NullableType, so we don't need to check for NullableType
428         everywhere.
429         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
430         case where we'll be resolved into a `parenthesized_expression_0'
431         afterwards.
432
433         * convert.cs
434         (Convert.UserDefinedConversion): Added nullable conversions.
435
436 2005-02-28  Martin Baulig  <martin@ximian.com>
437
438         * generic.cs (TypeManager.IsNullableType): New static method.
439         (Nullable): New abstract class.
440         (Nullable.NullLiteral): New public class.
441         (Nullable.LiftedConversion): New public class.
442
443         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
444         `builtin_types opt_nullable'.
445
446         * convert.cs
447         (Convert.ImplicitConversionStandard): Added nullable conversions.
448         (Convert.ExplicitConversionStandard): Likewise.
449         (Convert.ExplicitConversion): Likewise.
450
451 2005-02-26  Martin Baulig  <martin@ximian.com>
452
453         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
454         begin with a "?", for instance "?[]".  Don't do a type lookup if
455         `dim' is empty.
456
457 2005-02-25  Martin Baulig  <martin@ximian.com>
458
459         The first part of Nullable Types :-)
460
461         * generic.cs (NullableType): New public class.
462         (NullCoalescingOperator): New public class.
463         (TypeArguments.Resolve): Add a CS0306 check.
464
465         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
466         (opt_nullable): New rule.
467         (type): Added `opt_nullable' to `namespace_or_type_name',
468         `builtin_types' and `pointer_type'.
469         (array_type): Added `opt_nullable'.
470         (opt_rank_specifier_or_nullable): New rule; this is the
471         combination of `opt_rank_specifier' and `opt_nullable'.
472         (opt_error): New rule; catch errors here.
473         (nullable_type_or_conditional): New rule; we use this to check for
474         nullable and still detect the conditional operator.
475         (local_variable_type): Use `opt_rank_specifier_or_nullable'
476         instead `opt_rank_specifier'.
477
478         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
479         for nullables.
480
481 2005-02-24  Martin Baulig  <martin@ximian.com>
482
483         * README, README.Changes: Removed; they're old and obsolete.
484
485 2005-02-22  Martin Baulig  <martin@ximian.com>
486
487         * generic.cs (TypeParameter.Resolve): If resolving the constraints
488         returned an error, set `constraints' to null to avoid a crash
489         later on.
490         (TypeParameter.ResolveType): Likewise.
491
492 2005-02-22  Martin Baulig  <martin@ximian.com>
493
494         * generic.cs
495         (Constraints.ResolveTypes): Protect against being called twice.
496         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
497         (TypeParameter.ResolveType): New public method; calls
498         constraints.ResolveTypes().
499         (TypeParameter.DefineType): Moved constraints.ResolveType() out
500         into the new ResolveType().
501         (GenericMethod.Define): Call ResolveType() on all our
502         TypeParameter's.        
503
504 2005-02-21  Martin Baulig  <martin@ximian.com>
505
506         * generic.cs
507         (TypeManager.generic_nullable_type): New static public field.
508         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
509
510         * rootcontext.cs
511         (RootContext.ResolveCore): Resolve "System.Nullable`1".
512
513 2005-02-15  Martin Baulig  <martin@ximian.com>
514
515         * generic.cs (ConstructedType.Constraints): Correctly check
516         constraints if the argument type is a type parameter; fixes
517         #72326. 
518
519 2005-02-02  Martin Baulig  <martin@ximian.com>
520
521         * delegate.cs (Delegate.DefineType): Report an internal error if
522         TypeManager.multicast_delegate_type is null.  See bug #72015 for
523         details.        
524
525 2005-01-29  Miguel de Icaza  <miguel@novell.com>
526
527         * pending.cs: Produce better code (no nops produced by using Ldarg
528         + value).
529         
530         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
531         i - 1' it should be arg + 1.
532
533         Fixes bug #71819.
534         
535 2005-01-26  Martin Baulig  <martin@ximian.com>
536
537         * cs-parser.jay (indexer_declarator): Don't report an error if we
538         have type parameters since we can be an explicit interface
539         implementation; fixes #71449.
540
541 2005-01-26  Martin Baulig  <martin@ximian.com>
542
543         * class.cs (TypeContainer.AttributeTargets): Return the correct
544         AttributeTargets depending on our `Kind' instead of throwing an
545         exception; fixes #71632.
546
547 2005-01-26  Martin Baulig  <martin@ximian.com>
548
549         * delegate.cs (Delegate.DefineType): Correctly define our type
550         parameters.  Fixes #71483.
551
552 2005-01-25  Raja R Harinath  <rharinath@novell.com>
553
554         Fix #71602.
555         * expression.cs (MemberAccess.DoResolve): Don't complain with
556         cs0572 when the LHS of a member access has identical name and type
557         name.
558
559 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
560
561         Fix #71651, #71675
562         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
563         CreatePermission.
564         Create custom PermissionSet only for PermissionSetAttribute.
565
566 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
567
568         Fix #71649
569         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
570         delegates in static class.
571
572 2005-01-24  Martin Baulig  <martin@ximian.com>
573
574         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
575         merging an implicit block, just use its reachability.
576
577         * statement.cs (Block.Resolve): Make the unreachable code check
578         work wrt. implicit blocks; see test-337 from #63842.
579
580 2005-01-21  Alp Toker  <alp@atoker.com>
581  
582         * cs-parser.jay: destructor_declaration's container is PartialContainer
583         not Class when partial types are used, so use Kind prop instead of
584         'is'.
585         
586 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
587
588         * cs-parser.jay: Improve error reporting when an interface
589         declares new types.
590
591 2005-01-20  Dick Porter  <dick@ximian.com>
592
593         * support.cs: SeekableStreamReader fix from Sandor Dobos
594         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
595         chars are read.  Fixes bug 70369.
596
597 2005-01-20  Raja R Harinath  <rharinath@novell.com>
598
599         * cs-parser.jay (catch_clause): Simplify current_block handling
600         somewhat.
601
602 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
603
604         * convert.cs (ImplicitStandardConversionExists): Synchronize the
605         code with ImplicitStandardConversion to handle the implicit
606         conversion of method groups into valid delegate invocations. 
607
608         The problem is that in parameter handling we were using this code
609         path.  Fixes bug #64698
610
611 2005-01-19  Raja R Harinath  <rharinath@novell.com>
612
613         * cs-parser.jay: Fix several infelicities.
614         - Avoid assigning to the parser value stack.  Code like 
615           '$3 = null' is unclean.  Synthesize a value for the code block
616           instead. 
617         - Avoid using oob_stack for storing location information.  Use ...
618         (_mark_): ... this.  New (empty) rule.  Saves the current location
619         in $$.
620         (foreach_statement): Avoid using oob_stack for current_block
621         handling.  Use technique used in for_statement and
622         using_statement.  Synthesize a value for the code block to store
623         additional intermediate information.
624
625 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
626
627         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
628         of a different type is only allowed to private fields of a
629         containing type, not on fields of a base class.
630
631         See test-174.cs and error cs0122-9.cs
632
633 2005-01-13  Raja R Harinath  <rharinath@novell.com>
634
635         Fix test-335.cs (bug #58126).
636         * cs-parser.jay (argument): Split out non-expression parts of the
637         rule into 'non_simple_argument'.
638         (invocation_expression): Support parenthesized invocations with
639         multiple arguments, and with single non-simple arguments.
640
641 2005-01-13  Raja R Harinath  <rharinath@novell.com>
642
643         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
644         places.
645
646 2005-01-12  Raja R Harinath  <rharinath@novell.com>
647
648         Fix cs0038-1.cs, cs1640-6.cs.
649         * ecore.cs (Expression.Resolve): Remove special-case for
650         SimpleName in error-handling.
651         (Expression.almostMatchedMembers): Relax access permission to
652         protected.
653         (Expression.MemberLookupFailed): Handle duplicates in
654         almostMatchedMembers list.
655         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
656         * expression.cs (New.DoResolve): Report CS1540 for more cases.
657         * typemanager.cs (GetFullNameSignature): Use the MethodBase
658         overload if the passed in MemberInfo is a MethodBase.
659
660 2005-01-25  Martin Baulig  <martin@ximian.com>
661
662         * doc.cs
663         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
664
665 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
666
667         Fix #70749
668         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
669         for non-CAS & merge permission sets properly.
670
671 2005-01-11  Raja R Harinath  <rharinath@novell.com>
672
673         Improve standard-compliance of simple name and member access 
674         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
675         * ecore.cs (FullNamedExpression): New abstract base class 
676         for Namespaces and TypeExpressions.
677         (ResolveFlags.SimpleName): Remove.
678         (SimpleName): Remove support for dotted names.
679         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
680         DeclSpace.FindType and DeclSpace.LookupType.
681         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
682         (Expression.ExprClassName): Make member function.
683         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
684         a namespace.  Remove creation of dotted "SimpleName"s.
685         (MemberAccess.DoResolve): Likewise.
686         * decl.cs (DeclSpace.Cache): Make private.
687         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
688         (DeclSpace.FindType): Update.
689         (DeclSpace.LookupType): Move here from RootContext.  Return a 
690         FullNamedExpression.
691         * namespace.cs (Namespace): Derive from FullNamedExpression
692         so that it can be part of expression resolution.
693         (Namespace.Lookup): Return an FullNamedExpression.
694         (NamespaceEntry.LookupAlias): Lookup aliases only in current
695         namespace.
696         * rootcontext.cs (NamespaceLookup): Remove.
697         (LookupType): Move to DeclSpace.
698         * attribute.cs (CheckAttributeType): Update.
699         * doc.cs (FindDocumentedType): Remove allowAlias argument.
700         (FindDocumentedTypeNonArray): Likewise.
701
702 2005-01-11  Raja R Harinath  <rharinath@novell.com>
703
704         Fix cs0509.cs, cs1632.cs.
705         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
706         is the same as IsInterface.
707         (TypeContainer.GetClassBases): Likewise.
708         * statement.cs (LabeledStatement.ig): New field.
709         (LabeledStatement.LabelTarget): Save ILGenerator which created the
710         label.
711         (LabeledStatement.DoEmit): Check that the label was created with
712         the same ILGenerator.
713
714 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
715
716         Fix #71058
717         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
718         accessors to its properties.
719
720         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
721         from accessors to property.
722         
723 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
724
725         Fix #70722
726         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
727         only for overrides.
728         
729 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
730
731         * attribute.cs: Check for null and empty strings.  
732
733         I have lost another battle to Paolo.
734
735 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
736
737         Fix #70942
738         * class.cs (PropertyMethod): Set Parent field in ctors.
739         (SetMethod.InternalParameters): Add unsafe switch hack.
740         Override MarkForDuplicationCheck where it is appropriate.
741
742         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
743         It says whether container allows members with the same name.
744         Base default is no.
745         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
746         Removed is_method parameter.
747
748 2005-01-06  Duncan Mak  <duncan@ximian.com>
749
750         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
751         because the previous change led to incorrect reporting of CS1032
752         ("Cannot define/undefine preprocessor symbols after first token in
753         file"). Instead of using `tokens_seen' as the only flag that
754         triggers CS1040, introduce `comments_seen'. This new flag is used
755         to signify having seen comments on the current line, so it is
756         unset after a newline.
757
758 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
759
760         * doc.cs : When searching for a type, find nested type too.
761           This fixes bug #71040.
762
763 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
764
765         * doc.cs :
766           - Warn missing member comment on those classes which also does not
767             have doc comments. Fixed bug #71041.
768           - Don't warn missing doc comment on default constructor.
769             Fixed bug #71042.
770
771 2005-01-06  Duncan Mak  <duncan@ximian.com>
772
773         * cs-tokenizer.cs (xtoken): After handling traditional C-style
774         comments, set `tokens_seen' to true. This allows us to detect
775         misplaced preprocessor directives (i.e. not at the beginning of
776         the a line, nor after whitespaces). In that case, report error
777         CS1040. This fixes bug #56460.
778
779         * cs-parser.jay (interface_member_declaration): Add checks for
780         IsExplicitImpl, and report CS0541 error if an interface member is
781         defined as an explicit interface declaration.
782
783 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
784
785         Fix #70817
786         * class.cs (PropertyMethod): Set Parent field in ctors.
787         (SetMethod.InternalParameters): Add unsafe switch hack.
788         
789         * decl.cs (MemberCore.Parent): Cannot be readonly.
790
791 2005-01-06  Raja R Harinath  <rharinath@novell.com>
792
793         * decl.cs (DeclSpace.ResolveType): Remove.
794         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
795         Merge in code from ...
796         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
797         * class.cs, enum.cs: Update to changes.
798
799 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
800
801         * anonymous.cs: Ensure that we init the scope of our parent if it
802         has not been initialized yet.
803
804 2004-12-30  Duncan Mak  <duncan@ximian.com>
805
806         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
807         if field.FieldBuilder is null. Fixes #70758.
808
809         * convert.cs: Fixed some typos and updated some of the comments.
810         (ImplicitStandardConversionExists):
811         (TryImplicitIntConversion): If `target_type' is an interface and
812         the type of `ic' implements this interface, return true or a new
813         BoxedCast instead of null. This fixes #70468.
814
815 2004-12-29  Duncan Mak  <duncan@ximian.com>
816
817         * expression.cs (Argument.Emit): Check that Expr is
818         IMemoryLocation before casting to it, and report CS1510 otherwise.
819
820         This fixes #70402.
821
822 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
823
824         * statement.cs (Block.ThisVariable): remove the recursion here, to
825         make the --profile more sane.
826
827 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
828
829         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
830         assembly, by JB Evain.
831
832 2004-12-17  Raja R Harinath  <rharinath@novell.com>
833
834         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
835           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
836         "parent" refers to enclosing type/class.  "base" refers to superclass.
837
838 2004-12-17  Raja R Harinath  <rharinath@novell.com>
839
840         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
841         Ensure that we only have GlobalAttributes.
842         * attribute.cs (Attribute.Emit): Make non-virtual.
843         (GlobalAttribute.Emit): Remove.
844         (Attribute.Resolve): Make virtual.
845         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
846         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
847         the argument. Don't create one.
848         (Attribute.GetObsoleteAttribute): Likewise.
849         (Attribute.GetClsCompliantAttributeValue): Likewise.
850         * class.cs, decl.cs: Update to changes.
851
852 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
853
854         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
855         
856         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
857         
858         * statement.cs (Foreach.Resolve): Add error 186 report.
859
860 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
861
862         * expression.cs (Conditional.DoResolve): Add warning 429.
863         
864         * statement.cs (If.Resolve): Add warning 665.
865
866 2004-12-16  Raja R Harinath  <rharinath@novell.com>
867
868         New invariant: RootContext.Tree.Types.NamespaceEntry == null
869         except when in the parser, and in GlobalAttribute.
870         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
871         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
872         RootContext.Tree.Types.NamespaceEntry once work is done.
873         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
874         and resets RootContext.Tree.Types.NamespaceEntry.
875
876 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
877
878         * cs-parser.jay: Don't create a block for every variable.
879
880 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
881
882         * location.cs: Provide extra information.
883
884         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
885         variables from the captured environment, it is the ldarg_0.
886
887 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
888
889         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
890         find a conclusion.
891         
892         * class.cs: Changed warning level for 169 to avoid developer
893         displeasure from warning flooding. It will be changed back when they
894         fix most of current BCL warnings.
895         
896         * RootContext.cs: Pushed default WarningLevel to 3.
897         
898         * statement.cs: Removed unused variable.
899
900 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
901
902         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
903         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
904         Add error 502 report.
905         (StaticClass.DefineType): Add error 441 report.
906         (Class.AllowedModifiersProp): New virtual property as temporary
907         extension to AllowedModifiers.
908         (Class.DefineType): Add error 418 report. Moved ModFlags check here
909         to share implementation with StaticClass and don't call virtual
910         methods from ctor.
911         
912         * driver.cs (MainDriver): Add error 1558 test.
913
914         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
915         report. Moved error 36 test here.
916
917         * statement.cs (Throw.Resolve): Add error 724 report.
918
919         * typemanager.cs: Add out_attribute_type core type.
920         
921 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
922
923         * class.cs (TypeContainer.VerifyClsCompliance): Add error
924         3018 report.
925         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
926
927         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
928         3017 report.
929         
930         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
931
932         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
933         Add error 3023 report.
934         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
935
936         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
937         implementation.
938
939 2004-12-12  John Luke  <john.luke@gmail.com>
940
941         * driver.cs (AddArgs): take -- into account when
942         adding arguments, fixes bug 65710 
943
944 2004-12-12  Martin Baulig  <martin@ximian.com>
945
946         * expression.cs (Unary.TryReduceNegative): Added support for
947         SByteConstant and ByteConstant.
948         (Unary.Reduce): Check error values from TryReduceNegative().
949
950 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
951
952         * attributes.cs (Attribute.Resolve): Avoid multiple error report
953         and report exception as error 182.
954
955 2004-12-10  Raja R Harinath  <rharinath@novell.com>
956
957         * driver.cs (Main): Fix message when there are warnings.
958
959 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
960
961         * delegate.cs: Fixed my fix from yesterday, sorry about that.
962
963 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
964
965         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
966         Reduced number of warnings.
967         
968         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
969
970 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
971
972         * driver.cs: Removed message.
973
974         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
975
976 2004-12-08    <vargaz@freemail.hu>
977
978         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
979
980 2004-12-08  Martin Baulig  <martin@ximian.com>
981
982         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
983         instead of a CS3002 for properties and indexer.
984
985 2004-12-08  Martin Baulig  <martin@ximian.com>
986
987         * decl.cs (MemberName.ToString): Make this work again.
988
989 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
990
991         * attribute.cs (Resolve): Add error 591 detection.
992
993         * class.cs (FieldMember.Define): Add error 1547 detection.
994         (Indexer.Define): Add error 620 detection.
995         (Operator.Define): Add error 590 detection.
996
997         * ecore.cs: Missing argument for error 79.
998
999         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1000         detection.
1001
1002 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1003
1004         Fix #70106
1005         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1006         only.
1007
1008 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1009
1010         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1011           Some operator comments were suppressed.
1012         * doc.cs : Implicit/explicit operator name in doc comments are like
1013           "op_Explicit(type)~returnType", so added suffix handling.
1014
1015 2005-01-21  Alp Toker  <alp@atoker.com>
1016
1017         * cs-parser.jay: destructor_declaration's container is PartialContainer
1018         not Class when partial types are used, so use Kind prop instead of 'is'.
1019
1020 2004-12-12  Martin Baulig  <martin@ximian.com>
1021
1022         * expression.cs (Unary.TryReduceNegative): Added support for
1023         SByteConstant and ByteConstant.
1024         (Unary.Reduce): Check error values from TryReduceNegative().
1025
1026 2004-12-11  Martin Baulig  <martin@ximian.com>
1027
1028         * support.cs (ReflectionParameters.ParameterName): If we have a
1029         `gpd', call `ParameterName' on it.
1030
1031         * parameter.cs (Parameter.GetParameterAttributes): New static method.
1032
1033         * pending.cs (PendingImplementation.DefineProxy): Call
1034         DefineParameter() for all of the MethodBuilder's arguments.
1035
1036 2004-12-09  Martin Baulig  <martin@ximian.com>
1037
1038         * doc.cs (DocUtil): Make this a static class.
1039
1040 2004-12-09  Martin Baulig  <martin@ximian.com>
1041
1042         * expression.cs (Invocation.InferType): Moved the type inference
1043         implementation into TypeManager.
1044
1045         * generics.cs (TypeManager): Moved the type inference
1046         implementation here.
1047
1048 2004-12-09  Martin Baulig  <martin@ximian.com>
1049
1050         * typemanager.cs (TypeManager): Make this a partial class.
1051
1052         * generics.cs
1053         (TypeManager): Move the generics part of `TypeManager' here.
1054
1055 2004-12-08  Martin Baulig  <martin@ximian.com>
1056
1057         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1058         instead of a CS3002 for properties and indexer.  Added CS3024
1059         check for generic interfaces.
1060
1061         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
1062         instances are not CLS-compliant.
1063
1064 2004-12-08  Martin Baulig  <martin@ximian.com>
1065
1066         * cs-parser.jay
1067         (void_pointer_expression): New rule for `void*', `void**' etc.
1068         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
1069
1070 2004-12-08  Martin Baulig  <martin@ximian.com>
1071
1072         * expression.cs (Invocation.InferType): Removed the hack for
1073         MethodCore.MayUnify().  
1074
1075         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
1076         this actually work.
1077
1078         * class.cs (MethodCore.MayUnify): Use
1079         TypeManager.MayBecomeEqualGenericTypes().       
1080
1081 2004-12-08  Martin Baulig  <martin@ximian.com>
1082
1083         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
1084         parameter, box it.  Fixes #69233.
1085
1086 2004-12-08  Martin Baulig  <martin@ximian.com>
1087
1088         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
1089         have the ctor constraint.  Fixes #68326.
1090
1091 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1092
1093         * cs-parser.jay : interface comment was not consumed because of
1094           extra opt_semicolon before doc handling.
1095
1096 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1097
1098         Fix test-327.cs, test-328.cs, and put in early infrastructure
1099         for eventually fixing #52697.
1100         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1101         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1102         from other methods.
1103         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1104         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1105         (VerifyUsing, error246): Update.
1106         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1107         'NamespaceEntry.LookupNamespaceOrType'.
1108
1109 2004-12-07  Martin Baulig  <martin@ximian.com>
1110
1111         * driver.cs: Call it "BETA SOFTWARE" :-)
1112
1113 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1114
1115         Fix crash on cs0657-17.cs.
1116         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1117         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1118         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1119         the case where the NamespaceEntry gets overwritten.
1120
1121 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1122
1123         Fixed #69195, #56821
1124         * ecore.cs (ResolveBoolean): Tiny refactoring.
1125
1126         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1127         of right expression resolving when left is false constant and
1128         operator is LogicalAnd OR true constant and operator is LogicalOr.
1129
1130         * statement.cs (ResolveUnreachable): Always reports warning.
1131
1132 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1133
1134         * class.cs: Distinguish between 1721 and 1722 (just a little help
1135         for the programmer).
1136
1137 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1138
1139         * delegate.cs: Only allow this on new versions of the language. 
1140
1141 2004-12-02  Duncan Mak  <duncan@ximian.com>
1142
1143         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1144         Expression class.
1145         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1146         here as a static method. Take an additional bool out parameter
1147         `must_do_cs1540_check' for signaling to InstanceResolve.
1148         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1149         member field from PropertyExpr class and made it an argument of
1150         the method instead.
1151         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1152         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1153         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1154         and `remove_accessor' as well as InstanceResolve: report CS0122
1155         where applicable.
1156
1157         Fixes #70129.
1158
1159 2004-12-07  Martin Baulig  <martin@ximian.com>
1160
1161         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
1162         and CS0692 where appropriate.
1163
1164 2004-12-06  Martin Baulig  <martin@ximian.com>
1165
1166         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
1167         IsDuplicateImplementation() and improved it.
1168
1169         * expression.cs (Invocation.InferTypeArguments): Added
1170         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
1171         and removed the "ref" modifier from `infered_types'.
1172
1173         * decl.cs (MemberName.ToString): Removed the exception.
1174
1175 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1176
1177         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1178           comments are allowed.
1179
1180 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1181
1182         * delegate.cs: Add checks for subtypes in paramaters and return values
1183         in VerifyMethod () to add support for Covariance/Contravariance
1184         in delegates.
1185         
1186 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1187
1188         * report.cs: Remove extra closing parenthesis.
1189
1190         * convert.cs (Error_CannotImplicitConversion): If the name of the
1191         types are the same, provide some extra information.
1192
1193 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1194
1195         Fix bug #70102
1196         * attribute.cs (Resolve): Improved implementation of params
1197         attribute arguments.
1198
1199         * support.cs (ParameterData): Add HasParams to be faster.
1200
1201 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1202
1203         all things are for /doc support:
1204
1205         * doc.cs: new file that supports XML documentation generation.
1206         * mcs.exe.sources: added doc.cs.
1207         * driver.cs:
1208           Handle /doc command line option.
1209           Report error 2006 instead of 5 for missing file name for /doc.
1210           Generate XML documentation when required, after type resolution.
1211         * cs-tokenizer.cs:
1212           Added support for picking up documentation (/// and /** ... */),
1213           including a new XmlCommentState enumeration.
1214         * cs-parser.jay:
1215           Added lines to fill Documentation element for field, constant,
1216           property, indexer, method, constructor, destructor, operator, event
1217           and class, struct, interface, delegate, enum.
1218           Added lines to warn incorrect comment.
1219         * rootcontext.cs :
1220           Added Documentation field (passed only when /doc was specified).
1221         * decl.cs:
1222           Added DocComment, DocCommentHeader, GenerateDocComment() and
1223           OnGenerateDocComment() and some supporting private members for
1224           /doc feature to MemberCore.
1225         * class.cs:
1226           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1227         * delegate.cs:
1228           Added overriden DocCommentHeader.
1229         * enum.cs:
1230           Added overriden DocCommentHeader and GenerateDocComment().
1231
1232 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1233
1234         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1235         unwrapping the enumeration values, chain to
1236         DoConstantNumericPromotions again, so we can promote things to the
1237         fundamental types (takes care of enums that are bytes, sbytes).
1238
1239         Fixes bug #62054.
1240
1241 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1242
1243         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1244         Fix long-standing bug in type-lookup.  Use FindType instead of
1245         LookupType when ec.ResolvingTypeTree.
1246         (Attribute.ResolveType, Attribute.Resolve)
1247         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1248         Update to changes.
1249         (Attributes.Search): Remove internal version.  Update.
1250         (Attributes.SearchMulti): Update.
1251         (Attributes.GetClsCompliantAttribute): Remove.
1252         (Attributes.GetIndexerNameAttribute): Remove.
1253         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1254         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1255         * class.cs (Indexer.Define): Likewise.
1256
1257 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1258
1259         Fix bug #68790
1260         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1261         MarshallByReference members access.
1262
1263         * expression.cs: Use CheckMarshallByRefAccess;
1264         Better error CS0197 message.
1265
1266         * report.cs: Print whole related error message.
1267
1268 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1269
1270         * class (GetClassBases): Better error 60 report.
1271         (EventProperty): Disabled warning 67 detection.
1272
1273 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1274
1275         Fix bug #60324
1276         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1277
1278         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1279         precise values.
1280
1281 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1282
1283         Fix bug #49488
1284         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1285
1286         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1287
1288 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
1289
1290         * attribute.cs (Attribute.Resolve): Refine error reporting and
1291         report a cs0117 if the identifier does not exist, to distinguish
1292         from 0617 which is a miss-use of the actual identifier.
1293
1294         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1295         between cs0070 and cs0079.
1296
1297         * class.cs (MemberBase.DoDefine): When reporting a wrong
1298         accessibility level, we use MethodCore to compare instead of
1299         Method (this was a regression in some refactoring effort).
1300
1301         So now we correctly report cs0056 again.
1302
1303         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1304         testing the target_type (which was known to be object_type) and
1305         not the source type (which is anonymous_method).
1306
1307         Fixed reporting of error cs1660.
1308
1309         * expression.cs (UserCast.Source): Expose the underlying cast.
1310
1311         * statement.cs (Switch.SwitchGoverningType): Sort the list of
1312         allowed types to find a match to int32 first (most common).
1313
1314         In addition, it ignores any ImplicitUserConversions that did an
1315         internal implicit conversion (as the switch statement allows only
1316         one integral conversion to exist).
1317
1318         * class.cs (PartialContainer.Create): rename `name' to
1319         `member_name' for clarity.  Then replace the string calls with a
1320         call to MemberName.GetPartialName, as now using
1321         MemberName.ToString is an error (this is due to the side effects
1322         it had, that were fixed in the past).
1323
1324         This will restore the error reporting on a number of partial class
1325         errors that were missusing this (and getting an exception as a
1326         results, which is now just a plain textual warning, because
1327         yyparse debug output would crash otherwise).
1328
1329 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1330
1331         * Makefile (PROGRAM_INSTALL_DIR): Remove.
1332
1333 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1334
1335         * rootcontext.cs (LookupType): Make sure to cache lookups that
1336         don't give us a negative result. This saves about 5% of corlib
1337         compilation time.
1338
1339 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1340
1341         * report.cs (AbstractMessage.Print): messages are sent to stderr
1342
1343         * class.cs (TypeContainer.GetClassBases): It is an error to have a
1344         non-interface in the list of interfaces (at this point, either
1345         parent was properly set, or a base class is being listed in the
1346         interfaces section).
1347
1348         This flags error 1722, and resolves the crash from bug 69259.
1349
1350 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1351
1352         * statement.cs (Using.EmitExpressionFinally): make this work right
1353         for valuetypes. Fixes 69926.
1354
1355 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1356
1357         * const.cs (Const.ChangeType): Cope with the "0 literal can be
1358         converted to an enum" here, before we try to change the underlying
1359         type.  This code exists, but it is a different code path than the
1360         one used while encoding constants.
1361
1362         (ImplicitReferenceConversionExists): In addition, resynchronized
1363         the code here, so it matches the same code in
1364         ImplicitReferenceConversionExists for the `from any class-type S
1365         to any interface-type T'.       
1366
1367 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
1368
1369         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1370
1371 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
1372
1373         * cs-parser.jay: Use verbosity accordingly. 
1374
1375 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1376
1377         * expression.cs (Unary.ResolveOperator): Do not report warning;
1378         AddressOf reads from variable.
1379         
1380         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1381
1382 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1383
1384         Fix bug #69462
1385
1386         * attribute.cs (Attributable): Removed CheckTargets.
1387         (Attributes.Emit): Explicit attribute targets are tested here.
1388
1389         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1390         not enabled for interfaces.
1391
1392         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1393         (GetAssemblyName): Ouch next bug there.
1394
1395 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1396
1397         * expression.cs: Error 275 added.
1398         
1399 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1400
1401         Fix bug #69177 (Implemented decimal constant support)
1402
1403         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1404         (BinaryFold): Add DecimalConstant.
1405
1406         * const.cs (Define): Decimal constant 
1407         (is not constant.
1408         (ChangeType): Add decimal type handling.
1409         (LookupConstantValue): Don't set value for decimal type but
1410         emit DecimalConstantAttribute. Needed for constant optimization.
1411
1412         * constant.cs (ToDecimal): New method.
1413         (ConvertToDecimal): New method.
1414         (IntConstant): Implemented ConvertToDecimal.
1415         (DecimalConstant.Emit): Emit optimized version for decimals in
1416         int range.
1417
1418         * expression.cs (ResolveOperator): Changed order of constant
1419         reduction to work correctly with native types which have
1420         overloaded operators.
1421         (ResolveMemberAccess): Extract constant value from attribute
1422         for decimal type.
1423
1424         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1425
1426         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1427         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1428         (ChangeType): Decimal is special.
1429         (TypeToCoreType): Add decimal type.
1430
1431 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1432
1433         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1434         decimal types.
1435
1436 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1437
1438         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1439         test cs1667-5.cs.
1440
1441 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1442
1443         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1444
1445         * pending.cs (PendingImplementation): Grab only interfaces.
1446
1447 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1448
1449         * statement.cs (ForeachHelperMethods): Add location member and
1450         error 202 detection.
1451
1452 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1453
1454         * expression.cs (DoResolveBase): Fixed wrong warning for out
1455         variables.
1456
1457 2004-12-04  Martin Baulig  <martin@ximian.com>
1458
1459         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
1460         to check whether the conversion is ok.
1461
1462         * typemanager.cs (TypeManager.GetTypeArguments): Just return
1463         `Type.EmptyTypes' if we're not a generic TypeContainer.
1464
1465 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1466
1467         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1468         old bug: when converting from the null literal to a pointer,
1469         return an EmptyCast, not the NullLiteral.
1470
1471         This fixes #69921, the recent null_type changes probably made this
1472         bug more prominent.
1473
1474 2004-12-03  Martin Baulig  <martin@ximian.com>
1475
1476         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1477         method as our child, call AnonymousMethod.Compatible() on it.
1478
1479 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1480
1481         * class.cs (FieldBase): Use an unused bit field from the field to
1482         encode the `has_offset' property from the FieldMember.  This saves
1483         a couple of Ks on bootstrap compilation.
1484
1485         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1486         method as our child, return the AnonymousMethod resolved
1487         expression.
1488
1489         * expression.cs (New.DoResolve): Allow return values from
1490         NewDelegate to also include AnonymousMethods.
1491
1492         Fixes #70150.
1493
1494 2004-11-29  Raja R Harinath  <rharinath@novell.com>
1495
1496         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
1497         cs1648 report.
1498         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
1499         System.Runtime.InteropServices._Exception, since it's a base
1500         interface of the core type System.Exception in the net_2_0 profile.
1501
1502 2004-11-27  Martin Baulig  <martin@ximian.com>
1503
1504         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
1505
1506 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1507
1508         * Makefile: Convert to use executable.make.
1509         * gmcs.exe.sources: New.
1510
1511 2004-11-25  Martin Baulig  <martin@ximian.com>
1512
1513         * expression.cs (Invocation.InferType): Added support for byref types.
1514
1515 2004-11-25  Martin Baulig  <martin@ximian.com>
1516
1517         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1518         in TypeManager.TypeToCoreType().
1519
1520 2004-11-25  Martin Baulig  <martin@ximian.com>
1521
1522         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1523         "Dispose" method from the `current_type'.
1524         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1525         DoDefineMembers() instead of using the MethodBuilder; this is
1526         required for generic iterators.
1527
1528         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1529
1530 2004-11-24  Martin Baulig  <martin@ximian.com>
1531
1532         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1533
1534 2004-11-20  Martin Baulig  <martin@ximian.com>
1535
1536         * expression.cs (Invocation.InferType): Correctly infer generic
1537         instances; see gen-103.cs.
1538         (Invocation.InferTypeArguments): If a generic method doesn't have
1539         any unbound type parameters, we don't need to infer anything.
1540
1541 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1542
1543         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1544
1545 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1546
1547         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1548         (TypeHandle.GetMemberCache): New.
1549         (TypeHandle.TypeHandle): Update.
1550         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1551         (TypeManager.LookupParentInterfacesCache):
1552         Rename from LookupInterfaceCache.  Optimize slightly.
1553         (TypeManager.MemberLookup_FindMembers): Update.
1554         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1555         multi-type variant.
1556         (AddCacheContents): Rename from AddHashtable.
1557         * class.cs (TypeContainer.parent_container): Remove.
1558         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1559         (TypeContainer.DoDefineMembers): Don't initialize it.
1560         Update to name changes.
1561         
1562 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1563
1564         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1565         that factors the code to check access modifiers on override.  
1566
1567         (PropertyBase): Use the code here.
1568
1569         Patch from Lluis S'anchez, fixes bug #69361.
1570
1571 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1572
1573         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1574         routine that is used to report the use of a captured variable
1575         whose address has been taken.
1576
1577         There are two checks: one when variables are being captured and
1578         the other check is when the address of a variable is taken. 
1579         
1580         (because an anonymous methods might be resolved before *or* after
1581         the address has been taken) and 
1582
1583         * expression.cs (Conditional.DoResolve): Remove the special
1584         casing that Martin added to trueExpr and falseExpr being both
1585         NullLiteral.  We get the right behavior now just by introducing
1586         the null_type into the compiler. 
1587
1588         * convert.cs (ExplicitConversion): Change the code to use
1589         null_type instead of testing `expr is NullLiteral'.
1590         (ImplicitConversionStandard): use null_type too.
1591         (ImplicitReferenceConversionExists): use null_type too.
1592         (ImplicitReferenceConversion): use null_type too.
1593
1594         * literal.cs: The type of `NullLiteral' is now null_type instead
1595         of object_type. 
1596         (Resolve): Set the type here.
1597
1598         * typemanager.cs: Introduce null_type.
1599
1600 2004-11-18  Martin Baulig  <martin@ximian.com>
1601
1602         * rootcontext.cs
1603         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1604
1605 2004-11-18  Martin Baulig  <martin@ximian.com>
1606
1607         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1608
1609 2004-11-18  Martin Baulig  <martin@ximian.com>
1610
1611         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1612         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1613         call ResolveConstructedType() on it to resolve it without checking
1614         constraints.
1615         (Constraints.ResolveTypes): Check them here.
1616         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1617         but don't check constraints.
1618         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1619         check constraints here.
1620         (ConstructedType.ResolveConstructedType): New public method.  This
1621         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1622         resolve ourselves without checking constraints.
1623
1624         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1625
1626 2004-11-18  Martin Baulig  <martin@ximian.com>
1627
1628         * decl.cs
1629         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1630
1631         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1632
1633 2004-11-18  Martin Baulig  <martin@ximian.com>
1634
1635         * ecore.cs (TypeExpr.ResolveType): Removed.
1636         (Expression.ResolveAsTypeTerminal): We always return a fully
1637         resolved `TypeExpr', so we can just access its `Type'.
1638
1639         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1640
1641 2004-11-17  Martin Baulig  <martin@ximian.com>
1642
1643         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1644         sure we don't return any unresolved TypeExpr's.
1645         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1646         a `TypeExpr'.
1647         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1648
1649         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1650         unresolved `ConstructedType's.
1651
1652 2004-11-17  Martin Baulig  <martin@ximian.com>
1653
1654         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1655
1656 2004-11-17  Martin Baulig  <martin@ximian.com>
1657
1658         * ecore.cs
1659         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1660
1661         * decl.cs (DeclSpace.ResolveType): Removed.
1662         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1663
1664 2004-11-17  Martin Baulig  <martin@ximian.com>
1665
1666         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1667         direction, like FindMembers() does.  Fixes #69546, testcase is in
1668         test-315.cs.    
1669
1670 2004-11-16  Martin Baulig  <martin@ximian.com>
1671
1672         This is based on a patch from Marek Safar, see bug #69082.
1673         Fixes bugs #63705 and #67130.
1674
1675         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1676         method; create a MemberCache for an interface type and cache the
1677         result.
1678
1679         * decl.cs (IMemberContainer.ParentContainer): Removed.
1680         (IMemberContainer.ParentCache): New property.
1681         (MemberCache.SetupCacheForInterface): Removed.
1682         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1683         to create a cache for an interface's "parent".
1684
1685         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1686         interfaces too.
1687
1688 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1689
1690         * statement.cs: Avoid adding bools to a hashtable.
1691
1692 2004-11-15  Martin Baulig  <martin@ximian.com>
1693
1694         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1695
1696 2004-11-11  Martin Baulig  <martin@ximian.com>
1697
1698         * typemanager.cs (TypeManager.GetMethodName): New method.
1699
1700         * class.cs (MethodData.Define): Include the generic arity in the
1701         name of an explicit interface; also add it to the method name.
1702
1703         * pending.cs (PendingImplementation.InterfaceMethod): The method
1704         name now includes the generic arity.
1705
1706 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1707
1708         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1709         calling an unsafe method from a safe location.
1710
1711 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1712
1713         Fix #69167
1714         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1715
1716 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1717
1718         * namespace.cs (VerifyUsing): use GetPartialName instead of
1719         ToString. 
1720
1721 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1722
1723         * statement.cs (Return.Resolve): Fix regression in typo: if
1724         `in_exc', we have to request a NeedReturnLabel, this was a typo
1725         introduced in the anonymous method check-in.  Fixes #69131.
1726
1727         * Indexers were using the ShortName when defining themselves,
1728         causing a regression in the compiler bootstrap when applying the
1729         patch from 2004-11-02 (first part), now they use their full name
1730         and the bug is gone.
1731
1732 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1733
1734         * driver.cs: Strip the path from the names of embedded resources. Fixes
1735         #68519.
1736
1737 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1738
1739         Fix error message regression: cs0104-2.cs.
1740         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1741         (AliasEntry.Resolve): Update.
1742         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1743         'silent' flag.
1744         (RootContext.LookupType): Update.
1745
1746 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1747
1748         * cs-parser.jay: Add support for handling accessor modifiers
1749         * class: Add support port accessor modifiers and error checking,
1750         define PropertyMethod.Define as virtual (not abstract anymore)
1751         * ecore.cs: Add checking for proeprties access with access modifiers
1752         * iterators.cs: Modify Accessor constructor call based in the modified
1753         constructor
1754 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1755
1756         * expression.cs (StringConcat): Handle being called twice,
1757         as when we have a concat in a field init with more than two
1758         ctors in the class
1759
1760 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1761
1762         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1763         special case explicit implementations, we should always produce
1764         the .property or .event declaration.
1765         
1766         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1767         since it will not return correct data if people use this
1768         unresolved in the presence of using statements (see test-313).
1769
1770         * class.cs (MethodData.Define): If we are an explicit interface
1771         implementation, set the method name to the full name of the
1772         interface plus the name of the method.  
1773
1774         Notice that using the method.MethodName.GetFullName() does not
1775         work, as it will only contain the name as declared on the source
1776         file (it can be a shorthand in the presence of using statements)
1777         and not the fully qualifed type name, for example:
1778
1779         using System;
1780
1781         class D : ICloneable {
1782                 object ICloneable.Clone ()  {
1783                 }
1784         }
1785
1786         Would produce a method called `ICloneable.Clone' instead of
1787         `System.ICloneable.Clone'.
1788
1789         * namespace.cs (Alias.Resolve): Use GetPartialName.
1790         
1791 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1792
1793         * cs-parser.jay: Add error 1055 report.
1794
1795 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1796
1797         * assign.cs (Assign.DoResolve): Only do the transform of
1798         assignment into a New if the types are compatible, if not, fall
1799         through and let the implicit code deal with the errors and with
1800         the necessary conversions. 
1801
1802 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1803
1804         * cs-parser.jay: Add error 1031 report.
1805
1806         * cs-tokenizer.cs: Add location for error 1038.
1807
1808 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1809
1810         * cs-parser.jay: Add error 1016 report.
1811
1812 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1813
1814         * cs-parser.jay: Add errors 1575,1611 report.
1815
1816 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1817
1818         * cs-parser.jay: Add error 1001 report.
1819
1820 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1821
1822         Fix #68850
1823         * attribute.cs (GetMarshal): Add method argument for
1824         caller identification.
1825
1826         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1827         agument for GetMarshal and RuntimeMissingSupport.
1828
1829 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1830
1831         * attribute.cs (ExtractSecurityPermissionSet): Removed
1832         TypeManager.code_access_permission_type.
1833
1834         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1835
1836 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1837
1838         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1839         for obsolete use of a variable here.   Fixes regression on errors
1840         cs0619-25 and cs0619-26.
1841
1842 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1843
1844         Fix #62358, implemented security attribute encoding.
1845
1846         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1847         Tests permitted SecurityAction for assembly or other types.
1848         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1849         data from SecurityPermissionAttribute to PermisionSet class.
1850
1851         * class.cs (ApplyAttributeBuilder): Added special handling
1852         for System.Security.Permissions.SecurityAttribute based types.
1853
1854         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1855         special handling for System.Security.Permissions.SecurityAttribute
1856         based types.
1857
1858         * enum.cs (ApplyAttributeBuilder): Added special handling
1859         for System.Security.Permissions.SecurityAttribute based types.
1860
1861         * parameter.cs (ApplyAttributeBuilder): Added special handling
1862         for System.Security.Permissions.SecurityAttribute based types.
1863
1864         * rootcontext.cs: Next 2 core types.
1865
1866         * typemanager.cs (TypeManager.security_permission_attr_type):
1867         Built in type for the SecurityPermission Attribute.
1868         (code_access_permission_type): Build in type.
1869
1870 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1871
1872         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1873         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1874         all of this information into
1875         EmitContext.EmitCapturedVariableInstance.
1876         
1877         * codegen.cs (EmitCapturedVariableInstance): move here the
1878         funcionality of emitting an ldarg.0 in the presence of a
1879         remapping.   This centralizes the instance emit code.
1880
1881         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1882         then emit a load of this: it means that we have reached the
1883         topmost ScopeInfo: the one that contains the pointer to the
1884         instance of the class hosting the anonymous method.
1885
1886         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1887         captures to the topmost CaptureContext.
1888
1889 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1890
1891         * expression.cs (LocalVariableReference): Move the knowledge about
1892         the iterators into codegen's EmitCapturedVariableInstance.
1893
1894 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1895
1896         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1897         all code paths return a value from an anonymous method (it is the
1898         same as the 161 error, but for anonymous methods).
1899
1900 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1901
1902         The introduction of anonymous methods in the compiler changed
1903         various ways of doing things in the compiler.  The most
1904         significant one is the hard split between the resolution phase
1905         and the emission phases of the compiler.
1906
1907         For instance, routines that referenced local variables no
1908         longer can safely create temporary variables during the
1909         resolution phase: they must do so from the emission phase,
1910         since the variable might have been "captured", hence access to
1911         it can not be done with the local-variable operations from the runtime.
1912         
1913         * statement.cs 
1914
1915         (Block.Flags): New flag `IsTopLevel' to indicate that this block
1916         is a toplevel block.
1917
1918         (ToplevelBlock): A new kind of Block, these are the blocks that
1919         are created by the parser for all toplevel method bodies.  These
1920         include methods, accessors and anonymous methods.
1921
1922         These contain some extra information not found in regular blocks:
1923         A pointer to an optional CaptureContext (for tracking captured
1924         local variables and parameters).  A pointer to the parent
1925         ToplevelBlock.
1926         
1927         (Return.Resolve): Catch missmatches when returning a value from an
1928         anonymous method (error 1662).
1929         Invoke NeedReturnLabel from the Resolve phase instead of the emit
1930         phase.
1931
1932         (Break.Resolve): ditto.
1933
1934         (SwitchLabel): instead of defining the labels during the
1935         resolution phase, we now turned the public ILLabel and ILLabelCode
1936         labels into methods called GetILLabelCode() and GetILLabel() that
1937         only define the label during the Emit phase.
1938
1939         (GotoCase): Track the SwitchLabel instead of the computed label
1940         (its contained therein).  Emit the code by using
1941         SwitchLabel.GetILLabelCode ().
1942
1943         (LocalInfo.Flags.Captured): A new flag has been introduce to track
1944         whether the Local has been captured or not.
1945
1946         (LocalInfo.IsCaptured): New property, used to tell whether the
1947         local has been captured.
1948         
1949         * anonymous.cs: Vastly updated to contain the anonymous method
1950         support.
1951
1952         The main classes here are: CaptureContext which tracks any
1953         captured information for a toplevel block and ScopeInfo used to
1954         track the activation frames for various local variables.   
1955
1956         Each toplevel block has an optional capture context associated
1957         with it.  When a method contains an anonymous method both the
1958         toplevel method and the anonymous method will create a capture
1959         context.   When variables or parameters are captured, they are
1960         recorded on the CaptureContext that owns them, for example:
1961
1962         void Demo () {
1963              int a;
1964              MyDelegate d = delegate {
1965                  a = 1;
1966              }
1967         }
1968
1969         Here `a' will be recorded as captured on the toplevel
1970         CapturedContext, the inner captured context will not have anything
1971         (it will only have data if local variables or parameters from it
1972         are captured in a nested anonymous method.
1973
1974         The ScopeInfo is used to track the activation frames for local
1975         variables, for example:
1976
1977         for (int i = 0; i < 10; i++)
1978                 for (int j = 0; j < 10; j++){
1979                    MyDelegate d = delegate {
1980                         call (i, j);
1981                    }
1982                 }
1983
1984         At runtime this captures a single captured variable `i', but it
1985         captures 10 different versions of the variable `j'.  The variable
1986         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
1987         recorded on a child.  
1988
1989         The toplevel ScopeInfo will also track information like the `this'
1990         pointer if instance variables were referenced (this is necessary
1991         as the anonymous method lives inside a nested class in the host
1992         type of the method). 
1993
1994         (AnonymousMethod): Expanded to track the Toplevel, implement
1995         `AnonymousMethod.Compatible' to tell whether an anonymous method
1996         can be converted to a target delegate type. 
1997
1998         The routine now also produces the anonymous method content
1999
2000         (AnonymousDelegate): A helper class that derives from
2001         DelegateCreation, this is used to generate the code necessary to
2002         produce the delegate for the anonymous method that was created. 
2003
2004         * assign.cs: API adjustments for new changes in
2005         Convert.ImplicitStandardConversionExists.
2006
2007         * class.cs: Adjustments to cope with the fact that now toplevel
2008         blocks are of type `ToplevelBlock'. 
2009
2010         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2011         insteda of standard blocks.
2012
2013         Flag errors if params arguments are passed to anonymous methods.
2014
2015         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2016         `CurrentAnonymousMethod' which points to the current Anonymous
2017         Method.  The variable points to the AnonymousMethod class that
2018         holds the code being compiled.  It is set in the new EmitContext
2019         created for the anonymous method.
2020
2021         (EmitContext.Phase): Introduce a variable and an enumeration to
2022         assist in enforcing some rules about when and where we are allowed
2023         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2024         only one that enfonces this right now).
2025
2026         (EmitContext.HaveCaptureInfo): new helper method that returns
2027         whether we have a CapturedContext initialized.
2028
2029         (EmitContext.CaptureVariable): New method used to register that a
2030         LocalInfo must be flagged for capturing. 
2031
2032         (EmitContext.CapturedParameter): New method used to register that a
2033         parameters must be flagged for capturing. 
2034         
2035         (EmitContext.CapturedField): New method used to register that a
2036         field must be flagged for capturing. 
2037
2038         (EmitContext.HaveCapturedVariables,
2039         EmitContext.HaveCapturedFields): Return whether there are captured
2040         variables or fields. 
2041
2042         (EmitContext.EmitMethodHostInstance): This is used to emit the
2043         instance for the anonymous method.  The instance might be null
2044         (static methods), this (for anonymous methods that capture nothing
2045         and happen to live side-by-side with the current method body) or a
2046         more complicated expression if the method has a CaptureContext.
2047
2048         (EmitContext.EmitTopBlock): Routine that drives the emission of
2049         code: it will first resolve the top block, then emit any metadata
2050         and then emit the code.  The split is done so that we can extract
2051         any anonymous methods and flag any captured variables/parameters.
2052         
2053         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2054         during this phase, the ILGenerator should not be used as labels
2055         and local variables declared here might not be accessible to any
2056         code that is part of an anonymous method.  
2057
2058         Exceptions to this include the temporary variables that are
2059         created by some statements internally for holding temporary
2060         variables. 
2061         
2062         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2063         metadata for a cb
2064
2065         (EmitContext.TemporaryReturn): This method is typically called
2066         from the Emit phase, and its the only place where we allow the
2067         ReturnLabel to be defined other than the EmitMeta.  The reason is
2068         that otherwise we would have to duplicate a lot of logic in the
2069         Resolve phases of various methods that today is on the Emit
2070         phase. 
2071
2072         (EmitContext.NeedReturnLabel): This no longer creates the label,
2073         as the ILGenerator is not valid during the resolve phase.
2074
2075         (EmitContext.EmitThis): Extended the knowledge in this class to
2076         work in anonymous methods in addition to iterators. 
2077
2078         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2079         code is necessary on the stack to access the instance to a local
2080         variable (the variable will be accessed as a field).
2081
2082         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2083         EmitContext.EmitAddressOfParameter): Routines to support
2084         parameters (not completed at this point). 
2085         
2086         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2087         will also remove the parameters.
2088
2089         * convert.cs (Convert): Define a `ConstantEC' which points to a
2090         null.  This is just to prefity some code that uses
2091         ImplicitStandardConversion code and do not have an EmitContext
2092         handy.
2093
2094         The idea is to flag explicitly that at that point in time, it is
2095         known that the conversion will not trigger the delegate checking
2096         code in implicit conversions (which requires a valid
2097         EmitContext). 
2098
2099         Everywhere: pass new EmitContext parameter since
2100         ImplicitStandardConversionExists now requires it to check for
2101         anonymous method conversions. 
2102
2103         (Convert.ImplicitStandardConversionExists): If the type of an
2104         expression is the anonymous_method_type, and the type is a
2105         delegate, we invoke the AnonymousMethod.Compatible method to check
2106         whether an implicit conversion is possible. 
2107
2108         (Convert.ImplicitConversionStandard): Only do implicit method
2109         group conversions if the language level is not ISO_1.
2110
2111         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2112         MethodInfo for the Invoke method.  used by Delegate and
2113         AnonymousDelegate.
2114
2115         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2116         method conversions if the target type is a delegate.
2117
2118         Removed extra debugging nops.
2119
2120         (LocalVariableReference): Turn the `local_info' into a public
2121         field. 
2122
2123         Add `prepared' field, the same hack used for FieldExprs to cope
2124         with composed assignments, as Local variables do not necessarily
2125         operate purely on the stack as they used to: they can be captured
2126         fields. 
2127
2128         Add `temp' for a temporary result, like fields.
2129
2130         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2131
2132         It now copes with Local variables that are captured and emits the
2133         proper instance variable to load it from a field in the captured
2134         case. 
2135
2136         (ParameterReference.DoResolveBase): During the resolve phase,
2137         capture parameters if we are in an anonymous method.
2138
2139         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2140         anonymous method, use the EmitContext helper routines to emit the
2141         parameter reference.
2142
2143         * iterators.cs: Set RemapToProxy to true/false during the
2144         EmitDispose class.
2145
2146         * parameters.cs (GetParameterByName): New helper method. 
2147
2148         * typemanager.cs (anonymous_method_type) a new type that
2149         represents an anonyous method.  This is always an internal type,
2150         used as a fencepost to test against the anonymous-methodness of an
2151         expression. 
2152         
2153 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2154
2155         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2156         561 report.
2157         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2158
2159 2004-11-10  Martin Baulig  <martin@ximian.com>
2160
2161         * expression.cs (Invocation.BetterFunction): If two methods have
2162         equal parameter types, but only one of them is generic, the
2163         non-generic one wins.
2164         (New.DoResolve): Don't set `is_struct' to false if we're a generic
2165         instance; just use `Type.IsValueType' to determine whether
2166         something is a struct or not.
2167         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
2168         so we can be called multiple times.
2169
2170 2004-11-10  Martin Baulig  <martin@ximian.com>
2171
2172         * generic.cs (TypeParameter.DefineConstraints): New public method.
2173         (TypeParameter.CheckAccessLevel): Override this and return true.
2174         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
2175         override ResolveType() anymore.
2176         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
2177
2178 2004-11-10  Martin Baulig  <martin@ximian.com>
2179
2180         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
2181         call DeclSpace.ResolveNestedType() on it.
2182
2183 2004-11-10  Martin Baulig  <martin@ximian.com>
2184
2185         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
2186         non-null, call ParameterModifier() on it.
2187
2188 2004-11-10  Martin Baulig  <martin@ximian.com>
2189
2190         * iterators.cs
2191         (Iterators): Added `current_type' and `this_type' fields.
2192         (Iterators.DefineIterator): Create a new EmitContext and store it
2193         in `ec'; compute `this_type'.
2194
2195 2004-11-10  Martin Baulig  <martin@ximian.com>
2196
2197         * typemanager.cs
2198         (TypeManager.IsPrivateAccessible): New public method.
2199         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
2200
2201 2004-11-10  Martin Baulig  <martin@ximian.com>
2202
2203         * class.cs (TypeContainer.DefineType): Call
2204         TypeBuilder.DefineGenericParameters() before resolving the type
2205         parameters.
2206         (MethodData.parent_method): New protected field.
2207         (MethodData..ctor): Added `MethodInfo parent_method' argument.
2208         (MethodData.Define): Compute `parent_method'.
2209
2210         * decl.cs
2211         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2212         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2213         (DeclSpace.ec): New protected field; store the EmitContext here.
2214         (DeclSpace.EmitContext): New public property.
2215         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
2216         (DeclSpace.ResolveNestedType): New public method.
2217         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
2218         (DeclSpace.NestedAccessible): Added `Type tb' argument.
2219         (DeclSpace.FamilyAccessible): Likewise.
2220         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
2221         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2222         EmitContext.
2223
2224         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
2225         field.
2226
2227         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2228         (Enum.Emit): Don't create a new EmitContext.
2229
2230 2004-10-18  Martin Baulig  <martin@ximian.com>
2231
2232         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2233         `Type' directly, but call ResolveType() on it.
2234         (Catch.Resolve): Likewise.
2235         (Foreach.Resolve): Likewise.
2236
2237 2004-10-18  Martin Baulig  <martin@ximian.com>
2238
2239         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2240         `Type' directly, but call ResolveType() on it.
2241         (Probe.DoResolve): Likewise.
2242         (ArrayCreation.LookupType): Likewise.
2243         (TypeOf.DoResolve): Likewise.
2244         (SizeOf.DoResolve): Likewise.
2245
2246 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2247
2248         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2249         the ResolveType.
2250
2251 2004-10-17  John Luke  <john.luke@gmail.com>
2252
2253         * class.cs (Operator.GetSignatureForError): use CSharpName
2254
2255         * parameter.cs (Parameter.GetSignatureForError): Returns
2256         correct name even if was not defined.
2257
2258 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2259
2260         Fix #65816.
2261         * class.cs (TypeContainer.EmitContext): New property.
2262         (DefineNestedTypes): Create an emitcontext for each part.
2263         (MethodCore.DoDefineParameters): Use container's emitcontext.
2264         Pass type array to InternalParameters.
2265         (MemberBase.DoDefine): Use container's emitcontext.
2266         (FieldMember.Define): Likewise.
2267         (Event.Define): Likewise.
2268         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2269         Pass type array to InternalParameters.
2270         (SetIndexerMethod.GetParameterInfo): Likewise.
2271         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2272         * delegate.cs (Define): Pass emitcontext to
2273         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2274         array to InternalParameters.
2275         * expression.cs (ParameterReference.DoResolveBase): Pass
2276         emitcontext to GetParameterInfo.
2277         (ComposedCast.DoResolveAsTypeStep): Remove check on
2278         ec.ResolvingTypeTree.
2279         * parameter.cs (Parameter.Resolve): Change argument to
2280         EmitContext.  Use ResolveAsTypeTerminal.
2281         (Parameter.GetSignature): Change argument to EmitContext.
2282         (Parameters.ComputeSignature): Likewise.
2283         (Parameters.ComputeParameterTypes): Likewise.
2284         (Parameters.GetParameterInfo): Likewise.
2285         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2286         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2287         * support.cs (InternalParameters..ctor): Remove variant that takes
2288         a DeclSpace.
2289         * typemanager.cs (system_intptr_expr): New.
2290         (InitExpressionTypes): Initialize it.
2291
2292 2004-10-12  Chris Toshok  <toshok@ximian.com>
2293
2294         * cs-parser.jay: fix location for try_statement and catch_clause.
2295
2296 2004-10-18  Martin Baulig  <martin@ximian.com>
2297
2298         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2299         `Type' directly, but call ResolveType() on it.
2300         (MemberBase.DoDefine): Likewise.
2301
2302         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2303         `Type' directly, but call ResolveType() on it.
2304         (ComposedCast.DoResolveAsTypeStep): Likewise.
2305
2306         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2307         `Type' directly, but call ResolveType() on it.
2308
2309 2004-10-17  John Luke  <john.luke@gmail.com>
2310
2311         * class.cs (Operator.GetSignatureForError): use CSharpName
2312
2313         * parameter.cs (Parameter.GetSignatureForError): Returns
2314         correct name even if was not defined.
2315
2316 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2317
2318         Fix #65816.
2319         * class.cs (TypeContainer.EmitContext): New property.
2320         (DefineNestedTypes): Create an emitcontext for each part.
2321         (MethodCore.DoDefineParameters): Use container's emitcontext.
2322         Pass type array to InternalParameters.
2323         (MemberBase.DoDefine): Use container's emitcontext.
2324         (FieldMember.Define): Likewise.
2325         (Event.Define): Likewise.
2326         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2327         Pass type array to InternalParameters.
2328         (SetIndexerMethod.GetParameterInfo): Likewise.
2329         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2330         * delegate.cs (Define): Pass emitcontext to
2331         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2332         array to InternalParameters.
2333         * expression.cs (ParameterReference.DoResolveBase): Pass
2334         emitcontext to GetParameterInfo.
2335         (ComposedCast.DoResolveAsTypeStep): Remove check on
2336         ec.ResolvingTypeTree.
2337         * parameter.cs (Parameter.Resolve): Change argument to
2338         EmitContext.  Use ResolveAsTypeTerminal.
2339         (Parameter.GetSignature): Change argument to EmitContext.
2340         (Parameters.ComputeSignature): Likewise.
2341         (Parameters.ComputeParameterTypes): Likewise.
2342         (Parameters.GetParameterInfo): Likewise.
2343         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2344         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2345         * support.cs (InternalParameters..ctor): Remove variant that takes
2346         a DeclSpace.
2347         * typemanager.cs (system_intptr_expr): New.
2348         (InitExpressionTypes): Initialize it.
2349
2350 2004-10-12  Chris Toshok  <toshok@ximian.com>
2351
2352         * cs-parser.jay: fix location for try_statement and catch_clause.
2353
2354 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2355
2356         More DeclSpace.ResolveType avoidance.
2357         * decl.cs (MemberCore.InUnsafe): New property.
2358         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2359         with newly created EmitContext.
2360         (FieldMember.Define): Likewise.
2361         * delegate.cs (Delegate.Define): Likewise.
2362         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2363         only if normal name-lookup fails.
2364         (TypeExpr.DoResolve): Enable error-checking.
2365         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2366         (SizeOf.DoResolve): Likewise.
2367         (ComposedCast.DoResolveAsTypeStep): Likewise.
2368         (StackAlloc.DoResolve): Likewise.
2369         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2370         (Block.Unsafe): New property.
2371         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2372         (Unsafe): Set 'unsafe' flag of contained block.
2373         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2374         (Fixed.Resolve): Likewise.
2375         (Catch.Resolve): Likewise.
2376         (Using.ResolveLocalVariableDecls): Likewise.
2377         (Foreach.Resolve): Likewise.
2378
2379 2004-10-05  John Luke <john.luke@gmail.com>
2380
2381         * cs-parser.jay: add location to error CS0175
2382
2383 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2384
2385         * ecore.cs (Expression.Constantity): Add support for turning null
2386         into a constant.
2387
2388         * const.cs (Const.Define): Allow constants to be reference types
2389         as long as the value is Null.
2390
2391 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2392
2393         * namespace.cs (NamespaceEntry.Using): No matter which warning
2394         level is set, check if this namespace name has already been added.
2395
2396 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2397
2398         * expression.cs: reftype [!=]= null should always use br[true,false].
2399         # 67410
2400
2401 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2402
2403         Fix #67108
2404         * attribute.cs: Enum conversion moved to 
2405         GetAttributeArgumentExpression to be applied to the all
2406         expressions.
2407
2408 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2409
2410         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2411         * class.c (TypeContainer.DefineType): Flag error if
2412         base types aren't accessible due to access permissions.
2413         * decl.cs (DeclSpace.ResolveType): Move logic to
2414         Expression.ResolveAsTypeTerminal.
2415         (DeclSpace.ResolveTypeExpr): Thin layer over
2416         Expression.ResolveAsTypeTerminal.
2417         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2418         Refactor code into NestedAccess.  Use it.
2419         (DeclSpace.NestedAccess): New.
2420         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2421         argument to silence errors.  Check access permissions.
2422         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2423         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2424         (Cast.DoResolve): Likewise.
2425         (New.DoResolve): Likewise.
2426         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2427         (TypeOf.DoResolve): Likewise.
2428
2429         * expression.cs (Invocation.BetterConversion): Return the Type of
2430         the better conversion.  Implement section 14.4.2.3 more faithfully.
2431         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2432         section 14.4.2.2 explicit.
2433         (Invocation.OverloadResolve): Update.
2434         (Invocation): Remove is_base field.
2435         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2436         (Invocation.Emit): Likewise.
2437
2438 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2439
2440         * cs-parser.jay: Reverted 642 warning fix.
2441
2442 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2443
2444         Fix bug #66615
2445         * decl.cs (FindMemberWithSameName): Indexer can have more than
2446         1 argument.
2447
2448 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2449
2450         * expression.cs (LocalVariableReference.DoResolveLValue):
2451         Do not report warning 219 for out values.
2452         (EmptyExpression.Null): New member to avoid extra allocations.
2453
2454 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2455
2456         * cs-parser.jay: Fix wrong warning 642 report.
2457
2458         * cs-tokenizer.cs (CheckNextToken): New helper;
2459         Inspect next character if is same as expected.
2460
2461 2004-09-23  Martin Baulig  <martin@ximian.com>
2462
2463         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2464         (Convert.ImplicitReferenceConversionExists): Likewise.
2465
2466 2004-11-09  Raja R Harinath  <rharinath@novell.com>
2467
2468         * Makefile (DISTFILES): Comment out a few missing files.
2469
2470 2004-10-29  Raja R Harinath  <rharinath@novell.com>
2471
2472         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
2473         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
2474         (gmcs.exe): Invoke bootstrap-libs.
2475         (clean-local): Clean the net_2_0_bootstrap profile too.
2476         (PROGRAM_INSTALL_DIR): New.
2477         (install-local): Use it.
2478
2479 2004-10-13  Martin Baulig  <martin@ximian.com>
2480
2481         * generic.cs (TypeManager.InflatedConstraints): New nested class.
2482         (TypeParameter.DefineType): If we're a method type parameter and
2483         that method is overriding something, "inflate" its constraints.
2484
2485 2004-10-12  Martin Baulig  <martin@ximian.com>
2486
2487         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
2488         and have type arguments, create and resolve a ConstructedType.
2489
2490 2004-10-12  Martin Baulig  <martin@ximian.com>
2491
2492         * decl.cs (MemberCache.FindMemberToOverride): Use
2493         TypeManager.IsEqual() to compare the parameters and Type.Equals()
2494         to compare the invocationType.
2495
2496         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
2497         When comparing two type parameters, only do the signature-only
2498         comparision for method type parameters.
2499
2500 2004-10-11  Martin Baulig  <martin@ximian.com>
2501
2502         * report.cs: Don't make --fatal abort on warnings, we have
2503         -warnaserror for that.
2504
2505 2004-10-11  Martin Baulig  <martin@ximian.com>
2506
2507         * typemanager.cs
2508         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
2509         (TypeManager.IsEqual): Call ourself recursively instead of using
2510         Type.IsEqual(). 
2511
2512 2004-10-11  Martin Baulig  <martin@ximian.com>
2513
2514         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2515         on our own type parameters, not on the ones we inherit from a containing
2516         class.
2517
2518         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2519         the comparision.
2520
2521         * generic.cs (TypeParameter.Define): We may only be called once.
2522
2523         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2524         instead of TypeManager.IsEqual().
2525
2526 2004-09-28  Martin Baulig  <martin@ximian.com>
2527
2528         * generic.cs
2529         (GenericConstraints.EffectiveBaseClass): New public property.
2530         (TypeParameter.GenericConstraints): New public property.
2531         (ConstructedType.CheckConstraints): Improved.
2532
2533         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2534         (Convert.TypeParameterConversion): New private method; use this in
2535         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2536         for all conversions related to type parameters.
2537
2538 2004-09-24  Martin Baulig  <martin@ximian.com>
2539
2540         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2541         type parameter conversions for type parameters which are known to
2542         be reference types.
2543
2544 2004-09-24  Martin Baulig  <martin@ximian.com>
2545
2546         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2547         `IsValueType' properties.
2548
2549         * support.cs (ReflectionConstraints): Use
2550         Type.GetGenericParameterConstraints() instead of the old hack.
2551
2552 2004-09-24  Martin Baulig  <martin@ximian.com>
2553
2554         * generic.cs (GenericConstraints): Moved here and made it an
2555         abstract class.
2556
2557         * support.cs (GenericConstraints): Moved to generic.cs.
2558
2559 2004-09-24  Martin Baulig  <martin@ximian.com>
2560
2561         * support.cs
2562         (ReflectionConstraints): Un-nested this class and made it public.
2563
2564         * typemanager.cs
2565         (TypeManager.GetTypeParameterConstraints): New public method.
2566         (TypeManager.HasConstructorConstraint): Use the attributes.
2567
2568 2004-09-24  Martin Baulig  <martin@ximian.com>
2569
2570         * support.cs (GenericConstraints): Replaced `HasConstructor',
2571         `IsReferenceType' and `IsValueType' with `Attributes'.
2572         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2573         method and made the .ctor public.
2574
2575         * generic.cs (Constraints.Attributes): New public property.
2576         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2577         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2578         `IsValueType' -> `HasValueTypeConstraint'.
2579
2580 2004-09-23  Martin Baulig  <martin@ximian.com>
2581
2582         * generic.cs (Constraints): Reflect latest runtime changes.
2583
2584 2004-09-23  Martin Baulig  <martin@ximian.com>
2585
2586         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2587         (Convert.ImplicitReferenceConversionExists): Likewise.
2588
2589 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2590
2591         * class.cs (Operator.Define): Add error 448 and 559 report.
2592         
2593 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2594
2595         * class.cs (MemberBase.IsTypePermitted): New protected
2596         method for checking error CS0610.
2597
2598 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2599
2600         * class.cs (TypeContainer.HasExplicitLayout): New property
2601         Returns whether container has StructLayout attribute set Explicit.
2602         (FieldMember): New abstract class for consts and fields.
2603         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2604         (Field): Reuse FieldMember.
2605
2606         * const.cs (Const): Reuse FieldMember.
2607
2608         * rootcontext.cs: EmitConstants call moved to class.
2609
2610 2004-09-22  Martin Baulig  <martin@ximian.com>
2611
2612         Marek and me just fixed one of our oldest bugs: #28562 :-)
2613
2614         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2615
2616         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2617         we're an EnumConstant, just return that.
2618         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2619         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2620         to get the value which'll actually be written into the attribute.
2621         However, we have to use GetValue() to access the attribute's value
2622         in the compiler.        
2623
2624 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2625
2626         * constant.cs (Constant.IsNegative): New abstract property
2627         IsNegative.
2628
2629         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2630         (StackAlloc.DoResolve): Reused IsNegative.
2631
2632 2004-09-22  Martin Baulig  <martin@ximian.com>
2633
2634         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2635         public method; like LookupTypeContainer, but also works for
2636         generic instances.
2637
2638         * report.cs (Report.SymbolRelatedToPreviousError): Use
2639         TypeManager.LookupGenericTypeContainer().       
2640
2641 2004-09-22  Martin Baulig  <martin@ximian.com>
2642
2643         Thanks to Peter Sestoft for this bug report.
2644
2645         * expression.cs (Conditional): If both the `trueExpr' and the
2646         `falseExpr' is a NullLiteral, return a NullLiteral.
2647
2648 2004-09-22  Martin Baulig  <martin@ximian.com>
2649
2650         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2651         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2652         for the "get_Current" call.
2653
2654 2004-09-21  Martin Baulig  <martin@ximian.com>
2655
2656         * convert.cs (Convert.ImplicitReferenceConversion): When
2657         converting to an interface type, first check whether we're
2658         converting from a reference type.
2659
2660 2004-09-14  Martin Baulig  <martin@ximian.com>
2661
2662         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2663
2664 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2665
2666         Fixed bug #61902
2667         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2668         called and is obsolete then this member suppress message
2669         when call is inside next [Obsolete] method or type.
2670
2671         * expression.cs: Use TestObsoleteMethodUsage member.
2672
2673 2004-09-14  Martin Baulig  <martin@ximian.com>
2674
2675         * genericparser.cs: Removed.
2676
2677 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2678
2679         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2680
2681 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2682
2683         * attribute.cs (Attribute.Resolve): Add error 653 report.
2684
2685         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2686         report.
2687         (Method.ApplyAttributeBuilder): Add error 685 report.
2688         (Operator.Define): Add error 564 report.
2689
2690         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2691
2692         * expression.cs (Invocation.DoResolve): Add error
2693         245 and 250 report.
2694
2695         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2696         error 674 report.
2697
2698 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2699
2700         * class.cs (ConstructorInitializer.Resolve):
2701         Wrong error number (515->516).
2702
2703 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2704
2705         * class.cs (Indexer.Define): Add error 631 report.
2706
2707 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2708
2709         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2710
2711 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2712
2713         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2714
2715 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2716
2717         * cs-parser.jay: Added error CS0241 report.
2718
2719 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2720
2721         * cs-parser.jay (fixed_statement): Introduce a scope for the
2722         declaration in the 'fixed' statement.
2723
2724 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2725
2726         * cs-parser.jay: Added CS0230 error report.
2727
2728 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2729
2730         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2731
2732 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2733
2734         * expression.cs (Argument.Resolve): Added error CS0192 and
2735         CS0199 report.
2736
2737 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2738
2739         C# 2.0 #pragma warning feature
2740
2741         * cs-tokenizer.cs (PreProcessPragma): New method; 
2742         Handles #pragma directive.
2743
2744         * report.cs (WarningRegions): New class; Support
2745         class for #pragma warning directive. It tests whether
2746         warning is enabled for a given line.
2747
2748 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2749
2750         * const.cs: Add more descriptive error report, tahnks to
2751         Sebastien. 
2752
2753 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2754
2755         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2756
2757 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2758
2759         * expression.cs: Apply patch from Ben: Remove dead code from
2760         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2761         as that code just threw an exception anwyays.
2762
2763         * const.cs: Remove the call to the turnintoconstant, for details
2764         see bug: #63144
2765         
2766         * literal.cs: The type of the null-literal is the null type;  So
2767         we use a placeholder type (literal.cs:System.Null, defined here)
2768         for it.
2769
2770         * expression.cs (Conditional.DoResolve): Remove some old code that
2771         is no longer needed, conversions have been fixed.
2772
2773         (ArrayCreationExpression.DoResolve): Return false if we fail to
2774         resolve the inner expression.
2775
2776 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2777
2778         Fix test-290.cs.
2779         * cs-parser.jay (delegate_declaration): Record a delegate
2780         declaration as a type declaration.
2781         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2782
2783 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2784
2785         * parameter.cs: Do not crash if the type can not be resolved. 
2786
2787         * expression.cs: Report errors with unsafe pointers, fixes #64896
2788
2789 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2790
2791         * expression.cs: Pointer arith always needs to do a conv.i
2792         if the operand is a long. fix 65320
2793
2794 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2795
2796         Fixed cs0619-37.cs, cs0619-38.cs
2797
2798         * enum.cs (GetObsoleteAttribute): Removed.
2799
2800         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2801         on Enum member is double staged. The first is tested member
2802         and then enum.
2803
2804 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2805
2806         Fixed #56986, #63631, #65231
2807
2808         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2809         adds member to name container.
2810         (TypeContainer.AddToTypeContainer): New method, adds type to
2811         name container.
2812         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2813         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2814         AddOperator): Simplified by reusing AddToMemberContainer.
2815         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2816         instead of field.
2817         (Method.CheckForDuplications): Fixed implementation to test all
2818         possibilities.
2819         (MemberBase): Detection whether member is explicit interface
2820         implementation is now in constructor.
2821         (MemberBase.UpdateMemberName): Handles IndexerName.
2822         (Accessor): Changed to keep also location information.
2823         (AbstractPropertyEventMethod): Is derived from MemberCore.
2824         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2825         will be emited or not.
2826         (PropertyBase.AreAccessorsDuplicateImplementation):
2827         Tests whether accessors are not in collision with some method.
2828         (Operator): Is derived from MethodCore to simplify common
2829         operations.
2830
2831         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2832         must be performed.
2833         (DeclSpace.AddToContainer): Adds the member to defined_names
2834         table. It tests for duplications and enclosing name conflicts.
2835
2836         * enum.cs (EnumMember): Clean up to reuse the base structures
2837
2838 2004-09-03  Martin Baulig  <martin@ximian.com>
2839
2840         Merged latest changes into gmcs.  Please keep this comment in
2841         here, it makes it easier for me to see what changed in MCS since
2842         the last time I merged.
2843
2844 2004-09-03  Martin Baulig  <martin@ximian.com>
2845
2846         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2847         into TypeContainer, to make partial classes work again.
2848
2849 2004-09-03  Martin Baulig  <martin@ximian.com>
2850
2851         * rootcontext.cs (RootContext.V2): Removed.
2852
2853 2004-03-23  Martin Baulig  <martin@ximian.com>
2854
2855         * expression.cs (Invocation.OverloadResolve): Added `bool
2856         may_fail' argument and use it instead of the Location.IsNull() hack.
2857
2858 2004-09-09  Martin Baulig  <martin@ximian.com>
2859
2860         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2861
2862 2004-09-09  Martin Baulig  <martin@ximian.com>
2863
2864         * generic.cs (TypeParameter.DefineType): Added support for
2865         explicit interface methods.
2866
2867 2004-09-09  Martin Baulig  <martin@ximian.com>
2868
2869         * README.Changes: New document.  Started to list important changes
2870         between MCS and GMCS here.
2871
2872 2004-09-08  Martin Baulig  <martin@ximian.com>
2873
2874         * class.cs
2875         (TypeContainer.CheckRecursiveDefinition): New protected method.
2876         (TypeContainer.DefineType): Move the CS0146 check into
2877         CheckRecursiveDefinition().     
2878
2879 2004-09-06  Martin Baulig  <martin@ximian.com>
2880
2881         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2882         types for the constructor constraint.
2883
2884 2004-09-03  Martin Baulig  <martin@ximian.com>
2885
2886         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2887         into TypeContainer, to make partial classes work again.
2888
2889 2004-09-03  Martin Baulig  <martin@ximian.com>
2890
2891         * rootcontext.cs (RootContext.V2): Removed.
2892
2893 2004-03-23  Martin Baulig  <martin@ximian.com>
2894
2895         * expression.cs (Invocation.OverloadResolve): Added `bool
2896         may_fail' argument and use it instead of the Location.IsNull() hack.
2897
2898 2004-09-03  Martin Baulig  <martin@ximian.com>
2899
2900         Merged latest changes into gmcs.  Please keep this comment in
2901         here, it makes it easier for me to see what changed in MCS since
2902         the last time I merged.
2903
2904 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2905
2906         Fix #61128.
2907         * expression.cs (BetterConversion): Don't allow either conversion 
2908         to be null.  Remove redundant implicit conversion test when 'q ==
2909         null' -- when this function is invoked, we already know that the
2910         implicit conversion exists.
2911         (BetterFunction): Assume that 'best' is non-null.  Remove
2912         redundant reimplementation of IsApplicable when 'best' is null.
2913         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2914         number of arguments.
2915         (IsAncestralType): Extract from OverloadResolve.
2916         (OverloadResolve): Make robust to the MethodGroupExpr being
2917         unsorted.  Implement all the logic of Section 14.5.5.1, and
2918         support overloading of methods from multiple applicable types.
2919         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
2920
2921         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2922         (RealError, Warning): Append type of report to related symbol.
2923
2924 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
2925
2926         * enum.cs: Fixed CLS-Compliance checks for enum members.
2927         Error tests cs3008-8.cs, cs3014-8.cs
2928
2929 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2930
2931         Fixed bug #62342, #63102
2932         * class.cs: ImplementIndexer uses member.IsExplicitImpl
2933         like ImplementMethod.
2934
2935 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2936
2937         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2938         Fixed bug #65170.
2939
2940 2004-09-02  Martin Baulig  <martin@ximian.com>
2941
2942         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2943         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2944         on the MethodBase.
2945
2946 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
2947
2948         C# 2.0 Static classes implemented
2949
2950         * class.cs (TypeContainer): instance_constructors,
2951         initialized_fields, initialized_static_fields,
2952         default_constructor, base_inteface_types are protected to be
2953         accessible from StaticClass.
2954         (TypeContainer.DefineDefaultConstructor): New virtual method
2955         for custom default constructor generating
2956         (StaticClass): New class to handle "Static classes" feature.
2957
2958         * cs-parser.jay: Handle static keyword on class like instance
2959         of StaticClass.
2960
2961         * driver.cs: Added "/langversion" command line switch with two
2962         options (iso-1, default).
2963
2964 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
2965
2966         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
2967
2968 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
2969
2970         * delegate.cs: Style.
2971
2972 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2973
2974         * delegate.cs: Add seperate instance expr field for miguel.
2975
2976 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2977
2978         * PointerArithmetic (Resolve): make sure we are not doing
2979         pointer arith on void*. Also, make sure we are resolved
2980         by not setting eclass until resolve.
2981
2982         All callers: Make sure that PointerArithmetic gets resolved.
2983
2984 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2985
2986         * ArrayCreation (LookupType): If the type does not resolve 
2987         to an array, give an error.
2988
2989 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
2990
2991         * statement.cs (Try.Resolve): Fixed bug #64222
2992
2993 2004-08-27  Martin Baulig  <martin@ximian.com>
2994
2995         * class.cs
2996         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
2997         crash here.     
2998
2999 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3000
3001         * ecore.cs (Constantify): Get underlying type via
3002         System.Enum.GetUnderlyingType to avoid StackOverflow on the
3003         Windows in special cases.
3004
3005 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3006
3007         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3008         for obtaining also private methods.
3009         (GetRemoveMethod): Used GetRemoveMethod (true)
3010         for obtaining also private methods.
3011
3012 2004-09-02  Martin Baulig  <martin@ximian.com>
3013
3014         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3015         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3016         on the MethodBase.
3017
3018 2004-08-27  Martin Baulig  <martin@ximian.com>
3019
3020         * class.cs
3021         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3022         crash here.     
3023
3024 2004-08-25  Martin Baulig  <martin@ximian.com>
3025
3026         * support.cs (ReflectionParameters..ctor): If this is a generic
3027         method, retrieve and store its type parameters.
3028         (InternalParameters..ctor): Added `TypeParameter[]' argument.
3029         (ReflectionParameters.GenericConstraints): The argument specifies
3030         the type parameter, not the method parameter.
3031         (InternalParameters.GenericConstraints): Likewise.
3032
3033         * generic.cs (TypeParameter.DefineType): Correctly handle
3034         constraints wrt. generic methods in interfaces and their
3035         implementations.        
3036
3037 2004-08-24  Martin Baulig  <martin@ximian.com>
3038
3039         * generic.cs (TypeParameter.IsSubclassOf): New public method.
3040         (Constraints.IsSubclassOf): New internal method.
3041
3042         * typemanager.cs (TypeManager.FindMembers): Added special support
3043         for GenericTypeParameterBuilder's.      
3044         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
3045         type parameters.
3046
3047 2004-08-24  Martin Baulig  <martin@ximian.com>
3048
3049         * typemanager.cs
3050         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3051         this for accessibility checks.
3052         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3053         IsNestedFamilyAccessible.
3054         (TypeManager.IsSubclassOf): New method, do what the name actually
3055         says.   
3056
3057 2004-08-24  Martin Baulig  <martin@ximian.com>
3058
3059         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
3060         as a SimpleName, include the generic arity.
3061
3062 2004-08-24  Martin Baulig  <martin@ximian.com>
3063
3064         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3065         MethodAttributes.HideBySig for operators.
3066
3067 2004-08-23  Martin Baulig  <martin@ximian.com>
3068
3069         Back to the old error reporting system :-)
3070
3071         * report.cs (Message): Removed.
3072         (Report.MessageData, ErrorData, WarningData): Removed.
3073         (Report.Error, Warning): Back to the old system.
3074
3075 2004-08-23  Martin Baulig  <martin@ximian.com>
3076
3077         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3078
3079         * class.cs (TypeContainer.ParentContainer): New public virtual
3080         method; replaces the explicit interface implementation.
3081         (ClassPart.ParentContainer): Override.
3082
3083 2004-08-23  Martin Baulig  <martin@ximian.com>
3084
3085         * statement.cs (Switch): Added support for constant switches; see
3086         #59428 or test-285.cs.
3087
3088 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3089
3090         Fixed bug #62740.
3091         * statement.cs (GetEnumeratorFilter): Removed useless
3092         logic because C# specs is strict. GetEnumerator must be
3093         public.
3094
3095 2004-08-22  Martin Baulig  <martin@ximian.com>
3096
3097         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3098         a switch and may break, reset the barrier.  Fixes #59867.
3099
3100 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3101
3102         CLS-Compliance speed up (~5% for corlib)
3103
3104         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3105         New method. Tests container for CLS-Compliant names
3106
3107         * class.cs (TypeContainer.VerifyClsName): New method.
3108         Checks whether container name is CLS Compliant.
3109         (Constructor): Implements IMethodData.
3110
3111         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3112         low-case table for CLS Compliance test.
3113         (MemberCache.VerifyClsParameterConflict): New method.
3114         Checks method parameters for CS3006 error.
3115
3116         * enum.cs (EnumMember): Is derived from MemberCore.
3117         (Enum.VerifyClsName): Optimized for better performance.
3118
3119 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3120
3121         * report.cs: Renamed Error_T to Error and changed all
3122         references.
3123
3124 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3125
3126         * class.cs (TypeContainer.IndexerArrayList): New inner class
3127         container for indexers.
3128         (TypeContainer.DefaultIndexerName): New constant for default
3129         indexer name. Replaced all "Item" with this constant.
3130         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3131
3132         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3133         DefaultMemberAttribute constructor.
3134
3135 2004-08-05  Martin Baulig  <martin@ximian.com>
3136
3137         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3138         Fix bug #59429.
3139
3140 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3141
3142         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3143         multi platforms problem.
3144
3145         * compiler.csproj: Included shared files.
3146
3147 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3148
3149         Fix bug 60333, 55971 in the more general way
3150         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3151         Added arg_type argument for constant conversion.
3152         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3153
3154 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3155
3156         Fix bug #59760
3157         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3158         OperatorArrayList, MethodCoreArrayList for typecontainer
3159         containers. Changed class member types to these new types.
3160         (MethodArrayList.DefineMembers): Added test for CS0659.
3161
3162 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3163
3164         * cfold.cs: Synchronize the folding with the code in expression.cs
3165         Binary.DoNumericPromotions for uint operands.
3166
3167         * attribute.cs: Revert patch from Raja, it introduced a regression
3168         while building Blam-1.2.1 (hard to isolate a test case).
3169
3170 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3171
3172         Fix for #55382
3173         * class.cs:
3174         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3175         name collision.
3176         (MethodCore.parent_method): New member. The method we're overriding
3177         if this is an override method.
3178         (MethodCore.CheckBase): Moved from Method class and made common.
3179         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3180         private.
3181         (MethodCore.CheckForDuplications): New abstract method. For custom
3182         member duplication search in a container
3183         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3184         method and its return type.
3185         (Event.conflict_symbol): New member. Symbol with same name in the
3186         parent class.
3187
3188         * decl.cs:
3189         (MemberCache.FindMemberWithSameName): New method. The method
3190         is looking for conflict with inherited symbols.
3191
3192 2004-08-04  Martin Baulig  <martin@ximian.com>
3193
3194         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3195
3196         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3197
3198 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3199
3200         * report.cs (Message): New enum for better error, warning reference in
3201         the code.
3202         (MessageData): New inner abstract class. It generally handles printing of
3203         error and warning messages.
3204         Removed unused Error, Warning, Message methods.
3205
3206 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3207
3208         Fix for cs0592-8.cs test
3209         * attribute.cs
3210         (Attributable.ValidAttributeTargets): Made public.
3211         (Attribute.ExplicitTarget): New member for explicit target value.
3212         (Attribute.CheckTargets): Now we translate explicit attribute
3213         target to Target here.
3214
3215 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3216
3217         * ecore.cs (MethodGroupExpr): new IsBase property.
3218
3219         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3220
3221         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3222         rather than an instance expr.
3223
3224         (DelegateCreation.Emit): Use the method group rather than
3225         the instance expression. Also, if you have base.Foo as the
3226         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3227
3228         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3229
3230         (NewDelegate.DoResolve): Only check for the existance of Invoke
3231         if the method is going to be needed. Use MethodGroupExpr.
3232
3233         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3234
3235         * expression.cs: For pointer arith., make sure to use
3236         the size of the type, not the size of the pointer to
3237         the type.
3238
3239 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3240
3241         Fix for #60722
3242         * class.cs (Class): Added error CS0502 test.
3243
3244 2004-08-03  John Luke  <jluke@cfl.rr.com>
3245             Raja R Harinath  <rharinath@novell.com>
3246
3247         Fix for #60997.
3248         * attribute.cs (Attribute.complained_before): New flag.
3249         (Attribute.ResolveType, Attribute.Resolve),
3250         (Attribute.DefinePInvokeMethod): Set it.
3251         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3252         
3253 2004-08-03  Martin Baulig  <martin@ximian.com>
3254
3255         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3256         use a user-defined operator; we still need to do numeric
3257         promotions in case one argument is a builtin type and the other
3258         one has an implicit conversion to that type.  Fixes #62322.
3259
3260 2004-08-18  Martin Baulig  <martin@ximian.com>
3261
3262         * class.cs (Method.Define): Use the correct method name when
3263         creating the MethodBuilder for a generic method.
3264
3265 2004-08-17  Martin Baulig  <martin@ximian.com>
3266
3267         * generic.cs (Constraints): Support type parameter constraints.
3268
3269 2004-08-16  Martin Baulig  <martin@ximian.com>
3270
3271         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
3272         (Token.GENERIC_DIMENSION): New token; this is returned if we
3273         encounter an unbound generic type in a typeof() expression.
3274
3275         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
3276         this token is only generated while parsing a typeof() expression.
3277         (typeof_expression): Removed the old unbound_type hack.
3278
3279         * generic.cs (TypeArguments.IsUnbound): New public property.
3280
3281         * decl.cs (MemberName): Added support for unbound types.
3282
3283 2004-08-14  Martin Baulig  <martin@ximian.com>
3284
3285         * typemanager.cs
3286         (TypeManager.IsEqualGenericInstance): New static method.
3287         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
3288         just used to check accessibility, so follow the rules of 26.1.6.        
3289
3290         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
3291         ConstructedType instead of a TypeExpression if we have type arguments.
3292
3293         * cs-parser.jay (typeof_expression): Support unbound generic types.
3294
3295         * ecore.cs (UnboundTypeExpression): New public class.
3296
3297 2004-08-12  Martin Baulig  <martin@ximian.com>
3298
3299         * typemanager.cs (TypeManager.IsNestedChildOf): Use
3300         TypeManager.IsEqual() rather than `=='.
3301
3302         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
3303         generic instances as well.
3304
3305 2004-08-12  Martin Baulig  <martin@ximian.com>
3306
3307         * expression.cs (Invocation.InferType): We can only infer method
3308         type parameters.  Fixes #62647.
3309
3310 2004-08-11  Martin Baulig  <martin@ximian.com>
3311
3312         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
3313         before resolving the base classes.
3314
3315 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3316
3317         * Makefile: install .mdb file too.
3318
3319 2004-08-05  Martin Baulig  <martin@ximian.com>
3320
3321         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
3322         initializer, the current type is just the TypeBuilder, not the
3323         instantiated generic type.
3324         (FieldExpr.IsFieldInitializer): New public property.
3325
3326 2004-08-04  Martin Baulig  <martin@ximian.com>
3327
3328         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3329
3330         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3331
3332 2004-08-03  Martin Baulig  <martin@ximian.com>
3333
3334         * class.cs (MethodData.Define): If we're an explicit
3335         implementation, remove the generic arity from the type name.
3336
3337 2004-08-03  Martin Baulig  <martin@ximian.com>
3338
3339         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3340         use a user-defined operator; we still need to do numeric
3341         promotions in case one argument is a builtin type and the other
3342         one has an implicit conversion to that type.  Fixes #62322.
3343
3344 2004-08-02  Martin Baulig  <martin@ximian.com>
3345
3346         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
3347         `TypeExpr[]' array.
3348         (TypeContainer.GetClassBases): Return the unexpanded list of
3349         interfaces; we expand them later.
3350         (TypeContainer.DefineType): After creating the TypeBuilder, call
3351         TypeManager.ExpandInterfaces() to get an expanded and resolved
3352         list of interfaces.
3353
3354         * ecore.cs (TypeExpr.GetInterfaces): Removed
3355
3356         * generics.cs (Constraints.InterfaceConstraints): Remove.
3357         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
3358         register the interface constraints.
3359
3360         * typemanager.cs
3361         (TypeManager.AddUserType): Removed the `ifaces' argument.
3362         (TypeManager.AddTypeParameter): Likewise.
3363         (TypeManager.AddUserInterface): Removed, was unused.
3364         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
3365         `TypeExpr[]' array for the interfaces.
3366         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
3367         has been defined, returns a list of the resolved interfaces types.
3368         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
3369         (TypeManager.GetExplicitInterfaces): Likewise.  
3370
3371 2004-08-02  Martin Baulig  <martin@ximian.com>
3372
3373         * expression.cs (Invocation.EmitCall): If we're invoking a method
3374         on a type parameter, use the new `Constrained' prefix opcode.
3375
3376 2004-08-02  Martin Baulig  <martin@ximian.com>
3377
3378         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3379         (LocalInfo.IsThis): New public property.
3380         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3381
3382 2004-08-01  Martin Baulig  <martin@ximian.com>
3383
3384         * class.cs (TypeContainer.GetClassBases): Don't set the default
3385         here since we may get called from GetPartialBases().
3386         (TypeContainer.DefineType): If GetClassBases() didn't return a
3387         parent, use the default one.
3388
3389 2004-07-30  Martin Baulig  <martin@ximian.com>
3390
3391         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3392
3393         * class.cs (SourceMethod): New public class, derive from the
3394         symbol writer's ISourceMethod.
3395         (Method): Use the new symbol writer API.
3396
3397         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3398         as argument and use the new symbol writer.
3399
3400         * location.cs
3401         (SourceFile): Implement the symbol writer's ISourceFile.
3402         (Location.SymbolDocument): Removed.
3403         (Location.SourceFile): New public property.
3404
3405         * symbolwriter.cs: Use the new symbol writer API.
3406
3407 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3408
3409         * Makefile (install-local): Remove.  Functionality moved to
3410         executable.make.
3411
3412 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3413
3414         * Makefile: Install mcs.exe.config file together with mcs.exe.
3415         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3416         correct runtime version.
3417         
3418 2004-07-25  Martin Baulig  <martin@ximian.com>
3419
3420         * class.cs
3421         (TypeContainer.RegisterOrder): Removed, this was unused.
3422         (TypeContainer, interface_order): Removed.
3423         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3424         TypeContainer as argument since we can also be called with a
3425         `PartialContainer' for a partial class/struct/interface.
3426         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3427         of checking whether we're an `Interface' - we could be a
3428         `PartialContainer'.
3429         (PartialContainer.Register): Override; call
3430         AddClass()/AddStruct()/AddInterface() on our parent.
3431
3432         * cs-parser.jay (interface_member_declaration): Add things to the
3433         `current_container', not the `current_class'.
3434
3435         * rootcontext.cs (RegisterOrder): The overloaded version which
3436         takes an `Interface' was unused, removed.
3437
3438         * typemanager.cs (TypeManager.LookupInterface): Return a
3439         `TypeContainer', not an `Interface'.
3440         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3441         contain a `PartialContainer' for an interface, so check it's
3442         `Kind' to figure out what it is.
3443
3444 2004-07-25  Martin Baulig  <martin@ximian.com>
3445
3446         * class.cs (Class.DefaultTypeAttributes): New public constant.
3447         (Struct.DefaultTypeAttributes): Likewise.
3448         (Interface.DefaultTypeAttributes): Likewise.
3449         (PartialContainer.TypeAttr): Override this and add the
3450         DefaultTypeAttributes.
3451
3452 2004-07-25  Martin Baulig  <martin@ximian.com>
3453
3454         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3455         we can just use the `Parent' field instead.
3456
3457 2004-07-25  Martin Baulig  <martin@ximian.com>
3458
3459         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3460
3461 2004-07-25  Martin Baulig  <martin@ximian.com>
3462
3463         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3464         our parts before defining any methods.
3465         (TypeContainer.VerifyImplements): Make this virtual.
3466         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3467         on our PartialContainer.
3468
3469 2004-07-25  Martin Baulig  <martin@ximian.com>
3470
3471         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3472
3473         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3474         argument, we can just use the `Parent' field instead.
3475
3476         * class.cs
3477         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3478         (MemberBase.DoDefine): Likewise.
3479
3480 2004-07-24  Martin Baulig  <martin@ximian.com>
3481
3482         * decl.cs (MemberCore.Parent): New public field.
3483         (DeclSpace.Parent): Moved to MemberCore.
3484
3485         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3486         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3487         parent's .ctor.
3488         (FieldBase, Field, Operator): Likewise.
3489         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3490         (EventField, Event): Likewise.
3491
3492 2004-07-23  Martin Baulig  <martin@ximian.com>
3493
3494         * class.cs (PartialContainer): New public class.
3495         (ClassPart): New public class.
3496         (TypeContainer): Added support for partial classes.
3497         (TypeContainer.GetClassBases): Splitted some of the functionality
3498         out into GetNormalBases() and GetPartialBases().
3499
3500         * cs-tokenizer.cs (Token.PARTIAL): New token.
3501         (Tokenizer.consume_identifier): Added some hacks to recognize
3502         `partial', but only if it's immediately followed by `class',
3503         `struct' or `interface'.
3504
3505         * cs-parser.jay: Added support for partial clases.
3506
3507 2004-07-23  Martin Baulig  <martin@ximian.com>
3508
3509         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3510         a `DeclSpace' and also made it readonly.
3511         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3512         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3513         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3514
3515         * cs-parser.jay: Pass the `current_class', not the
3516         `current_container' (at the moment, this is still the same thing)
3517         to a new Method, Property, Event, Indexer or Constructor.
3518
3519 2004-07-23  Martin Baulig  <martin@ximian.com>
3520
3521         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3522         and removed the `current_interface' one.
3523         (struct_declaration, class_declaration, interface_declaration):
3524         Set `current_class' to the newly created class/struct/interface;
3525         set their `Bases' and call Register() before parsing their body.
3526
3527 2004-07-23  Martin Baulig  <martin@ximian.com>
3528
3529         * class.cs (Kind): New public enum.
3530         (TypeContainer): Made this class abstract.
3531         (TypeContainer.Kind): New public readonly field.
3532         (TypeContainer.CheckDef): New public method; moved here from
3533         cs-parser.jay.
3534         (TypeContainer.Register): New public abstract method.
3535         (TypeContainer.GetPendingImplementations): New public abstract
3536         method.
3537         (TypeContainer.GetClassBases): Removed the `is_class' and
3538         `is_iface' parameters.
3539         (TypeContainer.DefineNestedTypes): Formerly known as
3540         DoDefineType().
3541         (ClassOrStruct): Made this class abstract.
3542
3543         * tree.cs (RootTypes): New public type. 
3544
3545 2004-07-20  Martin Baulig  <martin@ximian.com>
3546
3547         * tree.cs (Tree.RecordNamespace): Removed.
3548         (Tree.Namespaces): Removed.
3549
3550         * rootcontext.cs (RootContext.IsNamespace): Removed.
3551
3552         * cs-parser.jay (namespace_declaration): Just create a new
3553         NamespaceEntry here.
3554
3555 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3556
3557         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3558         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3559         entry to make sure it runs in the correct runtime version.
3560         
3561 2004-07-18  Martin Baulig  <martin@ximian.com>
3562
3563         * generic.cs (ConstructedType.CheckConstraints): Improved
3564         constraints checking.
3565
3566 2004-07-18  Martin Baulig  <martin@ximian.com>
3567
3568         * expression.cs (Invocation.BetterMethod): Call
3569         TypeManager.TypeToCoreType() on all types and removed my previous
3570         hack; we're already doig the right thing here.
3571
3572 2004-07-17  Martin Baulig  <martin@ximian.com>
3573
3574         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3575
3576 2004-07-16  Martin Baulig  <martin@ximian.com>
3577
3578         * iterators.cs: Added generics support.
3579
3580 2004-07-16  Martin Baulig  <martin@ximian.com>
3581
3582         * iterators.cs: Rewrote this.  We're now using one single Proxy
3583         class for both the IEnumerable and the IEnumerator interface and
3584         `Iterator' derives from Class so we can use the high-level API.
3585
3586         * class.cs (TypeContainer.AddIterator): New method.
3587         (TypeContainer.DoDefineType): New protected virtual method, which
3588         is called from DefineType().
3589         (TypeContainer.DoDefineMembers): Call DefineType() and
3590         DefineMembers() on all our iterators.
3591         (TypeContainer.Emit): Call Emit() on all our iterators.
3592         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3593
3594         * codegen.cs (EmitContext.CurrentIterator): New public field.
3595
3596 2004-07-15  Martin Baulig  <martin@ximian.com>
3597
3598         * typemanager.cs
3599         (TypeManager.not_supported_exception_type): New type.   
3600
3601 2004-07-14  Martin Baulig  <martin@ximian.com>
3602
3603         * typemanager.cs
3604         (TypeManager.generic_ienumerable_type): New type.
3605         (TypeManager.generic_ienumerator_type): New type.
3606
3607         * rootcontext.cs
3608         (RootContext.interfaces_first_stage): Added
3609         "System.Collections.Generic.IEnumerator`1" and
3610         "System.Collections.Generic.IEnumerable`1".     
3611
3612 2004-07-14  Martin Baulig  <martin@ximian.com>
3613
3614         * iterators.cs: Use real error numbers.
3615
3616 2004-07-14  Martin Baulig  <martin@ximian.com>
3617
3618         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3619         requires this to be a System.Collection.IEnumerable and not a
3620         class implementing that interface.
3621         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3622
3623 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3624
3625         * class.cs: Fixed previous fix, it broke some error tests.
3626
3627 2004-07-12  Martin Baulig  <martin@ximian.com>
3628
3629         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3630         Fixes #61293.
3631
3632 2004-07-14  Martin Baulig  <martin@ximian.com>
3633
3634         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3635         an exclamation mark (!) for the generic arity to reflect the
3636         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3637
3638 2004-07-13  Martin Baulig  <martin@ximian.com>
3639
3640         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3641         specifiers being part of a type argument.
3642
3643 2004-07-13  Martin Baulig  <martin@ximian.com>
3644
3645         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3646         name for generic types.
3647
3648 2004-07-13  Martin Baulig  <martin@ximian.com>
3649
3650         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3651         bit to fix #60119.
3652
3653 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3654
3655         * assign.cs (LocalTemporary): Add new argument: is_address,If
3656         `is_address' is true, then the value that we store is the address
3657         to the real value, and not the value itself.
3658         
3659         * ecore.cs (PropertyExpr): use the new local temporary
3660         stuff to allow us to handle X.Y += z (where X is a struct)
3661
3662 2004-07-08  Martin Baulig  <martin@ximian.com>
3663
3664         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3665         not always return, just like we're doing in Using.Resolve().
3666
3667 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3668
3669         * cs-parser.jay (fixed_statement): flag this as Pinned.
3670
3671 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3672
3673         * typemanager.cs (TypeManager): Removed MakePinned method, this
3674         mechanism is replaced with the .NET 2.x compatible mechanism of
3675         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3676
3677         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3678         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3679         `IsFixed' property which has a different meaning.
3680
3681 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3682
3683         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3684         visible from inside a nested class, not just the names of the
3685         immediately enclosing class.
3686         Fix for bug #60730.
3687
3688 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3689
3690         * expression.cs (BetterConversion): Remove buggy special-case
3691         handling of "implicit constant expression conversions".  At this
3692         point, we already know that the conversion is possible -- we're
3693         only checking to see which is better.
3694
3695 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3696
3697         * cs-parser.jay: Added error CS0210 test.
3698
3699 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3700
3701         * cs-parser.jay: Added error CS0134 test.
3702
3703 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3704
3705         Fix bug #52507
3706         * cs-parser.jay: Added error CS0145 test.
3707
3708 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3709
3710         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3711
3712 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3713         
3714         * expression.cs (StackAlloc.Resolve): The argument may not
3715         be a constant; deal with this case.
3716         
3717 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3718
3719         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3720         GetIndexerAttributeValue.
3721         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3722
3723         * class.cs (Indexer.Define): Added error tests for CS0415,
3724         CS0609.
3725
3726 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3727
3728         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3729         property code.
3730
3731 2004-06-23  Martin Baulig  <martin@ximian.com>
3732
3733         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3734         neither return nor throw, reset the barrier as well.  Fixes #60457.
3735
3736 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3737
3738         * class.cs : EventAttributes is now set to None by default.
3739           This fixes bug #60459.
3740
3741 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3742
3743         Fix bug #60219
3744         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3745         Don't throw exception but return null (it's sufficient now).
3746
3747 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3748
3749         * typemanager.cs (GetArgumentTypes): Faster implementation.
3750
3751 2004-06-18  Martin Baulig  <martin@ximian.com>
3752
3753         * attribute.cs (Attribute.Resolve): Check whether we're an
3754         EmptyCast which a Constant child.  Fixes #60333.
3755
3756 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3757
3758         * statement.cs (EmitCollectionForeach): Account for the fact that
3759         not all valuetypes are in areas which we can take the address of.
3760         For these variables, we store to a temporary variable. Also, make
3761         sure that we dont emit a `callvirt' on a valuetype method.
3762
3763 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3764
3765         * expression.cs (StackAlloc.DoReSolve): Added test for
3766         negative parameter (CS0247).
3767
3768 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3769
3770         Fix bug #59792
3771         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3772
3773 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3774
3775         Fix bug #59781
3776         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3777         ulong.
3778
3779 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3780
3781         Fix bug #58254 & cs1555.cs, cs1556.cs
3782         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3783
3784 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3785
3786         * cs-parser.jay: Added error CS1669 test for indexers.
3787
3788 2004-06-18  Martin Baulig  <martin@ximian.com>
3789
3790         * generics.cs (GenericMethod.ctor): Don't take an Attributes
3791         argument.  Fixes #60441.
3792
3793 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
3794         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3795         The name needs to have the actual name of the method in order
3796         for other tests (such as the one in OverloadResolve for Invoke
3797         on a delegate) to work. As well, it does not really help
3798         error reporting because the method group had multiple methods.
3799         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3800         Make profiling work.
3801         
3802 2004-06-13  Martin Baulig  <martin@ximian.com>
3803
3804         * cs-parser.jay: Don't allow generic attributes.
3805
3806 2004-06-13  Martin Baulig  <martin@ximian.com>
3807
3808         * class.cs (MemberBase.DoDefineBase): New protected method.
3809         (MemberBase.DoDefine): Compute the `flags' in the new
3810         DoDefineBase() which must be called first.
3811         (Method.Define): Call DoDefineBase() first so we have the flags
3812         when defining the generic method.
3813
3814         * cs-parser.jay (interface_method_declaration): Support generic methods.
3815
3816 2004-06-13  Martin Baulig  <martin@ximian.com>
3817
3818         * decl.cs (TypeName): Removed.
3819         (MemberName): Removed TypeName and MemberNow; now we just have
3820         MemberName.
3821
3822         * cs-parser.jay: Don't distinguish between type arguments and type
3823         parameters in the grammar and simplified the rules a bit.  The
3824         reduce/reduce conflicts are now gone (except the one we inherited
3825         from mcs).
3826
3827 2004-06-11  Martin Baulig  <martin@ximian.com>
3828
3829         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3830         call this twice: for params and varargs methods.
3831
3832 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3833
3834         * class.cs:
3835         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3836
3837 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3838
3839         * attribute.cs (Attribute.GetValidTargets): Made public.
3840
3841         * class.cs: 
3842         (AbstractPropertyEventMethod): New class for better code sharing.
3843         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3844         CS1667 report.
3845         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3846
3847 2004-06-09  Martin Baulig  <martin@ximian.com>
3848
3849         * cs-parser.jay: Removed a reduce/reduce conflict.
3850
3851 2004-06-03  Martin Baulig  <martin@ximian.com>
3852
3853         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3854         GetSimpleName() and return a SimpleName.
3855
3856         * ecore.cs (SimpleName.Arguments): New public field.
3857         (SimpleName): Added overloaded ctor which takes an additional
3858         TypeArguments argument.
3859         (SimpleName.SimpleNameResolve): Added support for generic methods.
3860         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
3861         formerly in MemberAccess.DoResolve(), but we also need it in
3862         SimpleNameResolve().
3863
3864         * expression.cs (MemberAccess.DoResolve): Use the new
3865         MethodGroupExpr.ResolveGeneric().       
3866
3867 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3868
3869         * decl.cs: If possible, use lookuptypedirect here. We can only do
3870         this if there is no `.' after the namespace. Avoids using
3871         LookupType, which does lots of slow processing.
3872         (FindNestedType) New method, does what it says :-).
3873         * namespace.cs: use LookupTypeDirect.
3874         * rootcontext.cs: use membercache, if possible.
3875         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3876
3877 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3878
3879         * expression.cs:
3880         According to the spec, 
3881
3882         In a member access of the form E.I, if E is a single identifier,
3883         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3884         field, property, localvariable, or parameter with the same type as
3885         the meaning of E as a type-name (§3.8), then both possible
3886         meanings of E are permitted.
3887
3888         We did not check that E as a simple-name had the same type as E as
3889         a type name.
3890
3891         This trivial check gives us 5-7% on bootstrap time.
3892
3893 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3894
3895         * expression.cs (Invocation.OverloadResolve): Avoid the
3896         use of hashtables and boxing here by allocating on demand.
3897
3898 2004-05-30  Martin Baulig  <martin@ximian.com>
3899
3900         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3901         we're doing a silent lookup.  Don't try to lookup nested types in
3902         TypeManager.object_type (thanks to Ben Maurer).
3903
3904 2004-05-30  Martin Baulig  <martin@ximian.com>
3905
3906         Committing a patch from Ben Maurer.
3907
3908         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3909
3910 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3911
3912         * convert.cs: add a trivial cache for overload operator resolution.
3913
3914 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
3915
3916         * attribute.cs
3917         (AttributeTester.GetObsoleteAttribute): Returns instance of
3918         ObsoleteAttribute when type is obsolete.
3919
3920         * class.cs
3921         (TypeContainer.VerifyObsoleteAttribute): Override.
3922         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3923         (MethodCode.VerifyObsoleteAttribute): Override.
3924         (MemberBase.VerifyObsoleteAttribute): Override.
3925
3926         * decl.cs
3927         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3928         and report proper error.
3929
3930         *delegate.cs
3931         (Delegate.VerifyObsoleteAttribute): Override.
3932
3933         * ecore.cs
3934         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3935         and report proper error.
3936         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3937
3938         * enum.cs
3939         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3940         and enum member.
3941
3942         * expression.cs
3943         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
3944         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
3945         Added test for ObsoleteAttribute.
3946
3947         * statement.cs
3948         (Catch): Derived from Statement.
3949
3950 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3951
3952         * decl.cs: If possible, use lookuptypedirect here. We can only do
3953         this if there is no `.' after the namespace. Avoids using
3954         LookupType, which does lots of slow processing.
3955         (FindNestedType) New method, does what it says :-).
3956         * namespace.cs: use LookupTypeDirect.
3957         * rootcontext.cs: use membercache, if possible.
3958         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3959
3960 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3961
3962         * expression.cs:
3963         According to the spec, 
3964
3965         In a member access of the form E.I, if E is a single identifier,
3966         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3967         field, property, localvariable, or parameter with the same type as
3968         the meaning of E as a type-name (§3.8), then both possible
3969         meanings of E are permitted.
3970
3971         We did not check that E as a simple-name had the same type as E as
3972         a type name.
3973
3974         This trivial check gives us 5-7% on bootstrap time.
3975
3976 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3977
3978         Fixed bug #59071 & cs0160.cs
3979         * statement.cs (Try.Resolve): Check here whether order of catch
3980         clauses matches their dependencies.
3981
3982 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3983
3984         Fixed bug #58624
3985         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
3986         unsafe type.
3987
3988 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3989
3990         * expression.cs (Invocation.OverloadResolve): Avoid the
3991         use of hashtables and boxing here by allocating on demand.
3992
3993 2004-05-30  Martin Baulig  <martin@ximian.com>
3994
3995         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3996         we're doing a silent lookup.  Don't try to lookup nested types in
3997         TypeManager.object_type (thanks to Ben Maurer).
3998
3999 2004-05-30  Martin Baulig  <martin@ximian.com>
4000
4001         Committing a patch from Ben Maurer.
4002
4003         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
4004
4005 2004-05-29  Martin Baulig  <martin@ximian.com>
4006
4007         * class.cs (IMethodData.ShouldIgnore): New method.
4008
4009         * typemanager.cs (TypeManager.MethodFlags): Don't take a
4010         `Location' argument, we don't need it anywhere.  Use
4011         `IMethodData.ShouldIgnore ()' instead of
4012         `MethodData.GetMethodFlags ()'.
4013         (TypeManager.AddMethod): Removed.
4014         (TypeManager.AddMethod2): Renamed to AddMethod.
4015
4016 2004-05-29  Martin Baulig  <martin@ximian.com>
4017
4018         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4019
4020         * convert.cs (Convert.ImplicitReferenceConversion): If we're
4021         converting from a class type S to an interface type and we already
4022         have an object on the stack, don't box it again.  Fixes #52578.
4023
4024 2004-05-29  Martin Baulig  <martin@ximian.com>
4025
4026         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4027         Added support for `params' parameters.  Fixes #59267.
4028
4029 2004-05-29  Martin Baulig  <martin@ximian.com>
4030
4031         * literal.cs (NullPointer): Provide a private .ctor which sets
4032         `type' to TypeManager.object_type.  Fixes #59048.
4033
4034 2004-05-29  Martin Baulig  <martin@ximian.com>
4035
4036         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4037         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
4038
4039         * ecore.cs (EventExpr.instance_expr): Make the field private.
4040
4041 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
4042
4043         Fixed bug #50080 & cs0214-2.cs
4044         * expression.cs (Cast.DoResolve): Check unsafe context here.
4045         
4046         * statement.cs (Resolve.DoResolve): Likewise.
4047
4048 2004-05-26  Martin Baulig  <martin@ximian.com>
4049
4050         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4051
4052         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4053         (RootContext.LookupType): Pass down the `silent' flag.
4054
4055 2004-05-25  Martin Baulig  <martin@ximian.com>
4056
4057         * expression.cs
4058         (MethodGroupExpr.IdenticalTypeName): New public property.
4059         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4060         expression actually refers to a type.
4061
4062 2004-05-25  Martin Baulig  <martin@ximian.com>
4063
4064         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4065         for #56176 and made it actually work.
4066
4067 2004-05-25  Martin Baulig  <martin@ximian.com>
4068
4069         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4070         (FieldExpr, PropertyExpr): Override and implement
4071         CacheTemporaries.  Fixes #52279.
4072
4073 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
4074
4075         * location.cs: In the new compiler listing a file twice is a
4076         warning, not an error.
4077
4078 2004-05-24  Martin Baulig  <martin@ximian.com>
4079
4080         * enum.cs (Enum.DefineType): For the `BaseType' to be a
4081         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
4082
4083 2004-05-24  Martin Baulig  <martin@ximian.com>
4084
4085         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4086         walking the `using' list.  Fixes #53921.
4087
4088 2004-05-24  Martin Baulig  <martin@ximian.com>
4089
4090         * const.cs (Const.LookupConstantValue): Added support for
4091         EmptyCast's; fixes #55251.
4092
4093 2004-05-24  Martin Baulig  <martin@ximian.com>
4094
4095         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4096         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4097         which does the CS0135 check.  The reason is that we first need to
4098         check whether the variable actually exists.
4099
4100 2004-05-24  Martin Baulig  <martin@ximian.com>
4101
4102         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4103         than RootContext.LookupType() to find the explicit interface
4104         type.  Fixes #58584.
4105
4106 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4107
4108         * Makefile: Simplify.  Use executable.make.
4109         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4110
4111 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4112
4113         * decl.cs:
4114         * enum.cs:
4115         Use the invariant culture when doing String.Compare for CLS case
4116         sensitivity.
4117         
4118 2004-05-23  Martin Baulig  <martin@ximian.com>
4119
4120         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4121         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4122
4123         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4124
4125 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4126
4127         * class.cs (MemberBase.Define): Reuse MemberType member for 
4128         resolved type. Other methods can use it too.
4129
4130 2004-05-23  Martin Baulig  <martin@ximian.com>
4131
4132         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4133         the variable also exists in the current block (otherwise, we need
4134         to report a CS0103).  Fixes #58670.
4135
4136 2004-05-23  Martin Baulig  <martin@ximian.com>
4137
4138         * flowanalysis.cs (Reachability.Reachable): Compute this
4139         on-the-fly rather than storing it as a field.
4140
4141 2004-05-23  Martin Baulig  <martin@ximian.com>
4142
4143         * flowanalysis.cs (Reachability.And): Manually compute the
4144         resulting `barrier' from the reachability.      
4145        
4146 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4147
4148         Fix bug #57835
4149         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4150         instance of ObsoleteAttribute when symbol is obsolete.
4151
4152         * class.cs
4153         (IMethodData): Extended interface for ObsoleteAttribute support.
4154
4155 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4156
4157         * attribute.cs: Fix bug #55970
4158
4159 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4160
4161         Fix bug #52705
4162         * attribute.cs
4163         (GetObsoleteAttribute): New method. Creates the instance of
4164         ObsoleteAttribute.
4165         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4166         ObsoleteAttribute when member is obsolete.
4167         (AttributeTester.Report_ObsoleteMessage): Common method for
4168         Obsolete error/warning reporting.
4169
4170         * class.cs
4171         (TypeContainer.base_classs_type): New member for storing parent type.
4172
4173         * decl.cs
4174         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4175         for this MemberCore.
4176
4177 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4178
4179         * attribute.cs, const.cs: Fix bug #58590
4180
4181 2004-05-21  Martin Baulig  <martin@ximian.com>
4182
4183         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4184         out parameters if the end of the method is unreachable.  Fixes
4185         #58098. 
4186
4187 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4188
4189         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4190         Hari was right, why extra method.
4191
4192 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4193
4194         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4195
4196 2004-05-20  Martin Baulig  <martin@ximian.com>
4197
4198         * delegate.cs: Convert this file to Unix mode - like the original
4199         version in mcs is.
4200
4201 2004-05-20  Martin Baulig  <martin@ximian.com>
4202
4203         * attribute.cs: Convert this file to Unix mode - like the original
4204         version in mcs is.
4205
4206 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4207
4208        Fix bug #58688 (MCS does not report error when the same attribute
4209        is assigned twice)
4210
4211        * attribute.cs (Attribute.Emit): Distinction between null and default.
4212
4213 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4214
4215        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4216        of a top-level attribute without an attribute target.
4217        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4218        Make non-static.
4219        (Attribute.Conditional_GetConditionName), 
4220        (Attribute.Obsolete_GetObsoleteMessage): Update.
4221        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4222        part of ScanForIndexerName.
4223        (Attribute.CanIgnoreInvalidAttribute): New function.
4224        (Attribute.ScanForIndexerName): Move to ...
4225        (Attributes.ScanForIndexerName): ... here.
4226        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4227        (Attributes.Search): New internal variant that can choose not to
4228        complain if types aren't resolved.  The original signature now
4229        complains.
4230        (Attributes.GetClsCompliantAttribute): Use internal variant, with
4231        complaints suppressed.
4232        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4233        only if it not useful.
4234        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4235        top-level for attributes that are shared between the assembly
4236        and a top-level class.
4237        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4238        * class.cs: Update to reflect changes.
4239        (DefineIndexers): Fuse loops.
4240        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4241        a couple more variants of attribute names.
4242
4243 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4244
4245         Fix bug #52585 (Implemented explicit attribute declaration)
4246
4247         * attribute.cs:
4248         (Attributable.ValidAttributeTargets): New abstract method. It gets
4249         list of valid attribute targets for explicit target declaration.
4250         (Attribute.Target): It holds target itself.
4251         (AttributeSection): Removed.
4252         (Attribute.CheckTargets): New method. It checks whether attribute
4253         target is valid for the current element.
4254
4255         * class.cs:
4256         (EventProperty): New class. For events that are declared like
4257         property (with add and remove accessors).
4258         (EventField): New class. For events that are declared like field.
4259         class.cs
4260
4261         * cs-parser.jay: Implemented explicit attribute target declaration.
4262
4263         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4264         Override ValidAttributeTargets.
4265
4266         * parameter.cs:
4267         (ReturnParameter): Class for applying custom attributes on 
4268         the return type.
4269         (ParameterAtribute): New class. Class for applying custom
4270         attributes on the parameter type.
4271
4272 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4273
4274         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4275         definitions. 
4276
4277         (Method): Allow UNSAFE here.
4278
4279         * modifiers.cs: Support unsafe reporting.
4280
4281 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4282
4283         * decl.cs: Fix bug #58478.
4284
4285 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4286
4287         * statement.cs: When checking for unreachable code on an EmptyStatement,
4288         set the location. Fixes bug #58488.
4289
4290 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4291
4292         * driver.cs: Add -pkg handling.
4293
4294         From Gonzalo: UseShelLExecute=false
4295
4296 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4297
4298         * attribute.cs:
4299         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4300         for attribute.
4301         (Attribute.IsClsCompliaceRequired): Moved to base for better
4302         accesibility.
4303         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4304         when attribute is AttributeUsageAttribute.
4305         (Attribute.GetValidTargets): Simplified.
4306         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4307         attribute for this type.
4308         (Attribute.ApplyAttributes): Method renamed to Emit and make
4309         non-static.
4310         (GlobalAttributeSection): New class for special handling of global
4311         attributes (assembly, module).
4312         (AttributeSection.Emit): New method.
4313
4314         * class.cs: Implemented Attributable abstract methods.
4315         (MethodCore.LabelParameters): Moved to Parameter class.
4316         (Accessor): Is back simple class.
4317         (PropertyMethod): Implemented Attributable abstract class.
4318         (DelegateMethod): Implemented Attributable abstract class.
4319         (Event): New constructor for disctintion between normal Event
4320         and Event with accessors.
4321
4322         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4323
4324         * codegen.cs, const.cs, decl.cs, delegate.cs:
4325         (CommonAssemblyModulClass): Implemented Attributable abstract class
4326         and simplified.
4327
4328         * enum.cs: Implement IAttributeSupport interface.
4329         (EnumMember): New class for emum members. Implemented Attributable
4330         abstract class
4331
4332         * parameter.cs:
4333         (ParameterBase): Is abstract.
4334         (ReturnParameter): New class for easier [return:] attribute handling.
4335
4336         * typemanager.cs: Removed builder_to_attr.
4337
4338 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4339
4340         Fix bug #57151.
4341         * attribute.cs (Attribute.GetPositionalValue): New function.
4342         * class.cs (TypeContainer.VerifyMembers): New function.
4343         (TypeContainer.Emit): Use it.
4344         (ClassOrStruct): New base class for Class and Struct.
4345         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4346         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4347         class.
4348         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4349         then each non-static field should have a FieldOffset attribute.
4350         Otherwise, none of the fields should have a FieldOffset attribute.
4351         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4352         and FieldOffset attributes.
4353         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4354         (TypeManager.field_offset_attribute_type): New core types.
4355         (TypeManager.InitCoreTypes): Initialize them.
4356
4357 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4358
4359         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4360         Return correct type.
4361         From bug #58270.
4362
4363 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4364
4365         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4366         be implicitly converted to ulong.
4367         
4368         * expression.cs: The logic for allowing operator &, | and ^ worked
4369         was wrong, it worked before because we did not report an error in
4370         an else branch.  Fixes 57895.
4371
4372         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4373         allow volatile fields to be reference types.
4374
4375 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4376
4377         * driver.cs: Add support for /debug-
4378
4379 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4380
4381         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4382         Add a 'complain' parameter to silence errors.
4383         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4384         silently overlooked type-resolutions.
4385         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4386         to reflect changes.
4387         (Attributes.Search): New function.
4388         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4389         (Attributes.GetAttributeFullName): Remove hack.
4390         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4391         Update to reflect changes.
4392         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4393         Use Attributes.Search instead of nested loops.
4394
4395 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4396
4397         * decl.cs:
4398         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4399         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4400         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4401
4402         * report.cs: (Report.Warning): Renamed to Warning_T because of
4403         parameter collision.
4404
4405 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4406
4407         * expression.cs (MemberAccess.ResolveMemberAccess):
4408         Exit with non-zero status after Report.Error.
4409         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4410         Likewise.
4411         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4412
4413 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4414
4415         * support.cs: Don't hang when the file is empty.
4416
4417 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4418
4419         * support.cs: In SeekableStreamReader, compute the preamble size of the
4420           underlying stream. Position changes should take into account that initial
4421           count of bytes.
4422
4423 2004-05-03  Todd Berman  <tberman@sevenl.net>
4424
4425         * driver.cs: remove unused GetSysVersion function.
4426
4427 2004-05-03  Todd Berman  <tberman@sevenl.net>
4428
4429         * driver.cs: Remove the hack from saturday, as well as the hack
4430         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4431         link_paths to get that bit proper.
4432
4433 2004-05-01  Todd Berman  <tberman@sevenl.net>
4434
4435         * driver.cs: Try a LoadFrom before a Load, this checks the current
4436         path. This is currently a bug in mono that is be fixed, however, this
4437         provides a workaround for now. This will be removed when the bug
4438         is fixed.
4439
4440 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4441
4442         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4443         incomplete key pairs (#57941).
4444
4445 2004-05-01  Todd Berman  <tberman@sevenl.net>
4446
4447         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4448         from the GAC
4449
4450 2004-04-30  Jackson Harper  <jackson@ximian.com>
4451
4452         * codegen.cs: Open keys readonly.
4453         
4454 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4455
4456         * typemanager.cs: don't report cyclic struct layout when a struct
4457         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4458         which has 2 Pango.Rectangle fields.
4459
4460 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4461
4462         * expression.cs: Handle IntPtr comparisons with IL code
4463         rather than a method call.
4464
4465 2004-04-29  Martin Baulig  <martin@ximian.com>
4466
4467         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4468         the list of PropertyInfo's in class hierarchy and find the
4469         accessor.  Fixes #56013.
4470
4471 2004-04-29  Martin Baulig  <martin@ximian.com>
4472
4473         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4474
4475 2004-04-29  Martin Baulig  <martin@ximian.com>
4476
4477         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4478
4479         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4480
4481 2004-04-29  Martin Baulig  <martin@ximian.com>
4482
4483         * class.cs (ConstructorInitializer.Resolve): Check whether the
4484         parent .ctor is accessible.  Fixes #52146.
4485
4486 2004-04-29  Martin Baulig  <martin@ximian.com>
4487
4488         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4489
4490         * statement.cs (Using.EmitLocalVariableDecls): Use
4491         TypeManager.idisposable_type, not typeof (IDisposable).
4492         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4493
4494 2004-04-29  Martin Baulig  <martin@ximian.com>
4495
4496         * class.cs (Event.Define): Don't emit the field and don't set
4497         RTSpecialName and SpecialName for events on interfaces.  Fixes
4498         #57703. 
4499
4500 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4501
4502         Refactor Attribute.ApplyAttributes.
4503         * attribute.cs (Attributable): New base class for objects that can
4504         have Attributes applied on them.
4505         (Attribute): Make AttributeUsage fields public.
4506         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4507         (Attribute.IsInternalCall): New property.
4508         (Attribute.UsageAttr): Convert to a public read-only property.
4509         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4510         (Attribute.ResolveType, Attribute.Resolve)
4511         (Attribute.ScanForIndexerName): Update to reflect changes.
4512         (Attribute.CheckAttributeTarget): Re-format.
4513         (Attribute.ApplyAttributes): Refactor, to various
4514         Attributable.ApplyAttributeBuilder methods.
4515         * decl.cs (MemberCore): Make Attributable.
4516         * class.cs (Accessor): Make Attributable.
4517         (MethodData.ApplyAttributes): Use proper attribute types, not
4518         attribute names.
4519         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4520         (TypeContainer.ApplyAttributeBuilder)
4521         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4522         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4523         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4524         (Operator.ApplyAttributeBuilder): New factored-out methods.
4525         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4526         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4527         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4528         * parameter.cs (ParameterBase): New Attributable base class
4529         that can also represent Return types.
4530         (Parameter): Update to the changes.
4531
4532 2004-04-29  Jackson Harper  <jackson@ximian.com>
4533
4534         * driver.cs: Prefer the corlib system version when looking for
4535         assemblies in the GAC. This is still a hack, but its a better hack
4536         now.
4537         
4538 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4539
4540         * decl.cs, enum.cs: Improved error 3005 reporting.
4541   
4542         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4543         (related_symbols): New private member for list of symbols
4544         related to reported error/warning.
4545         
4546         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4547
4548 2004-04-29  Martin Baulig  <martin@ximian.com>
4549
4550         * ecore.cs (Expression.Constantify): If we're an enum and
4551         TypeManager.TypeToCoreType() doesn't give us another type, use
4552         t.UnderlyingSystemType.  Fixes #56178.  
4553
4554 2004-04-29  Martin Baulig  <martin@ximian.com>
4555
4556         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4557         interfaces and for each interface, only add members directly
4558         declared in that interface.  Fixes #53255.
4559
4560 2004-04-28  Martin Baulig  <martin@ximian.com>
4561
4562         * expression.cs (ConditionalLogicalOperator): Use a temporary
4563         variable for `left' to avoid that we evaluate it more than once;
4564         bug #52588.
4565
4566 2004-04-28  Martin Baulig  <martin@ximian.com>
4567
4568         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4569         `void[]' (CS1547).
4570
4571 2004-04-28  Martin Baulig  <martin@ximian.com>
4572
4573         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4574         void (CS1547).
4575
4576         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4577         whether the type is not void (CS1547).
4578
4579 2004-04-28  Martin Baulig  <martin@ximian.com>
4580
4581         * expression.cs (Unary.DoResolveLValue): Override this and report
4582         CS0131 for anything but Operator.Indirection.
4583
4584 2004-04-28  Martin Baulig  <martin@ximian.com>
4585
4586         Committing a patch from Ben Maurer; see bug #50820.
4587
4588         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4589         check for classes.
4590
4591         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4592         classes.        
4593
4594 2004-04-28  Martin Baulig  <martin@ximian.com>
4595
4596         Committing a patch from Ben Maurer; see bug #50820.
4597
4598         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4599         check for classes.
4600
4601         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4602         classes.        
4603
4604 2004-04-28  Martin Baulig  <martin@ximian.com>
4605
4606         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4607         (Block.AddLabel): Call DoLookupLabel() to only search in the
4608         current block.
4609
4610 2004-04-28  Martin Baulig  <martin@ximian.com>
4611
4612         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4613         comparing StringConstants and NullLiterals in Equality and Inequality.
4614
4615 2004-04-28  Jackson Harper  <jackson@ximian.com>
4616
4617         * driver.cs: Attempt to load referenced assemblies from the
4618         GAC. This is the quick and dirty version of this method that
4619         doesnt take into account versions and just takes the first
4620         canidate found. Will be good enough for now as we will not have more
4621         then one version installed into the GAC until I update this method.
4622
4623 2004-04-28  Martin Baulig  <martin@ximian.com>
4624
4625         * typemanager.cs (TypeManager.CheckStructCycles): New public
4626         static method to check for cycles in the struct layout.
4627
4628         * rootcontext.cs (RootContext.PopulateTypes): Call
4629         TypeManager.CheckStructCycles() for each TypeContainer.
4630         [Note: We only need to visit each type once.]
4631
4632 2004-04-28  Martin Baulig  <martin@ximian.com>
4633
4634         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4635
4636         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4637         success and added `out object value'.  Use a `bool resolved' field
4638         to check whether we've already been called rather than
4639         `ConstantValue != null' since this breaks for NullLiterals.
4640
4641 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4642
4643         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4644         setting of this flag, since the 'set' method may be non-public.
4645
4646 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4647
4648         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4649         check on current_vector.Block.
4650
4651 2004-04-27  Martin Baulig  <martin@ximian.com>
4652
4653         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4654         a field initializer.  Fixes #56459.
4655
4656 2004-04-27  Martin Baulig  <martin@ximian.com>
4657
4658         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4659         we're not attempting to use an indexer.  Fixes #52154.
4660
4661 2004-04-27  Martin Baulig  <martin@ximian.com>
4662
4663         * statement.cs (Return): Don't create a return label if we don't
4664         need it; reverts my change from January 20th.  Thanks to Ben
4665         Maurer for this.
4666
4667 2004-04-27  Martin Baulig  <martin@ximian.com>
4668
4669         According to the spec, `goto' can only leave a nested scope, but
4670         never enter it.
4671
4672         * statement.cs (Block.LookupLabel): Only lookup in the current
4673         block, don't recurse into parent or child blocks.
4674         (Block.AddLabel): Check in parent and child blocks, report
4675         CS0140/CS0158 if we find a duplicate.
4676         (Block): Removed this indexer for label lookups.
4677         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4678         this already does the error reporting for us.
4679
4680         * flowanalysis.cs
4681         (FlowBranching.UsageVector.Block): New public variable; may be null.
4682         (FlowBranching.CreateSibling): Added `Block' argument.
4683         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4684         label for the target of a `goto' and check whether we're not
4685         leaving a `finally'.
4686
4687 2004-04-27  Martin Baulig  <martin@ximian.com>
4688
4689         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4690         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4691         just for returns).
4692
4693 2004-04-27  Martin Baulig  <martin@ximian.com>
4694
4695         * statement.cs (Block.AddLabel): Also check for implicit blocks
4696         and added a CS0158 check.
4697
4698 2004-04-27  Martin Baulig  <martin@ximian.com>
4699
4700         * flowanalysis.cs (FlowBranchingLoop): New class.
4701         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4702         UsageVector's instead of an ArrayList.
4703         (FlowBranching.Label): Likewise.
4704         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4705         (FlowBranching.AddBreakVector): New method.
4706
4707 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4708
4709         * attribute.cs: Small regression fix: only convert the type if we
4710         the type is different, fixes System.Drawing build.
4711
4712 2004-04-27  Martin Baulig  <martin@ximian.com>
4713
4714         * attribute.cs (Attribute.Resolve): If we have a constant value
4715         for a named field or property, implicity convert it to the correct
4716         type.
4717
4718 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4719
4720         * statement.cs (Block.Block): Implicit blocks share
4721         'child_variable_names' fields with parent blocks.
4722         (Block.AddChildVariableNames): Remove.
4723         (Block.AddVariable): Mark variable as "used by a child block" in
4724         every surrounding block.
4725         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4726         been used in a child block, complain about violation of "Invariant
4727         meaning in blocks" rule.
4728         * cs-parser.jay (declare_local_variables): Don't use
4729         AddChildVariableNames.
4730         (foreach_statement): Don't create an implicit block: 'foreach'
4731         introduces a scope.
4732
4733 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4734
4735         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4736         converting from 0L to ulong.  Fixes 57522.
4737
4738 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4739
4740         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4741         derived class hides via 'new' keyword field from base class (test-242.cs).
4742         TODO: Handle this in the more general way.
4743         
4744         * class.cs (CheckBase): Ditto.
4745
4746 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4747
4748         * decl.cs (caching_flags): New member for storing cached values
4749         as bit flags.
4750         (MemberCore.Flags): New enum where bit flags for caching_flags
4751         are defined.
4752         (MemberCore.cls_compliance): Moved to caching_flags.
4753         (DeclSpace.Created): Moved to caching_flags.
4754
4755         * class.cs: Use caching_flags instead of DeclSpace.Created
4756         
4757 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4758
4759         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4760         if we are only a derived class, not a nested class.
4761
4762         * typemanager.cs: Same as above, but do this at the MemberLookup
4763         level (used by field and methods, properties are handled in
4764         PropertyExpr).   Allow for the qualified access if we are a nested
4765         method. 
4766
4767 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4768
4769         * class.cs: Refactoring.
4770         (IMethodData): New inteface; Holds links to parent members
4771         to avoid member duplication (reduced memory allocation).
4772         (Method): Implemented IMethodData interface.
4773         (PropertyBase): New inner classes for get/set methods.
4774         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4775         (Event): New inner classes for add/remove methods.
4776         (Event.DelegateMethod): Implemented IMethodData interface.
4777
4778         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4779         EmitContext (related to class.cs refactoring).
4780
4781 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4782
4783         * delegate.cs (Delegate.VerifyApplicability): If the number of
4784         arguments are the same as the number of parameters, first try to
4785         verify applicability ignoring  any 'params' modifier on the last
4786         parameter.
4787         Fixes #56442.
4788
4789 2004-04-08  Martin Baulig  <martin@ximian.com>
4790
4791         Merged latest changes into gmcs.  Please keep this comment in
4792         here, it makes it easier for me to see what changed in MCS since
4793         the last time I merged.
4794
4795 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4796
4797         * class.cs (TypeContainer.AddIndexer): Use
4798         'ExplicitInterfaceName' to determine if interface name was
4799         explicitly specified.  'InterfaceType' is not initialized at this time.
4800         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4801         Indexers array is already in the required order.  Initialize
4802         'IndexerName' only if there are normal indexers.
4803         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4804         (TypeContainer.Emit): Emit DefaultMember attribute only if
4805         IndexerName is initialized.
4806         Fixes #56300.
4807
4808 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4809
4810         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4811         Fixes #57007
4812
4813 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4814
4815         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4816         attributes.
4817         Fix for #56456.
4818
4819         * attribute.cs (Attribute.Resolve): Check for duplicate named
4820         attributes.
4821         Fix for #56463.
4822
4823 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4824
4825         * iterators.cs (MarkYield): track whether we are in an exception,
4826         and generate code accordingly.  Use a temporary value to store the
4827         result for our state.
4828
4829         I had ignored a bit the interaction of try/catch with iterators
4830         since their behavior was not entirely obvious, but now it is
4831         possible to verify that our behavior is the same as MS .NET 2.0
4832
4833         Fixes 54814
4834
4835 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4836
4837         * iterators.cs: Avoid creating temporaries if there is no work to
4838         do. 
4839
4840         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4841         Enumerations, use TypeManager.EnumToUnderlying and call
4842         recursively. 
4843
4844         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4845         bug #57013
4846
4847         (This.Emit): Use EmitContext.EmitThis to emit our
4848         instance variable.
4849
4850         (This.EmitAssign): Ditto.
4851
4852         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4853         codepaths, we will move all the functionality into
4854         Mono.CSharp.This 
4855
4856         (FieldExpr.EmitAssign): Ditto.
4857
4858         This fixes several hidden bugs that I uncovered while doing a code
4859         review of this today.
4860
4861         * codegen.cs (EmitThis): reworked so the semantics are more clear
4862         and also support value types "this" instances.
4863
4864         * iterators.cs: Changed so that for iterators in value types, we
4865         do not pass the value type as a parameter.  
4866
4867         Initialization of the enumerator helpers is now done in the caller
4868         instead of passing the parameters to the constructors and having
4869         the constructor set the fields.
4870
4871         The fields have now `assembly' visibility instead of private.
4872
4873 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4874
4875         * expression.cs (Argument.Resolve): Check if fields passed as ref
4876         or out are contained in a MarshalByRefObject.
4877
4878         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4879         another compiler type.
4880
4881 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4882
4883         * class.cs (Indexer.Define): use the new name checking method.
4884         Also, return false on an error.
4885         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4886         (is_identifier_[start/part]_character): make static.
4887
4888 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4889
4890         * expression.cs (Binary.ResolveOperator): Do no append strings
4891         twice: since we can be invoked more than once (array evaluation)
4892         on the same concatenation, take care of this here.  Based on a fix
4893         from Ben (bug #56454)
4894
4895 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4896
4897         * codegen.cs: Fix another case where CS1548 must be reported (when 
4898         delay-sign isn't specified and no private is available #56564). Fix
4899         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4900         error when MCS is used on the MS runtime and we need to delay-sign 
4901         (which seems unsupported by AssemblyBuilder - see #56621).
4902
4903 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4904
4905         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4906         (TypeManager.ComputeNamespaces): Faster implementation for
4907         Microsoft runtime.
4908
4909         * compiler.csproj: Updated AssemblyName to mcs.
4910
4911 2004-05-11  Jackson Harper  <jackson@ximian.com>
4912
4913         * Makefile: Preserve MONO_PATH
4914         
4915 2004-05-11  Jackson Harper  <jackson@ximian.com>
4916
4917         * Makefile: Use mono and mcs to build gmcs
4918         
4919 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
4920
4921         * codegen.cs: Add patch from Robert Shade
4922         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
4923         sync with mcs.
4924
4925 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
4926
4927         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4928         incomplete key pairs (#57941).
4929
4930 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4931
4932         * codegen.cs: Fix another case where CS1548 must be reported (when 
4933         delay-sign isn't specified and no private is available #56564). Fix
4934         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4935         error when MCS is used on the MS runtime and we need to delay-sign 
4936         (which seems unsupported by AssemblyBuilder - see #56621).
4937
4938 2004-04-29  Jackson Harper  <jackson@ximian.com>
4939
4940         * Makefile: Set MONO_PATH to use the bootstrap corlib
4941         * driver.cs: Check the GAC for referenced assemblies.
4942                 
4943 2004-04-29  Martin Baulig  <martin@ximian.com>
4944
4945         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
4946
4947 2004-04-07  Martin Baulig  <martin@ximian.com>
4948
4949         * expression.cs (Binary.ResolveOperator): Added special case for
4950         Equality/Inequality between a type parameter and a null literal.
4951
4952 2004-04-07  Martin Baulig  <martin@ximian.com>
4953
4954         * convert.cs: Check null literal -> type parameter conversions.
4955
4956 2004-04-07  Martin Baulig  <martin@ximian.com>
4957
4958         * generic.cs (ConstructedType.CheckConstraints): Enforce the
4959         `class' and `struct' constraints.
4960
4961 2004-04-07  Martin Baulig  <martin@ximian.com>
4962
4963         * generic.cs (SpecialConstraint): New public enum.
4964         (Constraints.Resolve): Added support for the `class' and `struct'
4965         constraints.
4966
4967         * cs-parser.jay (type_parameter_constraint): Added support for the
4968         `class' and `struct' constraints.
4969
4970 2004-04-07  Martin Baulig  <martin@ximian.com>
4971
4972         * support.cs (GenericConstraints): Replaced `Types' by
4973         `ClassConstraint' and `InterfaceConstraints'; added
4974         `HasClassConstraint'.   
4975
4976 2004-04-07  Martin Baulig  <martin@ximian.com>
4977
4978         * generic.cs
4979         (Constraints.InterfaceConstraints): New public property.
4980         (Constraints.Types): Make this property public
4981         (TypeParameter): Implement IMemberContainer.
4982         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
4983         instead of a TypeBuilder/MethodBuilder; pass the interface
4984         constraints to TypeManager.AddTypeParameter().
4985         (TypeParameter.DefineType): Just take an EmitContext and no
4986         TypeBuilder/MethodBuilder.  Use the new public API.
4987
4988         * typemanager.cs (TypeManager.AddTypeParameter): Added
4989         `TypeExpr[]' argument; add the interfaces to the
4990         `builder_to_ifaces' hash.
4991         (TypeManager.LookupMemberContainer): For
4992         GenericTypeParameterBuilders, get the TypeParameter from the
4993         `builder_to_type_param'.
4994         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
4995         the TypeParameter and call FindMembers on it.
4996
4997 2004-04-07  Martin Baulig  <martin@ximian.com>
4998
4999         * class.cs
5000         (MethodCore.GenericMethod): Moved this field here from Method.
5001         (MethodCore.IsDuplicateImplementation): Take the number of type
5002         parameters into account if we're a generic method.
5003
5004         * expression.cs (Invocation.InferTypeArguments): Don't return true
5005         if `arguments' is null; we still need to check whether we actually
5006         don't need to infer anything in this case.
5007         (MemberAccess): Merged the functionality from GenericMemberAccess
5008         into this class.
5009
5010         * generic.cs (GenericMemberAccess): Removed.
5011
5012 2004-04-05  Martin Baulig  <martin@ximian.com>
5013
5014         * decl.cs (MemberCore): For generic classes, interfaces and
5015         structs, `Name' now includes the number of type parameters
5016         ("Stack!1.Node!1").
5017         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
5018         encode the number of type arguments in the type name.
5019
5020         * expression.cs (Expression.MemberLookup): Removed the
5021         `num_type_args' argument; we now encode the number of type
5022         arguments in the type name.
5023
5024         * ecore.cs (SimpleName): Encode the number of type arguments in
5025         the type name itself.
5026
5027         * generic.cs (ConstructedType): Likewise.
5028
5029         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
5030         `MemberName'; we now include the number of type parameters in the
5031         type name.
5032
5033         * typemanager.cs (TypeManager.CheckGeneric): Removed.
5034         (TypeManager.MemberLookup): Removed the
5035         `num_type_args' argument; we now encode the number of type
5036         arguments in the type name.     
5037
5038 2004-04-03  Martin Baulig  <martin@ximian.com>
5039
5040         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
5041         (MemberCore.MemberName): Moved here from MemberBase.
5042         (DeclSpace.SetParameterInfo): Just take the constraints as an
5043         ArrayList; we already have the type parameters in our
5044         `MemberName'; also do the CS0080 reporting here.
5045
5046         * cs-parser.jay (struct_declaration): Use `member_name' instead of
5047         `IDENTIFIER opt_type_parameter_list'; when constructing our
5048         `MemberName', it'll already include our type parameters.
5049         (class_declaration, interface_declaration): Likewise.
5050         (delegate_declaration): Likewise.
5051         (MakeName): Take a MemberName and return a MemberName.
5052         The following two changes are required to avoid shift/reduce conflicts:
5053         (member_name): Don't include a TypeName anymore; ie. this is now
5054         just 'IDENTIFIER opt_type_parameter_list'.
5055         (property_declaration, event_declaration): Use a
5056         `namespace_or_type_name' instead of a `member_name'.            
5057
5058 2004-04-03  Martin Baulig  <martin@ximian.com>
5059
5060         * decl.cs (MemberName): Renamed to `TypeName' and created a new
5061         `MemberName' class.
5062         (TypeName): Formerly known as MemberName.
5063
5064         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
5065         instead of a `MemberName'.
5066
5067         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
5068         (member_name): New rule; create a MemberName.
5069
5070 2004-04-02  Martin Baulig  <martin@ximian.com>
5071
5072         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
5073         (CS0305 and CS0308).
5074
5075 2004-04-02  Martin Baulig  <martin@ximian.com>
5076
5077         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
5078         support for nested types.
5079
5080 2004-04-02  Martin Baulig  <martin@ximian.com>
5081
5082         * ecore.cs (IAlias): New public interface.
5083         (TypeExpr, TypeExpression): Implement IAlias.
5084         (TypeAliasExpression): New public class.
5085
5086         * namespace.cs (Namespace): Implement IAlias.
5087         (Namespace.Lookup): Return an IAlias instead on an object.
5088         (Namespace.DefineName): Take an IAlias instead of an object.
5089         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
5090         an object.
5091         (NamespaceEntry.UsingAlias): Take a Membername instead of an
5092         Expression.
5093         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
5094         object.
5095         (NamespaceEntry.Lookup): Likewise.
5096
5097         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
5098         instead of a Type.      
5099
5100         * decl.cs (DeclSpace): Implement IAlias.
5101         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
5102
5103         * generic.cs (ConstructedType): Improved error checking.
5104
5105 2004-04-02  Martin Baulig  <martin@ximian.com>
5106
5107         * convert.cs: Added type parameter conversions.
5108
5109         * ecore.cs
5110         (UnboxCast.Emit): Emit an `unbox.any' for type params.
5111         (ClassCast.Emit): If the source type is a type parameter, box it.
5112         If the target type is a type parameter, emit an `unbox.any'
5113         instead of a `classcast'.1      
5114
5115 2004-04-01  Martin Baulig  <martin@ximian.com>
5116
5117         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
5118
5119 2004-04-01  Martin Baulig  <martin@ximian.com>
5120
5121         * generic.cs (ConstructedType.CheckConstraints): Use
5122         Convert.ImplicitStandardConversionExists(); user-defined implicit
5123         conversions are not allowed according to the spec.
5124
5125 2004-03-30  Martin Baulig  <martin@ximian.com>
5126
5127         * expression.cs (New): Added support for type parameters.
5128
5129         * typemanager.cs
5130         (TypeManager.activator_type): New public static field.
5131         (TypeManager.activator_create_instance): Likewise.
5132
5133 2004-03-30  Martin Baulig  <martin@ximian.com>
5134
5135         * typemanager.cs (TypeManager.HasConstructorConstraint): New
5136         public method.
5137
5138 2004-03-30  Martin Baulig  <martin@ximian.com>
5139
5140         * generic.cs (ConstructedType.CheckConstraints): Actually follow
5141         the spec here: the argument type must be convertible to the
5142         constraints.
5143
5144 2004-03-30  Martin Baulig  <martin@ximian.com>
5145
5146         * generic.cs
5147         (TypeParameter.Define, TypeParameter.DefineMethod): Call
5148         TypeManager.AddTypeParameter().
5149         (ConstructedType.CheckConstraints): Re-enable this and actually
5150         check whether we have a constructor constraint.
5151
5152         * typemanager.cs
5153         (TypeManager.builder_to_type_param): New static field.
5154         (TypeManager.AddTypeParameter): New static method.
5155         (TypeManager.LookupTypeParameter): New public method.
5156
5157 2004-03-30  Martin Baulig  <martin@ximian.com>
5158
5159         * generic.cs (TypeParameter.DefineType): Return a boolean and use
5160         the new API to actually define the constructor constraint.
5161
5162         * typemanager.cs
5163         (TypeManager.new_constraint_attr_type): New static field.
5164         (TypeManager.InitCoreTypes): Initialize it.
5165
5166 2004-03-30  Martin Baulig  <martin@ximian.com>
5167
5168         * generic.cs (Constraints): Completed error checking, use correct
5169         error numbers.
5170
5171 2004-03-29  Martin Baulig  <martin@ximian.com>
5172
5173         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
5174
5175         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5176         public version which takes a `ParameterData pd' instead of an
5177         `ArrayList args'.
5178
5179 2004-03-29  Martin Baulig  <martin@ximian.com>
5180
5181         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
5182         not a MethodInfo.       
5183
5184 2004-03-29  Martin Baulig  <martin@ximian.com>
5185
5186         * expression.cs (Argument.ResolveMethodGroup): If we're a
5187         ConstructedType, call GetMemberAccess() on it.  
5188
5189 2004-03-29  Martin Baulig  <martin@ximian.com>
5190
5191         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
5192         (MethodCore.CheckGenericOverride): When overriding a generic
5193         method, check whether the constraints match.
5194
5195         * support.cs (GenericConstraints): New public interface.
5196         (ParameterData.GenericConstraints): New public method.
5197
5198         * parameter.cs (Parameter.Resolve): Check whether we're a generic
5199         method parameter and compute our constraints if appropriate.
5200         (Parameter.GenericConstraints): New public property.
5201
5202         * generic.cs (Constraints): Implement GenericConstraints.
5203
5204 2004-03-29  Martin Baulig  <martin@ximian.com>
5205
5206         * decl.cs (MemberCache.FindMemberToOverride): Use
5207         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
5208
5209 2004-03-29  Martin Baulig  <martin@ximian.com>
5210
5211         * generic.cs (GenericMethod.Define): Resolve our type parameters.
5212
5213 2004-03-29  Martin Baulig  <martin@ximian.com>
5214
5215         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
5216         not allowed on non-generic declarations").
5217
5218 2004-03-29  Martin Baulig  <martin@ximian.com>
5219
5220         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5221         public version of this method.
5222
5223         * class.cs (MethodCore.IsDuplicateImplementation): Use
5224         Invocation.InferTypeArguments() to check this.
5225
5226 2004-03-29  Martin Baulig  <martin@ximian.com>
5227
5228         * convert.cs: Use TypeManager.IsDelegateType() instead of
5229         comparing types correctly.
5230
5231 2004-03-29  Martin Baulig  <martin@ximian.com>
5232
5233         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
5234         types directly to make it work for generic instances.
5235
5236         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
5237
5238 2004-03-29  Martin Baulig  <martin@ximian.com>
5239
5240         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
5241         support for arrays.     
5242
5243 2004-03-24  Martin Baulig  <martin@ximian.com>
5244
5245         * decl.cs (DeclSpace.FindType): Also use
5246         TypeManager.CheckGeneric() for types from the using clauses.
5247
5248 2004-03-23  Martin Baulig  <martin@ximian.com>
5249
5250         * expression.cs (Invocation.OverloadResolve): Added `bool
5251         may_fail' argument and use it instead of the Location.IsNull() hack.
5252
5253 2004-03-23  Martin Baulig  <martin@ximian.com>
5254
5255         * expression.cs (Invocation.InferType): Use correct type inference
5256         rules here.     
5257
5258 2004-03-23  Martin Baulig  <martin@ximian.com>
5259
5260         * ecore.cs (MethodGroupExpr.Name): Use
5261         TypeManager.CSharpSignature() instead of just the name.
5262
5263         * expression.cs (Invocation.OverloadResolve): Provide better error
5264         reporting.
5265         (Invocation.DoResolve): OverloadResolve() never returns null
5266         without reporting an error, so removed the error -6 reporting here.
5267
5268 2004-03-23  Martin Baulig  <martin@ximian.com>
5269
5270         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
5271         generic methods.
5272
5273         * cs-parser.jay (delegate_declaration): Support generic delegates.
5274
5275         * delegate.cs: Support generic delegates.
5276
5277 2004-03-22  Martin Baulig  <martin@ximian.com>
5278
5279         * expression.cs (Invocation.InferParamsTypeArguments): New static
5280         method; does type inference for params arguments.
5281
5282 2004-03-21  Martin Baulig  <martin@ximian.com>
5283
5284         * typemanager.cs (TypeManager.IsGenericMethod): New public static
5285         method; checks whether a method is a generic method.    
5286
5287         * expression.cs (Invocation.InferTypeArguments): New static method;
5288         infer type arguments for generic method invocation.
5289
5290         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
5291         property; we set this to true if we're resolving a generic method
5292         invocation and the user specified type arguments, ie. we're not
5293         doing type inference.
5294
5295 2004-03-20  Martin Baulig  <martin@ximian.com>
5296
5297         * class.cs (MethodData.DeclaringType): New public property.
5298         (MethodData.Define): Set DeclaringType here.
5299         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
5300         instead of OperatorMethodBuilder.DeclaringType.
5301
5302 2004-03-20  Martin Baulig  <martin@ximian.com>
5303
5304         * cs-tokenizer.cs (xtoken): Return a special
5305         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
5306
5307         * cs-parser.jay (default_value_expression): Switch to the new
5308         syntax (14.5.13).
5309
5310 2004-03-19  Martin Baulig  <martin@ximian.com>
5311
5312         * decl.cs (MemberName): New class.  We use this to "construct"
5313         namespace_or_type_name's.
5314
5315         * generics.cs (TypeArguments.GetDeclarations): New public method;
5316         returns the type arguments as a string[] and reports a CS0081 if
5317         one of them is not an identifier.
5318
5319         * class.cs (MemberBase): The .ctor now takes the name as a
5320         MemberName instead of a string.
5321         (MemberBase.ExplicitInterfaceName): Changed type from string to
5322         Expression.
5323         (MemberBase.DoDefine): If we're an explicit implementation, the
5324         InterfaceType may be a generic instance.
5325
5326         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
5327         (namespace_name): Call MemberName.GetName () to transform the
5328         MemberName into a string and ensure we don't have any type
5329         arguments.
5330         (type_name): Call MemberName.GetTypeExpression() to transfrom the
5331         MemberName into an expression.
5332         (method_header): Use namespace_or_type_name instead of member_name.     
5333
5334 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5335
5336         * rootcontext.cs: Add new types to the boot resolution.
5337
5338         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5339         MulticastDelegate is not allowed.
5340
5341         * typemanager.cs: Add new types to lookup: System.TypedReference
5342         and ArgIterator.
5343
5344         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5345         check for TypedReference or ArgIterator, they are not allowed. 
5346
5347         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5348         makes us properly catch 1510 in some conditions (see bug 56016 for
5349         details). 
5350
5351 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5352
5353         * CryptoConvert.cs: update from corlib version
5354         with endian fixes.
5355
5356 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5357
5358         * class.cs (Indexer.Define): Check indexername declaration
5359
5360 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5361
5362         * attribute.cs (IsClsCompliant): Fixed problem with handling
5363         all three states (compliant, not-compliant, undetected).
5364
5365 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5366
5367         * attribute.cs (Attribute): Location is now public.
5368         (Resolve): Store resolved arguments (pos_values) in attribute class.
5369         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5370         (GetClsCompliantAttributeValue): New method that gets
5371         CLSCompliantAttribute value.
5372         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5373         if exists else null.
5374         (AttributeTester): New class for CLS-Compliant verification routines.
5375
5376         * class.cs (Emit): Add CLS-Compliant verification.
5377         (Method.GetSignatureForError): Implemented.
5378         (Constructor.GetSignatureForError): Implemented
5379         (Constructor.HasCompliantArgs): Returns if constructor has
5380         CLS-Compliant arguments.
5381         (Constructor.Emit): Override.
5382         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5383         is needed to test only parameters.
5384         (FieldBase.GetSignatureForError): Implemented.
5385         (TypeContainer): New member for storing base interfaces.
5386         (TypeContainer.FindMembers): Search in base interfaces too.
5387
5388         * codegen.cs (GetClsComplianceAttribute): New method that gets
5389         assembly or module CLSCompliantAttribute value.
5390         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5391         for assembly.
5392         (ModuleClass.Emit): Add error 3012 test.
5393
5394         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5395
5396         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5397         state for all decl types.
5398         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5399         if CLS-Compliant tests are required.
5400         (IsClsCompliaceRequired): New method. Analyze whether code
5401         must be CLS-Compliant.
5402         (IsExposedFromAssembly): New method. Returns true when MemberCore
5403         is exposed from assembly.
5404         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5405         value or gets cached value.
5406         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5407         is explicitly marked with CLSCompliantAttribute.
5408         (IsIdentifierClsCompliant): New abstract method. This method is
5409         used to testing error 3005.
5410         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5411         for identifier and parameters CLS-Compliant testing.
5412         (VerifyClsCompliance): New method. The main virtual method for
5413         CLS-Compliant verifications.
5414         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5415         null. I don't know why is null (too many public members !).
5416         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5417         and get value of first CLSCompliantAttribute that found.
5418
5419         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5420         (VerifyClsCompliance): Override and add extra tests.
5421
5422         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5423         clscheck- disable CLS-Compliant verification event if assembly is has
5424         CLSCompliantAttribute(true).
5425
5426         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5427         ApllyAttribute is now called in emit section as in the other cases.
5428         Possible future Emit integration.
5429         (IsIdentifierClsCompliant): New override.
5430         (VerifyClsCompliance): New override.
5431         (GetEnumeratorName): Returns full enum name.
5432
5433         * parameter.cs (GetSignatureForError): Implemented.
5434
5435         * report.cs (WarningData): New struct for Warning message information.
5436         (LocationOfPreviousError): New method.
5437         (Warning): New method. Reports warning based on the warning table.
5438         (Error_T): New method. Reports error based on the error table.
5439
5440         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5441         verifications are done here.
5442
5443         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5444
5445         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5446         CLSCompliantAttribute.
5447         (all_imported_types): New member holds all imported types from other
5448         assemblies.
5449         (LoadAllImportedTypes): New method fills static table with exported types
5450         from all referenced assemblies.
5451         (Modules): New property returns all assembly modules.
5452
5453 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5454
5455         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5456         throwing a parser error.
5457
5458         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5459         which removes the hardcoded get_/set_ prefixes for properties, as
5460         IL allows for the properties to be named something else.  
5461
5462         Bug #56013
5463
5464         * expression.cs: Do not override operand before we know if it is
5465         non-null.  Fix 56207
5466
5467 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5468
5469         * typemanager.cs: support for pinned variables.
5470
5471 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5472
5473         * decl.cs, typemanager.cs: Avoid using an arraylist
5474         as a buffer if there is only one result set.
5475
5476 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5477
5478         * expression.cs: Make sure you cant call a static method
5479         with an instance expression, bug #56174.
5480
5481 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5482
5483         * class.cs (IsDuplicateImplementation): Improve error reporting to
5484         flag 663 (method only differs in parameter modifier).
5485
5486         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5487         in preprocessor directives.
5488
5489         * location.cs (LookupFile): Allow for the empty path.
5490
5491         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5492         better approach for some of that patch, but its failing with the
5493         CharSet enumeration.  For now try/catch will do.
5494
5495         * typemanager.cs: Do not crash if a struct does not have fields.
5496         Fixes 56150.
5497
5498 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5499
5500         * expression.cs: cs0213, cant fix a fixed expression.
5501         fixes 50231.
5502
5503 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5504
5505         * cs-parser.jay: detect invalid embeded statements gracefully.
5506         bug #51113.
5507
5508 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5509
5510         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5511         As a regex:
5512         s/
5513         the invocation type may not be a subclass of the tye of the item/
5514         The type of the item must be a subclass of the invocation item.
5515         /g
5516
5517         Fixes bug #50820.
5518
5519 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5520
5521         * attribute.cs: Added methods to get a string and a bool from an
5522         attribute. Required to information from AssemblyKeyFileAttribute,
5523         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5524         * codegen.cs: Modified AssemblyName creation to include support for
5525         strongnames. Catch additional exceptions to report them as CS1548.
5526         * compiler.csproj: Updated include CryptoConvert.cs.
5527         * compiler.csproj.user: Removed file - user specific configuration.
5528         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5529         Mono.Security assembly. The original class is maintained and tested in
5530         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5531         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5532         like CSC 8.0 (C# v2) supports.
5533         * Makefile: Added CryptoConvert.cs to mcs sources.
5534         * rootcontext.cs: Added new options for strongnames.
5535
5536 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5537
5538         * driver.cs: For --expect-error, report error code `2'
5539         if the program compiled with no errors, error code `1' if
5540         it compiled with an error other than the one expected.
5541
5542 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5543
5544         * compiler.csproj: Updated for Visual Studio .NET 2003.
5545         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5546         * compiler.sln: Updated for Visual Studio .NET 2003.
5547
5548 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5549
5550         * expression.cs: Fix bug #47234. We basically need to apply the
5551         rule that we prefer the conversion of null to a reference type
5552         when faced with a conversion to 'object' (csc behaviour).
5553
5554 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5555
5556         * statement.cs: Shorter form for foreach, eliminates
5557         a local variable. r=Martin.
5558
5559 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5560
5561         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5562         checks if we can use brtrue/brfalse to test for 0.
5563         * expression.cs: use the above in the test for using brtrue/brfalse.
5564         cleanup code a bit.
5565
5566 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5567
5568         * expression.cs: Rewrite string concat stuff. Benefits:
5569
5570         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5571         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5572         rather than a concat chain.
5573
5574         * typemanager.cs: Add lookups for more concat overloads.
5575
5576 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5577
5578         * expression.cs: Emit shorter il code for array init.
5579
5580         newarr
5581         dup
5582         // set 1
5583
5584         // set 2
5585
5586         newarr
5587         stloc.x
5588
5589         ldloc.x
5590         // set 1
5591
5592         ldloc.x
5593         // set 2
5594
5595 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5596
5597         * statement.cs: Before, two switch blocks would be merged if the
5598         total size of the blocks (end_item - begin_item + 1) was less than
5599         two times the combined sizes of the blocks.
5600
5601         Now, it will only merge if after the merge at least half of the
5602         slots are filled.
5603
5604         fixes 55885.
5605
5606 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5607
5608         * class.cs : csc build fix for GetMethods(). See bug #52503.
5609
5610 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5611
5612         * expression.cs: Make sure fp comparisons work with NaN.
5613         This fixes bug #54303. Mig approved this patch a long
5614         time ago, but we were not able to test b/c the runtime
5615         had a related bug.
5616
5617 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5618
5619         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5620
5621 2004-03-19  Martin Baulig  <martin@ximian.com>
5622
5623         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5624         two overloads may unify for some type parameter substitutions and
5625         report a CS0408 if appropriate.
5626
5627 2004-03-19  Martin Baulig  <martin@ximian.com>
5628
5629         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5630         error here and not in our caller.
5631
5632 2004-03-19  Martin Baulig  <martin@ximian.com>
5633
5634         * interface.cs: Completely killed this file.
5635         (Interface): We're now a TypeContainer and live in class.cs.
5636
5637         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5638         argument; we're now also called for interfaces.
5639         (TypeContainer.DefineMembers): Allow this method being called
5640         multiple times.
5641         (TypeContainer.GetMethods): New public method; formerly known as
5642         Interface.GetMethod().  This is used by PendingImplementation.
5643         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5644         it's now private and non-static.
5645         (Interface): Moved this here; it's now implemented similar to
5646         Class and Struct.
5647         (Method, Property, Event, Indexer): Added `bool is_interface'
5648         argument to their .ctor's.
5649         (MemberBase.IsInterface): New public field.
5650
5651         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5652         instances instead of InterfaceMethod, InterfaceProperty, etc.
5653         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5654         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5655
5656 2004-03-19  Martin Baulig  <martin@ximian.com>
5657
5658         * class.cs (MethodCore.IsDuplicateImplementation): New private
5659         method which does the CS0111 checking.
5660         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5661         Use IsDuplicateImplementation().
5662
5663 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5664
5665         * decl.cs (FindMemberToOverride): New method to find the correct
5666         method or property to override in the base class.
5667         * class.cs
5668             - Make Method/Property use the above method to find the
5669               version in the base class.
5670             - Remove the InheritableMemberSignatureCompare as it is now
5671               dead code.
5672
5673         This patch makes large code bases much faster to compile, as it is
5674         O(n) rather than O(n^2) to do this validation.
5675
5676         Also, it fixes bug 52458 which is that nested classes are not
5677         taken into account when finding the base class member.
5678
5679         Reviewed/Approved by Martin.
5680
5681 2004-03-17  Martin Baulig  <martin@ximian.com>
5682
5683         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5684         of type arguments into account; use the `real_num_type_args'
5685         approach like in DoResolveAsTypeStep().
5686
5687         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5688         nested types.
5689
5690 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5691
5692         * interface.cs: In all interface classes removed redundant
5693         member initialization.
5694
5695 2004-03-16  Martin Baulig  <martin@ximian.com>
5696
5697         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5698
5699 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5700
5701         * decl.cs (DefineTypeAndParents): New helper method to define a
5702         type's containers before the type itself is defined;  This is a
5703         bug exposed by the recent changes to Windows.Forms when an
5704         implemented interface was defined inside a class that had not been
5705         built yet.   
5706
5707         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5708
5709         (Check): Loop correctly to report errors modifiers
5710         (UNSAFE was not in the loop, since it was the same as TOP).
5711
5712         * interface.cs: Every interface member now takes a ModFlags,
5713         instead of a "is_new" bool, which we set on the base MemberCore. 
5714
5715         Every place where we called "UnsafeOk" in the interface, now we
5716         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5717         the unsafe settings from the member declaration instead of the
5718         container interface. 
5719
5720         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5721
5722         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5723         `set_indexer_name' to the pending bits (one per type).
5724
5725         We fixed a bug today that was picking the wrong method to
5726         override, since for properties the existing InterfaceMethod code
5727         basically ignored the method name.  Now we make sure that the
5728         method name is one of the valid indexer names.
5729
5730 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5731  
5732         * support.cs (SeekableStreamReader): Keep track of stream byte
5733         positions and don't mix them with character offsets to the buffer.
5734
5735         Patch from Gustavo Giráldez
5736
5737 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5738
5739         * interface.cs (InterfaceSetGetBase): Removed double member
5740         initialization, base class does it as well.
5741
5742 2004-03-13  Martin Baulig  <martin@ximian.com>
5743
5744         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5745         when compiling corlib.
5746
5747 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5748
5749         * convert.cs (ExplicitConversion): We were reporting an error on
5750         certain conversions (object_type source to a value type, when the
5751         expression was `null') before we had a chance to pass it through
5752         the user defined conversions.
5753
5754         * driver.cs: Replace / and \ in resource specifications to dots.
5755         Fixes 50752
5756
5757         * class.cs: Add check for duplicate operators.  Fixes 52477
5758
5759 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5760
5761         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5762         that are in the middle of the statements, not only at the end.
5763         Fixes #54987
5764
5765         * class.cs (TypeContainer.AddField): No longer set the
5766         `HaveStaticConstructor' flag, now we call it
5767         `UserDefineStaticConstructor' to diferentiate the slightly
5768         semantic difference.
5769
5770         The situation is that we were not adding BeforeFieldInit (from
5771         Modifiers.TypeAttr) to classes that could have it.
5772         BeforeFieldInit should be set to classes that have no static
5773         constructor. 
5774
5775         See:
5776
5777         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5778
5779         And most importantly Zoltan's comment:
5780
5781         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5782
5783         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5784          before its static fields are used', i.e. initialization does not need
5785          to be triggered by the first access to the type. Setting this flag
5786          helps the JIT to compile better code, since it can run the static
5787          constructor at JIT time, and does not need to generate code to call it
5788          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5789          this flag for lots of classes like String. 
5790          
5791          csc sets this flag if the type does not have an explicit static 
5792          constructor. The reasoning seems to be that if there are only static
5793          initalizers for a type, and no static constructor, then the programmer
5794          does not care when this initialization happens, so beforefieldinit
5795          can be used.
5796          
5797          This bug prevents the AOT compiler from being usable, since it 
5798          generates so many calls to mono_runtime_class_init that the AOT code
5799          is much slower than the JITted code. The JITted code is faster, 
5800          because it does not generate these calls if the vtable is type is
5801          already initialized, which is true in the majority of cases. But the
5802          AOT compiler can't do this."
5803
5804 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5805
5806         * class.cs (MethodData.Emit): Refactor the code so symbolic
5807         information is generated for destructors;  For some reasons we
5808         were taking a code path that did not generate symbolic information
5809         before. 
5810
5811 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5812
5813         * class.cs: Create a Constructor.CheckBase method that
5814         takes care of all validation type code. The method
5815         contains some code that was moved from Define.
5816
5817         It also includes new code that checks for duplicate ctors.
5818         This fixes bug #55148.
5819
5820 2004-03-09  Joshua Tauberer <tauberer@for.net>
5821
5822         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5823         a { ... }-style array creation invokes EmitStaticInitializers
5824         which is not good for reference-type arrays.  String, decimal
5825         and now null constants (NullCast) are not counted toward
5826         static initializers.
5827
5828 2004-03-05  Martin Baulig  <martin@ximian.com>
5829
5830         * location.cs (SourceFile.HasLineDirective): New public field;
5831         specifies whether the file contains or is referenced by a "#line"
5832         directive.
5833         (Location.DefineSymbolDocuments): Ignore source files which
5834         either contain or are referenced by a "#line" directive.        
5835
5836 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5837
5838         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5839         direct access to our parent, so check the method inline there.
5840
5841 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5842
5843         * expression.cs (Invocation.EmitCall): Miguel's last commit
5844         caused a regression. If you had:
5845
5846             T t = null;
5847             t.Foo ();
5848
5849         In Foo the implict this would be null.
5850
5851 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5852
5853         * expression.cs (Invocation.EmitCall): If the method is not
5854         virtual, do not emit a CallVirt to it, use Call.
5855
5856         * typemanager.cs (GetFullNameSignature): Improve the method to
5857         cope with ".ctor" and replace it with the type name.
5858
5859         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5860         as an argument the ConstructorBuilder where it is being defined,
5861         to catch the recursive constructor invocations.
5862
5863 2004-03-16  Martin Baulig  <martin@ximian.com>
5864
5865         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5866         ConstructedType, call ResolveType() on it to get the type rather
5867         than just using `expr.Type'.
5868
5869 2004-03-16  Martin Baulig  <martin@ximian.com>
5870
5871         * generics.cs (ConstructedType.GetMemberAccess): Take the
5872         EmitContext instead on the TypeExpr and use
5873         ec.TypeContainer.CurrentType/ec.ContainerType.
5874
5875 2004-03-16  Martin Baulig  <martin@ximian.com>
5876
5877         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5878         parameters before aliases.
5879
5880 2004-03-16  Martin Baulig  <martin@ximian.com>
5881
5882         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5883         New oublic function; checks whether two generic instances may become
5884         equal under some instantiations (26.3.1).
5885
5886         * class.cs (TypeContainer.Define): Call
5887         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5888         error.
5889
5890 2004-03-16  Martin Baulig  <martin@ximian.com>
5891
5892         * class.cs (TypeContainer.GetClassBases): Moved
5893         Error_TypeParameterAsBase() here and also check whether the base
5894         class is not an attribute.
5895
5896 2004-03-16  Martin Baulig  <martin@ximian.com>
5897
5898         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5899
5900 2004-03-16  Martin Baulig  <martin@ximian.com>
5901
5902         * class.cs (Error_TypeParameterAsBase): Use correct error number
5903         here (CS0689).  
5904
5905 2004-03-16  Martin Baulig  <martin@ximian.com>
5906
5907         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5908         for generics.
5909
5910         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5911         error reporting.
5912
5913 2004-03-15  Martin Baulig  <martin@ximian.com>
5914
5915         * typemanager.cs (TypeManager.GetFullName): New public method.
5916         (TypeManager.MemberLookup): Added `int_num_type_arguments'
5917         argument; only return members with the correct number of type
5918         arguments.
5919         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
5920         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
5921         whether the number of type arguments matches.
5922
5923         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
5924         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
5925
5926         * expression.cs (MemberAccess): Added public `NumTypeArguments'
5927         field; it's set by the protected .ctor when we're actually a
5928         GenericMemberAccess.
5929         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
5930         arguments and pass it to MemberLookupFinal ().
5931
5932         * ecore.cs (Expression.MemberLookup): Added `int
5933         num_type_arguments' argument; only return members with the correct
5934         number of type arguments.
5935         (Expression.MemberLookupFailed): Check whether the MemberLookup
5936         failed because we did not have the correct number of type
5937         arguments; report CS0305 in this case.
5938
5939         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
5940         `e.ResolveAsTypeTerminal()' already did so.
5941
5942 2004-03-15  Martin Baulig  <martin@ximian.com>
5943
5944         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
5945         we're a ConstructedType; in this case, the caller must report an
5946         error (for instance CS0131).
5947
5948         * generic.cs (TypeArguments): Added Location argument to the .ctor.
5949         (TypeArguments.Resolve): Actually report errors here.
5950
5951 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5952
5953         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5954         `set_indexer_name' to the pending bits (one per type).
5955
5956         We fixed a bug today that was picking the wrong method to
5957         override, since for properties the existing InterfaceMethod code
5958         basically ignored the method name.  Now we make sure that the
5959         method name is one of the valid indexer names.
5960
5961 2004-03-15  Martin Baulig  <martin@ximian.com>
5962
5963         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
5964         for generic instances.
5965
5966 2004-03-13  Martin Baulig  <martin@ximian.com>
5967
5968         * class.cs (TypeContainer.DefineType): Call
5969         TypeManager.AddUserType() immediately after creating the
5970         TypeBuilder; pass all type parameters when creating the
5971         CurrentType.
5972
5973         * decl.cs (DeclSpace.FindNestedType): New public method.
5974         (DeclSpace.FindType): Added `int num_type_args' argument; only
5975         return types with the correct number of type parameters.
5976         (DeclSpace.CountTypeParams): New public property.
5977
5978         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
5979         the number of type parameters; defaults to zero.
5980
5981         * generic.cs (TypeArguments.Count): New public property.
5982         (ConstructedType.DoResolveAsTypeStep): First call
5983         ds.FindNestedType() to find out whether we're nested in the
5984         current generic type; in this case, we inherit all type parameters
5985         from the current class.
5986
5987         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
5988         num_type_args' argument.
5989         (RootContext.LookupType): Added overloaded version which takes the
5990         number of type arguments; only return types with the correct
5991         number of type arguments.
5992
5993         * typemanager.cs (TypeManager.CheckGeneric): New public function;
5994         checks whether `Type t' has `int num_type_args'.
5995
5996 2004-03-13  Martin Baulig  <martin@ximian.com>
5997
5998         * generic.cs (GenericMethod.DefineType): New method; calls
5999         DefineType() on all the type parameters.
6000
6001         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
6002         (MethodData.Define): If we're a generic method, call
6003         GenericMethod.DefineType() to define the type parameters.       
6004
6005 2004-03-10  Martin Baulig  <martin@ximian.com>
6006
6007         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
6008         instead of IsAssignableFrom.    
6009
6010 2004-03-10  Martin Baulig  <martin@ximian.com>
6011
6012         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
6013
6014         * support.cs (ParameterData.HasArrayParameter): New property.
6015         (ReflectionParameters.ctor): Take a MethodBase instead of a
6016         ParameterInfo[].  If we have any type parameters, get the generic
6017         method definition and ask it whether we have variable arguments.
6018
6019 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
6020
6021         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
6022         routines to check if a type is an enumerable/enumerator allow
6023         classes that implement the IEnumerable or IEnumerator interfaces.
6024
6025         * class.cs (Property, Operator): Implement IIteratorContainer, and
6026         implement SetYields.
6027
6028         (Property.Define): Do the block swapping for get_methods in the
6029         context of iterators.   We need to check if Properties also
6030         include indexers or not.
6031
6032         (Operator): Assign the Block before invoking the
6033         OperatorMethod.Define, so we can trigger the Iterator code
6034         replacement. 
6035
6036         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
6037         Property and Operator classes are not created when we parse the
6038         declarator but until we have the block completed, so we use a
6039         singleton SimpleIteratorContainer.Simple to flag whether the
6040         SetYields has been invoked.
6041
6042         We propagate this setting then to the Property or the Operator to
6043         allow the `yield' to function.
6044
6045 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
6046
6047         * codegen.cs: Implemented attribute support for modules.
6048         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
6049         Assembly/Module functionality.
6050
6051         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
6052         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
6053         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
6054
6055 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
6056
6057         * interface.cs (FindMembers): The operation is performed on all base
6058         interfaces and not only on the first. It is required for future CLS Compliance patch.
6059
6060 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6061
6062         * statement.cs, codegen.cs:
6063         This patch deals with patterns such as:
6064
6065         public class List : IEnumerable {
6066
6067                 public MyEnumerator GetEnumerator () {
6068                         return new MyEnumerator(this);
6069                 }
6070
6071                 IEnumerator IEnumerable.GetEnumerator () {
6072                         ...
6073                 }
6074                 
6075                 public struct MyEnumerator : IEnumerator {
6076                         ...
6077                 }
6078         }
6079
6080         Before, there were a few things we did wrong:
6081         1) we would emit callvirt on a struct, which is illegal
6082         2) we emited ldarg when we needed to emit ldarga
6083         3) we would mistakenly call the interface methods on an enumerator
6084         type that derived from IEnumerator and was in another assembly. For example:
6085
6086         public class MyEnumerator : IEnumerator
6087
6088         Would have the interface methods called, even if there were public impls of the
6089         method. In a struct, this lead to invalid IL code.
6090
6091 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
6092
6093         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
6094           renamed to Emit.
6095
6096         * delegate.cs (Define): Fixed crash when delegate type is undefined.
6097
6098 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
6099
6100         * cs-parser.jay: Fix small regression: we were not testing V2
6101         compiler features correctly.
6102
6103         * interface.cs: If the emit context is null, then create one
6104
6105 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6106
6107         * decl.cs (GetSignatureForError): New virtual method to get full name
6108           for error messages.
6109
6110         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6111           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6112
6113         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6114           Duplicated members and code in these classes has been removed.
6115           Better encapsulation in these classes.
6116
6117 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
6118
6119         * assign.cs (Assign.DoResolve): When dealing with compound
6120         assignments, there is a new rule in ECMA C# 2.4 (might have been
6121         there before, but it is documented here) that states that in:
6122
6123         a op= b;
6124
6125         If b is of type int, and the `op' is a shift-operator, then the
6126         above is evaluated as:
6127
6128         a = (int) a op b 
6129
6130         * expression.cs (Binary.ResolveOperator): Instead of testing for
6131         int/uint/long/ulong, try to implicitly convert to any of those
6132         types and use that in pointer arithmetic.
6133
6134         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6135         method to print information for from the type, not from the
6136         null-method we were given.
6137
6138 2004-02-01  Duncan Mak  <duncan@ximian.com>
6139
6140         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6141         parsing for cmd, fixes bug #53694.
6142
6143 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6144
6145         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6146         in the member name duplication tests. Property and operator name duplication
6147         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6148
6149 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6150
6151         * interface.cs (PopulateMethod): Fixed crash when interface method
6152         returns not existing type (error test cs0246-3.cs).
6153
6154 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6155
6156         * cs-parser.jay (interface_accessors): Re-write actions to also
6157         store attributes attached to get and set methods. Fix spelling
6158         while at it.
6159
6160         (inteface_property_declaration): Modify accordingly.
6161
6162         (InterfaceAccessorInfo): New helper class to store information to pass
6163         around between rules that use interface_accessors.
6164
6165         * interface.cs (Emit): Apply attributes on the get and set
6166         accessors of properties and indexers too.
6167
6168         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6169         right MethodBuilder when applying attributes to the get and set accessors.
6170
6171 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6172
6173         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6174
6175 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6176
6177         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6178
6179 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6180
6181         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6182         changes that treat `yield' specially when present before `break'
6183         or `return' tokens.
6184
6185         * cs-tokenizer.cs: yield is no longer a keyword.
6186
6187 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6188
6189         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6190         setting for default constructors.
6191         For default constructors are almost every time set wrong Modifier. The
6192         generated IL code has been alright. But inside mcs this values was
6193         wrong and this was reason why several of my CLS Compliance tests
6194         failed.
6195
6196 2004-02-27  Martin Baulig  <martin@ximian.com>
6197
6198         * generics.cs (ConstructedType.ResolveType): Make the nested type
6199         stuff actually work.
6200
6201 2004-02-25  Martin Baulig  <martin@ximian.com>
6202
6203         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
6204         property; returns the type parameters just from the current type,
6205         ie. with the ones from outer classes.
6206         (DeclSpace.LookupGeneric): First search in the current class, then
6207         in outer classes.
6208         (DeclSpace.initialize_type_params): When hiding a type parameter
6209         from an outer class, put it into the `type_param_list' anyways.
6210
6211         * expression.cs (MemberAccess.expr): Made this field protected.
6212
6213         * class.cs (TypeContainer.Define): The `CurrentType' just contains
6214         the type parameters from the current class.
6215
6216         * generic.cs (ConstructedType.ResolveType): Support nested generic
6217         types by taking the type parameters which we inherit from outer
6218         classes into account.
6219         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
6220         support for nested generic types.
6221
6222 2004-02-23  Martin Baulig  <martin@ximian.com>
6223
6224         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
6225         field and check whether we're nested inside a generic type.
6226         (DeclSpace.ResolveType): If we're resolving to a generic type
6227         definition, create a ConstructedType and return its resolved type.
6228         (DeclSpace.initialize_type_params): New private method;
6229         initializes the `type_param_list' field from the type parameters
6230         from this and all enclosing classes.
6231         (DeclSpace.TypeParameters): Call initialize_type_params() unless
6232         we're already initialized.
6233
6234 2004-02-23  Martin Baulig  <martin@ximian.com>
6235
6236         * class.cs (Method.Define): Create the generic method before
6237         calling DoDefine().
6238         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
6239         the TypeContainer one); we use this for generic methods.
6240
6241         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
6242         parent's TypeBuilder.
6243
6244 2004-02-18  Martin Baulig  <martin@ximian.com>
6245
6246         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
6247         to check for equality.
6248
6249 2004-02-05  Martin Baulig  <martin@ximian.com>
6250
6251         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
6252         `ec.TypeContainer.CurrentType', use it instead of
6253         `ec.ContainerType' to check whether we're in the type's ctor.
6254
6255 2004-01-29  Martin Baulig  <martin@ximian.com>
6256
6257         * expression.cs (Invocation.DoResolve): If we're a
6258         `ConstructedType', then we're actually a generic method, so
6259         rewrite the expr as a GenericMemberAccess.
6260
6261         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
6262         here; manually parse it into a string.
6263
6264 2004-01-28  Martin Baulig  <martin@ximian.com>
6265
6266         * typemanager.cs (TypeManager.IsEqual): New static method.
6267         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
6268         check for equality instead of using `=='.
6269
6270 2004-01-26  Martin Baulig  <martin@ximian.com>
6271
6272         * decl.cs (DeclSpace.CurrentType): New public field.
6273
6274         * expression.cs (This.ResolveBase): If we have an
6275         `ec.TypeContainer.CurrentType', use it instead of
6276         `ec.ContainerType'.
6277
6278         * class.cs (TypeContainer.DefineType): If we're a generic type,
6279         create the `CurrentType' (unresolved).
6280         (TypeContainer.GenericType): New private field.
6281         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
6282         it and store it in `GenericType' before creating the MemberCache.
6283         (TypeContainer.GetMembers): If we have a `GenericType', call
6284         TypeManager.FindMembers() on it.
6285
6286         * interface.cs (Interface.GenericType): New private field.
6287         (Interface.DefineType): If we're a generic type, create the
6288         `CurrentType' (unresolved).
6289         (Interface.DefineMembers): If we have a `CurrentType', resolve it
6290         and store it in `GenericType' before creating the MemberCache.
6291         (Interface.GetMembers): If we have a `GenericType', call
6292         TypeManager.FindMembers() on it.
6293
6294 2004-01-22  Martin Baulig  <martin@ximian.com>
6295
6296         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6297         not a QualifiedIdentifier.  This is what `type_name_expression'
6298         was previously doing.
6299         (type_name_expression): Removed; the code is now in
6300         `namespace_or_type_name'.
6301         (qualified_identifier): Removed, use `namespace_or_type_name'
6302         instead.
6303         (QualifiedIdentifier): Removed this class.      
6304
6305 2004-01-22  Martin Baulig  <martin@ximian.com>
6306
6307         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6308         not a string as alias name.
6309
6310 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6311
6312         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6313         #52730 bug, and instead compute correctly the need to use a
6314         temporary variable when requesting an address based on the
6315         static/instace modified of the field and the constructor.
6316  
6317 2004-01-21  Martin Baulig  <martin@ximian.com>
6318
6319         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6320         class and namespace before looking up aliases.  Fixes #52517.
6321
6322 2004-01-21  Martin Baulig  <martin@ximian.com>
6323
6324         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6325         assinged in a 'try'; fixes exception4.cs.
6326
6327 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6328         * class.cs : Implemented parameter-less constructor for TypeContainer
6329
6330         * decl.cs: Attributes are now stored here. New property OptAttributes
6331
6332         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6333
6334         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6335
6336 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6337
6338         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6339           (CSharpSignature): New method for indexer and property signature.
6340
6341 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6342
6343         * pending.cs (IsVirtualFilter): Faster implementation.
6344
6345 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6346
6347         * typemanager.cs: Avoid inclusion of same assembly more than once.
6348
6349 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6350
6351         * cs-parser.jay: Fixed problem where the last assembly attribute
6352           has been applied also to following declaration (class, struct, etc.)
6353           
6354 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6355
6356         * class.cs: Added error CS0538, CS0539 reporting.
6357         Fixed crash on Microsoft runtime when field type is void.
6358
6359         * cs-parser.jay: Added error CS0537 reporting.
6360
6361         * pending.cs: Added error CS0535 reporting.
6362         Improved error report for errors CS0536, CS0534.
6363
6364 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6365
6366         Merge a few bits from the Anonymous Method MCS tree.
6367
6368         * statement.cs (ToplevelBlock): New class for toplevel methods,
6369         will hold anonymous methods, lifted variables.
6370
6371         * cs-parser.jay: Create toplevel blocks for delegates and for
6372         regular blocks of code. 
6373
6374 2004-01-20  Martin Baulig  <martin@ximian.com>
6375
6376         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6377         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6378         and `NeedExplicitReturn'; added `IsLastStatement'.
6379         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6380         have a `ReturnLabel' or we're not unreachable.
6381
6382         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6383         child's reachability; don't just override ours with it.  Fixes
6384         #58058 (lluis's example).
6385         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6386         InFinally(), InLoop(), InSwitch() and
6387         BreakCrossesTryCatchBoundary() methods.
6388
6389         * statement.cs (Return): Do all error checking in Resolve().
6390         Unless we are the last statement in a top-level block, always
6391         create a return label and jump to it.
6392         (Break, Continue): Do all error checking in Resolve(); also make
6393         sure we aren't leaving a `finally'.
6394         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6395         statement in a top-level block.
6396         (Block.Flags): Added `IsDestructor'.
6397         (Block.IsDestructor): New public property.
6398
6399 2004-01-20  Martin Baulig  <martin@ximian.com>
6400
6401         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6402
6403 2004-01-20  Martin Baulig  <martin@ximian.com>
6404
6405         * statement.cs (Statement.ResolveUnreachable): New public method.
6406         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6407         (Block.Resolve): Resolve unreachable statements.
6408
6409 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6410
6411         * expression.cs: We need to fix the case where we do
6412         not have a temp variable here.
6413
6414         * assign.cs: Only expression compound assignments need
6415         temporary variables.
6416
6417 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6418
6419         * flowanalysis.cs: Reduce memory allocation in a few ways:
6420           - A block with no variables should not allocate a bit
6421             vector for itself.
6422           - A method with no out parameters does not need any tracking
6423             for assignment of the parameters, so we need not allocate
6424             any data for it.
6425           - The arrays:
6426                 public readonly Type[] VariableTypes;
6427                 public readonly string[] VariableNames;
6428             Are redundant. The data is already stored in the variable
6429             map, so we need not allocate another array for it.
6430           - We need to add alot of checks for if (params | locals) == null
6431             due to the first two changes.
6432
6433 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6434
6435         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6436         implement IMemoryLocation, we store a copy on a local variable and
6437         take the address of it.  Patch from Benjamin Jemlich
6438
6439         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6440         to use a special "type_name_expression" rule which reduces the
6441         number of "QualifiedIdentifier" classes created, and instead
6442         directly creates MemberAccess expressions.
6443
6444 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6445
6446         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6447         that fixes #52853.  Null literal assignment to ValueType
6448
6449         * class.cs (MethodData.Emit): Instead of checking the name of the
6450         method to determine if its a destructor, create a new derived
6451         class from Method called Destructor, and test for that.  
6452
6453         * cs-parser.jay: Create a Destructor object instead of a Method.  
6454
6455         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6456
6457         Fixes: 52933
6458
6459 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6460
6461         * expression.cs (Binary.ResolveOperator): Perform an implicit
6462         conversion from MethodGroups to their delegate types on the
6463         Addition operation.
6464
6465         * delegate.cs: Introduce a new class DelegateCreation that is the
6466         base class for `NewDelegate' and `ImplicitDelegateCreation',
6467         factor some code in here.
6468
6469         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6470         conversion from MethodGroups to compatible delegate types. 
6471
6472         * ecore.cs (Expression.Resolve): Do not flag error 654
6473         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6474         we allow conversions from MethodGroups to delegate types now.
6475
6476         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6477         assignments in v2 either.
6478
6479 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6480
6481         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6482         static read-only fields in ctors.
6483
6484         Applied patch from Benjamin Jemlich 
6485
6486         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6487
6488 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6489
6490         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6491         here to return true, as they can be used like this:
6492
6493                 (XXX) int.MEMBER ()
6494
6495         Fixed 49836 and all the other dups
6496
6497 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6498
6499         * driver.cs: Implement /win32res and /win32icon.
6500
6501 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6502
6503         * cs-parser.jay: Add a rule to improve error handling for the
6504         common mistake of placing modifiers after the type.
6505
6506 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6507
6508         * cs-parser.jay (interface_event_declaration): Catch
6509         initialization of events on interfaces, and report cs0068
6510
6511         * cs-parser.jay (interface_event_declaration): Catch
6512         initialization of events. 
6513
6514         * ecore.cs: Better report missing constructors.
6515
6516         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6517         the error reporting done in the wrong place.  Fix.
6518
6519         * expression.cs (Binary.ResolveOperator): Catch the 
6520         operator + (E x, E y) error earlier, and later allow for implicit
6521         conversions in operator +/- (E e, U x) from U to the underlying
6522         type of E.
6523
6524         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6525         52596, if the container class is abstract, the default constructor
6526         is protected otherwise its public (before, we were always public).
6527
6528         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6529         fixed statement.
6530
6531         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6532         Jemlich that fixes bug #52597, MCS was generating invalid code for
6533         idisposable structs.   Thanks to Ben for following up with this
6534         bug as well.
6535
6536 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6537
6538         * driver.cs: Allow assemblies without code to be generated, fixes
6539         52230.
6540
6541 2004-01-07  Nick Drochak <ndrochak@gol.com>
6542
6543         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6544
6545 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6546
6547         * cs-parser.jay: Add rules to improve error reporting if fields or
6548         methods are declared at the namespace level (error 116)
6549
6550         * Add rules to catch event add/remove
6551
6552 2004-01-04  David Sheldon <dave-mono@earth.li>
6553
6554   * expression.cs: Added matching ")" to error message for 
6555   CS0077
6556
6557 2004-01-03 Todd Berman <tberman@gentoo.org>
6558
6559         * ecore.cs, attribute.cs:
6560         Applying fix from #52429.
6561
6562 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6563
6564         * ecore.cs, expression.cs, statement.cs:
6565         Total rewrite of how we handle branching. We
6566         now handle complex boolean expressions with fewer
6567         jumps. As well if (x == 0) no longer emits a ceq.
6568
6569         if (x is Foo) is much faster now, because we generate
6570         better code.
6571
6572         Overall, we get a pretty big improvement on our benchmark
6573         tests. The code we generate is smaller and more readable.
6574
6575         I did a full two-stage bootstrap. The patch was reviewed
6576         by Martin and Miguel.
6577
6578 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6579
6580         * cs-parser.jay: Make primary_expression not take a QI.
6581         we dont need this because the member_access rule covers
6582         us here. So we replace the rule with just IDENTIFIER.
6583
6584         This has two good effects. First, we remove a s/r conflict.
6585         Second, we allocate many fewer QualifiedIdentifier objects.
6586
6587 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6588
6589         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6590         set the correct information via SRE. This prevents
6591         hanging on the MS runtime. Fixes #29374.
6592
6593 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6594
6595         * convert.cs: correctly handle conversions to value types
6596         from Enum and ValueType as unboxing conversions.
6597
6598         Fixes bug #52569. Patch by Benjamin Jemlich.
6599
6600 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6601
6602         * expression.cs (BetterConversion): Prefer int -> uint
6603         over int -> ulong (csc's behaviour). This fixed bug #52046.
6604
6605 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6606
6607         * decl.cs (MemberCache.FindMembers): now returns a
6608         MemberInfo [].
6609
6610         * typemanager.cs: In general, go with with ^^.
6611         (CopyNewMethods): take an IList.
6612         (RealMemberLookup): Only allocate an arraylist
6613         if we copy from two sets of methods.
6614
6615         This change basically does two things:
6616         1) Fewer array lists allocated due to CopyNewMethods.
6617         2) the explicit cast in MemberList costed ALOT.
6618
6619 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6620
6621         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6622         a hashtable to avoid needless string allocations when an identifier is
6623         used more than once (the common case).
6624
6625 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6626
6627         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6628         is broken, it will not return anything. So, we
6629         have to use the information we have in mcs to
6630         do the task.
6631
6632         * typemanager.cs: Add a cache for GetInterfaces,
6633         since this will now be used more often (due to ^^)
6634
6635         (GetExplicitInterfaces) New method that gets the
6636         declared, not effective, interfaces on a type
6637         builder (eg, if you have interface IFoo, interface
6638         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6639         { IBar }.
6640
6641         This patch makes MCS able to bootstrap itself on
6642         Windows again.
6643
6644 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6645
6646         * expression.cs: Remove the Nop's that Miguel put
6647         in by mistake.
6648
6649 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6650
6651         * report.cs, codegen.cs: Give the real stack trace to
6652         the error when an exception is thrown.
6653
6654 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6655
6656         * decl.cs: only allocate hashtables for ifaces if 
6657         it is an iface!
6658
6659 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6660
6661         * expression.cs: fix the error from cs0121-2.cs
6662         (a parent interface has two child interfaces that
6663         have a function with the same name and 0 params
6664         and the function is called through the parent).
6665
6666 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6667
6668         * class.cs, rootcontext.cs, typmanager.cs: do not
6669         leak pointers.
6670
6671 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6672
6673         * codegen.cs: remove stack for the ec flow branching.
6674         It is already a linked list, so no need.
6675
6676 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6677
6678         * Makefile: Allow custom profiler here.
6679
6680 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6681
6682         * typemanager.cs (LookupType):
6683           - Use a static char [], because split takes
6684             a param array for args, so it was allocating
6685             every time.
6686           - Do not store true in a hashtable, it boxes.
6687
6688 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6689
6690         * flowanalysis.cs: bytify common enums.
6691
6692 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6693
6694         * modifiers.cs: Add a new set of flags for the
6695         flags allowed on explicit interface impls.
6696         * cs-parser.jay: catch the use of modifiers in
6697         interfaces correctly.
6698         * class.cs: catch private void IFoo.Blah ().
6699
6700         All related to bug #50572.
6701
6702 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6703
6704         * decl.cs: Rewrite the consistant accessability checking.
6705         Accessability is not linear, it must be implemented in
6706         a tableish way. Fixes #49704.
6707
6708 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6709
6710         * expression.cs: Handle negation in a checked context.
6711         We must use subtraction from zero. Fixes #38674.
6712
6713 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6714
6715         * class.cs: Ignore static void main in DLLs.
6716         * rootcontext.cs: Handle the target type here,
6717         since we are have to access it from class.cs
6718         * driver.cs: account for the above.
6719
6720 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6721
6722         * report.cs: Give line numbers and files if available.
6723
6724 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6725
6726         * driver.cs: Implement /addmodule.
6727
6728         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6729         ModuleBuilders.
6730
6731 2003-12-20  Martin Baulig  <martin@ximian.com>
6732
6733         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6734         (FieldBase.IsAssigned): Removed this field.
6735         (FieldBase.SetAssigned): New public method.
6736         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6737
6738 2003-12-20  Martin Baulig  <martin@ximian.com>
6739
6740         * expression.cs (LocalVariableReference.DoResolve): Don't set
6741         `vi.Used' if we're called from DoResolveLValue().
6742
6743         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6744         returns the usage vector it just merged into the current one -
6745         pass this one to UsageWarning().
6746         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6747         of the `EmitContext', don't call this recursively on our children.
6748
6749 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6750
6751         * driver.cs: Implement /target:module.
6752
6753 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6754
6755         * support.cs (CharArrayHashtable): New helper class.
6756
6757         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6758         char arrays, not strings, so we can avoid creating a string in
6759         consume_identifier if the identifier is a keyword.
6760
6761 2003-12-16  Martin Baulig  <martin@ximian.com>
6762
6763         * statement.cs (LocalInfo.Assigned): Removed this property.
6764         (LocalInfo.Flags): Removed `Assigned'.
6765         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6766         and uses flow analysis.
6767         (Block.UsageWarning): Made this method private.
6768         (Block.Resolve): Call UsageWarning() if appropriate.
6769
6770         * expression.cs (LocalVariableReference.DoResolve): Always set
6771         LocalInfo.Used here.
6772
6773 2003-12-13  Martin Baulig  <martin@ximian.com>
6774
6775         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6776         any value here; we're now using flow analysis to figure out
6777         whether a statement/block returns a value.
6778
6779 2003-12-13  Martin Baulig  <martin@ximian.com>
6780
6781         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6782         working again.
6783         (FlowBranching.MergeFinally): Don't call
6784         `branching.CheckOutParameters()' here, this is called in
6785         MergeTopBlock().
6786         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6787         when adding the `finally' vector.       
6788
6789 2003-12-13  Martin Baulig  <martin@ximian.com>
6790
6791         * flowanalysis.cs
6792         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6793         actually work and also fix #48962.
6794
6795 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6796
6797         * decl.cs: Do not check System.Object for nested types,
6798         since we know it does not have any. Big bang for buck:
6799
6800         BEFORE:
6801            Run 1:   8.35 seconds
6802            Run 2:   8.32 seconds
6803            corlib:  17.99 seconds
6804         AFTER:
6805            Run 1:   8.17 seconds
6806            Run 2:   8.17 seconds
6807            corlib:  17.39 seconds
6808
6809 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6810
6811         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6812         time we are returning 0 members, so we save alot here.
6813
6814 2003-12-11  Martin Baulig  <martin@ximian.com>
6815
6816         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6817         `MergeChild()', also just take the `FlowBranching' as argument;
6818         call Merge() on it and return the result.
6819         (FlowBranching.Merge): We don't need to do anything if we just
6820         have one sibling.
6821
6822 2003-12-11  Martin Baulig  <martin@ximian.com>
6823
6824         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6825         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6826         Maurer for this idea.
6827
6828 2003-12-11  Martin Baulig  <martin@ximian.com>
6829
6830         * flowanalysis.cs (MergeResult): This class is now gone; we now
6831         use the `UsageVector' for this.  The reason for this is that if a
6832         branching just has one sibling, we don't need to "merge" them at
6833         all - that's the next step to do.
6834         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6835         `MergeResult'.
6836
6837 2003-12-11  Martin Baulig  <martin@ximian.com>
6838
6839         Reworked flow analyis and made it more precise and bug-free.  The
6840         most important change is that we're now using a special `Reachability'
6841         class instead of having "magic" meanings of `FlowReturns'.  I'll
6842         do some more cleanups and optimizations and also add some more
6843         documentation this week.
6844
6845         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6846         largely reworked this class.
6847         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6848         the new `Reachability' class instead of having "magic" values here.
6849         (FlowBranching): We're now using an instance of `Reachability'
6850         instead of having separate `Returns', `Breaks' etc. fields.
6851
6852         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6853         based on flow analysis; ignore the return value of block.Emit ().
6854
6855 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6856
6857         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6858         if they are private.
6859
6860 2003-12-09  Martin Baulig  <martin@ximian.com>
6861
6862         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6863         call them directly on the UsageVector.
6864
6865 2003-12-09  Martin Baulig  <martin@ximian.com>
6866
6867         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6868         Changed return type from `FlowReturns' to `Reachability'.
6869
6870 2003-12-09  Martin Baulig  <martin@ximian.com>
6871
6872         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6873         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6874         `Reachable' fields with a single `Reachability' one.
6875
6876 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6877
6878         * class.cs (FindMembers): Remove foreach's.
6879
6880         Bootstrap times:
6881
6882         BEFORE
6883                 Run 1:   8.74 seconds
6884                 Run 2:   8.71 seconds
6885
6886         AFTER
6887                 Run 1:   8.64 seconds
6888                 Run 2:   8.58 seconds
6889
6890
6891 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6892
6893         * cs-parser.jay:
6894         * gen-treedump.cs:
6895         * statement.cs:
6896         This patch does a few things:
6897                 1. EmptyStatement is now a singleton, so it is never reallocated.
6898                 2. All blah is EmptyStatement constructs have been changed to
6899                    blah == EmptyStatement.Value, which is much faster and valid
6900                    now that EmptyStatement is a singleton.
6901                 3. When resolving a block, rather than allocating a new array for
6902                    the non-empty statements, empty statements are replaced with
6903                    EmptyStatement.Value
6904                 4. Some recursive functions have been made non-recursive.
6905         Mainly the performance impact is from (3), however (1) and (2) are needed for
6906         this to work. (4) does not make a big difference in normal situations, however
6907         it makes the profile look saner.
6908
6909         Bootstrap times:
6910
6911         BEFORE
6912         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6913         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6914         Total memory allocated: 56397 KB
6915
6916         AFTER
6917         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6918         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6919         Total memory allocated: 55666 KB
6920
6921 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6922
6923         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6924         than the hashtable in a hashtable version
6925
6926         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6927         we always end up concating a string. This results in a huge perf
6928         loss, because many strings have to be tracked by the GC. In this
6929         patch, we first use a hashtable that works with two keys, so that
6930         the strings do not need to be concat'ed.
6931
6932         Bootstrap times:
6933         BEFORE
6934                 Run 1:   8.74 seconds
6935                 Run 2:   8.71 seconds
6936
6937         AFTER
6938                 Run 1:   8.65 seconds
6939                 Run 2:   8.56 seconds
6940
6941 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6942
6943         * Makefile: Add a new target `do-time' that does a quick and simple
6944         profile, leaving easy to parse output.
6945
6946 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6947
6948         * codegen.cs (Init): Create the dynamic assembly with 
6949         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6950
6951 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6952
6953         * support.cs: Make the PtrHashtable use only one
6954         instance of its comparer.
6955
6956 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6957
6958         * typemanager.cs: Fix lookup of GetNamespaces.
6959
6960 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6961
6962         * expression.cs: Removed redundant line.
6963
6964         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6965         ArrayLists, use for loops with bounds.  
6966
6967         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6968         arraylist.
6969
6970         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6971         arraylists, use for loop with bounds.
6972
6973         The above three changes give us a 0.071 second performance
6974         improvement out of 3.294 seconds down to 3.223.  On my machine
6975         the above changes reduced the memory usage by 1,387 KB during
6976         compiler bootstrap.
6977
6978         * cs-parser.jay (QualifiedIdentifier): New class used to represent
6979         QualifiedIdentifiers.  Before we created a new string through
6980         concatenation, and mostly later on, the result would be
6981         manipulated by DecomposeQI through string manipulation.
6982
6983         This reduced the compiler memory usage for bootstrapping from
6984         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6985         compile times in 0.05 seconds.
6986
6987 2003-11-28  Dick Porter  <dick@ximian.com>
6988
6989         * support.cs: Do string compares with the Invariant culture.
6990
6991         * rootcontext.cs: 
6992         * gen-treedump.cs: 
6993         * expression.cs: 
6994         * driver.cs: 
6995         * decl.cs: 
6996         * codegen.cs: 
6997         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
6998         the comparison is done with the Invariant culture.
6999
7000 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
7001
7002         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7003         GetEnumerator method.
7004
7005         (ProbeCollectionType): Iterate starting at the most specific type
7006         upwards looking for a GetEnumerator
7007
7008         * expression.cs: Shift count can be up to 31 for int/uint and 63
7009         for long/ulong.
7010
7011 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
7012
7013         * statement.cs (Block.LookupLabel): Also look for the label on the
7014         children blocks.  Use a hash table to keep track of visited
7015         nodes. 
7016
7017         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7018         we actually did transform the other operand, otherwise fall back
7019         to the common codepath that casts to long.
7020
7021         * cs-tokenizer.cs: Use the same code pattern as the int case.
7022         Maybe I should do the parsing myself, and avoid depending on the
7023         Parse routines to get this done.
7024
7025 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
7026
7027         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7028         which fixes bug 51347.  This time test it.
7029
7030         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7031         attributes for example can not tell the difference between these.
7032         The difference was only a syntax feature of the language. 
7033
7034         * attribute.cs: Apply attributes to delegates.
7035
7036         * delegate.cs: Call the apply attributes method.
7037
7038 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
7039
7040         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7041         comparing 0 vs Byte.MinValue, not the value
7042
7043         (ImplicitConversionRequired): When reporting a conversion error,
7044         use error 31 to print out the constant error instead of the
7045         simpler 29.
7046
7047         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7048         which fixes bug 51347.
7049
7050 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
7051
7052         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
7053         which fixes the -warnaserror command line option.
7054
7055 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
7056
7057         * cfold.cs (DoNumericPromotions): During constant folding of
7058         additions on UIntConstant, special case intconstants with
7059         IntConstants like we do on the expression binary operator. 
7060
7061 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
7062
7063         * convert.cs (ImplicitReferenceConversion): We were missing a case
7064         (System.Enum are not value types or class types, so we need to
7065         classify them separatedly).
7066
7067         * driver.cs: We do not support error 2007.
7068
7069 2003-11-12 Jackson Harper <jackson@ximian.com>
7070
7071         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
7072         system directory. Also use the full file name so users can
7073         libraries names mscorlib-o-tron.dll in a non system dir.
7074         
7075 2004-01-04  David Sheldon <dave-mono@earth.li>
7076
7077         * expression.cs: Added matching ")" to error message for CS0077.
7078
7079 2003-12-19  Martin Baulig  <martin@ximian.com>
7080
7081         * typemanager.cs (TypeManager.IsEqualGenericType): New public
7082         static method; see documentation in the method.
7083         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
7084
7085         * convert.cs (Convert.ImplicitReferenceConversion,
7086         Convert.ImplicitReferenceConversionExists): Add support for
7087         generic type declarations; see gen-36.cs.
7088
7089 2003-12-19  Martin Baulig  <martin@ximian.com>
7090
7091         * pending.cs (Pending.InterfaceMethod): Use
7092         `Type.IsAssignableFrom()' instead of `=='.
7093
7094 2003-12-18  Martin Baulig  <martin@ximian.com>
7095
7096         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
7097         byref types first.
7098
7099         * convert.cs (Convert.ImplicitStandardConversionExists): Use
7100         `expr_type.Equals (target_type)' instead of `=='.
7101
7102 2003-12-08  Martin Baulig  <martin@ximian.com>
7103
7104         * generics.cs (Constraints.Types): Removed.
7105         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
7106         to Type's.
7107         (Constraints.ResolveTypes): New public method; resolves the
7108         TypeExpr's to Type's.
7109         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
7110         longer takes the constraints.
7111         (TypeParameter.DefineMethod): Likewise.
7112         (TypeParameter.DefineType): New public method.  Calls
7113         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
7114         the constraints.
7115
7116 2003-12-08  Martin Baulig  <martin@ximian.com>
7117
7118         * convert.cs (Convert.ImplicitConversionStandard): Use
7119         `expr_type.Equals (target_type)' instead of `=='.
7120
7121 2003-12-08  Martin Baulig  <martin@ximian.com>
7122
7123         * typemanager.cs (TypeManager.GetReferenceType): Call
7124         `Type.MakeByRefType ()'.
7125
7126 2003-12-08  Martin Baulig  <martin@ximian.com>
7127
7128         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
7129         just has some special meaning in some situations.  For instance,
7130         it is allowed to use `where' as the name of a variable etc.
7131
7132 2003-12-04  Martin Baulig  <martin@ximian.com>
7133
7134         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7135         `Type.MakeArrayType()' for array types.
7136
7137 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
7138
7139         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
7140         debugging message.
7141
7142         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
7143         corlib to compile.
7144
7145 2003-11-16  Martin Baulig  <martin@ximian.com>
7146
7147         * codegen.cs (EmitContext.IsGeneric): Removed.
7148
7149         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
7150         ResolveGeneric() on the DeclSpace.
7151
7152 2003-11-16  Martin Baulig  <martin@ximian.com>
7153
7154         * generic.cs (TypeArguments.Resolve):
7155         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
7156         `ResolveType()' on it to get the Type.
7157
7158 2003-11-15  Martin Baulig  <martin@ximian.com>
7159
7160         * generic.cs (ConstructedType.GetInterfaces): Override this.
7161
7162 2003-11-14  Martin Baulig  <martin@ximian.com>
7163
7164         * interface.cs (Interface.DefineType): Define all type parameters
7165         before adding the interfaces we inherit.
7166
7167 2003-11-11  Martin Baulig  <martin@ximian.com>
7168
7169         * generic.cs (ConstructedType.ResolveType): Always call
7170         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
7171
7172 2003-11-10  Martin Baulig  <martin@ximian.com>
7173
7174         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7175         (TypeManager.InitCoreTypes): Initialize them here, but instead of
7176         calling `ResolveType()' on them, directly assign their `Type'.
7177
7178 2003-11-08  Martin Baulig  <martin@ximian.com>
7179
7180         * generic.cs (ConstructedType): Override `IsClass' etc.
7181
7182 2003-11-08  Martin Baulig  <martin@ximian.com>
7183
7184         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7185         return value and the `out parent' parameter.
7186         (TypeContainer.DefineType): Moved the CS0644 check into
7187         GetClassBases().  Don't pass the interface types to the
7188         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7189         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7190
7191         * ecore.cs (TypeExpr.IsAttribute): New property.
7192         (TypeExpr.GetInterfaces): New method.
7193
7194         * interface.cs (Interface.GetInterfaceTypeByName): Return a
7195         TypeExpr instead of a Type.
7196         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7197         (Interface.DefineType): Don't pass the interface types to the
7198         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7199         them later and then call `TypeBulider.AddInterfaceImplementation()'.
7200
7201         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7202         instead of a `Type[]'.
7203         (TypeManager.RegisterBuilder): Likewise.
7204         (TypeManager.AddUserInterface): Likewise.
7205         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7206         `Type[]' and also return a `TypeExpr[]'.
7207         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7208
7209 2003-11-08  Martin Baulig  <martin@ximian.com>
7210
7211         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7212         Expression.     
7213
7214 2003-11-08  Martin Baulig  <martin@ximian.com>
7215
7216         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7217         TypeManager.ResolveExpressionTypes().
7218
7219         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7220         instead of an Expression.
7221         (TypeExpr): This is now an abstract base class for `TypeExpression'.
7222         (TypeExpression): New public class; formerly known as `TypeExpr'.
7223
7224         * expression.cs (ComposedCast): Derive from TypeExpr.
7225
7226         * typemanager.cs (TypeManager.system_*_expr): These are now
7227         TypExpr's instead of Expression's.
7228         (TypeManager.ResolveExpressionTypes): New public static function;
7229         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7230         of them.        
7231
7232 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
7233
7234         * expression.cs (New.DoResolve): Do not dereference value that
7235         might be a null return.
7236
7237         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7238         sure that the constant value has the right type.  Fixes an
7239         unreported bug, similar to 50425.
7240
7241         * const.cs (Const.LookupConstantValue): Call
7242         ImplicitStandardConversionExists before doing a conversion to
7243         avoid havng the TypeManager.ChangeType do conversions.
7244
7245         Reduced the number of casts used
7246
7247         (Const.ChangeType): New routine to enable reuse of the constant
7248         type changing code from statement.
7249
7250         * typemanager.cs (ChangeType): Move common initialization to
7251         static global variables.
7252
7253         Fixes #50425.
7254
7255         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7256         every value type to go through, even if it was void.  Fix that. 
7257
7258         * cs-tokenizer.cs: Use is_identifier_start_character on the start
7259         character of the define, and the is_identifier_part_character for
7260         the rest of the string.
7261
7262 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
7263
7264         * expression.cs (UnaryMutator.EmitCode): When I updated
7265         LocalVariableReference.DoResolve, I overdid it, and dropped an
7266         optimization done on local variable references.
7267
7268 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
7269
7270         * ecore.cs: Convert the return from Ldlen into an int.
7271
7272 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
7273
7274         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7275         the accessibility, this is a special case for toplevel non-public
7276         classes (internal for instance).
7277
7278 2003-10-20  Nick Drochak <ndrochak@gol.com>
7279
7280         * ecore.cs: Fix typo and build.  Needed another right paren.
7281
7282 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
7283
7284         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
7285         `internal' case regular and protected, but not allowing protected
7286         to be evaluated later.  Bug 49840
7287
7288 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
7289
7290         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7291         to kb.Nlast, and not the kb.nFirst to isolate the switch
7292         statement.
7293
7294         Extract the underlying type, so enumerations of long/ulong are
7295         treated like long/ulong.
7296
7297 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
7298
7299         * expression.cs (New): Overload the meaning of RequestedType to
7300         track the possible creation of the NewDelegate type, since
7301         DoResolve is invoked more than once for new constructors on field
7302         initialization.
7303
7304         See bugs: #48800 and #37014
7305
7306         * cs-parser.jay (declare_local_constants): Take an arraylist
7307         instead of a single constant.
7308
7309         (local_constant_declaration): It should take a
7310         constant_declarators, not a constant_declarator.  Fixes 49487
7311
7312         * convert.cs: Fix error report.
7313
7314 2003-10-13 Jackson Harper <jackson@ximian.com>
7315
7316         * typemanager.cs (TypeToCoreType): Add float and double this fixes
7317         bug #49611
7318         
7319 2003-11-03  Martin Baulig  <martin@ximian.com>
7320
7321         * expression.cs (ArrayAccess.GetStoreOpcode): Added
7322         `out bool has_type_arg'; if set, we need to pass the type to
7323         ig.Emit().
7324         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
7325         Stelem_Any/Ldelem_Any for generic parameters.   
7326
7327 2003-11-02  Martin Baulig  <martin@ximian.com>
7328
7329         * expression.cs (Invocation.EmitCall): Use
7330         `TypeManager.IsValueType()' to check whether it's a value type.
7331         Don't set `struct_call' when calling a method on a type parameter.
7332
7333 2003-11-02  Martin Baulig  <martin@ximian.com>
7334
7335         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
7336         and removed the TypeBuilder argument.
7337
7338         * typemanager.cs (TypeManager.IsValueType): Return
7339         `t.IsGenericParameter || t.IsValueType'.
7340
7341 2003-10-25  Martin Baulig  <martin@ximian.com>
7342
7343         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
7344         call ConstructedType.Resolve() on it.
7345
7346         * generic.cs (ConstructedType.Resolve): Set `type' on success.
7347
7348 2003-10-25  Martin Baulig  <martin@ximian.com>
7349
7350         * class.cs (TypeContainer.GetClassBases): Changed
7351         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
7352         CS8214 reporting here.
7353         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
7354         instead of a `Type' for our parent.  In case of a recursive
7355         declaration (see tests/gen-23.cs for an example), our parent is a
7356         ConstructedType and it doesn't have its type set.  So, first
7357         create our own TypeBuilder, then call constructed.Resolve() to get
7358         the parent's type and finally TypeBuilder.SetParent() it.
7359
7360         * ecore.cs (TypeExpr.Name): New public virtual property.
7361
7362         * generic.cs
7363         (ConstructedType): We're now a TypeExpr and not just an Expression.
7364         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
7365         arguments here; this is done later.
7366         (ConstructedType.Resolve): New public method to resolve the type
7367         arguments and bind them.
7368
7369 2003-10-21  Martin Baulig  <martin@ximian.com>
7370
7371         * convert.cs: Use `TypeManager.IsValueType' instead of
7372         'type.IsValueType' everywhere.
7373
7374         * typemanager.cs (TypeManager.IsValueType): Return true for type
7375         parameters.  The reason for this is that we need to box a type
7376         parameter when converting it to a reference type.
7377
7378         * cs-parser.jay: Added support for default value expressions.
7379
7380         * generics.cs (DefaultValueExpression): New public class.       
7381
7382 2003-10-17  Martin Baulig  <martin@ximian.com>
7383
7384         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
7385         TypeContainer so we can also use this for Interfaces.
7386         (TypeParameter.Resolve): Likewise.
7387
7388         * interface.cs (Interface.DefineType): Added support for generic
7389         interfaces.
7390
7391         * cs-parser.jay: Added support for generic structs and interfaces.
7392
7393 2003-10-17  Martin Baulig  <martin@ximian.com>
7394
7395         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
7396         call generic methods :-)
7397
7398 2003-10-16  Martin Baulig  <martin@ximian.com>
7399
7400         * cs-parser.jay (namespace_or_type_name): Only create a
7401         GenericMemberAccess if we actually have type arguments.
7402
7403 2003-10-13  Martin Baulig  <martin@ximian.com>
7404
7405         * class.cs (Method.Define): If we're a generic method, call
7406         TypeBuilder.DefineGenericMethod () before resolving
7407         the parameters.
7408         (MethodData): Added .ctor which takes an additional MethodBuilder
7409         argument; this is used for generic methods.
7410         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
7411         we already have a MethodBuilder.
7412
7413 2003-10-10  Martin Baulig  <martin@ximian.com>
7414
7415         * class.cs (Method): Added .ctor which takes a `GenericMethod'
7416         instead of a `DeclSpace'.  This is used for generic methods.
7417
7418         * cs-parser.jay (method_header): Added support for generic
7419         methods; create a `GenericMethod' instance and pass it to the
7420         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
7421         parameters and locals.
7422
7423         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
7424         since we already have the location.  Check whether we're a generic
7425         type declaration or a generic method and create the correct type
7426         parameter.
7427
7428         * generic.cs (TypeParameter.DefineMethod): New public method.
7429         (GenericMethod): New public class; derives from DeclSpace and is
7430         used for generic methods.       
7431
7432 2003-10-09  Martin Baulig  <martin@ximian.com>
7433
7434         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7435         to the .ctor.
7436         (MethodCore.DoDefineParameters): Removed the TypeContainer
7437         argument; use the DeclSpace which was passed to the .ctor instead.
7438         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7439         TypeContainer; we only need a DeclSpace here.
7440
7441 2003-10-09  Martin Baulig  <martin@ximian.com>
7442
7443         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7444         to the .ctor.
7445         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7446         EmitContext's .ctor.    
7447
7448 2003-10-09  Martin Baulig  <martin@ximian.com>
7449
7450         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7451         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7452         AsAccessible(), moved them as well.
7453
7454         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7455
7456 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7457
7458         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7459         generation for >=, as spotted by Paolo, bug 48679.  
7460         Patch from David Waite.
7461
7462         * cs-tokenizer.cs: Add handling for #pragma.
7463
7464         * cs-parser.jay: Allow for both yield and yield return in the
7465         syntax.  The anti-cobolization of C# fight will go on!
7466
7467         * class.cs (TypeBuilder.DefineType): Catch error condition here
7468         (Parent.DefineType erroring out and returning null).
7469
7470         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7471         coping with enumerations variables, we were mistakenly processing
7472         them as a regular value type instead of built-in types.  Fixes the
7473         bug #48063
7474
7475         * typemanager.cs (IsBuiltinOrEnum): New method.
7476
7477 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7478
7479         * cs-parser.jay: Upgrade: yield now needs the return clause.
7480
7481 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7482
7483         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7484
7485 2003-09-29  Martin Baulig  <martin@ximian.com>
7486
7487         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
7488         inflated generic methods.
7489
7490         * generics.cs (ConstructedType): Distinguish between open and
7491         closed constructed types; correctly resolve the arguments.
7492
7493 2003-09-22  Martin Baulig  <martin@ximian.com>
7494
7495         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
7496         all type arguments meet their constraints.
7497
7498 2003-09-19  Martin Baulig  <martin@ximian.com>
7499
7500         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7501         `MemberCache parent' argument.  Normally, an interface doesn't
7502         have a parent type except System.Object, but we use this in gmcs
7503         for generic type parameters.
7504
7505 2003-09-18  Martin Baulig  <martin@ximian.com>
7506
7507         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7508         on `type.IsInterface'; don't check whether the type has a parent
7509         to determine whether it's an interface.
7510
7511 2003-09-17  Martin Baulig  <martin@ximian.com>
7512
7513         * generic.cs (ConstructedType.ToString): Always use `name' as the
7514         type name.
7515
7516 2003-09-15  Martin Baulig  <martin@ximian.com>
7517
7518         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7519
7520         * generic.cs (Constraints.Resolve): New public method; this is
7521         called to resolve the constraint types and to check whether all
7522         the constraints are correct.
7523         (Constraints.Types): New public property.
7524         (TypeParameter.Resolve): New public method; resolves all the
7525         type's constraints.
7526
7527         * class.cs (TypeContainer.DefineType): Call
7528         TypeParameter.Resolve() before actually defining the type.
7529
7530 2003-09-15  Martin Baulig  <martin@ximian.com>
7531
7532         * class.cs (TypeContainer.DefineType): Added an error flag to
7533         avoid reporting duplicate CS0146's ("class definition is
7534         circular.").
7535
7536         * driver.cs (Driver.MainDriver): Abort if
7537         RootContext.ResolveTree() reported any errors.
7538
7539 2003-09-07  Martin Baulig  <martin@ximian.com>
7540
7541         * report.cs (Error, Warning): Added overloaded versions which take
7542         a `params object[] args' and call String.Format().
7543
7544 2003-09-07  Martin Baulig  <martin@ximian.com>
7545
7546         * decl.cs (DeclSpace..ctor): Don't call
7547         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7548         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7549         (DeclSpace.RecordDecl): New method.
7550
7551         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7552
7553 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7554
7555         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7556         value attributes to be applied to ParameterBuilders.
7557
7558         * class.cs (MethodCore.LabelParameters): Make static and more
7559         generic so that it can be used from other places - like interface
7560         methods, for instance.
7561
7562         * interface.cs (Interface.Emit): Call LabelParameters before
7563         emitting attributes on the InterfaceMethod.
7564
7565 2003-09-07  Martin Baulig  <martin@ximian.com>
7566
7567         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7568         if the number of type parameters doesn't match.
7569
7570 2003-09-04  Martin Baulig  <martin@ximian.com>
7571
7572         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7573         for arrays of generic type params (ie. `!0[]').
7574
7575 2003-09-04  Martin Baulig  <martin@ximian.com>
7576
7577         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7578         for the moment.
7579
7580 2003-09-04  Martin Baulig  <martin@ximian.com>
7581
7582         * decl.cs (DeclSpace.LookupGeneric): New method.
7583         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7584         moment.
7585
7586         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7587         argument, not just a string.
7588         (TypeParameter.Define): New public method; this is called to
7589         actually define the generic parameter; after this, you can use the
7590         new `Type' property to get the type.
7591
7592 2003-09-04  Martin Baulig  <martin@ximian.com>
7593
7594         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7595         is now an ArrayList; initialize the result of the `TypeParameters'
7596         property here.
7597         (DeclSpace.GetGenericData): Removed.
7598         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7599         implement this in a different way.
7600         (DeclSpace.GetTypeParameters): Removed; there's now a
7601         `TypeParameters' property.
7602         (DeclSpace.TypeParameters): New public property.
7603
7604         * generic.cs (Constraints): Make this class public.
7605         (TypeParameter): New public class.
7606
7607 2003-09-04  Martin Baulig  <martin@ximian.com>
7608
7609         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7610         generic parameters.
7611
7612         * class.cs (TypeContainer.DefineType): Call
7613         TypeBuilder.DefineGenericParameter () on all generic parameters if
7614         this is a generic type.
7615
7616 2003-08-28  Martin Baulig  <martin@ximian.com>
7617
7618         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7619         sample-stack.il".
7620
7621         * sample-hello.cs: Compile this with gmcs: "gmcs
7622         /r:sample-stack.dll sample-hello.cs".
7623
7624 2003-08-28  Martin Baulig  <martin@ximian.com>
7625
7626         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7627         the parameters to the generic type.
7628
7629 2003-08-28  Martin Baulig  <martin@ximian.com>
7630
7631         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7632
7633 2003-08-28  Martin Baulig  <martin@ximian.com>
7634
7635         * cs-parser.jay (opt_type_argument_list): Use
7636         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7637         (primary_expression): Replace `qualified_identifier' with `type_name'.
7638         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7639
7640         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7641         parser to check whether it is syntactically a type parameter list;
7642         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7643         this case.
7644
7645 2003-08-26  Martin Baulig  <martin@ximian.com>
7646
7647         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7648         resolving aliases; fixes #47927.
7649
7650 2003-08-26  Martin Baulig  <martin@ximian.com>
7651
7652         * statement.cs (Using.DoResolve): This is internally emitting a
7653         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7654         do not always return.  Fixes #47681.
7655
7656 2003-08-26  Martin Baulig  <martin@ximian.com>
7657
7658         * decl.cs (MemberCore): Moved WarningNotHiding(),
7659         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7660         into MemberBase.
7661         (AdditionResult): Make this nested in DeclSpace.
7662         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7663         argument; call NamespaceEntry.Define() unless we're nested in a
7664         class or struct.
7665
7666         * namespace.cs (Namespace.DefineName): New public function.  This
7667         is called from DeclSpace's .ctor to add 
7668         (Namespace.Lookup): Include DeclSpaces in the lookup.
7669
7670         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7671
7672         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7673
7674 2003-08-25  Martin Baulig  <martin@ximian.com>
7675
7676         * convert.cs (Convert.ExplicitReferenceConversion): When
7677         converting from an interface type to a class, unbox if the target
7678         type is a struct type.  Fixes #47822.
7679
7680 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7681
7682         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7683         #47854.
7684
7685 2003-08-22  Martin Baulig  <martin@ximian.com>
7686
7687         * class.cs (TypeManager.DefineType): When defining a nested type,
7688         call DefineType() on our parent; fixes #47801.
7689
7690 2003-08-22  Martin Baulig  <martin@ximian.com>
7691
7692         * class.cs (MethodData.Define): While checking if a method is an
7693         interface implementation, improve the test a bit more to fix #47654.
7694
7695 2003-08-22  Martin Baulig  <martin@ximian.com>
7696
7697         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7698         correctly; fixes #47722.
7699
7700 2003-08-22  Martin Baulig  <martin@ximian.com>
7701
7702         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7703         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7704
7705         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7706
7707 2003-08-22  Martin Baulig  <martin@ximian.com>
7708
7709         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7710         can only be assigned in static constructors.  Fixes #47161.
7711
7712 2003-08-22  Martin Baulig  <martin@ximian.com>
7713
7714         Rewrote and improved the flow analysis code.
7715
7716         * flowbranching.cs (FlowBranching): Make this class abstract.
7717         (FlowBranching.CreateBranching): New static function to create a
7718         new flow branching.
7719         (FlowBranchingBlock, FlowBranchingException): New classes.
7720         (FlowBranching.UsageVector.Type): New public readonly field.
7721         (FlowBranching.UsageVector.Breaks): Removed the setter.
7722         (FlowBranching.UsageVector.Returns): Removed the setter.
7723         (FlowBranching.UsageVector): Added Break(), Return(),
7724         NeverReachable() and Throw() methods to modify the reachability.
7725         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7726         done by FlowBranching.Merge().
7727         (FlowBranching.UsageVector.MergeChild): New method; merges the
7728         merge result into the current vector.
7729         (FlowBranching.Merge): New abstract method to merge a branching.
7730
7731 2003-08-12  Martin Baulig  <martin@ximian.com>
7732
7733         * expression.cs (Indirection.CacheTemporaries): Create the
7734         LocalTemporary with the pointer type, not its element type.
7735
7736 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7737
7738         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7739         token was a keyword or not.
7740
7741         Add `error' options where an IDENTIFIER was expected;  Provide
7742         CheckToken and CheckIdentifierToken convenience error reporting
7743         functions. 
7744
7745         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7746
7747         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7748         NameSpaceEntry NameSpaceEntry.
7749
7750         (LookupInterfaceOrClass): Avoid creating a full qualified name
7751         from namespace and name: avoid doing lookups when we know the
7752         namespace is non-existant.   Use new Tree.LookupByNamespace which
7753         looks up DeclSpaces based on their namespace, name pair.
7754
7755         * driver.cs: Provide a new `parser verbose' to display the
7756         exception thrown during parsing.  This is turned off by default
7757         now, so the output of a failure from mcs is more graceful.
7758
7759         * namespace.cs: Track all the namespaces defined in a hashtable
7760         for quick lookup.
7761
7762         (IsNamespace): New method
7763
7764 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7765
7766         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7767         we know that we need to concatenate (full typename can never be
7768         null). 
7769
7770         * class.cs: ditto.
7771
7772         * statement.cs: Use a bitfield;  Do not initialize to null things
7773         which are done by the constructor by default.
7774
7775         * cs-parser.jay: bug fix, parameter was 4, not 3.
7776
7777         * expression.cs: Just use the property;
7778
7779         * statement.cs: No need for GetVariableInfo method.
7780
7781 2003-08-08  Martin Baulig  <martin@ximian.com>
7782
7783         * flowanalysis.cs (FlowReturns): This is now nested in the
7784         `FlowBranching' class.
7785         (MyBitVector): Moved this here from statement.cs.
7786         (FlowBranching.SiblingType): New enum type.
7787         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7788
7789 2003-08-07  Martin Baulig  <martin@ximian.com>
7790
7791         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7792         `FlowBranching' class and called `BranchingType'.
7793
7794 2003-08-07  Martin Baulig  <martin@ximian.com>
7795
7796         * flowanalysis.cs: Moved all the control flow analysis code into
7797         its own file.
7798
7799 2003-08-07  Martin Baulig  <martin@ximian.com>
7800
7801         * assign.cs (Assign.DoResolve): `target' must either be an
7802         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7803         #37319.
7804
7805 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7806
7807         * expression.cs (BinaryMethod): This kind of expression is created by the
7808         Binary class if it determines that the operator has to be handled
7809         by a method.
7810
7811         (BinaryDelegate): This kind of expression is created if we are
7812         dealing with a + or - operator on delegates.
7813
7814         (Binary): remove method, argumetns, and DelegateOperator: when
7815         dealing with methods, 
7816
7817         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7818
7819         * statement.cs (Block): use bitfields for the three extra booleans
7820         we had in use.   Remove unused topblock parameter.
7821
7822         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7823
7824         * assign.cs: Drop extra unneeded tests.
7825
7826 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7827
7828         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7829
7830         * statement.cs (Foreach): Use VariableStorage instead of
7831         LocalBuilders.   
7832
7833         * codegen.cs (VariableStorage): New class used by clients that
7834         require a variable stored: locals or fields for variables that
7835         need to live across yield.
7836
7837         Maybe provide a convenience api for EmitThis+EmitLoad?
7838
7839         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7840         these bad boys.
7841
7842 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7843
7844         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7845         RemapParameterLValue): New methods that are used to turn a
7846         precomputed FieldInfo into an expression like this:
7847
7848                 instance.FieldInfo
7849
7850         The idea is to use this instead of making LocalVariableReference
7851         have more than one meaning.
7852
7853         * cs-parser.jay: Add error production to BASE.
7854
7855         * ecore.cs: Deal with TypeManager.GetField returning null, which
7856         is now a valid return value.
7857
7858         (FieldExprNoAddress): New expression for Fields whose address can
7859         not be taken.
7860
7861         * expression.cs (LocalVariableReference): During the resolve
7862         phases, create new expressions if we are in a remapping context.
7863         Remove code that dealt with remapping here.
7864
7865         (ParameterReference): same.
7866
7867         (ProxyInstance): New expression, like the `This' expression, but
7868         it is born fully resolved.  We know what we are doing, so remove
7869         the errors that are targeted to user-provided uses of `this'.
7870
7871         * statement.cs (Foreach): our variable is now stored as an
7872         Expression;  During resolution, follow the protocol, dont just
7873         assume it will return this.
7874
7875 2003-08-06  Martin Baulig  <martin@ximian.com>
7876
7877         * support.cs (SeekableStreamReader.cs): New public class.
7878
7879         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7880         SeekableStreamReader instead of the normal StreamReader.
7881
7882 2003-08-04  Martin Baulig  <martin@ximian.com>
7883
7884         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7885         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7886         deambiguate casts and delegate invocations.
7887         (parenthesized_expression): Use the new tokens to ensure this is
7888         not a cast of method invocation.
7889
7890         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7891         when reading a `)' and Deambiguate_CloseParens () was previously
7892         called.
7893
7894         * expression.cs (ParenthesizedExpression): New class.  This is
7895         just used for the CS0075 test.
7896         (Binary.DoResolve): Check for CS0075.   
7897
7898 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7899
7900         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7901         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7902         reference comparison.
7903
7904         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7905         examine the ReturnType for equality - this is necessary in the
7906         cases of implicit and explicit operators whose signature also
7907         includes the return type.
7908
7909 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7910
7911         * namespace.cs: Cache the result of the namespace computation,
7912         instead of computing it every time.
7913
7914 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7915
7916         * decl.cs: Use a global arraylist that we reuse over invocations
7917         to avoid excesive memory consumption.  Reduces memory usage on an
7918         mcs compile by one meg (45 average).
7919
7920         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7921         private, work around that.
7922
7923 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7924
7925         * literal.cs (IntLiteral): Define Zero and One static literals. 
7926
7927         * cs-parser.jay (integer_literal): use static literals to reduce
7928         memory usage for the most used literals (0, 1 and -1).  211kb
7929         reduced in memory usage.
7930
7931         Replace all calls to `new ArrayList' with `new
7932         ArrayList(4)' which is a good average number for most allocations,
7933         and also requires only 16 bytes of memory for its buffer by
7934         default. 
7935
7936         This reduced MCS memory usage in seven megabytes for the RSS after
7937         bootstrapping.
7938
7939 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7940
7941         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7942         handle params methods the correct way by forming only one
7943         applicable set with params and normal methods in them. Earlier we
7944         were looking at params methods only if we found no normal methods
7945         which was not the correct thing to do.
7946
7947         (Invocation.BetterFunction): Take separate arguments indicating
7948         when candidate and the best method are params methods in their
7949         expanded form.
7950
7951         This fixes bugs #43367 and #46199.
7952
7953         * attribute.cs: Documentation updates.
7954
7955         (CheckAttribute): Rename to CheckAttributeTarget.
7956         (GetValidPlaces): Rename to GetValidTargets.
7957
7958         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7959         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7960
7961         Fixes bug #44468.
7962
7963 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
7964
7965         * codegen.cs: Compute IsGeneric correctly.
7966
7967         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
7968         resolution. 
7969
7970         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
7971         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
7972         regressions, and I was chasing more bugs than I required.
7973
7974         * interface.cs: Use expressions for base type names (like classes
7975         and structs have been doing for a while now), and resolve that.
7976         This patch should probably go into head as well.
7977
7978         This makes it one less user of FindType.
7979
7980 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7981
7982         This compiler can not self host currently.  Need to fix that.
7983         
7984         * Makefile: compile to `gmcs.exe'
7985
7986         * driver.cs: Turn on v2 by default on gmcs.
7987
7988         * generic.cs (ConstructedType): Does no longer take a container
7989         type argument;  That will be taken care of later.
7990
7991         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
7992         Use SimpleName to resolve for now, so we can continue the work on
7993         the parser, until we get Type.GetType that understands generics.
7994
7995         (ConstructedType.ToString): Implement
7996
7997         (TypeArguments.Resolve): Resolve the child expressions as types. 
7998         
7999         * cs-parser.jay: Rename interface_constraints to
8000         type_parameter_constraints
8001
8002         (namespace_or_type_name): Only use constructed types for the basic
8003         construction, we will deal with identifier<...> later.
8004
8005         (type/type_name): No longer call DecomposeQI, as
8006         namespace_or_type_name is always decoded now.
8007         
8008 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8009
8010         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8011         closely: we eliminate methods in base types when we have an
8012         applicable method in a top-level type.
8013
8014         Please see section 14.5.5.1 for an exact description of what goes
8015         on. 
8016
8017         This fixes bug #45127 and a host of other related to corlib compilation.
8018
8019         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8020         array is the method corresponding to the top-level type (this is
8021         because of the changes made to icall.c) so we change this
8022         accordingly.
8023
8024         (MethodGroupExpr.Name): This too.
8025
8026         * typemanager.cs (GetElementType): New method which does the right
8027         thing when compiling corlib. 
8028
8029         * everywhere: Make use of the above in the relevant places.
8030
8031 2003-07-22  Martin Baulig  <martin@ximian.com>
8032
8033         * cs-parser.jay (invocation_expression): Moved
8034         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8035         `cast_expression', but create a InvocationOrCast which later
8036         resolves to either an Invocation or a Cast.
8037
8038         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8039         method; call this before EmitStatement() to make sure that this
8040         expression can be used as a statement.
8041
8042         * expression.cs (InvocationOrCast): New class; resolves to either
8043         an Invocation or a Cast.
8044
8045         * statement.cs (StatementExpression): Call ResolveStatement() on
8046         the ExpressionStatement before emitting it.
8047
8048 2003-07-21  Martin Baulig  <martin@ximian.com>
8049
8050         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8051         `ref' and `out' attributes match; fixes #46220.
8052         (MemberAccess.ResolveMemberAccess): You can't reference a type
8053         through an expression; fixes #33180.
8054         (Indexers.GetIndexersForType): Don't return the indexers from
8055         interfaces the class implements; fixes #46502.
8056
8057 2003-07-21  Martin Baulig  <martin@ximian.com>
8058
8059         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8060         CS0661 checks; fixes bug #30442.
8061
8062 2003-07-21  Martin Baulig  <martin@ximian.com>
8063
8064         * decl.cs (AdditionResult): Added `Error'.
8065
8066         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8067
8068         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
8069         cs0031.cs actually work.
8070
8071  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8072  
8073         * cs-parser.jay (namespace_name): do not use
8074         namespace_or_type_name, use qualified_identifier, because
8075         namespace_or_type_name will soon return a composed expression
8076         instead of a string.
8077  
8078         (namespace_or_type_name): Instead of returning a string, now this
8079         production returns an expression.
8080  
8081         * codegen.cs (EmitContext): Setup IsGeneric property based on
8082         whether our DeclSpace is generic, our the method is generic.
8083  
8084         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
8085         the method is generic.
8086  
8087         * cs-parser.jay (type_arguments, opt_type_argument_list,
8088         type_parameters, type_parameter_list, opt_type_parameter_list,
8089         type_parameter,, opt_type_parameter_constraints_clauses,
8090         type_parameter_constraints_clauses,
8091         type_parameter_constraint_clause, type_parameter_constraint,
8092         interface_constraints): Add new production
8093  
8094         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
8095         DeclSpace is generic or not.
8096  
8097         (DeclSpace.SetParameterInfo): New routine, used to set the
8098         parameter info for a type.
8099  
8100         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
8101         returns a GenericTypeExpr
8102  
8103         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
8104         generic, lookup the generic argument.
8105  
8106         * attribute.cs: Do not allow TypeParameterExpressions in
8107         Attributes.
8108  
8109         * class.cs: Do not allow the Main method to be defined in a
8110         Generic container.
8111  
8112         * expression.cs (SizeOf): Do not allow generic types to be used as
8113         arguments to sizeof.
8114  
8115         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
8116         it: whether a type is generic or not.  Only works for types we are
8117         currently building for now.
8118         
8119 2003-07-20  Martin Baulig  <martin@ximian.com>
8120
8121         * namespace.cs: Fixed that bug which caused a crash when compiling
8122         the debugger's GUI.
8123
8124 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8125
8126         * typemanager.cs (LookupTypeReflection): Never expose types which
8127         are NotPublic, NestedPrivate, NestedAssembly, or
8128         NestedFamANDAssem.  We used to return these, and later do a check
8129         that would report a meaningful error, but the problem is that we
8130         would not get the real match, if there was a name override.
8131
8132 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8133
8134         * namespace.cs (Namespace, Name): Do not compute the namespace
8135         name dynamically, compute it in the constructor.  This reduced
8136         memory usage by 1697 KB.
8137
8138         * driver.cs: Use --pause to pause at the end.
8139
8140 2003-07-17  Peter Williams  <peter@newton.cx>
8141
8142         * Makefile: Change the name of the test target so that it doesn't
8143         conflict with the recursive test target.
8144
8145 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8146
8147         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8148         AddressOf): Do not use EmitThis, that was wrong, use the actual
8149         this pointer.
8150
8151 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8152
8153         * class.cs (MethodData.Define): While checking if a method is an
8154         interface implementation, improve the test: If we are not public
8155         (use new test here: use the computed MethodAttributes directly,
8156         instead of the parsed modifier flags) check if the `implementing'
8157         method comes from an interface or not.
8158
8159         * pending.cs (VerifyPendingMethods): Slightly better error
8160         message.
8161
8162         * makefile: add test target that does the mcs bootstrap.
8163
8164 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8165
8166         * interface.cs (Define): Do nothing here since there are no
8167         members to populate etc. Move the attribute emission out of here
8168         since this was just totally the wrong place to put it. Attribute
8169         application happens during the 'Emit' phase, not in the 'Define'
8170         phase.
8171
8172         (Emit): Add this method and move the attribute emission here
8173
8174         * rootcontext.cs (EmitCode): Call the Emit method on interface
8175         types too.
8176
8177 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8178
8179         * expression.cs (OverloadResolve): Report error only if Location
8180         is not 'Null' which means that there was a probe going on.
8181
8182 2003-07-14  Martin Baulig  <martin@ximian.com>
8183
8184         * expression.cs (ConditionalLogicalOperator): New public class to
8185         implement user defined conditional logical operators.
8186         This is section 14.11.2 in the spec and bug #40505.
8187
8188 2003-07-14  Martin Baulig  <martin@ximian.com>
8189
8190         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8191
8192 2003-07-14  Martin Baulig  <martin@ximian.com>
8193
8194         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8195
8196         * ecore.cs (IVariable.VerifyFixed): New interface method.
8197
8198         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8199         operator, check whether the variable is actually fixed.  Fixes bug
8200         #36055.  Set a variable definitely assigned when taking its
8201         address as required by the spec.
8202
8203         * statement.cs (LocalInfo.IsFixed): New field.
8204         (LocalInfo.MakePinned): Set `IsFixed' to true.
8205
8206 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8207
8208         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8209         for .ctors, ensure that we only ask for members declared in the
8210         attribute type (BindingFlags.DeclaredOnly).
8211
8212         Fixes bug #43632.
8213
8214         * expression.cs (Error_WrongNumArguments): Report error 1501
8215         correctly the way CSC does.
8216
8217 2003-07-13  Martin Baulig  <martin@ximian.com>
8218
8219         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8220         lookup on the fully qualified name, to make things like "X.X" work
8221         where "X.X" is a fully qualified type name, but we also have a
8222         namespace "X" in the using list.  Fixes #41975.
8223
8224 2003-07-13  Martin Baulig  <martin@ximian.com>
8225
8226         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8227         function. If we're a CompoundAssign, we need to create an embedded
8228         CompoundAssign, not an embedded Assign.
8229         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8230         Fixes #45854.
8231
8232 2003-07-13  Martin Baulig  <martin@ximian.com>
8233
8234         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8235         work to fix bug #46088.
8236
8237 2003-07-13  Ravi Pratap <ravi@ximian.com>
8238
8239         * class.cs (Operator.Emit): Do not emit attributes here - it is
8240         taken care of by the Method class that we delegate too. This takes
8241         care of bug #45876.
8242
8243 2003-07-10  Martin Baulig  <martin@ximian.com>
8244
8245         * expression.cs (TypeOfVoid): New class.
8246         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8247
8248 2003-07-10  Martin Baulig  <martin@ximian.com>
8249
8250         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8251         bug #35957.
8252
8253 2003-07-10  Martin Baulig  <martin@ximian.com>
8254
8255         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8256         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8257
8258         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8259
8260         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8261
8262 2003-07-10  Martin Baulig  <martin@ximian.com>
8263
8264         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8265         of decimal.  Fixes #42850.
8266
8267         NOTE: I also fixed the created byte blob, but this doesn't work on
8268         the MS runtime and csc never produces any byte blobs for decimal
8269         arrays.
8270
8271 2003-07-10  Martin Baulig  <martin@ximian.com>
8272
8273         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8274         structs; fixes #32068.
8275         (Block.AddChildVariableNames): Fixed #44302.
8276
8277 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8278
8279         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8280
8281 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8282
8283         * attribute.cs: And this test is onger needed.
8284
8285 2003-07-08  Martin Baulig  <martin@ximian.com>
8286
8287         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8288         inaccessible types.  Fixes #36313.
8289
8290         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8291
8292         * namespace.cs (NamespaceEntry): Create implicit entries for all
8293         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8294         implicit entries for N1.N2 and N1.
8295
8296 2003-07-08  Martin Baulig  <martin@ximian.com>
8297
8298         Rewrote the handling of namespaces to fix a lot of the issues
8299         wrt. `using' aliases etc.
8300
8301         * namespace.cs (Namespace): Splitted this class into a
8302         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8303
8304         * typemanager.cs (TypeManager.IsNamespace): Removed.
8305         (TypeManager.ComputeNamespaces): Only compute namespaces from
8306         loaded assemblies here, not the namespaces from the assembly we're
8307         currently compiling.
8308
8309 2003-07-08  Martin Baulig  <martin@ximian.com>
8310
8311         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8312
8313 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8314
8315         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8316         already fixed it.  
8317
8318         I thought about the memory savings here, but LookupTypeReflection
8319         is used under already very constrained scenarios.  Compiling
8320         corlib or mcs only exposes one hit, so it would not really reduce
8321         any memory consumption.
8322
8323 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8324
8325         * typemanager.cs: fixes bug #45889 by only adding public types from
8326         other assemblies to the list of known types.
8327
8328 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8329
8330         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8331         on the type we resolved.
8332
8333 2003-07-05  Martin Baulig  <martin@ximian.com>
8334
8335         * pending.cs (PendingImplementation.ParentImplements): Don't
8336         create the proxy if the parent is abstract.
8337
8338         * class.cs (TypeContainer.DefineIndexers): Process explicit
8339         interface implementations first.  Fixes #37714.
8340
8341 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8342
8343         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8344         defined recursively;  but since we modify the input parameters
8345         (left is set to `this' temporarily), we reset this value if the
8346         left_is_explicit is false, which gives the original semantics to
8347         the code.  
8348
8349         * literal.cs (NullPointer): new class used to represent a null
8350         literal in a pointer context.
8351
8352         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8353         type is a pointer, use a NullPointer object instead of a
8354         NullLiteral.   Closes 43687
8355
8356         (ExplicitConversion): Convert pointer values using
8357         the conv opcode to the proper type.
8358
8359         * ecore.cs (New): change ValueTypeVariable property into a method,
8360         that returns whether the valuetype is suitable for being used.
8361
8362         * expression.cs (Binary.DoNumericPromotions): Only return if we
8363         the int constant was a valid uint, and we can return both left and
8364         right as uints.  If not, we continue processing, to trigger the
8365         type conversion.  This fixes 39018.
8366
8367         * statement.cs (Block.EmitMeta): During constant resolution, set
8368         the CurrentBlock property on the emitcontext, so that we resolve
8369         constants propertly.
8370
8371 2003-07-02  Martin Baulig  <martin@ximian.com>
8372
8373         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8374         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8375
8376         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8377         than emitting it here.
8378
8379         * statement.cs: Fixed some more flow analysis bugs.
8380
8381 2003-07-02  Martin Baulig  <martin@ximian.com>
8382
8383         * class.cs (MethodData.Define): When implementing interface
8384         methods, set Final unless we're Virtual.
8385
8386         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8387         check work for interface methods.
8388
8389 2003-07-01  Martin Baulig  <martin@ximian.com>
8390
8391         * ecore.cs (EmitContext.This): Replaced this property with a
8392         GetThis() method which takes a Location argument.  This ensures
8393         that we get the correct error location for a CS0188.
8394
8395 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8396
8397         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8398         ImplicitStandardConversion.
8399
8400         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8401
8402 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8403
8404         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8405         optimization.
8406
8407 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8408
8409         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8410         constructors.
8411
8412         (MethodData.Define): Turn off initlocals for unsafe methods.
8413
8414 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8415
8416         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8417         complete;  Fixes #37521.
8418
8419         * delegate.cs: Use Modifiers.TypeAttr to compute the
8420         TypeAttributes, instead of rolling our own.  This makes the flags
8421         correct for the delegates.
8422
8423 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8424
8425         * class.cs (Constructor.Define): Set the private flag for static
8426         constructors as well.
8427
8428         * cs-parser.jay (statement_expression): Set the return value to
8429         null, to avoid a crash when we catch an error.
8430
8431 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8432
8433         * cs-parser.jay: Applied patch from Jackson that adds support for
8434         extern and unsafe modifiers to destructor declarations.
8435
8436         * expression.cs: Report error 21 if the user is trying to index a
8437         System.Array.
8438
8439         * driver.cs: Add an error message, suggested by the bug report.
8440
8441         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8442         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8443
8444 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8445
8446         * namespace.cs: Add some information to reduce FAQs.
8447
8448 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8449
8450         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8451         underlying enumeration types.  Fixes #43915.
8452
8453         * expression.cs: Treat ushort/short as legal values to be used in
8454         bitwise operations.
8455
8456 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8457
8458         * delegate.cs: transfer custom attributes for paramenters from
8459         the delegate declaration to Invoke and BeginInvoke.
8460
8461 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8462
8463         * attribute.cs: handle custom marshalers and emit marshal info
8464         for fields, too.
8465
8466 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8467
8468         * makefile.gnu: Added anonymous.cs to the compiler sources.
8469
8470 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8471
8472         * iterators.cs: Change the name of the proxy class to include two
8473         underscores.
8474
8475         * cs-parser.jay: Update grammar to include anonymous methods.
8476
8477         * anonymous.cs: new file.
8478
8479 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8480
8481         * class.cs (Field.Define): Add missing test for pointers and
8482         safety. 
8483
8484 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8485
8486         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8487         we use the stobj opcode.
8488
8489         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8490         since it wasn't the correct fix. 
8491
8492         It still is puzzling that we are required to use stobj for IntPtr
8493         which seems to be a ValueType.
8494
8495 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8496
8497         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8498         during regular simple name resolution.   Now, the trick is that
8499         instead of returning for processing the simplename, we do a
8500         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8501         contextual lookup type).   If a match is found, return that, if
8502         not, return for further composition.
8503
8504         This fixes long-standing 30485.
8505
8506         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8507         using the address to initialize an object, do an Stobj instead of
8508         using the regular Stelem.
8509
8510         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8511         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8512         Because if we are a BaseIndexerAccess that value will be true.
8513         Fixes 43643.
8514
8515         * statement.cs (GotoCase.Resolve): Return after reporting an
8516         error, do not attempt to continue. 
8517
8518         * expression.cs (PointerArithmetic.Emit): If our operand is a
8519         long, convert our constants to match the operand before
8520         multiplying.  Convert to I type before adding.   Fixes 43670.
8521
8522 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8523
8524         * enum.cs (ImplicitConversionExists) : Rename to
8525         ImplicitEnumConversionExists to remove ambiguity. 
8526
8527         * ecore.cs (NullCast): New type of cast expression class which
8528         basically is very similar to EmptyCast with the difference being
8529         it still is a constant since it is used only to cast a null to
8530         something else
8531         (eg. (string) null)
8532
8533         * convert.cs (ImplicitReferenceConversion): When casting a null
8534         literal, we return a NullCast.
8535
8536         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8537         should be around anymore.
8538
8539         The renaming (reported was slightly wrong). Corrections:
8540
8541         ConvertImplicitStandard -> ImplicitConversionStandard
8542         ConvertExplicitStandard -> ExplicitConversionStandard
8543
8544         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8545         before passing them in !
8546
8547         * convert.cs (ImplicitConversionStandard): When comparing for
8548         equal expr and target types, ensure that expr is not a
8549         NullLiteral.
8550
8551         In general, we must not be checking (expr_type ==
8552         target_type) in the top level conversion methods
8553         (ImplicitConversion, ExplicitConversion etc). This checking is
8554         done in the methods that they delegate to.
8555
8556 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8557
8558         * convert.cs: Move Error_CannotConvertType,
8559         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8560         ImplicitNumericConversion, ImplicitConversionExists,
8561         ImplicitUserConversionExists, StandardConversionExists,
8562         FindMostEncompassedType, FindMostSpecificSource,
8563         FindMostSpecificTarget, ImplicitUserConversion,
8564         ExplicitUserConversion, GetConversionOperators,
8565         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8566         TryImplicitIntConversion, Error_CannotConvertImplicit,
8567         ConvertImplicitRequired, ConvertNumericExplicit,
8568         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8569         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8570         its own file.
8571
8572         Perform the following renames:
8573
8574         StandardConversionExists -> ImplicitStandardConversionExists
8575         ConvertImplicit -> ImplicitConversion
8576         ConvertImplicitStandard -> ImplicitStandardConversion
8577         TryImplicitIntConversion -> ImplicitIntConversion
8578         ConvertImplicitRequired -> ImplicitConversionRequired
8579         ConvertNumericExplicit -> ExplicitNumericConversion
8580         ConvertReferenceExplicit -> ExplicitReferenceConversion
8581         ConvertExplicit -> ExplicitConversion
8582         ConvertExplicitStandard -> ExplicitStandardConversion
8583
8584 2003-05-19  Martin Baulig  <martin@ximian.com>
8585
8586         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8587         (TypeInfo): Added support for structs having structs as fields.
8588
8589         * ecore.cs (FieldExpr): Implement IVariable.
8590         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8591         VariableInfo for the field.
8592
8593 2003-05-18  Martin Baulig  <martin@ximian.com>
8594
8595         * expression.cs (This.DoResolve): Report a CS0027 if we're
8596         emitting a field initializer.
8597
8598 2003-05-18  Martin Baulig  <martin@ximian.com>
8599
8600         * expression.cs (This.ResolveBase): New public function.
8601         (This.DoResolve): Check for CS0188.
8602
8603         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8604         This.Resolve().
8605
8606         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8607         `instance_expression' to null if we don't have any non-static
8608         methods.
8609
8610 2003-05-18  Martin Baulig  <martin@ximian.com>
8611
8612         Reworked the way how local variables and parameters are handled by
8613         the flow analysis code.
8614
8615         * statement.cs (TypeInfo, VariableMap): New public classes.
8616         (VariableInfo): New public class.  This is now responsible for
8617         checking whether a variable has been assigned.  It is used for
8618         parameters and local variables.
8619         (Block.EmitMeta): Take the InternalParameters as argument; compute
8620         the layout of the flow vectors here.
8621         (Block.LocalMap, Block.ParameterMap): New public properties.
8622         (FlowBranching): The .ctor doesn't get the InternalParameters
8623         anymore since Block.EmitMeta() now computes the layout of the flow
8624         vector.
8625         (MyStructInfo): This class is now known as `StructInfo' and nested
8626         in `TypeInfo'; we don't access this directly anymore.
8627
8628         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8629         property and removed IsAssigned(), IsFieldAssigned(),
8630         SetAssigned() and SetFieldAssigned(); we now call them on the
8631         VariableInfo so we don't need to duplicate this code everywhere.
8632
8633         * expression.cs (ParameterReference): Added `Block block' argument
8634         to the .ctor.
8635         (LocalVariableReference, ParameterReference, This): The new
8636         VariableInfo class is now responsible for all the definite
8637         assignment stuff.
8638
8639         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8640         IsParameterAssigned, SetParameterAssigned): Removed.
8641
8642 2003-05-18  Martin Baulig  <martin@ximian.com>
8643
8644         * typemanager.cs (InitCoreTypes): Try calling
8645         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8646         the 3-args-version.  Corlib now also needs our `void_type'.
8647         (GetMethod): Added overloaded version which takes an optional
8648         `bool report_errors' to allow lookups of optional methods.
8649
8650 2003-05-12  Martin Baulig  <martin@ximian.com>
8651
8652         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8653         only used for locals and not for parameters.
8654
8655 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8656
8657         * support.cs (InternalParameters.ParameterType): Return the
8658         ExternalType of the parameter.
8659
8660         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8661         they were unused.
8662
8663 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8664
8665         * class.cs (MethodData.Define): Do not set the `newslot' on
8666         interface members, if they are also flagged as "override".
8667
8668         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8669         better code for ++i and i++.  This only works for static fields
8670         and local variables.
8671
8672         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8673         want to pull the DeclSpace out of the builder_to_declspace instead
8674         of the TypeBuilder (like in TypeContainer.FindMembers).
8675
8676         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8677         instead of LookupTypeContainer.  Fixes the crash on .NET for
8678         looking up interface members.
8679
8680         * const.cs: Create our own emit context during the Definition
8681         stage, so that constants are evaluated in the proper context, when
8682         a recursive definition happens.
8683
8684 2003-05-11  Martin Baulig  <martin@ximian.com>
8685
8686         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8687         new block for a switch section.
8688         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8689         the adding/lookup in the switch block.  Fixes #39828.
8690
8691 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8692
8693         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8694         functionality: I needed to convert the data after I had performed
8695         the add/sub operation into the operands type size.
8696
8697         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8698         pass the type for the box operation, otherwise the resulting
8699         object would have been of type object.
8700
8701         (BoxedCast): Add constructor to specify the type to box as.
8702
8703 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8704
8705         * iterators.cs: I was reusing the `count' variable inadvertently,
8706         take steps to not allow this to happen.
8707
8708 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8709
8710         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8711         by creating an array at the point where the params starts and
8712         putting all those arguments there, then adjusting the size of the
8713         array.
8714
8715 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8716
8717         * expression.cs (New.AddressOf): Implement interface
8718         IMemoryLocation.  This is used when the `new' operator is used in
8719         the context of an invocation to a method on a value type.
8720
8721         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8722         example. 
8723
8724         * namespace.cs: Also check the using aliases here.
8725
8726         * driver.cs: Move the test for using validity after the types have
8727         been entered, so we do a single pass that also includes the using
8728         aliases. 
8729
8730         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8731         in the regular case.   CreateSiblingForFinally is doing extra
8732         error checking.
8733
8734         * attribute.cs (GetAttributeArgumentExpression): Store the result
8735         on an out value, and use the return value to indicate failure
8736         instead of using null (which is a valid return for Constant.GetValue).
8737
8738         * statement.cs: Perform the analysis flow for the increment
8739         portion after the statement, because this will be the real flow of
8740         execution.  Fixes #42385
8741
8742         * codegen.cs (EmitContext.EmitArgument,
8743         EmitContext.EmitStoreArgument): New helper functions when the
8744         RemapToProxy flag is set.
8745
8746         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8747         function.
8748
8749         Add support for remapping parameters. 
8750
8751         * iterators.cs: Propagate parameter values;  Store parameter
8752         values in the proxy classes.
8753
8754 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8755
8756         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8757         need a proxy reference;  I do not know what I was thinking
8758
8759         * cs-parser.jay (constructor_initializer): catch another error,
8760         and display nice message.
8761
8762         (field_declaration): catch void field declaration
8763         to flag a better error. 
8764
8765         * class.cs (MemberBase.CheckBase): Report an error instead of a
8766         warning if a new protected member is declared in a struct. 
8767         (Field.Define): catch the error of readonly/volatile.
8768
8769         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8770
8771         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8772         volatile variable is taken
8773
8774 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8775
8776         * statement.cs (Fixed.Resolve): Report an error if we are not in
8777         an unsafe context.
8778
8779 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8780
8781         * typemanager.cs: reuse the code that handles type clashes for
8782         delegates and enumerations.
8783
8784         * class.cs (Report28): Always report.
8785
8786         * expression.cs (EncodeAsAttribute): Allow nulls here.
8787
8788 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8789
8790         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8791         the functionality for testing whether an expression is valid for
8792         an attribute here.  Also handle the case of arrays of elements
8793         being stored. 
8794
8795         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8796         encoding a linear array into an array of objects that are suitable
8797         to be passed to an CustomAttributeBuilder.
8798
8799         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8800
8801         * ecore.cs: (FieldExpr): Handle field remapping here.
8802
8803         * iteratators.cs: Pass the instance variable (if the method is an
8804         instance method) to the constructors, so we can access the field
8805         variables on the class.
8806
8807         TODO: Test this with structs.  I think the THIS variable on
8808         structs might have to be a pointer, and not a refenrece
8809
8810 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8811
8812         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8813         local variables to fields in a proxy class.
8814
8815         * iterators.cs (PopulateProxy): Rename our internal fields to
8816         <XXX>.  
8817         Create a <THIS> field if we are an instance method, so we can
8818         reference our parent container variables.
8819         (MapVariable): Called back from the EmitContext code to enter a
8820         new variable to field mapping into the proxy class (we just create
8821         a FieldBuilder).
8822
8823         * expression.cs
8824         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8825         for using the remapped locals to fields.
8826
8827         I placed the code here, because that gives the same semantics to
8828         local variables, and only changes the Emit code.
8829
8830         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8831         statements inside iterators.
8832         (VariableInfo): Add a FieldBuilder for the cases when we are
8833         remapping local variables to fields in a proxy class
8834
8835         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8836         current_block != null.
8837
8838         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8839         not cope with strings, as it has been moved to the
8840         TableSwitchEmit.  Fixed bug in switch generation.
8841
8842         * expression.cs (New.DoResolve): Provide more context for the user
8843         when reporting an error.
8844
8845         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8846         pointers. 
8847
8848         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8849         check the permissions for it.  Note than in a type-resolution
8850         context the check was already present in DeclSpace.ResolveType,
8851         but was missing from the MemberAccess.
8852
8853         (ArrayCreation.CheckIndices): warn if the user has
8854         more nested levels of expressions, but there are no more
8855         dimensions specified.  Avoids crash on bug 41906.
8856
8857 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8858
8859         * statement.cs (Block): replace Implicit bool, for a generic
8860         flags.   
8861         New flag: `Unchecked'.  This is used during the EmitMeta phase
8862         (which is out-of-line with the regular Resolve/Emit process for a
8863         statement, as this is done ahead of time, but still gets a chance
8864         to call constant resolve).
8865
8866         (Block.Flags): new enum for adding a new flag.
8867
8868         (Block.EmitMeta): track the state of unchecked.
8869
8870         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8871         to enable constant resolution to work there as well.
8872
8873 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8874
8875         * typemanager.cs (ienumerable_type): Also look up
8876         System.Collections.IEnumerable. 
8877
8878 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8879
8880         TODO: Test more than one conditional per method.
8881
8882         * class.cs (Indexer.Define): Report the location where the user is
8883         referencing the unsupported feature.
8884
8885         (MethodData): Overload the use of `conditionals' to
8886         minimize the creation of needless ArrayLists.   This saves roughly
8887         212kb on my machine.
8888
8889         (Method): Implement the new IIteratorContainer interface.
8890         (Method.SetYields): Implement the method by setting the ModFlags
8891         to contain METHOD_YIELDS.
8892
8893         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8894         which just got set to null.
8895
8896         * iterators.cs: New file.
8897
8898         (Yield, YieldBreak): New statements.
8899
8900         * statement.cs (Return.Resolve): Flag an error if we are used in
8901         an iterator method.
8902
8903         * codegen.cs (InIterator): New flag set if the code is being
8904         compiled in an iterator method.
8905
8906         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8907         internal modifier, and we just use it to avoid adding extra
8908         fields, as this is seldom used.  
8909
8910         * cs-parser.jay: Add yield_statement (yield and yield break).
8911
8912         * driver.cs: New flag -v2 to turn on version 2 features. 
8913
8914         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8915         hashtable when v2 is enabled.
8916
8917 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8918
8919         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8920         there is already a namespace defined with this name.
8921
8922         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8923         people upgraded their corlibs.
8924
8925         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8926         always use fully qualified types, no need to use the compiler
8927         front end.
8928
8929         (TypeManager.IsNamespace): Use binarysearch.
8930
8931         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8932         AddDelegate): I did not quite use the new IsValid API properly: I
8933         have to pass the short-name and the fullname.  I was passing only
8934         the basename instead of the fullname sometimes. 
8935
8936         (TypeContainer.DefineType): call NamespaceClash.
8937
8938         * interface.cs (Interface.DefineType): use NamespaceClash before
8939         defining the type.
8940
8941         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8942         defining the type.
8943
8944         * enum.cs: (Enum.DefineType): use NamespaceClash before
8945         defining the type.
8946
8947         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8948         speed increase.  First, use the negative_hits cache when we get a
8949         negative.  Second, add the type with its full original name
8950         instead of the new . and + encoded name (reflection uses + to
8951         separate type from a nested type).  Use LookupTypeReflection
8952         directly which bypasses the type->name hashtable (that we already
8953         know does not contain the type.
8954
8955         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8956         location/container type. 
8957
8958         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8959
8960 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8961
8962         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8963
8964         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8965         method is being referenced in the method group from a static
8966         context, and report error 120 if so.
8967
8968         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8969         Error118. 
8970
8971         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8972         is created, we create the A namespace).
8973
8974         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8975         Fixes #41591
8976
8977 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
8978
8979         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8980         invocation to ModuleBuilder.GetType with the same values will
8981         return a new type instance, so we need to cache its return
8982         values. 
8983
8984         * expression.cs (Binary.ResolveOperator): Only allow the compare
8985         operators on enums if they are of the same type.
8986
8987         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8988         types of ValueType on their own case.  Before we were giving them
8989         the same treatment as objects.
8990
8991         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
8992         fullname.  Short name is used to compare against container name.
8993         Fullname is used to check against defined namespace names.
8994
8995         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
8996         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
8997
8998         (Method.CheckBase): Call parent.
8999         (MemberBase.CheckBase): Check for protected members on sealed
9000         classes.
9001         (PropertyBase.CheckBase): Call parent.
9002         (Field.Define): Call parent.
9003
9004         * report.cs: Negative error codes are now mapped to 8000 - code,
9005         so that the display is render more nicely.
9006
9007         * typemanager.cs: Do not use try/catch, instead report a regular
9008         error. 
9009
9010         (GetPointerType, GetReferenceType): These methods provide
9011         mechanisms to obtain the T* and T& from a T.  We had the code
9012         previously scattered around the code base, and it also used
9013         TypeManager.LookupType that would go through plenty of caches.
9014         This one goes directly to the type source.
9015
9016         In some places we did the Type.GetType followed by
9017         ModuleBuilder.GetType, but not in others, so this unifies the
9018         processing as well.
9019
9020         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9021         statements now that we have namespace information.
9022
9023         * typemanager.cs (IsNamespace): New method, returns whether the
9024         string presented is a namespace or not.
9025
9026         (ComputeNamespaces): New public entry point, computes the list of
9027         available namespaces, using the GetNamespaces API call in Mono, or
9028         the slower version in MS.NET.   
9029
9030         Now before we start the semantic analysis phase, we have a
9031         complete list of namespaces including everything that the user has
9032         provided.
9033
9034         Deleted old code to cache namespaces in .nsc files.
9035
9036 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9037
9038         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9039         class/struct location definition Location for the implicit
9040         constructor location.
9041
9042         (Operator.Define): Use the location of the operator for the
9043         implicit Method definition.
9044
9045         (Constructor.Emit): use the constructor location for the implicit
9046         base initializer constructor.
9047
9048         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9049         and the Expression class now contains two new methods:
9050
9051         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9052         isolate type lookup from the rest of the resolution process.
9053
9054         Since we use Expressions to hold type definitions due to the way
9055         we parse the input we have historically overloaded Resolve to
9056         perform the Type lookups if a special flag is passed.  Now this is
9057         eliminated and two methods take their place. 
9058
9059         The differences in the two methods between xStep and xTerminal is
9060         that xStep is involved in our current lookup system that uses
9061         SimpleNames to compose a name, while xTerminal is used just to
9062         catch the case where the simplename lookup failed.
9063
9064 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9065
9066         * expression.cs (ResolveMemberAccess): Remove redundant code.
9067         TypeExpr expressions are always born fully resolved.
9068
9069         * interface.cs (PopulateMethod): Do not lookup the types twice.
9070         We were doing it once during SemanticAnalysis and once during
9071         PopulateMethod.
9072
9073         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9074         in local variable type definitions, were being returned as a
9075         SimpleName (we decomposed everything into a string), that is
9076         because primary_expression was being used instead of a type in the
9077         grammar (reduce/reduce conflicts).
9078
9079         The part that was wrong is that we converted the expression into a
9080         string (an oversimplification in one hand, compounded with primary
9081         expressions doing string concatenation).
9082
9083         So things like:
9084
9085         A.B.C [] x;
9086
9087         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9088         using clauses from working on this particular context.  And a type
9089         was being matched directly against "A.B.C[]".
9090
9091         We now use the correct approach, and allow for ComposedCast to be
9092         part of the unary expression.  So the "A.B.C []" become a composed
9093         cast of "A.B.C" (as a nested group of MemberAccess with a
9094         SimpleName at the end) plus the rank composition "[]". 
9095
9096         Also fixes 35567
9097
9098 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9099
9100         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9101         for the access level checking.
9102
9103         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9104         `TypeContainer container', because I kept getting confused when I
9105         was debugging this code.
9106
9107         * expression.cs (Indexers): Instead of tracking getters/setters,
9108         we now track them in parallel.  We create one arraylist less, but
9109         most importantly it is possible now for the LValue code to find a
9110         matching get for a set.
9111
9112         (IndexerAccess.DoResolveLValue): Update the code.
9113         GetIndexersForType has been modified already to extract all the
9114         indexers from a type.  The code assumed it did not.
9115
9116         Also make the code set the correct return type for the indexer.
9117         This was fixed a long time ago for properties, but was missing for
9118         indexers.  It used to be void_type.
9119
9120         (Binary.Emit): Test first for doubles instead of
9121         floats, as they are more common.
9122
9123         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9124         when dealing with floats and the <=, >= operators.  This fixes bug
9125         #39314 
9126
9127         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9128         to load the array value by emitting a load on the foreach variable
9129         type.  This was incorrect.  
9130
9131         We now emit the code to load an element using the the array
9132         variable type, and then we emit the conversion operator.
9133
9134         Fixed #40176
9135
9136 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9137
9138         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9139
9140 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9141
9142         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9143         test for protection before we test for signatures. 
9144
9145         (MethodSignature.ToString): implement.
9146
9147         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9148         to the case where we reduced into a LongConstant.
9149
9150         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9151         depend on whether the information is acurrate, because the
9152         Microsoft runtime will always claim that the array type is public,
9153         regardless of the real state.
9154
9155         If the type is a pointer, another problem happens: the type is
9156         reported as non-public in Microsoft.  
9157
9158         In both cases we have to call CheckAccessLevel recursively with
9159         the underlying type as the argument to be tested.
9160
9161 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9162
9163         * assign.cs (Assign.Emit): If we are dealing with a compound
9164         assignment expression, we should use the code path that stores the
9165         intermediate result in a temporary value.  This fixes #40903.
9166
9167         *expression.cs (Indirection.ToString): Provide ToString method for
9168         debugging. 
9169
9170 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9171
9172         * class.cs: Null out fields holding references to Block objects so
9173         they can be garbage collected.
9174
9175         * expression.cs (OverloadResolve): Remove unused local.
9176
9177 2003-04-07  Martin Baulig  <martin@ximian.com>
9178
9179         * codegen.cs (EmitContext.CurrentFile): New public field.
9180         (EmitContext.Mark): Use the CurrentFile to check whether the
9181         location is in the correct file.
9182         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9183
9184 2003-04-07  Martin Baulig  <martin@ximian.com>
9185
9186         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9187
9188         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9189         location.  [FIXME: The location argument which gets passed to this
9190         method is sometimes wrong!]
9191
9192 2003-04-07  Nick Drochak <ndrochak@gol.com>
9193
9194         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9195
9196 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9197
9198         * expression.cs (Indirection.EmitAssign): We were using the
9199         temporary, but returning immediately instead of continuing the
9200         EmitAssing flow.
9201
9202 2003-04-06  Martin Baulig  <martin@ximian.com>
9203
9204         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9205         if it's a nested child, but also deriving from the outer class.
9206         See test 190.cs.
9207
9208         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9209         nested child, but also deriving from the outer class.  See
9210         test-190.cs.
9211         (FilterWithClosure): We may access private members of the outer
9212         class if we're a nested child and deriving from the outer class.
9213         (RealMemberLookup): Only set `closure_private_ok' if the
9214         `original_bf' contained BindingFlags.NonPublic.
9215
9216 2003-04-05  Martin Baulig  <martin@ximian.com>
9217
9218         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
9219         probe if its a type parameter, and if so, flag an error.
9220
9221         * decl.cs: Move here the SetParameterInfo code from class.cs.
9222         Handle IsGeneric here.
9223
9224         Handle a variety of errors in the parameter info definition.
9225
9226         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
9227         type parameters here.
9228
9229         * cs-parser.jay (class_declaration): report errors for parameters
9230         here as well.
9231
9232 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
9233
9234         * generic.cs: New file, contains support code for generics.
9235
9236         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
9237         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
9238
9239         Update parser for the above removals.
9240
9241         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
9242         now taken care of in the parser.
9243
9244 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9245
9246         * class.cs (Event.Define): Do not allow abstract events to have
9247         initializers. 
9248
9249 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9250
9251         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9252         block in event declarations.
9253
9254         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9255         value type, get its address.
9256
9257         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9258         leaving a class on the stack instead of a boolean value (int
9259         0/1).  Change the code so we compare against null, and then the
9260         result against zero.
9261
9262         * class.cs (TypeContainer.GetClassBases): We were checking for the
9263         parent class being sealed too late.
9264
9265         * expression.cs (Binary.Emit): For <= and >= when dealing with
9266         floating point values, use cgt.un and clt.un instead of cgt and
9267         clt alone.
9268
9269 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9270
9271         * statement.cs: Apply the same optimization as MS: skip the 
9272         GetEnumerator returning an IEnumerator, and use the one returning a 
9273         CharEnumerator instead. This allows us to avoid the try-finally block 
9274         and the boxing.
9275
9276 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9277
9278         * cs-parser.jay: Attributes cannot be applied to
9279                          namespaces. Fixes #40473
9280
9281 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9282
9283         * class.cs:
9284         (Add*): check if the name is valid using the full name for constants,
9285         fields, properties and events.
9286
9287 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9288
9289         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9290         char constants to be part of the enumeration.
9291
9292         * expression.cs (Conditional.DoResolve): Add support for operator
9293         true. Implements the missing functionality from 14.12
9294
9295         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9296         operator true/false as required by the spec.
9297
9298         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9299         implicit conversion to boolean.
9300
9301         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9302         also one where the type implements `operator true'. 
9303
9304         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9305         get an expression that will invoke operator true based on an
9306         expression.  
9307
9308         (GetConversionOperators): Removed the hack that called op_True
9309         here.  
9310
9311         (Expression.ResolveBoolean): Move this from Statement.
9312
9313 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9314
9315         * ecore.cs (FieldExpr): do not allow initialization of initonly
9316         fields on derived classes
9317
9318 2003-03-13  Martin Baulig  <martin@ximian.com>
9319
9320         * statement.cs (Block.Emit): Call ig.BeginScope() and
9321         ig.EndScope() when compiling with debugging info; call
9322         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9323
9324 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9325
9326         * expression.cs (Indexers): Do not construct immediately, allow
9327         for new members to be appended as we go.  Fixes 38143
9328
9329 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9330
9331         * expression.cs: save/restore context when resolving an unchecked
9332         expression.
9333
9334 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9335
9336         * cfold.cs: Catch division by zero in modulus operator during
9337         constant folding.
9338
9339 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9340
9341         * interface.cs (Interface.DefineMembers): Avoid defining members
9342         twice. 
9343
9344 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9345
9346         * driver.cs: handle the +/- options for -noconfig
9347
9348         * statement.cs (Unckeched.Resolve): Also track the state of
9349         unchecked in the Resolve phase.
9350
9351 2003-02-27  Martin Baulig  <martin@ximian.com>
9352
9353         * ecore.cs (Expression.MemberLookup): Don't create a
9354         MethodGroupExpr for something which is not a method.  Fixes #38291.
9355
9356 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9357
9358         * class.cs (MemberBase.CheckParameters): Also check that the type
9359         is unmanaged if it is a pointer.
9360
9361         * expression.cs (SizeOf.Resolve): Add location information.
9362
9363         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9364         a managed type is declared.
9365
9366         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9367         parameter modifiers as well.  Fixes bug 38606
9368
9369         * class.cs: Very sad.  Am backing out the speed up changes
9370         introduced by the ArrayList -> Array in the TypeContainer, as they
9371         were not actually that much faster, and introduced a bug (no error
9372         reports on duplicated methods).
9373
9374         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9375         source first, this will guarantee that we have a valid expression
9376         before calling in lower levels functions that will require a
9377         resolved object.  Then use this original_source in the
9378         target.ResolveLValue instead of the original source that was
9379         passed to us.
9380
9381         Another change.  Use target.Resolve instead of LValueResolve.
9382         Although we are resolving for LValues, we will let the Assign code
9383         take care of that (it will be called again from Resolve).  This
9384         basically allows code like this:
9385
9386         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9387         class Y { void A (X x) { x [0] += o; }
9388
9389         The problem was that the indexer was trying to resolve for
9390         set_Item (idx, object o) and never finding one.  The real set_Item
9391         was set_Item (idx, X).  By delaying the process we get the right
9392         semantics. 
9393
9394         Fixes bug 36505
9395
9396 2003-02-23  Martin Baulig  <martin@ximian.com>
9397
9398         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9399         while calling DoEmit ().
9400
9401         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9402         source files; if you use the #line directive inside a method, the
9403         compiler stops emitting line numbers for the debugger until it
9404         reaches the end of the method or another #line directive which
9405         restores the original file.
9406
9407 2003-02-23  Martin Baulig  <martin@ximian.com>
9408
9409         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9410
9411 2003-02-23  Martin Baulig  <martin@ximian.com>
9412
9413         * statement.cs (Block.AddChildVariableNames): We need to call this
9414         recursively, not just for our immediate children.
9415
9416 2003-02-23  Martin Baulig  <martin@ximian.com>
9417
9418         * class.cs (Event.Define): Always make the field private, like csc does.
9419
9420         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9421         actually work, fixes bug #37521.
9422
9423 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9424
9425         * delegate.cs: When creating the various temporary "Parameters"
9426         classes, make sure that we call the ComputeAndDefineParameterTypes
9427         on those new parameters (just like we do with the formal ones), to
9428         allow them to be resolved in the context of the DeclSpace.
9429
9430         This fixes the bug that Dick observed in Bugzilla #38530.
9431
9432 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9433
9434         * expression.cs (ResolveMemberAccess): When resolving a constant,
9435         do not attempt to pull a constant if the value was not able to
9436         generate a valid constant.
9437
9438         * const.cs (LookupConstantValue): Do not report more errors than required.
9439
9440 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9441
9442         * expression.cs: fixes bug #38328.
9443
9444 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9445
9446         * class.cs: Changed all the various members that can be part of a
9447         class from being an ArrayList to be an Array of the right type.
9448         During the DefineType type_list, interface_list, delegate_list and
9449         enum_list are turned into types, interfaces, delegates and enums
9450         arrays.  
9451
9452         And during the member population, indexer_list, event_list,
9453         constant_list, field_list, instance_constructor_list, method_list,
9454         operator_list and property_list are turned into their real arrays.
9455
9456         Although we could probably perform this operation earlier, for
9457         good error reporting we need to keep the lists and remove the
9458         lists for longer than required.
9459
9460         This optimization was triggered by Paolo profiling the compiler
9461         speed on the output of `gen-sample-program.pl' perl script. 
9462
9463         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9464         not crash in methods like MemberLookupFailed that use this field.  
9465
9466         This problem arises when the compiler fails to resolve a type
9467         during interface type definition for example.
9468
9469 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9470
9471         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9472         inherit from System.Object, so we have to stop at null, not only
9473         when reaching System.Object.
9474
9475 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9476
9477         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9478         DeclaredOnly because the parent indexer might have had a different
9479         name, but did not loop until the top of the hierarchy was reached.
9480
9481         The problem this one fixes is 35492: when a class implemented an
9482         indexer from an interface, we were getting the interface method
9483         (which was abstract) and we were flagging an error (can not invoke
9484         abstract method).
9485
9486         This also keeps bug 33089 functioning, and test-148 functioning.
9487
9488         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9489         out if a method is special is to see if it is declared in a
9490         property or event, or whether it is one of the predefined operator
9491         names.   This should fix correctly #36804.
9492
9493 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9494
9495         The goal here is to remove the dependency on EmptyCast.Peel ().
9496         Killing it completely.
9497
9498         The problem is that currently in a number of places where
9499         constants are expected, we have to "probe" for an EmptyCast, and
9500         Peel, which is not the correct thing to do, as this will be
9501         repetitive and will likely lead to errors. 
9502
9503         The idea is to remove any EmptyCasts that are used in casts that
9504         can be reduced to constants, so we only have to cope with
9505         constants. 
9506
9507         This bug hunt was triggered by Bug 37363 and the desire to remove
9508         the duplicate pattern where we were "peeling" emptycasts to check
9509         whether they were constants.  Now constants will always be
9510         constants.
9511
9512         * ecore.cs: Use an enumconstant here instead of wrapping with
9513         EmptyCast.  
9514
9515         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9516         throwing me off.  By handling this we can get rid of a few hacks.
9517
9518         * statement.cs (Switch): Removed Peel() code.
9519
9520 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9521
9522         * class.cs: Location information for error 508
9523
9524         * expression.cs (New.DoResolve): Add a guard against double
9525         resolution of an expression.  
9526
9527         The New DoResolve might be called twice when initializing field
9528         expressions (see EmitFieldInitializers, the call to
9529         GetInitializerExpression will perform a resolve on the expression,
9530         and later the assign will trigger another resolution
9531
9532         This leads to bugs (#37014)
9533
9534         * delegate.cs: The signature for EndInvoke should contain any ref
9535         or out parameters as well.  We were not doing this in the past. 
9536
9537         * class.cs (Field.Define): Do not overwrite the type definition
9538         inside the `volatile' group.  Turns out that volatile enumerations
9539         were changing the type here to perform a validity test, which
9540         broke conversions. 
9541
9542 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9543
9544         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9545         and structs, we do not want to load the instance variable
9546
9547         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9548         enum_type has to be handled like an object reference (implicit
9549         conversions exists from this to object), but the regular IsClass
9550         and IsValueType tests will never return true for this one.
9551
9552         Also we use TypeManager.IsValueType instead of type.IsValueType,
9553         just for consistency with the rest of the code (this is only
9554         needed if we ever use the construct exposed by test-180.cs inside
9555         corlib, which we dont today).
9556
9557 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9558
9559         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9560         just InternalCall.
9561
9562 2003-02-09  Martin Baulig  <martin@ximian.com>
9563
9564         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9565         (Namespace.DefineNamespaces): New static public method; this is
9566         called when we're compiling with debugging to add all namespaces
9567         to the symbol file.
9568
9569         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9570         pass it to the Namespace's .ctor.
9571
9572         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9573         and MethodBase arguments; pass the namespace ID to the symwriter;
9574         pass the MethodBase instead of the token to the symwriter.
9575         (SymbolWriter.DefineNamespace): New method to add a namespace to
9576         the symbol file.
9577
9578 2003-02-09  Martin Baulig  <martin@ximian.com>
9579
9580         * symbolwriter.cs: New file.  This is a wrapper around
9581         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9582         methods here in near future.
9583
9584 2003-02-09  Martin Baulig  <martin@ximian.com>
9585
9586         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9587         ILGenerator.MarkSequencePoint() which are actually used by the
9588         symbol writer.
9589
9590 2003-02-09  Martin Baulig  <martin@ximian.com>
9591
9592         * location.cs (SourceFile): New public sealed class.  This
9593         contains the name and an index which is used in the location's token.
9594         (Location): Reserve an appropriate number of bits in the token for
9595         the source file instead of walking over that list, this gives us a
9596         really huge performance improvement when compiling with debugging.
9597
9598         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9599         `SourceFile' argument instead of a string.
9600         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9601         but don't parse/tokenize here, we need to generate the list of all
9602         source files before we do that.
9603         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9604         the files.
9605
9606         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9607         instead of a string.
9608
9609         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9610         of a string.
9611
9612 2003-02-09  Martin Baulig  <martin@ximian.com>
9613
9614         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9615         filename on `#line default'.
9616
9617 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9618
9619         * statement.cs: don't clear the pinned var when the fixed statement
9620         returns from the method (fixes bug#37752).
9621
9622 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9623
9624         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9625         to IsValueType.
9626
9627 2003-02-07  Martin Baulig  <martin@ximian.com>
9628
9629         * driver.cs: Removed the `--debug-args' command line argument.
9630
9631         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9632         automatically by the AsssemblyBuilder.
9633         (CodeGen.InitializeSymbolWriter): We don't need to call any
9634         initialization function on the symbol writer anymore.  This method
9635         doesn't take any arguments.
9636
9637 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9638
9639         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9640         from referenced assemblies as well.
9641
9642 2003-02-02  Martin Baulig  <martin@ximian.com>
9643
9644         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9645
9646 2003-02-02  Martin Baulig  <martin@ximian.com>
9647
9648         * class.cs (Constructor.Emit): Open the symbol writer before
9649         emitting the constructor initializer.
9650         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9651         single-stepping through constructor initializers.
9652
9653 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9654
9655         * class.cs: Handle error 549: do not allow virtual methods in
9656         sealed classes. 
9657
9658 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9659
9660         * decl.cs: Check access levels when resolving types
9661
9662 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9663
9664         * statement.cs: Add parameters and locals set in catch blocks that might 
9665         return to set vector
9666
9667 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9668
9669         * class.cs (Operator): Set the SpecialName flags for operators.
9670
9671         * expression.cs (Invocation.DoResolve): Only block calls to
9672         accessors and operators on SpecialName methods.
9673
9674         (Cast.TryReduce): Handle conversions from char constants.
9675
9676
9677 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9678
9679         * statement.cs: small memory and time optimization in FlowBranching.
9680
9681 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9682
9683         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9684         problem that the last fix but in the other sid (Set).
9685
9686         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9687         access when there is no indexer in the hierarchy.
9688
9689 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9690
9691         * class.cs: Combine some if statements.
9692
9693 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9694
9695         * driver.cs: fixed bug #37187.
9696
9697 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9698
9699         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9700         any indexer, it's needed to build a list with all the indexers in the
9701         hierarchy (AllGetters), else we have problems. Fixes #35653.
9702
9703 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9704
9705         * class.cs (MethodData.Define): It is wrong for an interface
9706         implementation to be static in both cases: explicit and implicit.
9707         We were only handling this in one case.
9708
9709         Improve the if situation there to not have negations.
9710
9711         * class.cs (Field.Define): Turns out that we do not need to check
9712         the unsafe bit on field definition, only on usage.  Remove the test.
9713
9714 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9715
9716         * driver.cs: use assembly.Location instead of Codebase (the latest
9717         patch made mcs fail when using MS assemblies).
9718
9719 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9720
9721         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9722         get the path to *corlib.dll.
9723
9724 2003-01-21  Nick Drochak <ndrochak@gol.com>
9725
9726         * cs-tokenizer.cs:
9727         * pending.cs:
9728         * typemanager.cs: Remove compiler warnings
9729
9730 2003-01-20  Duncan Mak  <duncan@ximian.com>
9731
9732         * AssemblyInfo.cs: Bump the version number to 0.19.
9733
9734 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9735
9736         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9737
9738 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9739
9740         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9741
9742 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9743
9744         * cs-parser.jay: Small fix: we were not comparing the constructor
9745         name correctly.   Thanks to Zoltan for the initial pointer.
9746
9747 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9748
9749         * cs-tokenizer.cs: Set file name when specified with #line
9750
9751 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9752
9753         * cs-parser.jay: Only perform the constructor checks here if we
9754         are named like the class;  This will help provider a better
9755         error.  The constructor path is taken when a type definition is
9756         not found, but most likely the user forgot to add the type, so
9757         report that rather than the constructor error.
9758
9759 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9760
9761         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9762         allocations.
9763
9764 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9765
9766         * cs-parser.jay: Add cleanup call.
9767
9768 2003-01-13  Duncan Mak  <duncan@ximian.com>
9769
9770         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9771         consistent with other methods.
9772
9773 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9774
9775         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9776
9777 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9778
9779         * attribute.cs: only set GuidAttr to true when we have a
9780         GuidAttribute.
9781
9782 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9783
9784         * ecore.cs:
9785         * expression.cs:
9786         * typemanager.cs: fixes to allow mcs compile corlib with the new
9787         Type.IsSubclassOf fix.
9788
9789 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9790
9791         * expression.cs (LocalVariableReference.DoResolve): Classify a
9792         constant as a value, not as a variable.   Also, set the type for
9793         the variable.
9794
9795         * cs-parser.jay (fixed_statement): take a type instead of a
9796         pointer_type, so we can produce a better error message later.
9797
9798         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9799         as an error.  
9800
9801         (For.DoEmit): Make inifinite loops have a
9802         non-conditional branch back.
9803
9804         (Fixed.DoEmit): First populate the pinned variables, then emit the
9805         statement, then clear the variables.  Before I was emitting the
9806         code once for each fixed piece.
9807
9808
9809 2003-01-08  Martin Baulig  <martin@ximian.com>
9810
9811         * statement.cs (FlowBranching.MergeChild): A break in a
9812         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9813
9814 2003-01-08  Martin Baulig  <martin@ximian.com>
9815
9816         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9817         lives in the same number space than `param_map'.  Fixes #36154.
9818
9819 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9820
9821         * cs-parser.jay (constructor_declaration): Set the
9822         Constructor.ModFlags before probing for it.  This makes the
9823         compiler report 514, 515 and 132 (the code was there, but got
9824         broken). 
9825
9826         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9827         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9828         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9829
9830 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9831
9832         * enum.cs: create the enum static fields using the enum type.
9833
9834 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9835
9836         * class.cs: don't try to create the ParamBuilder for the return
9837         type if it's not needed (and handle it breaking for the ms runtime
9838         anyway).
9839
9840 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9841
9842         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9843
9844 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9845
9846         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9847         the command.   This showed up while compiling the JANET source
9848         code, which used \r as its only newline separator.
9849
9850 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9851
9852         * class.cs (Method.Define): If we are an operator (because it
9853         reuses our code), then set the SpecialName and HideBySig.  #36128
9854
9855 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9856
9857         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9858         exception, report error 120 `object reference required'.
9859
9860         * driver.cs: Add --pause option, used during to measure the size
9861         of the process as it goes with --timestamp.
9862
9863         * expression.cs (Invocation.DoResolve): Do not allow methods with
9864         SpecialName to be invoked.
9865
9866 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9867
9868         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9869         number before adding it.
9870
9871 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9872
9873         * ecore.cs (StandardImplicitConversion): When in an unsafe
9874         context, we allow conversion between void * to any other pointer
9875         type. This fixes bug #35973.
9876
9877 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9878
9879         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9880         is not thrown when extensionless outputs are used 
9881
9882 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9883
9884         * rootcontext.cs: fixed compilation of corlib.
9885
9886 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9887
9888         * attribute.cs (Attributes.Contains): Add new method.
9889
9890         * class.cs (MethodCore.LabelParameters): if the parameter is an
9891         `out' parameter, check that no attribute `[In]' has been passed.
9892
9893         * enum.cs: Handle the `value__' name in an enumeration.
9894
9895 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9896
9897         * decl.cs: Added special case to allow overrides on "protected
9898         internal" methods
9899
9900 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9901
9902         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9903         since it makes much more sense.
9904
9905         (Attributes.ctor): Don't require a Location parameter.
9906
9907         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9908
9909         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9910         since we already have that information per attribute.
9911
9912         * everywhere : make appropriate changes.
9913
9914         * class.cs (LabelParameters): Write the code which actually
9915         applies attributes to the return type. We can't do this on the MS
9916         .NET runtime so we flag a warning in the case an exception is
9917         thrown.
9918
9919 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9920
9921         * const.cs: Handle implicit null conversions here too.
9922
9923 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9924
9925         * class.cs (MethodCore.LabelParameters): Remove the extra
9926         Type [] parameter since it is completely unnecessary. Instead
9927         pass in the method's attributes so that we can extract
9928         the "return" attribute.
9929
9930 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9931
9932         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9933         of ignoring it and letting the compile continue.
9934
9935         * typemanager.cs (ChangeType): use an extra argument to return an
9936         error condition instead of throwing an exception.
9937
9938 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9939
9940         * expression.cs (Unary.TryReduce): mimic the code for the regular
9941         code path.  Perform an implicit cast in the cases where we can
9942         implicitly convert to one of the integral types, and then reduce
9943         based on that constant.   This fixes bug #35483.
9944
9945 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9946
9947         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9948
9949 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9950
9951         * namespace.cs: fixed bug #35489.
9952
9953 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9954
9955         * class.cs: Remove some dead code.
9956
9957         * cs-parser.jay: Estimate the number of methods needed
9958         (RootContext.MethodCount);
9959
9960         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9961         numbers instead of StringBuilders.
9962
9963         * support.cs (PtrHashtable): Add constructor with initial size;
9964         We can now reduce reallocations of the method table.
9965
9966 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9967
9968         * attribute.cs (ApplyAttributes): Keep track of the emitted
9969         attributes on a per-target basis. This fixes bug #35413.
9970
9971 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9972
9973         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9974         default to the Windows 1252 encoding.
9975
9976         (UnixParseOption): Support version, thanks to Alp for the missing
9977         pointer. 
9978
9979         * AssemblyInfo.cs: Add nice assembly information.
9980
9981         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9982         (bug 35169).
9983
9984         * cs-parser.jay: Allow a trailing comma before the close bracked
9985         in the attribute_section production.
9986
9987         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9988         address of the instance was being taken, I will take this out,
9989         because we take the address of the object immediately here.
9990
9991 2002-12-09  Ravi Pratap  <ravi@ximian.com>
9992
9993         * typemanager.cs (AreMultipleAllowed): Take care of the most
9994         obvious case where attribute type is not in the current assembly -
9995         stupid me ;-)
9996
9997 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
9998
9999         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10000         definitions, instead of doing that afterwards.  
10001
10002         Also we use a nice little hack, depending on the constructor, we
10003         know if we are a "composed" name or a simple name.  Hence, we
10004         avoid the IndexOf test, and we avoid 
10005
10006         * codegen.cs: Add code to assist in a bug reporter to track down
10007         the source of a compiler crash. 
10008
10009 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10010
10011         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10012         types have been emitted for a given element and flag an error
10013         if something which does not have AllowMultiple set is used more
10014         than once.
10015
10016         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10017         attribute types and their corresponding AllowMultiple properties
10018
10019         (AreMultipleAllowed): Check the property for a given type.
10020
10021         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10022         property in the case we have a TypeContainer.
10023
10024         (Attributes.AddAttribute): Detect duplicates and just skip on
10025         adding them. This trivial fix catches a pretty gross error in our
10026         attribute emission - global attributes were being emitted twice!
10027
10028         Bugzilla bug #33187 is now fixed.
10029
10030 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10031
10032         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10033         instead of pp_and).
10034
10035         * expression.cs (Binary.ResolveOperator): I can only use the
10036         Concat (string, string, string) and Concat (string, string,
10037         string, string) if the child is actually a concatenation of
10038         strings. 
10039
10040 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10041
10042         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10043         context where we need a 2-character lookahead.
10044
10045         * pending.cs (PendingImplementation): Rework so we can keep track
10046         of interface types all the time, and flag those which were
10047         implemented by parents as optional.
10048
10049 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10050
10051         * expression.cs (Binary.ResolveOperator): Use
10052         String.Concat(string,string,string) or
10053         String.Concat(string,string,string,string) when possible. 
10054
10055         * typemanager: More helper methods.
10056
10057
10058 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10059
10060         * pending.cs: remove the bogus return from GetMissingInterfaces()
10061         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10062
10063 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10064
10065         * namespace.cs: avoid duplicated 'using xxx' being added to
10066         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10067         when we get more than one 'using' statement for the same namespace.
10068         Report a CS0105 warning for it.
10069
10070 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10071
10072         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10073         of calling getChar/putback, uses internal knowledge of it.    
10074
10075         (xtoken): Reorder tokenizer so most common patterns are checked
10076         first.  This reduces the compilation time in another 5% (from 8.11s
10077         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10078
10079         The parsing time is 22% of the compilation in mcs, and from that
10080         64% is spent on the tokenization process.  
10081
10082         I tried using a binary search for keywords, but this is slower
10083         than the hashtable.  Another option would be to do a couple of
10084         things:
10085
10086                 * Not use a StringBuilder, instead use an array of chars,
10087                   with a set value.  Notice that this way we could catch
10088                   the 645 error without having to do it *afterwards*.
10089
10090                 * We could write a hand-parser to avoid the hashtable
10091                   compares altogether.
10092
10093         The identifier consumption process takes 37% of the tokenization
10094         time.  Another 15% is spent on is_number.  56% of the time spent
10095         on is_number is spent on Int64.Parse:
10096
10097                 * We could probably choose based on the string length to
10098                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10099                   computations. 
10100
10101         Another 3% is spend on wrapping `xtoken' in the `token' function.
10102
10103         Handle 0xa0 as whitespace (#34752)
10104
10105 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10106
10107         * typemanager.cs (IsCLRType): New routine to tell whether a type
10108         is one of the builtin types.  
10109
10110         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10111         typecode in more places instead of doing pointer comparissions.
10112         We could leverage some knowledge about the way the typecodes are
10113         laid out.
10114
10115         New code to cache namespaces in assemblies, it is currently not
10116         invoked, to be used soon.
10117
10118         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10119
10120         * expression.cs (Binary.ResolveOperator): specially handle
10121         strings, and do not perform user-defined operator overloading for
10122         built-in types.
10123
10124 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10125
10126         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10127         internalcall as it is a pretty simple operation;  Avoid whenever
10128         possible to call Char.IsLetter.
10129
10130         (consume_identifier): Cut by half the number of
10131         hashtable calls by merging the is_keyword and GetKeyword behavior.
10132
10133         Do not short-circuit, because if we do, we
10134         report errors (ie, #if false && true would produce an invalid
10135         directive error);
10136
10137
10138 2002-11-24  Martin Baulig  <martin@ximian.com>
10139
10140         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10141         check constant ranges and report a CS0221.  Fixes #33186.
10142
10143 2002-11-24  Martin Baulig  <martin@ximian.com>
10144
10145         * cs-parser.jay: Make this work for uninitialized variable
10146         declarations in the `for' initializer.  Fixes #32416.
10147
10148 2002-11-24  Martin Baulig  <martin@ximian.com>
10149
10150         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10151         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10152
10153 2002-11-24  Martin Baulig  <martin@ximian.com>
10154
10155         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10156         argument; if true, we also check for user-defined conversions.
10157         This is only needed if both arguments are of a user-defined type.
10158         Fixes #30443, added test-175.cs.
10159         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10160
10161         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10162
10163 2002-11-24  Martin Baulig  <martin@ximian.com>
10164
10165         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10166         function to get the store opcode.
10167         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10168         only emit the Ldelema if the store opcode is Stobj.  You must run
10169         both test-34 and test-167 to test this.  Fixes #34529.
10170
10171 2002-11-23  Martin Baulig  <martin@ximian.com>
10172
10173         * ecore.cs (Expression.MemberLookup): Added additional
10174         `qualifier_type' argument which is used when we're being called
10175         from MemberAccess.DoResolve() and null if we're called from a
10176         SimpleName lookup.
10177         (Expression.MemberLookupFailed): New method to report errors; this
10178         does the CS1540 check and reports the correct error message.
10179
10180         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10181         argument for the CS1540 check and redone the way how we're dealing
10182         with private members.  See the comment in the source code for details.
10183         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10184         `closure_start_type' to `closure_qualifier_type' and check whether
10185         it's not null.  It was not this filter being broken, it was just
10186         being called with the wrong arguments.
10187
10188         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10189         and pass it the correct `qualifier_type'; this also does the error
10190         handling for us.
10191
10192 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10193
10194         * expression.cs (Invocation.EmitParams): If the we are dealing
10195         with a non-built-in value type, load its address as well.
10196
10197         (ArrayCreation): Use a a pretty constant instead
10198         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10199         static initializers.  
10200
10201         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10202         because they are not really value types, just glorified integers. 
10203
10204         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10205
10206         * ecore.cs: Remove redundant code for enumerations, make them use
10207         the same code path as everything else, fixes the casting issue
10208         with enumerations in Windows.Forms.
10209
10210         * attribute.cs: Do only cast to string if it is a string, the
10211         validation happens later.
10212
10213         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10214         people upgrade their corlibs.
10215
10216         * ecore.cs: Oops, enumerations were not following the entire code path
10217
10218 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10219
10220         * typemanager.cs (FilterWithClosure): Commented out the test for
10221         1540 in typemanager.cs, as it has problems when accessing
10222         protected methods from a parent class (see test-174.cs). 
10223
10224         * attribute.cs (Attribute.ValidateGuid): new method.
10225         (Attribute.Resolve): Use above.
10226
10227 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10228
10229         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10230
10231         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10232         handling for enumerations, as we only needed the TypeContainer
10233         functionality to begin with (this is required for the fix below to
10234         work for enums that reference constants in a container class for
10235         example). 
10236
10237         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10238
10239         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10240         a valid TypeBuilder to perform lookups on.o
10241
10242         * class.cs (InheritableMemberSignatureCompare): Use true in the
10243         call to GetGetMethod and GetSetMethod, because we are comparing
10244         the signature, and we need to get the methods *even* if they are
10245         private. 
10246
10247         (PropertyBase.CheckBase): ditto.
10248
10249         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10250         GotoCase.Resolve): Use Peel on EmpytCasts.
10251
10252         * ecore.cs (EmptyCast): drop child, add Peel method.
10253
10254 2002-11-17  Martin Baulig  <martin@ximian.com>
10255
10256         * ecore.cs (EmptyCast.Child): New public property.
10257
10258         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10259         label resolved to an EmptyCast.  Fixes #34162.
10260         (GotoCase.Resolve): Likewise.
10261         (Block.EmitMeta): Likewise.
10262
10263 2002-11-17  Martin Baulig  <martin@ximian.com>
10264
10265         * expression.cs (Invocation.BetterConversion): Prefer int over
10266         uint; short over ushort; long over ulong for integer literals.
10267         Use ImplicitConversionExists instead of StandardConversionExists
10268         since we also need to check for user-defined implicit conversions.
10269         Fixes #34165.  Added test-173.cs.
10270
10271 2002-11-16  Martin Baulig  <martin@ximian.com>
10272
10273         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10274         with the `true' and `false' literals.  Fixes #33151.
10275
10276 2002-11-16  Martin Baulig  <martin@ximian.com>
10277
10278         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10279         October 22nd; don't do the cs1540 check for static members.
10280
10281         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10282         now using our own filter here and doing the cs1540 check again.
10283
10284 2002-11-16  Martin Baulig  <martin@ximian.com>
10285
10286         * support.cs (InternalParameters): Don't crash if we don't have
10287         any fixed parameters.  Fixes #33532.
10288
10289 2002-11-16  Martin Baulig  <martin@ximian.com>
10290
10291         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10292         when looking up static methods to make this work on Windows.
10293         Fixes #33773.
10294
10295 2002-11-16  Martin Baulig  <martin@ximian.com>
10296
10297         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10298         a setter rather than using PropertyInfo.CanWrite.
10299
10300 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10301
10302         * class.cs: Allow acces to block member by subclasses. Fixes build
10303         breaker.
10304
10305 2002-11-14  Martin Baulig  <martin@ximian.com>
10306
10307         * class.cs (Constructor.Emit): Added the extern/block check.
10308         Fixes bug #33678.
10309
10310 2002-11-14  Martin Baulig  <martin@ximian.com>
10311
10312         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10313         iteration while looking for indexers, this is needed because the
10314         indexer may have a different name in our base classes.  Fixed the
10315         error reporting (no indexers at all, not get accessor, no
10316         overloaded match).  Fixes bug #33089.
10317         (IndexerAccess.DoResolveLValue): Likewise.
10318
10319 2002-11-14  Martin Baulig  <martin@ximian.com>
10320
10321         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10322         indexers.  Fixes the first part of bug #33089.
10323         (MethodSignature.InheritableMemberSignatureCompare): Added support
10324         for properties.
10325
10326 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10327
10328         * attribute.cs (Attribute.Resolve): Catch the
10329         NullReferenceException and report it since it isn't supposed to
10330         happen. 
10331
10332 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10333
10334         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10335         LogicalOr and LogicalAnd that can benefit from recursively
10336         handling EmitBranchable.  The code now should be nice for Paolo.
10337
10338 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10339
10340         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10341         the Type lookups, as we perform quite a number of lookups on
10342         non-Types.  This can be removed once we can deterministically tell
10343         whether we have a type or a namespace in advance.
10344
10345         But this might require special hacks from our corlib.
10346
10347         * TODO: updated.
10348
10349         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10350         and double which avoids a conversion from an integer to a double.
10351
10352         * expression.cs: tiny optimization, avoid calling IsConstant,
10353         because it effectively performs the lookup twice.
10354
10355 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10356
10357         But a bogus return here to keep the semantics of the old code
10358         until the Mono runtime is fixed.
10359
10360         * pending.cs (GetMissingInterfaces): New method used to remove all
10361         the interfaces that are already implemented by our parent
10362         classes from the list of pending methods. 
10363
10364         * interface.cs: Add checks for calls after ResolveTypeExpr.
10365
10366 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10367
10368         * class.cs (Class.Emit): Report warning 67: event not used if the
10369         warning level is beyond 3.
10370
10371         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10372         being a NullLiteral.
10373
10374         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10375         specifiers. 
10376
10377         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10378         path that might fail if a type can not be resolved.
10379
10380         * expression.cs (Binary.Emit): Emit unsigned versions of the
10381         operators. 
10382
10383         * driver.cs: use error 5.
10384
10385 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10386
10387         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10388
10389 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10390
10391         * cs-parser.jay (switch_section): A beautiful patch from Martin
10392         Baulig that fixed 33094.
10393
10394 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10395
10396         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10397         Check whether the base is abstract and report an error if so.
10398
10399         * expression.cs (IndexerAccess.DoResolveLValue,
10400         IndexerAccess.DoResolve): ditto. 
10401
10402         (Invocation.DoResolve): ditto.
10403
10404         (Invocation.FullMethodDesc): Improve the report string.
10405
10406         * statement.cs (Block): Eliminate IsVariableDefined as it is
10407         basically just a wrapper for GetVariableInfo.
10408
10409         * ecore.cs (SimpleName): Use new 
10410
10411         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10412         type, as we return the actual parameter ref/unref state on a
10413         different call.
10414
10415 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10416
10417         * support.cs: Return proper flags REF/OUT fixing the previous
10418         commit.  
10419
10420         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10421         not used to mean `ref' but `ref or out' in ParameterReference
10422
10423         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10424         full type signature instead of calling TypeManger.CSharpName
10425         ourselves. 
10426
10427         * support.cs (InternalParameters.ParameterDesc): Do not compare
10428         directly to the modflags, because REF/OUT will actually be bitsets
10429         if set. 
10430
10431         * delegate.cs (VerifyMethod): Check also the modifiers.
10432
10433         * cs-tokenizer.cs: Fix bug where floating point values with an
10434         exponent where a sign was missing was ignored.
10435
10436         * driver.cs: Allow multiple assemblies to be specified in a single
10437         /r: argument
10438
10439 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10440
10441         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10442         because identifiers after a parenthesis would end up in this kind
10443         of production, and we needed to desamiguate it for having casts
10444         like:
10445
10446                 (UserDefinedType *) xxx
10447
10448 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10449
10450         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10451         we should set on the Bindingflags.NonPublic, but not turn on
10452         private_ok.  private_ok controls whether a Private member is
10453         returned (this is chekced on the filter routine), while the
10454         BindingFlags.NonPublic just controls whether private/protected
10455         will be allowed.   This fixes the problem part of the problem of
10456         private properties being allowed to be used in derived classes.
10457
10458         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10459         so we can call the children DoResolveLValue method (this will
10460         properly signal errors on lvalue assignments to base properties)
10461
10462         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10463         getter are null, and we have a property info, we know that this
10464         happened because the lookup failed, so we report an error 122 for
10465         protection level violation.
10466
10467         We also silently return if setter and getter are null in the
10468         resolve functions, this condition only happens if we have flagged
10469         the error before.  This is the other half of the problem. 
10470
10471         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10472         not have accessibility information, that is why we were returning
10473         true in the filter function in typemanager.cs.
10474
10475         To properly report 122 (property is inaccessible because of its
10476         protection level) correctly, we report this error in ResolveAccess
10477         by failing if both the setter and the getter are lacking (ie, the
10478         lookup failed). 
10479
10480         DoResolve and DoLResolve have been modified to check for both
10481         setter/getter being null and returning silently, the reason being
10482         that I did not want to put the knowledge about this error in upper
10483         layers, like:
10484
10485         int old = Report.Errors;
10486         x = new PropertyExpr (...);
10487         if (old != Report.Errors)
10488                 return null;
10489         else
10490                 return x;
10491
10492         So the property expr is returned, but it is invalid, so the error
10493         will be flagged during the resolve process. 
10494
10495         * class.cs: Remove InheritablePropertySignatureCompare from the
10496         class, as we no longer depend on the property signature to compute
10497         whether it is possible to implement a method or not.
10498
10499         The reason is that calling PropertyInfo.GetGetMethod will return
10500         null (in .NET, in Mono it works, and we should change this), in
10501         cases where the Get Method does not exist in that particular
10502         class.
10503
10504         So this code:
10505
10506         class X { public virtual int A { get { return 1; } } }
10507         class Y : X { }
10508         class Z : Y { public override int A { get { return 2; } } }
10509
10510         Would fail in Z because the parent (Y) would not have the property
10511         defined.  So we avoid this completely now (because the alternative
10512         fix was ugly and slow), and we now depend exclusively on the
10513         method names.
10514
10515         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10516         reference method, instead of using the property.
10517
10518         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10519         routines are gone now.
10520
10521         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10522         names, they were incorrectly named.
10523
10524         * cs-tokenizer.cs: Return are more gentle token on failure. 
10525
10526         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10527         had an out-of-sync index variable, which caused it to remove from
10528         the list of pending methods the wrong method sometimes.
10529
10530 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10531
10532         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10533         CanWrite, because those refer to this particular instance of the
10534         property, and do not take into account the fact that we can
10535         override single members of a property.
10536
10537         Constructor requires an EmitContext.  The resolution process does
10538         not happen here, but we need to compute the accessors before,
10539         because the resolution does not always happen for properties.
10540
10541         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10542         subclass, before we did not update this flag, but we did update
10543         bindingflags. 
10544
10545         (GetAccessors): Drop this routine, as it did not work in the
10546         presence of partially overwritten set/get methods. 
10547
10548         Notice that this broke the cs1540 detection, but that will require
10549         more thinking. 
10550
10551 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10552
10553         * class.cs:
10554         * codegen.cs:
10555         * driver.cs: issue a warning instead of an error if we don't support
10556         debugging for the platform. Also ignore a couple of errors that may
10557         arise when trying to write the symbols. Undo my previous patch.
10558
10559 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10560
10561         * driver.cs: ignore /debug switch except for Unix platforms.
10562
10563 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10564
10565         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10566
10567 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10568
10569         * driver.cs: Do not make mcs-debug conditional, so we do not break
10570         builds that use it.
10571
10572         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10573         review this patch.  But basically after all the children variables
10574         have been merged, the value of "Breaks" was not being set to
10575         new_breaks for Switch blocks.  I think that it should be set after
10576         it has executed.  Currently I set this to the value of new_breaks,
10577         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10578         conservative, but I do not understand this code very well.
10579
10580         I did not break anything in the build, so that is good ;-)
10581
10582         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10583
10584 2002-10-20  Mark Crichton  <crichton@gimp.org>
10585
10586         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10587
10588 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10589
10590         * cfold.cs: Fixed compile blocker.
10591
10592 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10593
10594         * driver.cs: I was chekcing the key, not the file.
10595
10596 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10597
10598         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10599         message that we were generating - we just need to silently return
10600         a null.
10601
10602 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10603
10604         * class.cs (Event.Define): Change my previous commit, as this
10605         breaks the debugger.  This is a temporary hack, as it seems like
10606         the compiler is generating events incorrectly to begin with.
10607
10608         * expression.cs (Binary.ResolveOperator): Added support for 
10609         "U operator - (E x, E y)"
10610
10611         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10612         y)".
10613
10614         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10615         init-only variables, but this path did not take into account that
10616         there might be also instance readonly variables.  Correct this
10617         problem. 
10618
10619         This fixes bug 32253
10620
10621         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10622         delegates as well.
10623
10624         * driver.cs: Change the extension for modules to `netmodule'
10625
10626         * cs-parser.jay: Improved slightly the location tracking for
10627         the debugger symbols.
10628
10629         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10630         modifiers that were specified instead of the hardcoded value
10631         (FamAndAssem).  This was basically ignoring the static modifier,
10632         and others.  Fixes 32429.
10633
10634         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10635         fixed a bug in the process (32476)
10636
10637         * expression.cs (ArrayAccess.EmitAssign): Patch from
10638         hwang_rob@yahoo.ca that fixes bug 31834.3
10639
10640 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10641
10642         * driver.cs: Make the module extension .netmodule.
10643
10644 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10645
10646         * driver.cs: Report an error if the resource file is not found
10647         instead of crashing.
10648
10649         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10650         false, like Emit does.
10651
10652 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10653
10654         * typemanager.cs: Remove unused private member.  Also reported mcs
10655         bug to report this as a warning like csc.
10656
10657 2002-10-15  Martin Baulig  <martin@gnome.org>
10658
10659         * statement.cs (Statement.Emit): Made this a virtual method; emits
10660         the line number info and calls DoEmit().
10661         (Statement.DoEmit): New protected abstract method, formerly knows
10662         as Statement.Emit().
10663
10664         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10665
10666 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10667
10668         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10669         have fixed a remaining problem: not every AddXXXX was adding a
10670         fully qualified name.  
10671
10672         Now everyone registers a fully qualified name in the DeclSpace as
10673         being defined instead of the partial name.  
10674
10675         Downsides: we are slower than we need to be due to the excess
10676         copies and the names being registered this way.  
10677
10678         The reason for this is that we currently depend (on the corlib
10679         bootstrap for instance) that types are fully qualified, because
10680         we dump all the types in the namespace, and we should really have
10681         types inserted into the proper namespace, so we can only store the
10682         basenames in the defined_names array.
10683
10684 2002-10-10  Martin Baulig  <martin@gnome.org>
10685
10686         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10687         from bug #31834, see the bug report for a testcase which is
10688         miscompiled.
10689
10690 2002-10-10  Martin Baulig  <martin@gnome.org>
10691
10692         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10693         flow analysis code for this.
10694
10695         * statement.cs (Do, While, For): Tell the flow analysis code about
10696         infinite loops.
10697         (FlowBranching.UsageVector): Added support for infinite loops.
10698         (Block.Resolve): Moved the dead code elimination here and use flow
10699         analysis to do it.
10700
10701 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10702
10703         * class.cs (Field.Define): Catch cycles on struct type
10704         definitions. 
10705
10706         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10707         fields if the fields are static.  We only need to check instance
10708         fields. 
10709
10710         * expression.cs (As.DoResolve): Test for reference type.
10711
10712         * statement.cs (Using.ResolveExpression): Use
10713         ConvertImplicitRequired, not ConvertImplicit which reports an
10714         error on failture
10715         (Using.ResolveLocalVariableDecls): ditto.
10716
10717         * expression.cs (Binary.ResolveOperator): Report errors in a few
10718         places where we had to.
10719
10720         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10721
10722 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10723
10724         * expression.cs: Use StoreFromPtr instead of extracting the type
10725         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10726
10727         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10728         an enumeration value to a System.Enum, but System.Enum is not a
10729         value type, but an class type, so we need to box.
10730
10731         (Expression.ConvertExplicit): One codepath could return
10732         errors but not flag them.  Fix this.  Fixes #31853
10733
10734         * parameter.cs (Resolve): Do not allow void as a parameter type.
10735
10736 2002-10-06  Martin Baulig  <martin@gnome.org>
10737
10738         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10739         if it's a class type and not a struct.  Fixes #31815.
10740
10741 2002-10-06  Martin Baulig  <martin@gnome.org>
10742
10743         * statement.cs: Reworked the flow analysis code a bit to make it
10744         usable for dead code elimination.
10745
10746 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10747
10748         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10749
10750 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10751
10752         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10753         to fix the test 165, will investigate deeper.
10754
10755 2002-10-04  Martin Baulig  <martin@gnome.org>
10756
10757         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10758         finally blocks actually work.
10759         (Try.Resolve): We don't need to create a sibling for `finally' if
10760         there is no finally block.
10761
10762 2002-10-04  Martin Baulig  <martin@gnome.org>
10763
10764         * class.cs (Constructor.Define): The default accessibility for a
10765         non-default constructor is private, not public.
10766
10767 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10768
10769         * class.cs (Constructor): Make AllowedModifiers public, add
10770         EXTERN.
10771
10772         * cs-parser.jay: Perform the modifiers test here, as the
10773         constructor for the Constructor class usually receives a zero
10774         because of the way we create it (first we create, later we
10775         customize, and we were never checking the modifiers).
10776
10777         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10778         is a version of LookupTypeReflection that includes the type-name
10779         cache.  This can be used as a fast path for functions that know
10780         the fully qualified name and are only calling into *.GetType() to
10781         obtain a composed type.
10782
10783         This is also used by TypeManager.LookupType during its type
10784         composition.
10785
10786         (LookupType): We now also track the real type name, as sometimes
10787         we can get a quey for the real type name from things like
10788         ComposedCast.  This fixes bug 31422.
10789
10790         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10791         complete type fullname, it does not have to go through the type
10792         resolution system to obtain the composed version of the type (for
10793         obtaining arrays or pointers).
10794
10795         (Conditional.Emit): Use the EmitBoolExpression to
10796         generate nicer code, as requested by Paolo.
10797
10798         (ArrayCreation.CheckIndices): Use the patch from
10799         hwang_rob@yahoo.ca to validate the array initializers. 
10800
10801 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10802
10803         * class.cs (ConstructorInitializer.Emit): simplify code by using
10804         Invocation.EmitCall, and at the same time, fix the bugs in calling
10805         parent constructors that took variable arguments. 
10806
10807         * ecore.cs (Expression.ConvertNumericExplicit,
10808         Expression.ImplicitNumericConversion): Remove the code that
10809         manually wrapped decimal (InternalTypeConstructor call is now gone
10810         as well).
10811
10812         * expression.cs (Cast.TryReduce): Also handle decimal types when
10813         trying to perform a constant fold on the type.
10814
10815         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10816
10817         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10818         that only turned off an error report, and did nothing else. 
10819
10820 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10821
10822         * driver.cs: Handle and ignore /fullpaths
10823
10824 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10825
10826         * expression.cs (Binary.ResolveOperator): Catch the case where
10827         DoNumericPromotions returns true, 
10828
10829         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10830
10831 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10832
10833         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10834         report error 70.
10835
10836 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10837
10838         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10839         conversion exists, but it is also required that the conversion be
10840         performed.  This manifested in "(Type64Enum) 2".  
10841
10842         * class.cs (TypeManager.AddMethod): The fix is not to change
10843         AddEnum, because that one was using a fully qualified name (every
10844         DeclSpace derivative does), but to change the AddMethod routine
10845         that was using an un-namespaced name.  This now correctly reports
10846         the duplicated name.
10847
10848         Revert patch until I can properly fix it.  The issue
10849         is that we have a shared Type space across all namespaces
10850         currently, which is wrong.
10851
10852         Options include making the Namespace a DeclSpace, and merge
10853         current_namespace/current_container in the parser.
10854
10855 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10856
10857         * cs-parser.jay: Improve error reporting when we get a different
10858         kind of expression in local_variable_type and
10859         local_variable_pointer_type. 
10860
10861         Propagate this to avoid missleading errors being reported.
10862
10863         * ecore.cs (ImplicitReferenceConversion): treat
10864         TypeManager.value_type as a target just like object_type.   As
10865         code like this:
10866
10867         ValueType v = 1;
10868
10869         Is valid, and needs to result in the int 1 being boxed before it
10870         is assigned to the value type v.
10871
10872         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10873         to validate the enumeration name.
10874
10875         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10876         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10877         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10878
10879         * ecore.cs (TryImplicitIntConversion): When doing an
10880         implicit-enumeration-conversion, check if the type is 64-bits and
10881         perform a conversion before passing to EnumConstant.
10882
10883 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10884
10885         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10886         report ambiguous type references.  Unlike the MS version, we
10887         report what the ambiguity is.   Innovation at work ;-)
10888
10889         (DeclSpace.FindType): Require a location argument to
10890         display when we display an ambiguous error.
10891
10892         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10893
10894         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10895
10896         * expression.cs (EmitDynamicInitializers): Apply patch from
10897         hwang_rob@yahoo.ca that fixes the order in which we emit our
10898         initializers. 
10899
10900 2002-09-21  Martin Baulig  <martin@gnome.org>
10901
10902         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10903         delegate takes no arguments.
10904
10905 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10906
10907         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10908         from integers.
10909
10910         * expression.cs: Extract the underlying type.
10911
10912         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10913
10914         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10915
10916 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10917
10918         * class.cs (TypeContainer.DefineType): We can not use the nice
10919         PackingSize with the size set to 1 DefineType method, because it
10920         will not allow us to define the interfaces that the struct
10921         implements.
10922
10923         This completes the fixing of bug 27287
10924
10925         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10926         means also structs.  This fixes part of the problem. 
10927         (Expresion.ImplicitReferenceConversionExists): ditto.
10928
10929         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10930         error if there were no errors reported during the type lookup
10931         process, to avoid duplicates or redundant errors.  Without this
10932         you would get an ambiguous errors plus a type not found.  We have
10933         beaten the user enough with the first error.  
10934
10935         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10936         reference. 
10937
10938         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10939         during the resolution process, stop the lookup, this avoids
10940         repeated error reports (same error twice).
10941
10942         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10943
10944         * typemanager.cs (LookupType): Redo the type lookup code to match
10945         the needs of System.Reflection.  
10946
10947         The issue is that System.Reflection requires references to nested
10948         types to begin with a "+" sign instead of a dot.  So toplevel
10949         types look like: "NameSpace.TopLevelClass", and nested ones look
10950         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10951         levels. 
10952
10953 2002-09-19  Martin Baulig  <martin@gnome.org>
10954
10955         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10956         says that a method always returns or always throws an exception,
10957         don't report the CS0161.
10958
10959         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10960         set `Returns = new_returns'.
10961
10962 2002-09-19  Martin Baulig  <martin@gnome.org>
10963
10964         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10965         to an enum constant, check for a CS0176.
10966
10967 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10968
10969         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10970         for operators that must be in pairs and report errors.
10971
10972         * ecore.cs (SimpleName.DoResolveType): During the initial type
10973         resolution process, when we define types recursively, we must
10974         check first for types in our current scope before we perform
10975         lookups in the enclosing scopes.
10976
10977         * expression.cs (MakeByteBlob): Handle Decimal blobs.
10978
10979         (Invocation.VerifyArgumentsCompat): Call
10980         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10981         I thought we were supposed to always call this, but there are a
10982         few places in the code where we dont do it.
10983
10984 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
10985
10986         * driver.cs: Add support in -linkres and -resource to specify the
10987         name of the identifier.
10988
10989 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10990
10991         * ecore.cs (StandardConversionExists): Sync with the conversion
10992         code: allow anything-* to void* conversions.
10993
10994         (FindMostSpecificSource): Use an Expression argument
10995         instead of a Type, because we might be handed over a Literal which
10996         gets a few more implicit conversions that plain types do not.  So
10997         this information was being lost.
10998
10999         Also, we drop the temporary type-holder expression when not
11000         required.
11001
11002 2002-09-17  Martin Baulig  <martin@gnome.org>
11003
11004         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11005         this is an explicit interface implementation.
11006
11007 2002-09-17  Martin Baulig  <martin@gnome.org>
11008
11009         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11010         different `IndexerName' attributes.
11011
11012         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11013         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11014         virtual CommonResolve().
11015
11016 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11017
11018         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11019         and convert that to the UnderlyingType.
11020
11021         * statement.cs (Foreach.Resolve): Indexers are just like variables
11022         or PropertyAccesses.
11023
11024         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11025         inside quoted strings, we were not doing this before.
11026
11027 2002-09-16  Martin Baulig  <martin@gnome.org>
11028
11029         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11030         resolve it.  This is needed for the definite assignment check of the
11031         instance expression, fixes bug #29846.
11032         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11033
11034 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11035
11036         * parameter.cs: Fix compile error.  Cannot reference static member
11037         from an instance object.  Is this an mcs bug?
11038
11039 2002-09-14  Martin Baulig  <martin@gnome.org>
11040
11041         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11042         multiple times.  Fixes bug #30295, added test-166.cs.
11043
11044 2002-09-14  Martin Baulig  <martin@gnome.org>
11045
11046         * statement.cs (Block.Emit): Don't emit unreachable code.
11047         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11048         `break' statements.
11049         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11050
11051 2002-09-14  Martin Baulig  <martin@gnome.org>
11052
11053         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11054         is set.
11055
11056 2002-09-14  Martin Baulig  <martin@gnome.org>
11057
11058         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11059         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11060         be false on the ms runtime.
11061
11062 2002-09-13  Martin Baulig  <martin@gnome.org>
11063
11064         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11065         the CS0038 error message.
11066
11067 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11068
11069         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11070         constant inside, return it.
11071
11072 2002-09-12  Martin Baulig  <martin@gnome.org>
11073
11074         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11075         implicit conversion can be done between enum types.
11076
11077         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11078         check whether an implicit conversion to the current enum's UnderlyingType
11079         exists and report an error if not.
11080
11081         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11082         without debugging support.
11083
11084         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11085         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11086
11087 2002-09-12  Martin Baulig  <martin@gnome.org>
11088
11089         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11090
11091         * ecore.cs (IMemberExpr.DeclaringType): New property.
11092         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11093         nonstatic member of an outer type (CS0038).
11094
11095 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11096
11097         * driver.cs: Activate the using-error detector at warning level
11098         4 (at least for MS-compatible APIs).
11099
11100         * namespace.cs (VerifyUsing): Small buglett fix.
11101
11102         * pending.cs (PendingImplementation): pass the container pointer. 
11103
11104         * interface.cs (GetMethods): Allow for recursive definition.  Long
11105         term, I would like to move every type to support recursive
11106         definitions, not the current ordering mechanism that we have right
11107         now.
11108
11109         The situation is this: Attributes are handled before interfaces,
11110         so we can apply attributes to interfaces.  But some attributes
11111         implement interfaces, we will now handle the simple cases
11112         (recursive definitions will just get an error).  
11113
11114         * parameter.cs: Only invalidate types at the end if we fail to
11115         lookup all types.  
11116
11117 2002-09-09  Martin Baulig  <martin@gnome.org>
11118
11119         * ecore.cs (PropertyExpr.Emit): Also check for
11120         TypeManager.system_int_array_get_length so this'll also work when
11121         compiling corlib.  Fixes #30003.
11122
11123 2002-09-09  Martin Baulig  <martin@gnome.org>
11124
11125         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11126         and throw an exception if we can't get the type's size.  Fixed #30040,
11127         added test-165.cs.
11128
11129 2002-09-09  Martin Baulig  <martin@gnome.org>
11130
11131         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11132
11133         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11134         context.  Fixes bug #30027.
11135
11136         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11137         virtual functions.  Fixes bug #30043, added test-164.cs.
11138
11139 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11140
11141         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11142
11143 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11144
11145         * driver.cs: Use an object to get the windows codepage since it's not a
11146         static property.
11147
11148 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11149
11150         * statement.cs (For.Emit): for infinite loops (test == null)
11151         return whether there is a break inside, not always "true".
11152
11153         * namespace.cs (UsingEntry): New struct to hold the name of the
11154         using definition, the location where it is defined, and whether it
11155         has been used in a successful type lookup.
11156
11157         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11158         strings.
11159
11160         * decl.cs: ditto.
11161
11162 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11163
11164         * attribute.cs : Fix incorrect code which relied on catching
11165         a NullReferenceException to detect a null being passed in
11166         where an object was expected.
11167
11168 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11169
11170         * statement.cs (Try): flag the catch variable as assigned
11171
11172         * expression.cs (Cast): Simplified by using ResolveType instead of
11173         manually resolving.
11174
11175         * statement.cs (Catch): Fix bug by using ResolveType.
11176
11177 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11178
11179         * expression.cs (BetterConversion): Special case for when we have
11180         a NullLiteral as the argument and we have to choose between string
11181         and object types - we choose string the way csc does.
11182
11183         * attribute.cs (Attribute.Resolve): Catch the
11184         NullReferenceException and report error #182 since the Mono
11185         runtime no more has the bug and having this exception raised means
11186         we tried to select a constructor which takes an object and is
11187         passed a null.
11188
11189 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11190
11191         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11192         message (1502, 1503) when we can't locate a method after overload
11193         resolution. This is much more informative and closes the bug
11194         Miguel reported.
11195
11196         * interface.cs (PopulateMethod): Return if there are no argument
11197         types. Fixes a NullReferenceException bug.
11198
11199         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11200         expressions too. Previously we were checking only in one place for
11201         positional arguments leaving out named arguments.
11202
11203         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11204         type to the enum type is not allowed. Remove code corresponding to
11205         that.
11206
11207         (ConvertNumericExplicit): Allow explicit conversions from
11208         the underlying type to enum type. This precisely follows the spec
11209         and closes a bug filed by Gonzalo.
11210
11211 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11212
11213         * compiler.csproj:
11214         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11215
11216 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11217
11218         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11219         it was important that we stored the right value after the
11220         reduction in `converted'.
11221
11222 2002-09-04  Martin Baulig  <martin@gnome.org>
11223
11224         * location.cs (Location.SymbolDocument): Use full pathnames for the
11225         source files.
11226
11227 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11228
11229         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11230         of the expression resolve mechanism, because that will catch the
11231         SimpleName error failures.
11232
11233         (Conditional): If we can not resolve the
11234         expression, return, do not crash.
11235
11236 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11237
11238         * cs-tokenizer.cs:
11239         (location): display token name instead of its number.
11240
11241 2002-08-28  Martin Baulig  <martin@gnome.org>
11242
11243         * expression.cs (Binary.ResolveOperator): Don't silently return
11244         but return an error if an operator cannot be applied between two
11245         enum types.
11246
11247 2002-08-28  Martin Baulig  <martin@gnome.org>
11248
11249         * class.cs (Constructor.Define): Set the permission attributes
11250         correctly instead of making all constructors public.
11251
11252 2002-08-28  Martin Baulig  <martin@gnome.org>
11253
11254         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11255         for private members before reporting a CS0103; if we find anything,
11256         it's a CS0122.
11257
11258 2002-08-28  Martin Baulig  <martin@gnome.org>
11259
11260         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11261         to check whether `closure_start_type == closure_invocation_type',
11262         we also need to check whether `m.DeclaringType == closure_invocation_type'
11263         before bypassing the permission checks.  We might be accessing
11264         protected/private members from the base class.
11265         (TypeManager.RealMemberLookup): Only set private_ok if private
11266         members were requested via BindingFlags.NonPublic.
11267
11268         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11269
11270         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11271         MethodGroupExpr.IsExplicitImpl if appropriate.
11272         (Invocation.DoResolve): Don't report the CS0120 for explicit
11273         interface implementations.
11274
11275 2002-08-27  Martin Baulig  <martin@gnome.org>
11276
11277         * expression.cs (Invocation.DoResolve): If this is a static
11278         method and we don't have an InstanceExpression, we must report
11279         a CS0120.
11280
11281 2002-08-25  Martin Baulig  <martin@gnome.org>
11282
11283         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11284         `==' between a valuetype and an object.
11285
11286 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11287
11288         * ecore.cs (TypeExpr): Provide a ToString method.
11289
11290 2002-08-24  Martin Baulig  <martin@gnome.org>
11291
11292         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11293         now called proggie.dbg and it's a binary file.
11294
11295 2002-08-23  Martin Baulig  <martin@gnome.org>
11296
11297         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11298
11299 2002-08-23  Martin Baulig  <martin@gnome.org>
11300
11301         * struct.cs (MyStructInfo.ctor): Make this work with empty
11302         structs; it's not allowed to use foreach() on null.
11303
11304 2002-08-23  Martin Baulig  <martin@gnome.org>
11305
11306         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11307         writer the full pathname of the generated assembly.
11308
11309 2002-08-23  Martin Baulig  <martin@gnome.org>
11310
11311         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11312         A `finally' block never returns or breaks; improved handling of
11313         unreachable code.
11314
11315 2002-08-23  Martin Baulig  <martin@gnome.org>
11316
11317         * statement.cs (Throw.Resolve): Allow `throw null'.
11318
11319 2002-08-23  Martin Baulig  <martin@gnome.org>
11320
11321         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11322         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11323         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11324         MemberLookup would return a wrong event if this is an explicit
11325         interface implementation and the class has an event with the same
11326         name.
11327
11328 2002-08-23  Martin Baulig  <martin@gnome.org>
11329
11330         * statement.cs (Block.AddChildVariableNames): New public method.
11331         (Block.AddChildVariableName): Likewise.
11332         (Block.IsVariableNameUsedInChildBlock): Likewise.
11333         (Block.AddVariable): Check whether a variable name has already
11334         been used in a child block.
11335
11336         * cs-parser.jay (declare_local_variables): Mark all variable names
11337         from the current block as being used in a child block in the
11338         implicit block.
11339
11340 2002-08-23  Martin Baulig  <martin@gnome.org>
11341
11342         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11343         find the symbol writer.
11344
11345         * driver.cs: csc also allows the arguments to /define being
11346         separated by commas, not only by semicolons.
11347
11348 2002-08-23  Martin Baulig  <martin@gnome.org>
11349
11350         * interface.cs (Interface.GetMembers): Added static check for events.
11351
11352 2002-08-15  Martin Baulig  <martin@gnome.org>
11353
11354         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11355         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11356
11357         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11358         why the MethodData.EmitDestructor() change was necessary.
11359
11360 2002-08-20  Martin Baulig  <martin@gnome.org>
11361
11362         * class.cs (TypeContainer.FindMembers): Added static check for events.
11363
11364         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11365
11366         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11367         use Type.GetEvents(), not Type.FindMembers().
11368
11369 2002-08-20  Martin Baulig  <martin@gnome.org>
11370
11371         * decl.cs (MemberCache): Added a special method cache which will
11372         be used for method-only searched.  This ensures that a method
11373         search will return a MethodInfo with the correct ReflectedType for
11374         inherited methods.      
11375
11376 2002-08-20  Martin Baulig  <martin@gnome.org>
11377
11378         * decl.cs (DeclSpace.FindMembers): Made this public.
11379
11380 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11381
11382         * delegate.cs: fixed build on windows.
11383         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11384
11385 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11386
11387         * ecore.cs (StandardConversionExists): Return a false
11388         if we are trying to convert the void type to anything else
11389         since that is not allowed.
11390
11391         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11392         we flag error 70 in the event an event is trying to be accessed
11393         directly from outside the declaring type.
11394
11395 2002-08-20  Martin Baulig  <martin@gnome.org>
11396
11397         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11398         MemberCache from typemanager.cs to decl.cs.
11399
11400 2002-08-19  Martin Baulig  <martin@gnome.org>
11401
11402         * class.cs (TypeContainer): Implement IMemberContainer.
11403         (TypeContainer.DefineMembers): Create the MemberCache.
11404         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11405         return public members if BindingFlags.Public was given, check
11406         whether members are static.
11407
11408 2002-08-16  Martin Baulig  <martin@gnome.org>
11409
11410         * decl.cs (DeclSpace.Define): Splitted this in Define and
11411         DefineMembers.  DefineMembers is called first and initializes the
11412         MemberCache.
11413
11414         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11415         DefineMembers() on all our DeclSpaces.
11416
11417         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11418         but call DefineMembers() on all nested interfaces.  We call their
11419         Define() in our new Define() function.
11420
11421         * interface.cs (Interface): Implement IMemberContainer.
11422         (Interface.Define): Moved all code except the attribute stuf to
11423         DefineMembers().
11424         (Interface.DefineMembers): Initialize the member cache.
11425
11426         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11427         need this anymore since we can use MemberCache.FindMembers directly.
11428
11429 2002-08-19  Martin Baulig  <martin@gnome.org>
11430
11431         * typemanager.cs (MemberCache): When creating the cache for an
11432         interface type, add all inherited members.
11433         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11434         to `out bool used_cache' and documented it.
11435         (TypeManager.MemberLookup): If we already used the cache in the first
11436         iteration, we don't need to do the interfaces check.
11437
11438 2002-08-19  Martin Baulig  <martin@gnome.org>
11439
11440         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11441         here from IMemberFinder and don't implement this interface anymore.
11442         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11443
11444         * typemanager.cs (IMemberFinder): This interface is now only used by
11445         classes which actually support the member cache.
11446         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11447         since we only put DeclSpaces into this Hashtable.
11448         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11449         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11450
11451 2002-08-16  Martin Baulig  <martin@gnome.org>
11452
11453         * typemanager.cs (ICachingMemberFinder): Removed.
11454         (IMemberFinder.MemberCache): New property.
11455         (TypeManager.FindMembers): Merged this with RealFindMembers().
11456         This function will never be called from TypeManager.MemberLookup()
11457         so we can't use the cache here, just the IMemberFinder.
11458         (TypeManager.MemberLookup_FindMembers): Check whether the
11459         IMemberFinder has a MemberCache and call the cache's FindMembers
11460         function.
11461         (MemberCache): Rewrote larger parts of this yet another time and
11462         cleaned it up a bit.
11463
11464 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11465
11466         * driver.cs (LoadArgs): Support quoting.
11467
11468         (Usage): Show the CSC-like command line arguments.
11469
11470         Improved a few error messages.
11471
11472 2002-08-15  Martin Baulig  <martin@gnome.org>
11473
11474         * typemanager.cs (IMemberContainer.Type): New property.
11475         (IMemberContainer.IsInterface): New property.
11476
11477         The following changes are conditional to BROKEN_RUNTIME, which is
11478         defined at the top of the file.
11479
11480         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11481         class'es members, but add all members from TypeHandle.ObjectType
11482         if we're an interface.
11483         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11484         is the current type.
11485         (MemberCache.CacheEntry.Container): Removed this field.
11486         (TypeHandle.GetMembers): Include inherited members.
11487
11488 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11489
11490         * typemanager.cs: fixed compilation and added a comment on a field that
11491         is never used.
11492
11493 2002-08-15  Martin Baulig  <martin@gnome.org>
11494
11495         * class.cs (ConstructorInitializer.Resolve): In the
11496         Expression.MemberLookup call, use the queried_type as
11497         invocation_type.
11498
11499         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11500         declared' attribute, it's always true.
11501         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11502         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11503         temporary wrapper for FindMembers which tells MemberLookup whether
11504         members from the base classes are included in the return value.
11505         This will go away soon.
11506         (TypeManager.MemberLookup): Use this temporary hack here; once the
11507         new MemberCache is completed, we don't need to do the DeclaredOnly
11508         looping here anymore since the MemberCache will take care of this.
11509         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11510         (MemberCache): When creating the MemberCache for a class, get
11511         members from the current class and all its base classes.
11512         (MemberCache.CacheEntry.Container): New field.  This is a
11513         temporary hack until the Mono runtime is fixed to distinguish
11514         between ReflectedType and DeclaringType.  It allows us to use MCS
11515         with both the MS runtime and the unfixed Mono runtime without
11516         problems and without accecting performance.
11517         (MemberCache.SearchMembers): The DeclaredOnly looping from
11518         TypeManager.MemberLookup is now done here.      
11519
11520 2002-08-14  Martin Baulig  <martin@gnome.org>
11521
11522         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11523         Type.GetFields on dynamic types but get the fields from the
11524         corresponding TypeContainer.
11525         (MyStructInfo.GetStructInfo): Added check for enum types.
11526
11527         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11528         (MemberList.SyncRoot): Implemented.
11529         (TypeManager.FilterWithClosure): No need to check permissions if
11530         closure_start_type == closure_invocation_type, don't crash if
11531         closure_invocation_type is null.
11532
11533 2002-08-13  Martin Baulig  <martin@gnome.org>
11534
11535         Rewrote TypeContainer.FindMembers to use a member cache.  This
11536         gives us a speed increase of about 35% for the self-hosting MCS
11537         build and of about 15-20% for the class libs (both on GNU/Linux).
11538
11539         * report.cs (Timer): New class to get enhanced profiling.  This
11540         whole class is "TIMER" conditional since it remarkably slows down
11541         compilation speed.
11542
11543         * class.cs (MemberList): New class.  This is an IList wrapper
11544         which we're now using instead of passing MemberInfo[]'s around to
11545         avoid copying this array unnecessarily.
11546         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11547         (ICachingMemberFinder, IMemberContainer): New interface.
11548         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11549         has already been checked, otherwise use it for the name comparision.
11550         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11551         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11552         if possible.  Returns a MemberList, not a MemberInfo [].
11553         (TypeHandle): New class, implements IMemberContainer.  We create
11554         one instance of this class per type, it contains a MemberCache
11555         which is used to do the member lookups.
11556         (MemberCache): New class.  Each instance of this class contains
11557         all members of a type and a name-based hash table.
11558         (MemberCache.FindMembers): This is our new member lookup
11559         function.  First, it looks up all members of the requested name in
11560         the hash table.  Then, it walks this list and sorts out all
11561         applicable members and returns them.
11562
11563 2002-08-13  Martin Baulig  <martin@gnome.org>
11564
11565         In addition to a nice code cleanup, this gives us a performance
11566         increase of about 1.4% on GNU/Linux - not much, but it's already
11567         half a second for the self-hosting MCS compilation.
11568
11569         * typemanager.cs (IMemberFinder): New interface.  It is used by
11570         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11571         Enum, Delegate or Interface.
11572         (TypeManager.finder_to_member_finder): New PtrHashtable.
11573         (TypeManager.finder_to_container): Removed.
11574         (TypeManager.finder_to_delegate): Removed.
11575         (TypeManager.finder_to_interface): Removed.
11576         (TypeManager.finder_to_enum): Removed.
11577
11578         * interface.cs (Interface): Implement IMemberFinder.
11579
11580         * delegate.cs (Delegate): Implement IMemberFinder.
11581
11582         * enum.cs (Enum): Implement IMemberFinder.
11583
11584         * class.cs (TypeContainer): Implement IMemberFinder.
11585
11586 2002-08-12  Martin Baulig  <martin@gnome.org>
11587
11588         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11589
11590 2002-08-12  Martin Baulig  <martin@gnome.org>
11591
11592         * ecore.cs (ITypeExpression): New interface for expressions which
11593         resolve to a type.
11594         (TypeExpression): Renamed to TypeLookupExpression.
11595         (Expression.DoResolve): If we're doing a types-only lookup, the
11596         expression must implement the ITypeExpression interface and we
11597         call DoResolveType() on it.
11598         (SimpleName): Implement the new ITypeExpression interface.
11599         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11600         hack, the situation that we're only looking up types can't happen
11601         anymore when this method is called.  Moved the type lookup code to
11602         DoResolveType() and call it.
11603         (SimpleName.DoResolveType): This ITypeExpression interface method
11604         is now doing the types-only lookup.
11605         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11606         (ResolveFlags): Added MaskExprClass.
11607
11608         * expression.cs (MemberAccess): Implement the ITypeExpression
11609         interface.
11610         (MemberAccess.DoResolve): Added support for a types-only lookup
11611         when we're called via ITypeExpression.DoResolveType().
11612         (ComposedCast): Implement the ITypeExpression interface.
11613
11614         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11615         Expression.Resolve() with ResolveFlags.Type instead.
11616
11617 2002-08-12  Martin Baulig  <martin@gnome.org>
11618
11619         * interface.cs (Interface.Define): Apply attributes.
11620
11621         * attribute.cs (Attribute.ApplyAttributes): Added support for
11622         interface attributes.
11623
11624 2002-08-11  Martin Baulig  <martin@gnome.org>
11625
11626         * statement.cs (Block.Emit): Only check the "this" variable if we
11627         do not always throw an exception.
11628
11629         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11630         whether the property has a set accessor.
11631
11632 2002-08-11  Martin Baulig  <martin@gnome.org>
11633
11634         Added control flow analysis support for structs.
11635
11636         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11637         with control flow analysis turned off.
11638         (IVariable): New interface.
11639         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11640         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11641         (FieldExpr.DoResolve): Resolve the instance expression with flow
11642         analysis turned off and do the definite assignment check after the
11643         resolving when we know what the expression will resolve to.
11644
11645         * expression.cs (LocalVariableReference, ParameterReference):
11646         Implement the new IVariable interface, only call the flow analysis
11647         code if ec.DoFlowAnalysis is true.
11648         (This): Added constructor which takes a Block argument.  Implement
11649         the new IVariable interface.
11650         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11651         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11652         This does the definite assignment checks for struct members.
11653
11654         * class.cs (Constructor.Emit): If this is a non-static `struct'
11655         constructor which doesn't have any initializer, call
11656         Block.AddThisVariable() to tell the flow analysis code that all
11657         struct elements must be initialized before control returns from
11658         the constructor.
11659
11660         * statement.cs (MyStructInfo): New public class.
11661         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11662         argument to this indexer.  If non-zero, check an individual struct
11663         member, not the whole struct.
11664         (FlowBranching.CheckOutParameters): Check struct members.
11665         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11666         overloaded versions of these methods which take an additional
11667         `int field_idx' argument to check struct members.
11668         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11669         overloaded versions of these methods which take an additional
11670         `string field_name' argument to check struct member.s
11671         (VariableInfo): Implement the IVariable interface.
11672         (VariableInfo.StructInfo): New public property.  Returns the
11673         MyStructInfo instance of the variable if it's a struct or null.
11674         (Block.AddThisVariable): New public method.  This is called from
11675         Constructor.Emit() for non-static `struct' constructor which do
11676         not have any initializer.  It creates a special variable for the
11677         "this" instance variable which will be checked by the flow
11678         analysis code to ensure that all of the struct's fields are
11679         initialized before control returns from the constructor.
11680         (UsageVector): Added support for struct members.  If a
11681         variable/parameter is a struct with N members, we reserve a slot
11682         in the usage vector for each member.  A struct is considered fully
11683         initialized if either the struct itself (slot 0) or all its
11684         members are initialized.
11685
11686 2002-08-08  Martin Baulig  <martin@gnome.org>
11687
11688         * driver.cs (Driver.MainDriver): Only report an error CS5001
11689         if there were no compilation errors.
11690
11691         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11692         `UnsafeContext' property to determine whether the parent is in
11693         unsafe context rather than checking the parent's ModFlags:
11694         classes nested in an unsafe class are unsafe as well.
11695
11696 2002-08-08  Martin Baulig  <martin@gnome.org>
11697
11698         * statement.cs (UsageVector.MergeChildren): Distinguish between
11699         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11700         we return.  Added test17() and test18() to test-154.cs.
11701
11702 2002-08-08  Martin Baulig  <martin@gnome.org>
11703
11704         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11705         Family access, make sure the invoking type isn't a subclass of the
11706         queried type (that'd be a CS1540).
11707
11708         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11709         this method which takes an additional `Type invocation_type'.
11710
11711         * expression.cs (BaseAccess.DoResolve): Use the base type as
11712         invocation and query type.
11713         (MemberAccess.DoResolve): If the lookup failed and we're about to
11714         report a CS0122, try a lookup with the ec.ContainerType - if this
11715         succeeds, we must report a CS1540.
11716
11717 2002-08-08  Martin Baulig  <martin@gnome.org>
11718
11719         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11720         (MethodGroupExpr): Implement the IMemberExpr interface.
11721
11722         * expression (MemberAccess.ResolveMemberAccess): No need to have
11723         any special code for MethodGroupExprs anymore, they're now
11724         IMemberExprs.   
11725
11726 2002-08-08  Martin Baulig  <martin@gnome.org>
11727
11728         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11729         Family, FamANDAssem and FamORAssem permissions.
11730         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11731
11732 2002-08-08  Martin Baulig  <martin@gnome.org>
11733
11734         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11735         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11736         or loop block.
11737
11738 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11739
11740         * driver.cs: implemented /resource option to embed managed resources.
11741
11742 2002-08-07  Martin Baulig  <martin@gnome.org>
11743
11744         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11745         (FieldBase.HasFieldInitializer): New public property.
11746         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11747         returns the field initializer and makes sure it is only resolved once.
11748         (TypeContainer.EmitFieldInitializers): Call
11749         FieldBase.GetInitializerExpression to get the initializer, this ensures
11750         that it isn't resolved multiple times.
11751
11752         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11753         the resolving process (SimpleName/MemberLookup) that we're currently
11754         emitting a field initializer (which must not access any instance members,
11755         this is an error CS0236).
11756
11757         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11758         argument, if the `IsFieldInitializer' flag is set, we must report and
11759         error CS0236 and not an error CS0120.   
11760
11761 2002-08-07  Martin Baulig  <martin@gnome.org>
11762
11763         * ecore.cs (IMemberExpr): New public interface.
11764         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11765         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11766         if the expression is an IMemberExpr.
11767
11768         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11769         to be null, implicitly default to `this' if we're non-static in
11770         this case.  Simplified the code a lot by using the new IMemberExpr
11771         interface.  Also fixed bug #28176 here.
11772
11773 2002-08-06  Martin Baulig  <martin@gnome.org>
11774
11775         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11776         ParameterReferences during semantic analysis so that we can do a
11777         type-only search when resolving Cast, TypeOf and SizeOf.
11778         (block): Pass the `current_local_parameters' to the Block's
11779         constructor.
11780
11781         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11782         argument to the constructor.
11783         (ConstructorInitializer.Resolve): Create a temporary implicit
11784         block with the parameters.
11785
11786         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11787         references here if we aren't doing a type-only search.
11788
11789         * statement.cs (Block): Added constructor which takes a
11790         `Parameters parameters' argument.
11791         (Block.Parameters): New public property.
11792
11793         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11794         to `Parameters' and made it public readonly.
11795
11796 2002-08-06  Martin Baulig  <martin@gnome.org>
11797
11798         * ecore.cs (Expression.Warning): Made this public as well.
11799
11800         * report.cs (Report.Debug): Print the contents of collections.
11801
11802 2002-08-06  Martin Baulig  <martin@gnome.org>
11803
11804         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11805         used to tell Resolve() which kinds of expressions it may return.
11806         (Expression.Resolve): Added overloaded version of this method which
11807         takes a `ResolveFlags flags' argument.  This can be used to tell
11808         Resolve() which kinds of expressions it may return.  Reports a
11809         CS0118 on error.
11810         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11811         ResolveFlags.SimpleName.
11812         (Expression.Error118): Added overloaded version of this method which
11813         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11814         which kinds of expressions are allowed.
11815
11816         * expression.cs (Argument.ResolveMethodGroup): New public method.
11817         Resolves an argument, but allows a MethodGroup to be returned.
11818         This is used when invoking a delegate.
11819
11820         * TODO: Updated a bit.
11821
11822 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11823
11824         Fixed compilation with csc.
11825
11826         * ecore.cs: Expression.Error made public. Is this correct? Should
11827         Warning be made public too?
11828
11829         * expression.cs: use ea.Location instead of ea.loc.
11830         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11831
11832 2002-08-06  Martin Baulig  <martin@gnome.org>
11833
11834         * ecore.cs (Expression.loc): Moved the location here instead of
11835         duplicating it in all derived classes.
11836         (Expression.Location): New public property.
11837         (Expression.Error, Expression.Warning): Made them non-static and
11838         removed the location argument.
11839         (Expression.Warning): Added overloaded version which takes an
11840         `int level' argument.
11841         (Expression.Error118): Make this non-static and removed the
11842         expression and location arguments.
11843         (TypeExpr): Added location argument to the constructor.
11844
11845         * expression.cs (StaticCallExpr): Added location argument to
11846         the constructor.
11847         (Indirection, PointerArithmetic): Likewise.
11848         (CheckedExpr, UnCheckedExpr): Likewise.
11849         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11850         (StringPtr): Likewise.
11851
11852
11853 2002-08-05  Martin Baulig  <martin@gnome.org>
11854
11855         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11856
11857         * assign.cs (Assign.DoResolve): Check whether the source
11858         expression is a value or variable.
11859
11860         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11861         while resolving the corresponding blocks.
11862
11863         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11864         an error, don't silently return null.
11865
11866         * statement.cs (Block.AddVariable): Do the error reporting here
11867         and distinguish between CS0128 and CS0136.
11868         (Block.DoResolve): Report all unused labels (warning CS0164).
11869         (LabeledStatement): Pass the location to the constructor.
11870         (LabeledStatement.HasBeenReferenced): New property.
11871         (LabeledStatement.Resolve): Set it to true here.
11872
11873         * statement.cs (Return.Emit): Return success even after reporting
11874         a type mismatch error (CS0126 or CS0127), this is what csc does and
11875         it avoids confusing the users with any consecutive errors.
11876
11877 2002-08-05  Martin Baulig  <martin@gnome.org>
11878
11879         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11880
11881         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11882
11883         * expression.cs (MemberAccess.DoResolve): Silently return if an
11884         error has already been reported.
11885
11886         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11887         error has already been reported.
11888
11889 2002-08-05  Martin Baulig  <martin@gnome.org>
11890
11891         * statement.cs (UsageVector): Only initialize the `parameters'
11892         vector if we actually have any "out" parameters.
11893
11894 2002-08-05  Martin Baulig  <martin@gnome.org>
11895
11896         * expression.cs (Binary.ResolveOperator): When combining delegates,
11897         they must have the same type.
11898
11899 2002-08-05  Martin Baulig  <martin@gnome.org>
11900
11901         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11902         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11903         work with the ms runtime and we also don't need it: if we're a
11904         PropertyBuilder and not in the `indexer_arguments' hash, then we
11905         are a property and not an indexer.
11906
11907         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11908         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11909         since the latter one doesn't work with the ms runtime.
11910
11911 2002-08-03  Martin Baulig  <martin@gnome.org>
11912
11913         Fixed bugs #27998 and #22735.
11914
11915         * class.cs (Method.IsOperator): New public field.
11916         (Method.CheckBase): Report CS0111 if there's already a method
11917         with the same parameters in the current class.  Report CS0508 when
11918         attempting to change the return type of an inherited method.
11919         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11920         and it's not marked abstract or extern.
11921         (PropertyBase): New abstract base class for Property and Indexer.
11922         (PropertyBase.CheckBase): Moved here from Property and made it work
11923         for indexers.
11924         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11925         the same so we can reuse it there.
11926         (Property, Indexer): Derive from PropertyBase.
11927         (MethodSignature.inheritable_property_signature_filter): New delegate
11928         to find properties and indexers.
11929
11930         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11931         argument and improved error reporting.
11932
11933         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11934         EmptyReadOnlyParameters and made it a property.
11935
11936         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11937         version of this method which takes a `PropertyInfo indexer'.
11938         (TypeManager.RegisterIndexer): New method.
11939
11940         * class.cs: Added myself as author of this file :-)
11941
11942 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11943
11944         * class.cs: fixed compilation on windoze.
11945
11946 2002-08-03  Martin Baulig  <martin@gnome.org>
11947
11948         * interface.cs (Interface.GetInterfaceBases): Check whether all
11949         base interfaces are at least as accessible than the current one.
11950
11951         * class.cs (TypeContainer.GetClassBases): Check whether base types
11952         are at least as accessible than the current type.
11953         (TypeContainer.AsAccessible): Implemented and made non-static.
11954         (MemberBase.CheckParameters): Report errors if the accessibility
11955         checks fail.
11956
11957         * delegate.cs (Delegate.Delegate): The default visibility is
11958         internal for top-level types and private for nested types.
11959         (Delegate.Define): Report errors if the accessibility checks fail.
11960
11961         * enum.cs (Enum.Enum): The default visibility is internal for
11962         top-level types and private for nested types.
11963         (Enum.DefineType): Compute the correct visibility.
11964
11965         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11966         function which takes a `bool is_toplevel' instead of a TypeContainer.
11967
11968         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11969         builtin type.
11970
11971 2002-08-02  Martin Baulig  <martin@gnome.org>
11972
11973         * expression.cs (LocalVariableReferenc): Added constructor which
11974         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11975         (LocalVariableReference.IsReadOnly): New property.
11976         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11977         variable is readonly, use our own readonly flag to do this; you can
11978         use the new constructor to get a writable reference to a read-only
11979         variable.
11980
11981         * cs-parser.jay (foreach_statement, using_statement): Get a writable
11982         reference to the local variable.
11983
11984 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
11985
11986         * rootcontext.cs (ResolveCore): Also include System.Exception
11987
11988         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11989         we reach an EmptyStatement.
11990
11991         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
11992         is also fine.
11993
11994         * expression.cs (Binary.ResolveOperator): Check error result in
11995         two places.
11996
11997         use brtrue/brfalse directly and avoid compares to null.
11998
11999 2002-08-02  Martin Baulig  <martin@gnome.org>
12000
12001         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12002         Fixes bug #28407, added test-155.cs.
12003
12004 2002-08-01  Martin Baulig  <martin@gnome.org>
12005
12006         * class.cs (Event.EmitDefaultMethod): Make this work with static
12007         events.  Fixes #28311, added verify-3.cs.
12008
12009 2002-08-01  Martin Baulig  <martin@gnome.org>
12010
12011         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12012         `is_disposable' fields.
12013         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12014         `hm.is_disposable' if we're using the collection pattern.
12015         (Foreach.EmitCollectionForeach): Use the correct type for the
12016         enumerator's local variable, only emit the try/finally block if
12017         necessary (fixes #27713).
12018
12019 2002-08-01  Martin Baulig  <martin@gnome.org>
12020
12021         * ecore.cs (Expression.report118): Renamed to Error118 and made
12022         it public static.
12023
12024         * statement.cs (Throw.Resolve): Check whether the expression is of
12025         the correct type (CS0118) and whether the type derives from
12026         System.Exception (CS0155).
12027         (Catch.Resolve): New method.  Do the type lookup here and check
12028         whether it derives from System.Exception (CS0155).
12029         (Catch.CatchType, Catch.IsGeneral): New public properties.
12030
12031         * typemanager.cs (TypeManager.exception_type): Added.
12032
12033 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12034
12035         * driver.cs: Updated About function.
12036
12037 2002-07-31  Martin Baulig  <martin@gnome.org>
12038
12039         Implemented Control Flow Analysis.
12040
12041         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12042         (EmitContext.CurrentBranching): Added.
12043         (EmitContext.StartFlowBranching): Added.
12044         (EmitContext.EndFlowBranching): Added.
12045         (EmitContext.KillFlowBranching): Added.
12046         (EmitContext.IsVariableAssigned): Added.
12047         (EmitContext.SetVariableAssigned): Added.
12048         (EmitContext.IsParameterAssigned): Added.
12049         (EmitContext.SetParameterAssigned): Added.
12050         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12051         Added control flow analysis stuff here.
12052
12053         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12054         resolve the expression as lvalue.
12055         (LocalVariableReference.DoResolve): Check whether the variable has
12056         already been assigned.
12057         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12058         the parameter as assigned here.
12059         (ParameterReference.DoResolve): Check whether the parameter has already
12060         been assigned.
12061         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12062         expression as lvalue.
12063
12064         * statement.cs (FlowBranching): New class for the flow analysis code.
12065         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12066         (LabeledStatement.IsDefined): New public property.
12067         (LabeledStatement.AddUsageVector): New public method to tell flow
12068         analyis that the label may be reached via a forward jump.
12069         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12070         flow analysis.
12071         (VariableInfo.Number): New public field.  This is used by flow analysis
12072         to number all locals of a block.
12073         (Block.CountVariables): New public property.  This is the number of
12074         local variables in this block (including the locals from all parent
12075         blocks).
12076         (Block.EmitMeta): Number all the variables.
12077
12078         * statement.cs: Added flow analysis support to all classes.
12079
12080 2002-07-31  Martin Baulig  <martin@gnome.org>
12081
12082         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12083         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12084         then use this argument.
12085
12086         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12087
12088         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12089         use this to specify /define options.
12090
12091 2002-07-29  Martin Baulig  <martin@gnome.org>
12092
12093         * statement.cs (Fixed): Moved all code that does variable lookups
12094         and resolvings from Emit to Resolve.
12095
12096         * statement.cs (For): Moved all code that does variable lookups
12097         and resolvings from Emit to Resolve.
12098
12099         * statement.cs (Using): Moved all code that does variable lookups
12100         and resolvings from Emit to Resolve.
12101
12102 2002-07-29  Martin Baulig  <martin@gnome.org>
12103
12104         * attribute.cs (Attribute.Resolve): Explicitly catch a
12105         System.NullReferenceException when creating the
12106         CustromAttributeBuilder and report a different warning message.
12107
12108 2002-07-29  Martin Baulig  <martin@gnome.org>
12109
12110         * support.cs (ParameterData.ParameterName): Added method to
12111         get the name of a parameter.
12112
12113         * typemanager.cs (TypeManager.IsValueType): New public method.
12114
12115 2002-07-29  Martin Baulig  <martin@gnome.org>
12116
12117         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12118         is a flag which specifies that it's either ref or out.
12119         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12120         the out parameter to `out Parameter.Modifier mod', also set the
12121         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12122
12123         * support.cs (InternalParameters.ParameterModifier): Distinguish
12124         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12125         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12126
12127         * expression.cs (Argument.GetParameterModifier): Distinguish
12128         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12129         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12130
12131 2002-07-29  Martin Baulig  <martin@gnome.org>
12132
12133         * expression.cs (ParameterReference.ParameterReference): Added
12134         `Location loc' argument to the constructor.
12135
12136         * cs-parser.jay: Pass location to ParameterReference.
12137
12138 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12139
12140         * statement.cs (Try): Initialize the location.
12141
12142         * cs-parser.jay: pass location to Try.
12143
12144         * expression.cs (Unary.Reduce): Change the prototype to return
12145         whether a constant fold could be performed or not.  The result is
12146         returned in an out parameters.  In the case of Indirection and
12147         AddressOf, we want to perform the full tests.
12148
12149 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12150
12151         * statement.cs (Statement.Emit): Flag dead code.
12152
12153 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12154
12155         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12156
12157 2002-07-27  Martin Baulig  <martin@gnome.org>
12158
12159         * class.cs (MethodData.Define): Put back call to
12160         TypeManager.AddMethod(), accidentally commented this out.
12161
12162         * report.cs (Debug): New public method to print debugging information,
12163         this is `[Conditional ("DEBUG")]'.
12164
12165 2002-07-26  Martin Baulig  <martin@gnome.org>
12166
12167         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12168         (switch_statement): Push the current_block to the switch_stack and
12169         pop it again when we're done with the switch.
12170         (switch_section): The new block is a child of the current_block.
12171         Fixes bug #24007, added test-152.cs.
12172
12173 2002-07-27  Martin Baulig  <martin@gnome.org>
12174
12175         * expression.cs (Invocation.EmitArguments): When calling a varargs
12176         function with only its fixed arguments, we need to pass an empty
12177         array.
12178
12179 2002-07-27  Martin Baulig  <martin@gnome.org>
12180
12181         Mono 0.13 has been released.
12182
12183 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12184
12185         * driver.cs: Rename --resource to --linkres, because that is what
12186         we do currently, we dont support --resource yet.
12187
12188         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12189
12190 2002-07-25  Martin Baulig  <martin@gnome.org>
12191
12192         * class.cs (MethodData): New public class.  This is a `method builder'
12193         class for a method or one accessor of a Property/Indexer/Event.
12194         (MethodData.GetMethodFlags): Moved here from MemberBase.
12195         (MethodData.ApplyAttributes): Likewise.
12196         (MethodData.ApplyObsoleteAttribute): Likewise.
12197         (MethodData.ApplyConditionalAttribute): Likewise.
12198         (MethodData.ApplyDllImportAttribute): Likewise.
12199         (MethodData.CheckAbstractAndExternal): Likewise.
12200         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12201         (MethodData.Emit): Formerly known as Method.Emit().
12202         (MemberBase): Moved everything which was specific to a single
12203         accessor/method to MethodData.
12204         (Method): Create a new MethodData and call Define() and Emit() on it.
12205         (Property, Indexer, Event): Create a new MethodData objects for each
12206         accessor and call Define() and Emit() on them.
12207
12208 2002-07-25  Martin Baulig  <martin@gnome.org>
12209
12210         Made MethodCore derive from MemberBase to reuse the code from there.
12211         MemberBase now also checks for attributes.
12212
12213         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12214         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12215         as virtual.
12216         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12217         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12218         (MemberBase.ApplyAttributes): New virtual method; applies the
12219         attributes to a method or accessor.
12220         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12221         (MemberBase.ApplyConditionalAttribute): Likewise.
12222         (MemberBase.ApplyDllImportAttribute): Likewise.
12223         (MemberBase.CheckAbstractAndExternal): Likewise.
12224         (MethodCore.ParameterTypes): This is now a property instead of a
12225         method, it's initialized from DoDefineParameters().
12226         (MethodCore.ParameterInfo): Removed the set accessor.
12227         (MethodCore.DoDefineParameters): New protected virtual method to
12228         initialize ParameterTypes and ParameterInfo.
12229         (Method.GetReturnType): We can now simply return the MemberType.
12230         (Method.GetMethodFlags): Override the MemberBase version and add
12231         the conditional flags.
12232         (Method.CheckBase): Moved some code from Define() here, call
12233         DoDefineParameters() here.
12234         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12235         here to avoid some larger code duplication.
12236         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12237         ensure that abstract and external accessors don't declare a body.
12238
12239         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12240         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12241         lookup in the attribute's parent classes, so we need to abort as soon
12242         as we found the first match.
12243         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12244         the attribute has no arguments.
12245
12246         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12247         of a Method.
12248
12249 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12250
12251         * cs-parser.jay: reverted previous patch.
12252
12253 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12254
12255         * cs-parser.jay: fixed bug #22119.
12256
12257 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12258
12259         * attribute.cs: fixed compilation. The error was:
12260         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12261         be assigned to before control leaves the current method."
12262         [FIXME:  Filed as bug #28186: MCS must report this error.]
12263
12264 2002-07-25  Martin Baulig  <martin@gnome.org>
12265
12266         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12267         method to pull the condition name ouf of a Conditional attribute.
12268         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12269         the obsolete message and error flag out of an Obsolete attribute.
12270
12271         * class.cs (Method.GetMethodFlags): New public method to get the
12272         TypeManager.MethodFlags for this method.
12273         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12274         private methods.
12275         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12276         if we're overriding a virtual function, set the new private variable
12277         `parent_method'; call the new TypeManager.AddMethod().
12278
12279         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12280         the MethodBuilder and the Method in a PtrHashtable.
12281         (TypeManager.builder_to_method): Added for this purpose.
12282         (TypeManager.MethodFlags): Added IsObsoleteError.
12283         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12284         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12285         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12286         the message from the attribute.
12287
12288 2002-07-24  Martin Baulig  <martin@gnome.org>
12289
12290         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12291         preprocessor directives, ensure that the argument to #define/#undef is
12292         exactly one identifier and that it's actually an identifier.
12293
12294         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12295         did not work ....
12296
12297 2002-07-24  Martin Baulig  <martin@gnome.org>
12298
12299         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12300         initialize it to TypeManager.object_type in the constructor.
12301         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12302         of the `hm.get_current' method if we're using the collection pattern.
12303         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12304         for the explicit conversion to make it work when we're using the collection
12305         pattern and the `Current' property has a different return type than `object'.
12306         Fixes #27713.
12307
12308 2002-07-24  Martin Baulig  <martin@gnome.org>
12309
12310         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12311         does not match, but don't report any errors.  This method is called in
12312         order for all methods in a MethodGroupExpr until a matching method is
12313         found, so we don't want to bail out if the first method doesn't match.
12314         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12315         matches, report the 123.  Fixes #28070.
12316
12317 2002-07-24  Martin Baulig  <martin@gnome.org>
12318
12319         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12320         TypeManager.TypeToCoreType() to the top of the method so the
12321         following equality checks will work.  Fixes #28107.
12322
12323 2002-07-24  Martin Baulig  <martin@gnome.org>
12324
12325         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12326         operand is of type uint, and the other operand is of type sbyte,
12327         short or int, the operands are converted to type long." -
12328         Actually do what this comment already told us.  Fixes bug #28106,
12329         added test-150.cs.
12330
12331 2002-07-24  Martin Baulig  <martin@gnome.org>
12332
12333         * class.cs (MethodBase): New abstract class.  This is now a base
12334         class for Property, Indexer and Event to avoid some code duplication
12335         in their Define() and DefineMethods() methods.
12336         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12337         generic methods for Define() and DefineMethods().
12338         (FieldBase): Derive from MemberBase, not MemberCore.
12339         (Property): Derive from MemberBase, not MemberCore.
12340         (Property.DefineMethod): Moved all the code from this method to the
12341         new MethodBase.DefineAccessor(), just call it with appropriate
12342         argumetnts.
12343         (Property.Define): Call the new Property.DoDefine(), this does some
12344         sanity checks and we don't need to duplicate the code everywhere.
12345         (Event): Derive from MemberBase, not MemberCore.
12346         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12347         accessors, this will also make them work with interface events.
12348         (Indexer): Derive from MemberBase, not MemberCore.
12349         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12350         (Indexer.Define): Use the new MethodBase functions.
12351
12352         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12353         argument to the constructor.
12354         (Interface.FindMembers): Added support for interface events.
12355         (Interface.PopluateEvent): Implemented.
12356
12357         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12358
12359 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12360
12361         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12362         but this is required to check for a method name being the same as
12363         the containing class.  
12364
12365         Handle this now.
12366
12367 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12368
12369         * interface.cs: initialize variable.
12370
12371 2002-07-23  Martin Baulig  <martin@gnome.org>
12372
12373         Implemented the IndexerName attribute in interfaces.
12374
12375         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12376         name if this is an explicit interface implementation.
12377         (Indexer.InterfaceIndexerName): New public variable.  If we're
12378         implementing an interface indexer, this is the IndexerName in that
12379         interface.  Otherwise, it's the IndexerName.
12380         (Indexer.DefineMethod): If we're implementing interface indexer,
12381         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12382         and Pending.ImplementIndexer methods.
12383         (Indexer.Define): Also define the PropertyBuilder if we're
12384         implementing an interface indexer and this is neither an explicit
12385         interface implementation nor do the IndexerName match the one in
12386         the interface.
12387
12388         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12389         If a method is defined here, then we always need to create a proxy
12390         for it.  This is used when implementing interface indexers.
12391         (Pending.IsInterfaceIndexer): New public method.
12392         (Pending.ImplementIndexer): New public method.
12393         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12394         This is used when implementing interface indexers to define a proxy
12395         if necessary.
12396         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12397         define a proxy if necessary.
12398
12399         * interface.cs (Interface.IndexerName): New public variable.
12400         (Interface.PopulateIndexer): Set the IndexerName.
12401         (Interface.DefineIndexers): New private method.  Populate all the
12402         indexers and make sure their IndexerNames match.
12403
12404         * typemanager.cs (IndexerPropertyName): Added support for interface
12405         indexers.
12406
12407 2002-07-22  Martin Baulig  <martin@gnome.org>
12408
12409         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12410         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12411         ret if HasReturnLabel.
12412         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12413         variables.
12414
12415         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12416         and set the ec.LoopBeginTryCatchLevel.
12417         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12418         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12419         the current ec.TryCatchLevel, the branch goes out of an exception
12420         block.  In this case, we need to use Leave and not Br.
12421
12422 2002-07-22  Martin Baulig  <martin@gnome.org>
12423
12424         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12425         block unless the block does not always return or it is contained in
12426         another try { ... } catch { ... } block.  Fixes bug #26506.
12427         Added verify-1.cs to the test suite.
12428
12429 2002-07-22  Martin Baulig  <martin@gnome.org>
12430
12431         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12432         then we do not always return.  Fixes bug #24985.
12433
12434 2002-07-22  Martin Baulig  <martin@gnome.org>
12435
12436         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12437         lookup on a per-class level; ie. walk up the class hierarchy until we
12438         found at least one applicable method, then choose the best among them.
12439         Fixes bug #24463 and test-29.cs.
12440
12441 2002-07-22  Martin Baulig  <martin@gnome.org>
12442
12443         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12444         return types of the methods.  The return type is not part of the
12445         signature and we must not check it to make the `new' modifier work.
12446         Fixes bug #27999, also added test-147.cs.
12447         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12448
12449         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12450         on the method's return type.
12451
12452 2002-07-21  Martin Baulig  <martin@gnome.org>
12453
12454         * assign.cs: Make this work if the rightmost source is a constant and
12455         we need to do an implicit type conversion.  Also adding a few more tests
12456         to test-38.cs which should have caught this.
12457
12458         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12459         target in the makefile for this.  The makefile.gnu is primarily intended
12460         for end-users who don't want to debug the compiler.
12461
12462 2002-07-21  Martin Baulig  <martin@gnome.org>
12463
12464         * assign.cs: Improved the Assign class so it can now handle embedded
12465         assignments (X = Y = Z = something).  As a side-effect this'll now also
12466         consume less local variables.  test-38.cs now passes with MCS, added
12467         a few new test cases to that test.
12468
12469 2002-07-20  Martin Baulig  <martin@gnome.org>
12470
12471         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12472         instructions.  Fixes bug #27977, also added test-146.cs.
12473
12474 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12475
12476         * cs-tokenizer.cs: fixed getHex ().
12477
12478 2002-07-19  Martin Baulig  <martin@gnome.org>
12479
12480         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12481         not Type.GetType() to lookup the array type.  This is needed when
12482         we're constructing an array of a user-defined type.
12483         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12484         single-dimensional arrays, but also for single-dimensial arrays of
12485         type decimal.
12486
12487 2002-07-19  Martin Baulig  <martin@gnome.org>
12488
12489         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12490         this function is called, it's not allowed to share LocalBuilders
12491         among ILGenerators.
12492
12493 2002-07-19  Martin Baulig  <martin@gnome.org>
12494
12495         * expression.cs (Argument.Resolve): Report an error 118 when trying
12496         to pass a type as argument.
12497
12498 2002-07-18  Martin Baulig  <martin@gnome.org>
12499
12500         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12501         Conv_R_Un for the signed `long' type.
12502
12503 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12504
12505         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12506         `expr' for the temporary result, as that will fail if we do
12507         multiple resolves on the same expression.
12508
12509 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12510
12511         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12512         ec.TypeContainer for looking up aliases. 
12513
12514         * class.cs (TypeContainer): Remove LookupAlias from here.
12515
12516         * decl.cs (DeclSpace); Move here.
12517
12518 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12519
12520         * class.cs (FindMembers): Only call filter if the constructor
12521         bulider is not null.
12522
12523         Also handle delegates in `NestedTypes' now.  Now we will perform
12524         type lookups using the standard resolution process.  This also
12525         fixes a bug.
12526
12527         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12528         This uses Expressions (the limited kind that can be parsed by the
12529         tree) instead of strings.
12530
12531         * expression.cs (ComposedCast.ToString): Implement, used to flag
12532         errors since now we have to render expressions.
12533
12534         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12535         FormArrayType. 
12536
12537         * ecore.cs (SimpleName.ToString): ditto.
12538
12539         * cs-parser.jay: Instead of using strings to assemble types, use
12540         Expressions to assemble the type (using SimpleName, ComposedCast,
12541         MemberAccess).  This should fix the type lookups in declarations,
12542         because we were using a different code path for this.
12543
12544         * statement.cs (Block.Resolve): Continue processing statements
12545         even when there is an error.
12546
12547 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12548
12549         * class.cs (Event.Define): Also remove the `remove' method from
12550         the list of pending items.
12551
12552         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12553         generate more compact code. 
12554
12555 2002-07-17  Martin Baulig  <martin@gnome.org>
12556
12557         * const.cs (Const.LookupConstantValue): Add support for constant
12558         `unchecked' and `checked' expressions.
12559         Also adding test case test-140.cs for this.
12560
12561 2002-07-17  Martin Baulig  <martin@gnome.org>
12562
12563         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12564         check whether mi.ReturnType implements the IEnumerator interface; the
12565         `==' and the IsAssignableFrom() will fail in this situation.
12566
12567 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12568
12569         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12570         here too.
12571
12572 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12573
12574         * expression.cs: fixed bug #27811.
12575
12576 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12577
12578         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12579         Molaro: when we are a ref, the value already contains a pointer
12580         value, do not take the address of it.
12581
12582 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12583         * removed mb-parser.jay and mb-tokenizer.cs
12584
12585 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12586
12587         * expression.cs: check against the building corlib void type.
12588
12589 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12590
12591         * ecore.cs: fix for valuetype static readonly fields: when 
12592         initializing them, we need their address, not the address of a copy.
12593
12594 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12595
12596         * typemanager.cs: register also enum_type in corlib.
12597
12598 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12599
12600         * class.cs: allow calling this (but not base) initializers in structs.
12601
12602 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12603
12604         * ecore.cs: make sure we compare against the building base types
12605         in GetTypeSize ().
12606
12607 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12608
12609         * typemanager.cs: fix TypeToCoreType() to handle void and object
12610         (corlib gets no more typerefs after this change).
12611
12612 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12613
12614         * expression.cs (ArrayCreation.EmitArrayArguments): use
12615         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12616
12617         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12618         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12619         array indexes, the runtime actually forbids them.
12620
12621         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12622         for array arguments here.
12623
12624         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12625         instead of the default for ValueTypes.
12626
12627         (New.DoEmit): Use IsValueType instead of
12628         IsSubclassOf (value_type)
12629         (New.DoResolve): ditto.
12630         (Invocation.EmitCall): ditto.
12631
12632         * assign.cs (Assign): ditto.
12633
12634         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12635         Statements *are* currently doing part of their resolution during
12636         Emit.  
12637
12638         Expressions do always resolve during resolve, but statements are
12639         only required to propagate resolution to their children.
12640
12641 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12642
12643         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12644
12645         (LoadAssembly): Do not add the dll if it is already specified
12646
12647         (MainDriver): Add the System directory to the link path at the end,
12648         after all the other -L arguments. 
12649
12650         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12651         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12652         ldelem.u1) and using the opposite for sbytes.
12653
12654         This fixes Digger, and we can finally run it.
12655
12656         * driver.cs (UnixParseOption): Move the option parsing here.  
12657         (CSCParseOption): Implement CSC-like parsing of options.
12658
12659         We now support both modes of operation, the old Unix way, and the
12660         new CSC-like way.  This should help those who wanted to make cross
12661         platform makefiles.
12662
12663         The only thing broken is that /r:, /reference: and /lib: are not
12664         implemented, because I want to make those have the same semantics
12665         as the CSC compiler has, and kill once and for all the confussion
12666         around this.   Will be doing this tomorrow.
12667
12668         * statement.cs (Unsafe.Resolve): The state is checked during
12669         resolve, not emit, so we have to set the flags for IsUnsfe here.
12670
12671 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12672
12673         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12674         not catch the Error_ObjectRefRequired in SimpleName (as it is
12675         possible to have a class/instance variable name that later gets
12676         deambiguated), we have to check this here.      
12677
12678 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12679
12680         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12681         make static and put into Expression.
12682
12683         (Event.Define): Register the private field of the event with the 
12684         TypeManager so that GetFieldFromEvent can get at it.
12685
12686         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12687         keep track of the private field associated with an event which
12688         has no accessors.
12689
12690         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12691         private field.
12692
12693         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12694
12695 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12696
12697         * expression.cs (Binary.EmitBranchable): this routine emits the
12698         Binary expression in a branchable context.  This basically means:
12699         we need to branch somewhere, not just get the value on the stack.
12700
12701         This works together with Statement.EmitBoolExpression.
12702
12703         * statement.cs (Statement.EmitBoolExpression): Use
12704         EmitBranchable. 
12705
12706 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12707
12708         * statement.cs (For): Reduce the number of jumps in loops.
12709
12710         (For): Implement loop inversion for the For statement.
12711
12712         (Break): We can be breaking out of a Try/Catch controlled section
12713         (foreach might have an implicit try/catch clause), so we need to
12714         use Leave instead of Br.
12715
12716         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12717         now).  If the instace expression supports IMemoryLocation, we use
12718         the AddressOf method from the IMemoryLocation to extract the
12719         address instead of emitting the instance.
12720
12721         This showed up with `This', as we were emitting the instance
12722         always (Emit) instead of the Address of This.  Particularly
12723         interesting when This is a value type, as we dont want the Emit
12724         effect (which was to load the object).
12725
12726 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12727
12728         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12729
12730         * statement.cs (Checked): Set the CheckedState during the resolve
12731         process too, as the ConvCast operations track the checked state on
12732         the resolve process, and not emit.
12733
12734         * cs-parser.jay (namespace_member_declaration): Flag that we have
12735         found a declaration when we do.  This is used to flag error 1529
12736
12737         * driver.cs: Report ok when we display the help only.
12738
12739 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12740
12741         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12742
12743 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12744
12745         * cs-tokenizer.cs (define): We also have to track locally the
12746         defines.  AllDefines is just used for the Conditional Attribute,
12747         but we also need the local defines for the current source code. 
12748
12749 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12750
12751         * statement.cs (While, For, Do): These loops can exit through a
12752         Break statement, use this information to tell whether the
12753         statement is the last piece of code.
12754
12755         (Break): Flag that we break.
12756
12757         * codegen.cs (EmitContexts): New `Breaks' state variable.
12758
12759 2002-07-03  Martin Baulig  <martin@gnome.org>
12760
12761         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12762         modifiers in method declarations in structs.  Otherwise, you won't
12763         be able to override things like Object.Equals().
12764
12765 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12766
12767         * class.cs (Method, Property, Indexer): Do not allow the public
12768         modifier to be used in explicit interface implementations.
12769
12770         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12771         override modifiers in method declarations in structs
12772
12773 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12774
12775         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12776         integer or real overflow, report an error
12777
12778 2002-07-02  Martin Baulig  <martin@gnome.org>
12779
12780         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12781         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12782         to tell the runtime about our newly created System.Object and
12783         System.ValueType types.
12784
12785 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12786
12787         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12788         struct instead of Ldarg/Starg.
12789
12790 2002-07-02  Martin Baulig  <martin@gnome.org>
12791
12792         * expression.cs (Indirection.Indirection): Call
12793         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12794
12795 2002-07-02  Martin Baulig  <martin@gnome.org>
12796
12797         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12798         ValueType, call TypeManager.TypeToCoreType() on it.
12799         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12800         the OpCodes.Newarr argument.
12801
12802 2002-07-02  Martin Baulig  <martin@gnome.org>
12803
12804         * expression.cs (Invocation.EmitCall): When compiling corlib,
12805         replace all calls to the system's System.Array type to calls to
12806         the newly created one.
12807
12808         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12809         System.Array methods.
12810         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12811         from the system's System.Array type which must be replaced.
12812
12813 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12814
12815         * typemanager.cs: load unverifiable_code_ctor so we can build
12816         corlib using the correct type. Avoid using GetTypeCode() with
12817         TypeBuilders.
12818         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12819         TypeManager.object_type to allow building corlib.
12820
12821 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12822
12823         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12824
12825 2002-07-01  Martin Baulig  <martin@gnome.org>
12826
12827         * class.cs: Make the last change actually work, we need to check
12828         whether `ifaces != null' to avoid a crash.
12829
12830 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12831
12832         * class.cs: when we build structs without fields that implement
12833         interfaces, we need to add the interfaces separately, since there is
12834         no API to both set the size and add the interfaces at type creation
12835         time.
12836
12837 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12838
12839         * expression.cs: the dimension arguments to the array constructors
12840         need to be converted if they are a long.
12841
12842 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12843
12844         * class.cs: don't emit ldarg.0 if there is no parent constructor
12845         (fixes showstopper for corlib).
12846
12847 2002-06-29  Martin Baulig  <martin@gnome.org>
12848
12849         MCS now compiles corlib on GNU/Linux :-)
12850
12851         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12852         ie. check for MethodImplOptions.InternalCall.
12853
12854         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12855         and TypeManager.attribute_type are null, so we must explicitly check
12856         whether parent is not null to find out whether it's an attribute type.
12857         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12858         and SetBuilder, not only if the property is neither abstract nor external.
12859         This is necessary to set the MethodImplOptions on the accessor methods.
12860         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12861         SetBuilder, see Property.Emit().
12862
12863         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12864         populate "System.Object", "System.ValueType" and "System.Attribute" since
12865         they've already been populated from BootCorlib_PopulateCoreTypes().
12866
12867 2002-06-29  Martin Baulig  <martin@gnome.org>
12868
12869         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12870         is the NullLiteral, we also need to make sure that target_type is not
12871         an enum type.   
12872
12873 2002-06-29  Martin Baulig  <martin@gnome.org>
12874
12875         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12876         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12877         before calling BootstrapCorlib_ResolveDelegate ().
12878
12879 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12880
12881         * statement.cs: fixed build-breaker. All tests passed ok.
12882
12883 2002-06-27  Martin Baulig  <martin@gnome.org>
12884
12885         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12886         for System.Decimal when compiling corlib.
12887
12888 2002-06-27  Martin Baulig  <martin@gnome.org>
12889
12890         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12891         switch blocks which contain nothing but a default clause.
12892
12893 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12894
12895        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12896
12897 2002-06-27  Martin Baulig  <martin@gnome.org>
12898
12899         * ecore.cs (PropertyExpr.PropertyExpr): Call
12900         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12901
12902         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12903         is already a TypeBuilder.
12904
12905 2002-06-27  Martin Baulig  <martin@gnome.org>
12906
12907         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12908         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12909         the "from an array-type to System.Array" case.  This makes it work
12910         when compiling corlib.
12911
12912 2002-06-27  Martin Baulig  <martin@gnome.org>
12913
12914         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12915         non-static PropertyExpr, set its InstanceExpression.  This makes
12916         the `ICollection.Count' property work in System/Array.cs.
12917
12918 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12919
12920         * driver.cs: Made error handling more consistent.  Errors now
12921         tracked by Report class, so many methods which used to return int
12922         now return void.  Main() now prints success/failure and 
12923         errors/warnings message.
12924
12925         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12926         the magic number return values (123 and 124).  Now, if the
12927         expected error occurs, the compiler exits with success (exit value
12928         0).  If the compilation completes without seeing that particular
12929         error, the compiler exits with failure (exit value 1).  The
12930         makefile in mcs/errors has been changed to handle the new behaviour.
12931
12932         * report.cs: Made 'expected error' number a property and renamed
12933         it from 'Probe' to 'ExpectedError'.
12934
12935         * genericparser.cs: Removed error handling support, since it is
12936         now all done by Report class.
12937
12938         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12939         class, so parse() no longer returns an int.
12940
12941         * namespace.cs: Use Report.Error instead of GenericParser.error
12942
12943 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12944
12945         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12946         TypeContainer.AddOperator): At the front of the list put the
12947         explicit implementations, so they get resolved/defined first. 
12948
12949 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
12950
12951         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12952         interface type is implemented by this TypeContainer.  Used during
12953         explicit interface implementation.
12954
12955         (Property.Define, Indexer.Define, Method.Define): Validate that
12956         the given interface in the explicit implementation is one of the
12957         base classes for the containing type.
12958
12959         Also if we are explicitly implementing an interface, but there is
12960         no match in the pending implementation table, report an error.
12961
12962         (Property.Define): Only define the property if we are
12963         not explicitly implementing a property from an interface.  Use the
12964         correct name also for those properties (the same CSC uses,
12965         although that is really not needed).
12966
12967         (Property.Emit): Do not emit attributes for explicitly implemented
12968         properties, as there is no TypeBuilder.
12969
12970         (Indexer.Emit): ditto.
12971
12972         Hiding then means that we do not really *implement* a pending
12973         implementation, which makes code fail.
12974
12975 2002-06-22  Martin Baulig  <martin@gnome.org>
12976
12977         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12978         the return value of Object.GetType().  [FIXME: we need to do this whenever
12979         we get a type back from the reflection library].
12980
12981 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12982
12983         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12984
12985 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
12986
12987         * attribute.cs: Return null if we can not look up the type.
12988
12989         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12990         the interface types found.
12991
12992         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
12993         interface types found.
12994
12995         * typemanager.cs (GetInterfaces): Make this routine returns alll
12996         the interfaces and work around the lame differences between
12997         System.Type and System.Reflection.Emit.TypeBuilder in the results
12998         result for GetInterfaces.
12999
13000         (ExpandInterfaces): Given an array of interface types, expand and
13001         eliminate repeated ocurrences of an interface.  This expands in
13002         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13003         be IA, IB, IC.
13004
13005 2002-06-21  Martin Baulig  <martin@gnome.org>
13006
13007         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13008         on System.Enum.
13009
13010 2002-06-21  Martin Baulig  <martin@gnome.org>
13011
13012         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13013         and called with one of the core types, return the corresponding typebuilder for
13014         that type.
13015
13016         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13017         element type.
13018
13019 2002-06-21  Martin Baulig  <martin@gnome.org>
13020
13021         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13022         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13023         (Expression.ConvertReferenceExplicit): Likewise.
13024
13025         * expression.cs (ElementAccess.DoResolve): Likewise.
13026         (ElementAccess.DoResolveLValue): Likewise.
13027
13028 2002-06-10  Martin Baulig  <martin@gnome.org>
13029
13030         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13031         add the "value" parameter to the parameter list.
13032
13033         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13034         to our caller.
13035
13036 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13037
13038         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13039         the argument to an int, uint, long or ulong, per the spec.  Also
13040         catch negative constants in array creation.
13041
13042 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13043
13044         * class.cs: do not allow the same interface to appear twice in
13045         the definition list.
13046
13047 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13048
13049         * ecore.cs: don't use ldlen with System.Array.
13050
13051 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13052
13053         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13054
13055 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13056
13057         * modifiers.cs: produce correct field attributes for protected
13058         internal. Easy fix so miguel can work on ther harder stuff:-)
13059
13060 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13061
13062         * pending.cs: New file.  Move the code from class.cs here.
13063         Support clearning the pending flag for all methods (when not doing
13064         explicit interface implementation).
13065
13066 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13067
13068         * rootcontext.cs: added a couple more types needed to bootstrap.
13069
13070 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13071
13072         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13073         constructor in the type, instead of any constructor in the type
13074         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13075         a bug in the Mono runtime when applying the params attribute). 
13076
13077 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13078         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13079
13080 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13081
13082         * expression.cs (Unary.ResolveOperator): Use TypeManager
13083         to resolve the type.
13084
13085 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13086
13087         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13088         attached.
13089
13090         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13091         with each member too.
13092
13093         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13094         field builders too - this takes care of the enum member case.
13095
13096 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13097
13098         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13099         address-of operator on both value types and pointers.
13100
13101 2002-06-10  Martin Baulig  <martin@gnome.org>
13102
13103         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13104         PropertyBuilder to the `property_builders' list.
13105
13106         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13107         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13108         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13109         find any indexers which are inherited from an interface.
13110
13111 2002-06-09  Martin Baulig  <martin@gnome.org>
13112
13113         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13114         the same type as the constant if necessary.  There's also a test-130.cs
13115         for this.
13116
13117         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13118
13119         * typemanager.cs (TypeManager.ChangeType): Previously known as
13120         Enum.ChangeEnumType().
13121
13122 2002-06-09  Martin Baulig  <martin@gnome.org>
13123
13124         * expression.cs (Cast.TryReduce): Added support for consts.
13125
13126 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13127
13128         * class.cs (Accessor): Hold attributes information so we can pass
13129         it along.
13130
13131         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13132         Modify to pass in attributes attached to the methods.
13133
13134         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13135
13136         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13137         to handle the Accessor kind :-)
13138
13139         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13140
13141 2002-06-08  Martin Baulig  <martin@gnome.org>
13142
13143         * expression.cs (Unary.TryReduceNegative): Added support for
13144         ULongConstants.
13145
13146 2002-06-08  Martin Baulig  <martin@gnome.org>
13147
13148         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13149         name can't be found in the `defined_names' - the caller will do a
13150         MemberLookup in this case and thus find methods in System.Enum
13151         such as Enum.IsDefined().
13152
13153 2002-06-08  Martin Baulig  <martin@gnome.org>
13154
13155         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13156         Convert.ChangeType() which works with TypeBuilder created types.
13157         (Enum.LookupEnumValue, Enum.Define): Use it here.
13158
13159         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13160         `TypeBuilder.BaseType != null' check.
13161         (TypeContainer.FindMembers): Only lookup parent members if we
13162         actually have a parent.
13163         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13164         (ConstructorInitializer.Resolve): Likewise.
13165
13166         * interface.cs (Interface.FindMembers): Added
13167         `TypeBuilder.BaseType != null' check.
13168
13169         * rootcontext.cs (RootContext.ResolveCore): Added
13170         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13171         classes_second_stage.
13172
13173         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13174         debug_type and trace_type when compiling with --nostdlib.       
13175
13176 2002-06-07  Martin Baulig  <martin@gnome.org>
13177
13178         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13179         (AddField): Set it to true when adding a non-static field.
13180         (DefineType): Use `have_nonstatic_fields' to find out whether we
13181         have non-static fields, not `Fields != null'.
13182
13183 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13184
13185         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13186         dereferencing a null on the static-field code path)
13187
13188 2002-05-30  Martin Baulig  <martin@gnome.org>
13189
13190         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13191         to take command line arguments.  Use reflection to call the new
13192         custom `Initialize' function on the symbol writer and pass it the
13193         command line arguments.
13194
13195         * driver.cs (--debug-args): New command line argument to pass command
13196         line arguments to the symbol writer.
13197
13198 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13199
13200         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13201         the target type for indexers and properties.  Thanks to Joe for
13202         catching this.
13203
13204 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13205
13206         * typemanager.cs (MethodFlags): returns the method flags
13207         (Obsolete/ShouldIgnore) that control warning emission and whether
13208         the invocation should be made, or ignored. 
13209
13210         * expression.cs (Invocation.Emit): Remove previous hack, we should
13211         not do this on matching a base type, we should do this based on an attribute
13212
13213         Only emit calls to System.Diagnostics.Debug and
13214         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13215         on the command line.
13216
13217         * rootcontext.cs: Global settings for tracing and debugging.
13218
13219         * cs-tokenizer.cs (define): New utility function to track
13220         defines.   Set the global settings for TRACE and DEBUG if found.
13221
13222 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13223
13224         * interface.cs (Populate*): Pass in the TypeContainer as well as
13225         the DeclSpace as parameters so that we can create EmitContexts and
13226         then use that to apply attributes etc.
13227
13228         (PopulateMethod, PopulateEvent, PopulateProperty)
13229         (PopulateIndexer): Apply attributes everywhere.
13230
13231         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13232         etc.
13233
13234         (ApplyAttributes): Update accordingly.
13235
13236         We now apply interface attributes for all members too.
13237
13238 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13239
13240         * class.cs (Indexer.Define); Correctly check if we are explicit
13241         implementation (instead of checking the Name for a ".", we
13242         directly look up if the InterfaceType was specified).
13243
13244         Delay the creation of the PropertyBuilder.
13245
13246         Only create the PropertyBuilder if we are not an explicit
13247         interface implementation.   This means that explicit interface
13248         implementation members do not participate in regular function
13249         lookups, and hence fixes another major ambiguity problem in
13250         overload resolution (that was the visible effect).
13251
13252         (DefineMethod): Return whether we are doing an interface
13253         implementation. 
13254
13255         * typemanager.cs: Temporary hack until we get attributes in
13256         interfaces (Ravi is working on that) and we get IndexerName
13257         support in interfaces.
13258
13259         * interface.cs: Register the indexers as properties.
13260
13261         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13262         warning, I have verified that this is a bug in the .NET runtime
13263         (JavaScript suffers of the same problem).
13264
13265         * typemanager.cs (MemberLookup): When looking up members for
13266         interfaces, the parent of an interface is the implicit
13267         System.Object (so we succeed in searches of Object methods in an
13268         interface method invocation.  Example:  IEnumerable x;  x.ToString
13269         ()) 
13270
13271 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13272
13273         * class.cs (Event): Events should also register if they do
13274         implement the methods that an interface requires.
13275
13276         * typemanager.cs (MemberLookup); use the new GetInterfaces
13277         method. 
13278
13279         (GetInterfaces): The code used to lookup interfaces for a type is
13280         used in more than one place, factor it here. 
13281
13282         * driver.cs: Track the errors at the bottom of the file, we kept
13283         on going.
13284
13285         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13286         instance if the method we are calling is static!
13287
13288 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13289
13290         * attribute.cs (ApplyAttributes): Make this function filter out
13291         the IndexerName attribute (as that attribute in reality is never
13292         applied) and return the string constant for the IndexerName
13293         attribute. 
13294
13295         * class.cs (TypeContainer.Emit): Validate that all the indexers
13296         have the same IndexerName attribute, and if so, set the
13297         DefaultName attribute on the class. 
13298
13299         * typemanager.cs: The return value might contain other stuff (not
13300         only methods).  For instance, consider a method with an "Item"
13301         property and an Item method.
13302
13303         * class.cs: If there is a problem with the parameter types,
13304         return. 
13305
13306 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13307
13308         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13309         looks at user defined conversion after making a call to 
13310         StandardConversionExists - we need this for overload resolution.
13311
13312         * expression.cs : Update accordingly the various method calls.
13313
13314         This fixes 2 bugs filed against implicit user defined conversions 
13315
13316 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13317
13318         * statement.cs: Track the result of the assignment.
13319
13320 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13321
13322         * expression.cs (MemberAccess): Improved error reporting for
13323         inaccessible members.
13324
13325 2002-05-22  Martin Baulig  <martin@gnome.org>
13326
13327         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13328         itself with debugging support.
13329
13330 2002-05-22  Martin Baulig  <martin@gnome.org>
13331
13332         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13333         Removed, this isn't needed anymore.
13334
13335 2002-05-20  Martin Baulig  <martin@gnome.org>
13336
13337         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13338         be underlying type for an enum.
13339
13340 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13341
13342         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13343         that splits out the loading of just the core types.
13344
13345         * rootcontext.cs (ResolveCore): Split the struct resolution in
13346         two, so we can load the enumeration underlying types before any
13347         enums are used.
13348
13349         * expression.cs (Is): Bandaid until we fix properly Switch (see
13350         bug #24985 for details).
13351
13352         * typemanager.cs (ImplementsInterface): The hashtable will contain
13353         a null if there are no interfaces implemented.
13354
13355 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13356
13357         * cs-parser.jay (indexer_declarator): It is fine to have array
13358         parameters
13359
13360 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13361
13362         * typemanager.cs: (RegisterBuilder): New function used to register
13363         TypeBuilders that implement interfaces.  Since
13364         TypeBuilder.GetInterfaces (as usual) does not work with lame
13365         Reflection.Emit. 
13366         (AddUserType): register interfaces.
13367
13368         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13369         dealing with TypeBuilder.  Also, arrays are showing up as
13370         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13371         methods can not be invoked on them!
13372
13373         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13374         (ImplicitReferenceConversionExists): Split out from
13375         StandardConversionExists. 
13376
13377         * expression.cs (As): We were only implementing one of the three
13378         cases for the as operator.  We now implement them all.
13379         (Is): Implement the various other cases for Is as well.
13380
13381         * typemanager.cs (CACHE): New define used to control if we want or
13382         not the FindMembers cache.  Seems to have a negative impact on
13383         performance currently
13384
13385         (MemberLookup): Nested types have full acess to
13386         enclosing type members
13387
13388         Remove code that coped with instance/static returns for events, we
13389         now catch this in RealFindMembers.
13390
13391         (RealFindMembers): only perform static lookup if the instance
13392         lookup did not return a type or an event.  
13393
13394 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13395
13396         * assign.cs (CompoundAssign): We pass more semantic information
13397         now to Compound Assignments than we did before: now we have all
13398         the information at hand, and now we resolve the target *before* we
13399         do the expression expansion, which allows the "CacheValue" method
13400         to have the effect we intended (before, a [x] += 1 would generate
13401         two differen ArrayAccess expressions from the ElementAccess,
13402         during the resolution process).
13403
13404         (CompoundAssign.DoResolve): Resolve target and original_source here.
13405
13406 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13407
13408         * expression.cs (ArrayAccess): dropped debugging information. 
13409
13410         * typemanager.cs: Small bug fix: I was always returning i_members,
13411         instead of one of i_members or s_members (depending on which had
13412         the content).
13413
13414         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13415         method is invoked before any code generation takes place, and it
13416         is a mechanism to inform that the expression will be invoked more
13417         than once, and that the method should use temporary values to
13418         avoid having side effects
13419
13420         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13421
13422         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13423         implementation.
13424
13425         * expression.cs (Indirection, ArrayAccess): Add support for
13426         CacheTemporaries in these two bad boys. 
13427
13428         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13429         ldobj or ldind_ref.  
13430         (StoreFromPtr): Handle stobj as well.
13431
13432         * expression.cs (UnaryMutator): Share more code.
13433
13434         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13435         down: I was not tracking the Filter function as well, which
13436         was affecting the results of the cache.
13437
13438 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13439
13440         * attribute.cs: Remove the hack to handle the CharSet property on
13441         StructLayouts. 
13442
13443 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13444
13445         * attribute.cs (DoResolve): More uglyness, we now only try to
13446         resolve the attribute partially, to extract the CharSet
13447         information (only if we are a StructLayout attribute).  Otherwise 
13448
13449         (GetExtraTypeInfo): Add some code to conditionally kill in the
13450         future this.   I am more and more convinced that the .NET
13451         framework has special code to handle the attribute setting on
13452         certain elements.
13453
13454         * expression.cs (IsParamsMethodApplicable): Revert my previous
13455         foreach change here, it was wrong.
13456
13457 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13458
13459         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13460         (pp_expr): do not abort on unknown input, just return.
13461         (eval): abort if there are pending chars.
13462
13463         * attribute.cs (Attribute.Resolve): Positional parameters are
13464         optional.  Deal with that case.
13465
13466         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13467         the Ansi/Unicode/Auto information for the type.
13468
13469         (TypeContainer.DefineType): instantiate the EmitContext here, as
13470         we will be using it during the type definition (to resolve
13471         attributes) and during the emit phase.
13472
13473         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13474         to pull type information out of the attributes
13475
13476         (Attribute.Resolve): track the constructor builder, and allow for
13477         multiple invocations (structs and classes will use this).
13478
13479         * ecore.cs (MemberLookupFinal): new version with all the
13480         parameters customizable.
13481
13482         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13483         constructors.  Return if the result value is null (as the error
13484         would have been flagged already by MemberLookupFinal)
13485
13486         Do not allow instances of abstract classes or interfaces to be
13487         created.
13488
13489         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13490         We have to compare the assembly property here when dealing with
13491         FamANDAssem and Assembly access modifiers, because we might be
13492         creating an assembly from *modules* (that means that we are not
13493         getting TypeBuilders for types defined in other modules that are
13494         part of this assembly).
13495
13496         (Method.Emit): If the method is marked abstract and has a body,
13497         emit an error. 
13498
13499         (TypeContainer.DefineMembers): If both the defined member and the
13500         parent name match are methods, then do not emit any warnings: let
13501         the Method.Define routine take care of flagging warnings.  But if
13502         there is a mismatch (method overrides something else, or method is
13503         overriwritten by something, then emit warning).
13504
13505         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13506         set to null, this means `do not check for the return type on the
13507         signature'. 
13508
13509         (Method.Define): set the return type for the method signature to
13510         null, so that we get methods with the same name and parameters and
13511         different return types.  This is used to flag warning 114 (you are
13512         hiding a method, and you probably want to use the new/override
13513         keywords instead).
13514
13515         * typemanager.cs (MemberLookup): Implemented proper access
13516         control, closing a long standing set of bug reports.  The problem
13517         was that the Framework only has two bits: Public and NonPublic,
13518         and NonPublic includes private and protected methods, but we need
13519         to enforce the FamANDAssem, FamOrAssem and Family. 
13520
13521 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13522
13523         * statement.cs (GotoCase): Return true: Ammounts to giving up
13524         knowledge on whether we return or not, and letting the other case
13525         be responsible for it.
13526
13527 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13528
13529         * driver.cs: Do not load directories for each file processed, only
13530         do it if there is a pattern.
13531
13532         * ecore.cs: Report readonly assigns here as well, as we might have
13533         been resolved only by MemberAccess.
13534
13535         (SimpleName.SimpleNameResolve): Also be useful for LValue
13536         resolution.   We need this to propagate assign to local readonly variables
13537
13538         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13539         do not want to reuse potential criteria memory.
13540
13541         * class.cs (MyEventBuilder): Set reflected_type;
13542
13543         * ecore.cs (Constantify): Added support for constifying bools.
13544
13545         (RootContext.LookupType): Added a cache for values looked up in
13546         the declaration space.
13547
13548         * typemanager.cs (FindMembers): Now is a front-end to
13549         RealFindMembers, and provides a two-level hashtable-based cache to
13550         the request.  
13551
13552         15% performance improvement: from 22.5 to 19.2 seconds.
13553
13554         * expression.cs (IsParamsMethodApplicable): use foreach.
13555         (Invocation.DoResolve): ditto.
13556         (New.DoResolve): ditto.
13557         (ArrayCreation.DoResolve): ditto.
13558
13559         * ecore.cs (FindMostEncompassingType): use foreach.
13560
13561         * delegate.cs (NewDelegate.DoResolve): Use foreach
13562
13563         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13564         (RemoveMethods): use foreach.
13565
13566         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13567         nested foreach statements instead of for, and also break out of
13568         the inner loop once a match is found.
13569
13570         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13571
13572 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13573
13574         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13575         we actually unwrap the expression to allow for extra information
13576         to be extracted. 
13577
13578         * expression.cs: Use Shr_Un on unsigned operations. 
13579
13580 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13581
13582         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13583         applicable operators was not being considered correctly. This closes
13584         the bug Miguel reported.
13585
13586 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13587
13588         * attribute.cs: check that the type derives from System.Attribute
13589         and report the correct error in that case (moved the duplicate code to
13590         its own method, too).
13591
13592 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13593
13594         * attribute.cs: lookup attribute type name as the spec says: first the
13595         bare attribute name and then name + "Attribute" (nant compiles with
13596         mcs after this fix).
13597
13598 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13599
13600         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13601         Because of the way we parse things, we should try to see if a
13602         UIntConstant can fit in an integer.
13603
13604 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13605
13606         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13607         when we are in an explicit context.
13608
13609         (ConvertReferenceExplicit): When converting from Iface type S to Class
13610         T make sure the rules are implemented as an OR.
13611
13612         * parameter.cs (ParameterType): Make it a property for now although the
13613         purpose really isn't anything immediate.
13614
13615         * expression.cs (Is*Applicable): Do better checking on the parameter type
13616         of a ref/out parameter. The ones from the system assemblies are already 
13617         marked with the correct type so we don't need to do any correction.
13618
13619         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13620         the object type is standard too so include that.
13621
13622 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13623
13624         * ecore.cs (StandardConversionExists): Augment with missing code:
13625         deal with IntConstant, LongConstants and Enumerations.
13626
13627         * assign.cs: Report the error, instead of failing silently
13628
13629         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13630         typecontainer that they are declared, because the
13631         typecontainer/namespace will have the list of using clauses that
13632         need to be applied.
13633
13634         Assembly Attributes were escaping the normal registration
13635         mechanism. 
13636
13637         (EmitCode): Apply attributes within an EmitContext that represents
13638         the container they were declared on.
13639
13640         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13641
13642 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13643
13644         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13645         Revamp completely - make much cleaner as we now operate only
13646         on a set of Types.
13647
13648         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13649         to implement the logic detailed in the spec more correctly.
13650
13651         (UserDefinedConversion): Update accordingly.
13652
13653 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13654
13655         * statement.cs: Return flow analysis information up.
13656
13657         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13658         and the default.
13659
13660         (token): Do not consume an extra character before calling
13661         decimal_digits.
13662
13663 2002-05-06  Piers Haken <piersh@friskit.com>
13664
13665         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13666
13667 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13668
13669         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13670         EmitContext during the instance constructor initializer
13671         resolution, to stop access to instance variables.
13672
13673         This is mandated by the spec, last paragraph of the `constructor
13674         initializers' section. 
13675
13676 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13677
13678         * cs-parser.jay, class.cs (Accessor): new class used to represent
13679         an accessor (get or set).  In the past we used `null' to represent
13680         a missing accessor.  But this is ambiguous because there was no
13681         way to tell in abstract indexers/properties if one of them was
13682         specified.
13683
13684         Now there is a way of addressing that.
13685
13686         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13687         instead of FindMembers.
13688
13689         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13690         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13691
13692         * attribute.cs: Treat indexers and properties as the same in terms
13693         of applying attributes
13694
13695         * ecore.cs (FindMostEncompassedType): Use statically initialized
13696         EmptyExpressions()s like we do elsewhere to avoid creating useless
13697         objects (and we take this out of the tight loop).
13698
13699         (GetConversionOperators): Move the code to extract the actual
13700         operators to a separate routine to clean things up.
13701
13702 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13703
13704         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13705         events are always registered FieldBuilders.
13706
13707         * class.cs (FieldBase): New class shared by Fields 
13708
13709         * delegate.cs: If we are a toplevel delegate, use our full name.
13710         If we are a nested delegate, then only use our tail name.
13711
13712 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13713
13714         * expression.cs (IsApplicable): Ensure that we add the "&" to
13715         ref/out types before comparing it with the type of the argument.
13716
13717         (IsParamsMethodApplicable): Ditto.
13718
13719         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13720         silly me ;-)
13721
13722         * delegate.cs : Handle the case when we have more than one applicable
13723         method. Flag an error only when we finish checking all.
13724
13725 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13726
13727         * expression.cs: Add support for boolean static initializers.
13728
13729 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13730
13731         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13732
13733         * parameter.cs (ComputeParameterTypes,
13734         ComputeAndDefineParameterTypes): Better error handling: now we
13735         clear the `types' cache if we fail during any of the type lookups.
13736         We also return the status code correctly to our caller
13737
13738         * delegate.cs: If we fail to define a delegate, abort the extra
13739         steps. 
13740
13741         * expression.cs (Binary.ResolveOperator): for
13742         operator==(object,object) and operator !=(object, object) we also
13743         have to verify that there is an implicit conversion from one to
13744         the other.
13745
13746         (ArrayAccess.DoResolve): Array Access can operate on
13747         non-variables. 
13748
13749 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13750
13751         * assign.cs (CompoundAssign): A new class used as a "flag" that
13752         the assignment actually is happening as part of a compound
13753         assignment operator.
13754
13755         During compound assignment, a few new rules exist to enable things
13756         like:
13757
13758         byte b |= 1 + 2
13759
13760         From the spec:
13761
13762         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13763         to the type of x) if y is implicitly convertible to the type of x,
13764         and the operator is a builtin operator and the return type of the
13765         operator is explicitly convertible to the type of x. 
13766
13767         * rootcontext.cs: Reset warning level to 2.  4 catches various
13768         "interesting" features in mcs, we must clean this up at some
13769         point, but currently am trying to kill other bugs ;-)
13770
13771         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13772         in container classes as well.  
13773
13774         * expression.cs (Binary.ResolveOperator): Handle string case
13775         before anything else (as operator overloading does emit an error
13776         before doing anything else).
13777
13778         This code could go away when we move to a table driven model, but
13779         i could not come up with a good plan last night.
13780
13781 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13782
13783         * typemanager.cs (CSharpName): reimplementation using regex.
13784         * class.cs: added null check for fields in Emit
13785         * rootcontext.cs: set warninglevel to 4
13786
13787 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13788
13789         * typemanager.cs (CSharpName): reimplemented with Lupus
13790         suggestion.
13791
13792 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13793
13794         * statement.cs (If): correclty implement Resolve, because we were
13795         not catching sem errors in there.  The same process is needed
13796         everywhere else. 
13797         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13798
13799
13800         (Statement.Warning_DeadCodeFound): Factorize code.
13801         (While): Report dead code here too.
13802
13803         (Statement): Added Resolve virtual method to allow
13804         for resolution split from the emit code.
13805
13806 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13807
13808         * statement.cs (EmitBoolExpression): No longer try to resolve the
13809         expression here.    
13810         (MakeBoolean): New utility function that resolve, implicitly
13811         converts to boolean and tags the expression. 
13812
13813
13814         (If, Do): Implement dead code elimination.
13815         (While): Implement loop inversion
13816
13817         (Do, While, For, If): Resolve the expression prior to calling our
13818         code generation.
13819
13820 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13821
13822         * class.cs:
13823           - added method Report28 (warning: program has more than one entry point)
13824           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13825           - modified method Method.Define, the part at the end of the method
13826
13827         * rootcontext.cs: added static public Location EntryPointLocation;
13828           
13829         * ../errors/cs0028.cs : Add test case for the above warning.              
13830
13831         * typemanager.cs:
13832           - modified method CSharpName to allow arrays of primitive type to
13833             be printed nicely (e.g. instead of System.Int32[][] it now prints
13834             int[][])
13835           - added method CSharpSignature: returns the signature of a method
13836             in string format to be used in reporting errors, warnings, etc.
13837
13838         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13839         with String.Empty.
13840
13841 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13842
13843         * delegate.cs (Define): Fix extremely silly bug where I was
13844         setting the type of the 'object' parameter of the BeginInvoke
13845         method to System.IAsyncResult instead of System.Object ;-)
13846
13847 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13848
13849         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13850         here. 
13851
13852         (Constructor.Emit): return if we fail to initialize the
13853         constructor.  Another door closed!  
13854
13855         * expression.cs (New.DoResolve): Improve error message (from -6 to
13856         1501).  Use DeclaredOnly lookup to find the exact constructor.
13857
13858         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13859         loop.  This is useful.
13860
13861         * cs-parser.jay: Adjust the default parameters so that destructors
13862         have the proper signature.
13863
13864 2002-04-26  Martin Baulig  <martin@gnome.org>
13865
13866         * driver.cs (LoadAssembly): If `assembly' contains any characters
13867         which are only valid in path names and not in assembly names
13868         (currently slash, backslash and point), use Assembly.LoadFrom ()
13869         instead of Assembly.Load () on the `assembly' (before iteration
13870         over the link_paths).
13871
13872 2002-04-26  Martin Baulig  <martin@gnome.org>
13873
13874         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13875
13876 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13877
13878         * class.cs (Property): use the new typemanager.MemberLookup
13879
13880         (TypeContainer.MemberLookup): Implement using the
13881         TypeManager.MemberLookup now. 
13882
13883         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13884         and return MemberInfos, so that these can be used without an
13885         EmitContext (what we had before).
13886
13887 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13888
13889         * expression.cs: Fix the case where the argument to params if the
13890         type of the params.  I omitted handling this before.   Fixed
13891
13892 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13893
13894         * driver.cs: Call BootCorlib_PopulateCoreType
13895
13896         * class.cs (Property.CheckBase): Check for properties only, not
13897         for all members. 
13898
13899         * interface.cs: Temporary hack: try/catch around the
13900         CustomAttributeBuilder, because I am getting an exception that I
13901         do not understand.
13902
13903         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13904         types whose definitions are required to be there (attributes are
13905         defined before standard types).
13906
13907         Compute definitions as we boot the various types, as they are used
13908         immediately (value_type class will need object_type, but if we do
13909         not initialize object_type, we will pass a null, which will let
13910         the runtime pick the System.Object from the existing corlib, which
13911         is not what we want).
13912
13913 2002-04-22  Patrik Torstensson <totte@labs2.com>
13914
13915         * cs-tokenizer.cs: fixed a number of trim() issues.
13916
13917 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13918
13919         * expression.cs (Argument.Type): Ensure that we return the correct
13920         type when we have out or ref parameters [in which case we 
13921         append a "&"].
13922
13923 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13924
13925         * class.cs (Property, Indexer): Allow extern modifier in there. 
13926
13927         * typemanager.cs (InitBaseTypes): Initializes object_type and
13928         value_type, since those will be used early on during the bootstrap
13929         process to compile corlib.
13930
13931         (InitCoreTypes): Move code from here to InitBaseTypes.
13932
13933 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13934
13935         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13936         single-dimension arrays as using the ldlen opcode.  
13937
13938         Daniel Lewis discovered this optimization.  
13939
13940         * typemanager.cs: Add signature for System.Array::get_Length
13941
13942 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13943
13944         * statement.cs: report the error when the foreach does not apply to an
13945         array nor a collection.
13946
13947 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
13948
13949         * expression.cs: Add implicit conversions to the operator ~.
13950
13951         * constant.cs (DecimalConstant.Emit): Emit decimal value.
13952
13953         * typemanager.cs: Locate the decimal constructor.
13954
13955 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13956
13957         * attribute.cs: use the new property of TypeOf.
13958         * expression.cs: added 'get' property around typearg.
13959
13960         These changes fix a build breaker reported by NickD. Is this the
13961         correct way to fix?  If not, please, revert my changes and make it
13962         work :-).
13963
13964 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13965
13966         * attribute.cs: Add support for typeof in attribute invocations.
13967         I am not sure that this is right though.
13968
13969 2002-04-14  Duncan Mak  <duncan@ximian.com>
13970
13971         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13972         Binary.Operator.Division case.
13973
13974 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13975
13976         * class.cs (DefineType): Ensure that we do a proper check on
13977         attribute types and also register it with the TypeManager.
13978
13979         (TypeContainer.Targets): The default for attribute types is
13980         AttributeTargets.All.
13981
13982         * attribute.cs (ApplyAttributes): Registering the attribute type
13983         is done elsewhere, not when we discover we have a Usage attribute.
13984
13985 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13986
13987         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13988         and get rid of is_delegate parameter.
13989
13990         * everywhere : update.
13991
13992 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13993
13994         * cs-parser.jay (compilation_unit): Revamp completely to use
13995         some new ideas that I got from Rhys' grammar to solve the problems
13996         with assembly level attributes.
13997
13998         (outer_declaration): New grammar production.
13999
14000         (attribute_sections): Add.
14001
14002         (opt_attributes): Base on attribute_sections
14003
14004         (namespace_declaration): Allow opt_attributes to tackle the case
14005         when we have assembly level attributes - we are clever in this
14006         regard now ;-)
14007
14008         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14009         attributes in the non-global context.
14010
14011         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14012         instead of SetGlobalAttributes.
14013
14014         * class.cs, rootcontext.cs : Ensure we define and generate 
14015         attribute types before anything else.
14016
14017         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14018         and flag the new error -20 for the case when the attribute type
14019         does not have valid targets specified. csc does not catch this.
14020
14021         * ../errors/errors.txt : update for error # -20
14022
14023 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14024
14025         * support.cs (InternalParameters.ParameterModifier): Do some null
14026         checking and return sane values.
14027
14028         * class.cs (Method.Define): If we are a PInvoke method, ensure
14029         that we are static and extern. Report error # 601
14030
14031         * ../errors/cs0601.cs : Add test case for the above error.
14032
14033 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14034
14035         * rootcontext.cs (attribute_types): We need to keep type of
14036         all attribute types separately and emit code for them first.
14037
14038         (RegisterAttribute) : Implement.
14039
14040         * class.cs (DefineType): Check if the current Type is a custom
14041         attribute type and register it accordingly.
14042
14043         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14044         adding the first attribute twice and rename to
14045
14046         (SetGlobalAttributes): this.
14047
14048         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14049         lookups.
14050
14051         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14052         if we are processing global arguments. Hmm, I am unsure of this.
14053
14054 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14055
14056         * expression.cs: added static array of strings to avoid calling
14057         Enum.ToString () for Operator in Binary. Significant recover of
14058         performance.
14059
14060 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14061
14062         * class.cs (FindMembers): Allow the Builders of the various
14063         members to be null.  If they are skip them.  This only happens
14064         during the PInvoke declaration.
14065
14066 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14067
14068         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14069         failure, so we do not keep going afterwards.
14070
14071         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14072         wanted to pass `false' as the `is_delegate' argument.  If this is
14073         the case, why not use delegate_type == null to mean `is_delegate =
14074         false' and anything else as is_delegate = true.
14075
14076 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14077
14078         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14079         code for the section, not the beginning of the tests.
14080
14081 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14082
14083         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14084
14085         * expression.cs (Binary): same.  Warn about errors where we have
14086         Enum/Enum in operator + as well.
14087
14088 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14089
14090         * statement.cs:
14091                 - added support for switch(bool)
14092                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14093                 - add TableSwitchEmit() to handle table-based switch statements
14094
14095 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14096
14097         * expression.cs (Invocation.OverloadResolve): Factor out code which
14098         does parameter compatibility checking with arguments so that we can 
14099         re-use the code even from Delegate.VerifyApplicability
14100
14101         (VerifyArgumentsCompat): Move above code here.
14102
14103         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14104         and instead make a call to the above method.
14105
14106 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14107
14108         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14109         We use it to keep track of classes which are attribute types.
14110
14111 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14112
14113         * delegate.cs (Delegate.Define): Correctly define the types in the
14114         presence of fixed and array parameters.
14115
14116         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14117         doing FindMembers.
14118
14119         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14120         include NonPublic after the first iteration.
14121
14122         * class.cs (Indexer.CheckBase): Only check if both parents are
14123         non-null. 
14124
14125         * cs-parser.jay (accessor_body): If empty, set to null.
14126
14127         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14128         same code path here to resolve constants names that we did have in
14129         MemberAccess.DoResolve.  There is too much code duplicated here.
14130
14131 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14132
14133         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14134
14135         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14136         to MakeUnionSet.
14137
14138         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14139         tokens, numbers and strings.
14140
14141         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14142         parenthesis.
14143
14144         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14145         asyncronous parameters and the regular parameters.  
14146
14147         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14148         specify the target directory.
14149
14150         * expression.cs: (This.DoResolve): Simplify
14151         (As.Emit): Optimize, do not generate IsInst if the expression is
14152         always of the given type.
14153
14154         (Is.DoResolve): Bug fix, we were reporting both always/never for
14155         the is expression.
14156
14157         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14158         creating too many unnecessary arrays.
14159
14160 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14161
14162         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14163         fields instead of rolling our own initializer.   Takes care of all
14164         implicit conversions, and drops unnecessary static checks/argument.
14165
14166 2002-03-31  Dick Porter  <dick@ximian.com>
14167
14168         * driver.cs: use the GetDirectories() return values properly, and
14169         use "/" as path separator.
14170
14171 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14172
14173         * expression.cs (Unary): Optimize - - expr into expr.
14174         (Binary): Optimize a + (-b) into a -b.
14175
14176         * codegen.cs (CodeGen): Made all methods static.
14177
14178 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14179
14180         * rootcontext.cs: 
14181
14182         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14183         TypeBuilder property.
14184
14185         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14186         instead. 
14187
14188         * tree.cs: Removed the various RecordXXXX, and replaced with a
14189         single RecordDecl.  Removed all the accessor methods, and just
14190         left a single access point Type 
14191
14192         * enum.cs: Rename DefineEnum to DefineType.
14193
14194         * decl.cs: New abstract method `DefineType' used to unify the
14195         Defines for Enumerations, Interfaces, TypeContainers and
14196         Delegates.
14197
14198         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14199         LookupBaseClasses method that used to live in class.cs and
14200         interface.cs here, and renamed to FindType.
14201
14202         * delegate.cs: Implement DefineType.  Take advantage of the
14203         refactored pattern for locating the parent builder without taking
14204         the parent_builder argument (which we know does not work if we are
14205         nested, and triggering a toplevel definition).
14206
14207 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14208
14209         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14210         accessibility of a member has changed during override and report
14211         an error if so.
14212
14213         * class.cs (Method.Define, Property.Define): Only complain on
14214         overrides if the method is private, any other accessibility is
14215         fine (and since we just checked the permission is the same, we are
14216         good to go).
14217
14218         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14219         and elif are processed always.  The other pre-processing
14220         directives are only processed if we are "taking" the path
14221
14222 2002-03-29  Martin Baulig  <martin@gnome.org>
14223
14224         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14225         current location is not Null.
14226
14227         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14228         a separate method so we can profile it.
14229
14230         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14231         `span.Seconds' are just seconds, but no minutes or hours.
14232         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14233
14234 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14235
14236         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14237         Remove the gratuitous set of Final:
14238
14239                                 // If an interface implementation, then we can set Final.
14240                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14241                                     implementing.DeclaringType.IsInterface)
14242                                         flags |= MethodAttributes.Final;
14243
14244         I do not know what I was smoking when I used that.
14245
14246
14247         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14248         step into fixing the name resolution issues for delegates and
14249         unifying the toplevel name resolution.
14250
14251 2002-03-28  Martin Baulig  <martin@gnome.org>
14252
14253         * class.cs (Method.Emit): If we have a symbol writer, call its
14254         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14255         tell it about the current method.
14256
14257         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14258         writer that we're going to emit the first byte of IL code for a new
14259         statement (a new source line).
14260         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14261         EmitContext.Mark() before emitting any code.
14262
14263         * location.cs (SymbolDocument): Return null when we're Null.
14264
14265         * statement.cs (Statement): Moved the `Location loc' variable here.
14266         (Statement.EmitBoolExpression): If we have a symbol writer, call
14267         ec.Mark() before emitting any code to tell it that we're at the
14268         beginning of a new statement.
14269         (StatementExpression): Added `Location' argument to the constructor.
14270         (Block): Added public readonly variable `StartLocation' and public
14271         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14272         (Block): Added constructor which takes a start and end location.
14273         (Block.SetEndLocation): New method. This sets the end location.
14274         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14275         local variables we create.
14276         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14277         each statement and do also mark the begin and end of the block.
14278
14279         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14280         tell it the current lexer.Location, use Location.Null for the end of the
14281         block.
14282         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14283         current block, set its end location using SetEndLocation().
14284         (statement_expression): StatementExpression constructor now takes the
14285         lexer.Location as additional argument.
14286         (for_statement, declare_local_variables): Likewise.
14287         (declare_local_variables): When creating a new implicit block, use the
14288         new Block constructor and pass it the lexer.Location.
14289
14290 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14291
14292         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14293         members also on the parent interfaces recursively.
14294
14295 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14296
14297         * report.cs: Use new formats, since Gonzalo finished the missing
14298         bits. 
14299
14300         * expression.cs (Binary.ResolveOperator): added missing operator|
14301         operator& and operator^ for bool/bool.
14302
14303         * cs-parser.jay: CheckDef now takes a Location argument that is
14304         used to report errors more precisly (instead of reporting the end
14305         of a definition, we try to track something which is a lot closer
14306         to the source of the problem).
14307
14308         * cs-tokenizer.cs: Track global token use, so we can properly flag
14309         the use of #define/#undef after the first token has been seen.
14310
14311         Also, rename the reportXXXX to Error_DescriptiveName
14312
14313         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14314         TypeContainer, so that Enum and Interface can use this too.
14315
14316         * class.cs (TypeContainer.LookupInterfaceOrClass,
14317         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14318         `builder' argument.  Typically this was used to pass the parent
14319         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14320         the definition).  
14321
14322         The problem is that a nested class could trigger the definition of
14323         a toplevel class, and the builder would be obviously wrong in that
14324         case. 
14325
14326         So we drop this argument, and we compute dynamically the
14327         TypeBuilder/ModuleBuilder (the correct information was available
14328         to us anyways from DeclSpace.Parent)
14329
14330         * interface.cs (Interface.DefineInterface): Drop builder
14331         parameter cleanup like class.cs
14332
14333         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14334         like class.cs
14335
14336         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14337         values. 
14338
14339         (Try.Emit): Propagate the returns value from the statement.
14340
14341         (Return.Emit): Even if we are leavning 
14342
14343         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14344
14345         * modifiers.cs: Fix the computation of MethodAttributes flags.
14346
14347 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14348
14349         * driver.cs: allow compilation of files that start with '/'.
14350         Add a default case when checking the argument of --target.
14351
14352 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14353
14354         * interface.cs: Implement the same search algorithm for types in
14355         the interface code.
14356
14357         * delegate.cs: Do not allow multiple definition.
14358
14359         * Recovered ChangeLog that got accidentally amputated
14360
14361         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14362
14363         * rootcontext.cs: Load manually enum to allow core classes to
14364         contain enumerations.
14365
14366         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14367         Update to new static methods in TypeManager.
14368
14369         * typemanager.cs (GetMethod, GetConstructor): Use our
14370         implementation of FindMembers to find the members, since during
14371         corlib compilation, the types are TypeBuilders and GetMethod and
14372         GetConstructor do not work.
14373
14374         Make all methods in TypeManager static.
14375
14376         (InitCodeHelpers): Split the functionality from
14377         the InitCodeTypes function.
14378
14379         * driver.cs: Call InitCodeHelpers after we have populated the
14380         types. 
14381
14382         * cs-parser.jay (delegate_declaration): we did not used to compute
14383         the delegate name correctly for void delegates.
14384
14385 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14386
14387         * rootcontext.cs (RootContext): Init the interface_resolve_order
14388         and type_container_resolve_order always.
14389
14390         (ResolveCore, BootstrapCorlib_ResolveClass,
14391         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14392         compiler when compiling with --nostdlib
14393
14394         * class.cs (TypeContainer.DefineType): Check that our parent is
14395         not null.  This test is most important when we are bootstraping
14396         the core types.
14397
14398         * codegen.cs: Split out the symbol writing code.
14399
14400 2002-03-25  Martin Baulig  <martin@gnome.org>
14401
14402         * driver.cs (-g): Made -g an alias for --debug.
14403
14404 2002-03-24  Martin Baulig  <martin@gnome.org>
14405
14406         * codegen.cs (SymbolWriter): New public variable. Returns the
14407         current symbol writer.
14408         (CodeGen): Added `bool want_debugging_support' argument to the
14409          constructor. If true, tell the ModuleBuild that we want debugging
14410         support and ask it for the ISymbolWriter.
14411         (Save): If we have a symbol writer, call it's Close() method after
14412         saving the assembly.
14413
14414         * driver.c (--debug): New command line argument to create a
14415         debugger information file.
14416
14417         * location.cs (SymbolDocument): New public property. Returns an
14418         ISymbolDocumentWriter object for the current source file or null
14419         if we don't have a symbol writer.
14420
14421 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14422
14423         * driver.cs (LoadAssembly): Correctly return when all the paths
14424         have been tried and not before.
14425
14426         * statement.cs (Switch.Emit): return the actual coverage for this
14427         statement (returns/not-returns)
14428
14429         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14430         switch of the statement if we are the last switch section.  That
14431         kills two problems: try/catch problems (we used to emit an empty
14432         nop at the end) and switch statements where all branches would
14433         return. 
14434
14435 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14436
14437         * driver.cs: Add default assemblies (the equivalent to the
14438         Microsoft CSC.RSP file)
14439
14440         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14441         also update tokens_seen and set it to false.
14442
14443         * driver.cs: Implement --recurse for Mike.
14444
14445         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14446         correctly splitting out the paths.
14447
14448 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14449
14450         * interface.cs (Interface.PopulateProperty): Instead of using
14451         `parent' as the declaration space for the set parameters, use
14452         `this' 
14453
14454         * support.cs (InternalParameters): InternalParameters constructor
14455         takes a DeclSpace instead of a TypeContainer.
14456
14457         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14458         types are being initialized, load the address of it before calling
14459         the function.  
14460
14461         (New): Provide a mechanism to disable the generation of local
14462         value type temporaries when the caller will be providing us with
14463         an address to store it.
14464
14465         (ArrayCreation.EmitDynamicInitializers): Use it.
14466
14467 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14468
14469         * expression.cs (Invocation.EmitArguments): Only probe for array
14470         property if there is more than one argument.  Sorry about that.
14471
14472         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14473         empty param arrays.
14474
14475         * class.cs (Method.LabelParameters): Fix incorrect code path that
14476         prevented the `ParamArrayAttribute' from being applied to the
14477         params attribute.
14478
14479 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14480
14481         * support.cs (ReflectionParameters): Correctly compute whether the
14482         last argument is a params array.  Fixes the problem with
14483         string.Split ('a')
14484
14485         * typemanager.cs: Make the assemblies array always be non-null
14486         (empty, but non-null)
14487
14488         * tree.cs (RecordDecl): New function that abstracts the recording
14489         of names.  This reports error 101, and provides a pointer to the
14490         previous declaration.  Fixes a crash in the compiler.
14491
14492         * cs-parser.jay (constructor_declaration): Update to new grammar,
14493         and provide a constructor_body that can be empty.
14494
14495 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14496
14497         * driver.cs: Add support for --resources.
14498
14499         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14500         Make all types for the various array helper methods be integer.
14501
14502         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14503         CheckState to ConvCast.
14504
14505         (ConvCast): Now it takes a `checked' state argument, to avoid
14506         depending on the emit context for the conversion, and just using
14507         the resolve time setting.
14508
14509         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14510         instead of Invocation.EmitArguments.  We do not emit the original
14511         arguments, instead we emit those which have been converted to
14512         unsigned int expressions.
14513
14514         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14515
14516         * codegen.cs: ditto.
14517
14518         * expression.cs (LocalVariableReference): Drop the use of the
14519         Store function that depended on the variable index.
14520
14521         * statement.cs (VariableInfo): Drop the `Idx' property from this
14522         class, as this is not taking into account the indexes for
14523         temporaries tat we generate during the execution, getting the
14524         indexes wrong.
14525
14526         * class.cs: First emit class initializers, then call the parent
14527         constructor. 
14528
14529         * expression.cs (Binary): Fix opcode emision.
14530         (UnaryMutator.EmitCode): Support checked code generation
14531
14532         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14533         matches for events for both the Static and Instance scans,
14534         pointing to the same element.   Fix that.
14535
14536 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14537
14538         * rootcontext.cs (ResolveTree): Always set the
14539         interface_resolve_order, because nested interfaces will be calling
14540         into us.
14541
14542         * class.cs (GetInterfaceOrClass): Track the same resolution
14543         process used by TypeManager.LookupType.  This fixes the nested
14544         type lookups in class declarations (separate path from
14545         LookupType). 
14546
14547         (TypeContainer.DefineType): Also define nested interfaces.
14548         (TypeContainer.RegisterOrder): New public function used to
14549         register the order in which child interfaces need to be closed.
14550
14551         Nested interfaces need to be closed after their parents have been
14552         created. 
14553
14554         * interface.cs (InterfaceAttr): Put all the logic for computing
14555         the interface attribute here. 
14556
14557         (DefineInterface): Register our interface order with the
14558         RootContext or with the TypeContainer depending on the case.
14559
14560 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14561
14562         * cs-parser.jay: rework foreach statement to work with the new
14563         changes to the policy on SimpleNames.
14564
14565         * report.cs: support Stacktrace on warnings as well.
14566
14567         * makefile: drop --unsafe and /unsafe from the compile.
14568
14569 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14570
14571         * ecore.cs (StandardConversionExists): Modify to take an Expression
14572         as the first parameter. Ensure we do null -> reference type conversion
14573         checking.
14574
14575         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14576         temporary Expression objects.
14577
14578 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14579
14580         * interface.cs: workaround bug in method overloading resolution
14581         (there is already a bugzilla bug for it).
14582
14583 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14584
14585         We could also solve this problem by having a separate path for
14586         performing type lookups, instead of DoResolve, we could have a
14587         ResolveType entry point, and only participating pieces of the
14588         production (simplename, deref, array) would implement this. 
14589
14590         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14591         signal SimpleName to only resolve type names and not attempt to
14592         resolve anything else.
14593
14594         * expression.cs (Cast): Set the flag.
14595
14596         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14597
14598         * class.cs: Only report 108 if there is no `new' modifier.
14599
14600         * cs-parser.jay: rework foreach statement to work with the new
14601         changes to the policy on SimpleNames.
14602         
14603         * report.cs: support Stacktrace on warnings as well.
14604
14605         * makefile: drop --unsafe and /unsafe from the compile.
14606
14607 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14608
14609         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14610         lookups here, instead of doing that at parse time.  This means
14611         that our grammar will not introduce `LocalVariableReferences' as
14612         expressions at this point.  That solves the problem of code like
14613         this:
14614
14615         class X {
14616            static void Main ()
14617            { int X = 1;
14618             { X x = null }}}
14619
14620         This is only half the fix.  The full fix requires parameters to
14621         also be handled in this way.
14622
14623         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14624         makes the use more obvious of the DeclSpace.  The
14625         ec.TypeContainer.TypeBuilder is now only used to pull the
14626         TypeBuilder for it.
14627
14628         My theory is that I can get rid of the TypeBuilder completely from
14629         the EmitContext, and have typecasts where it is used (from
14630         DeclSpace to where it matters).  
14631
14632         The only pending problem is that the code that implements Aliases
14633         is on TypeContainer, and probably should go in DeclSpace.
14634
14635         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14636         lookups here, instead of doing that at parse time.  This means
14637         that our grammar will not introduce `LocalVariableReferences' as
14638         expressions at this point.  That solves the problem of code like
14639         this:
14640
14641         class X {
14642            static void Main ()
14643            { int X = 1;
14644             { X x = null }}}
14645
14646         This is only half the fix.  The full fix requires parameters to
14647         also be handled in this way.
14648
14649         * class.cs (Property.DefineMethod): When implementing an interface
14650         method, set newslot, when implementing an abstract method, do not
14651         set the flag (before we tried never setting it, or always setting
14652         it, which is the difference).
14653         (Indexer.DefineMethod): same.
14654         (Method.DefineMethod): same.
14655
14656         * ecore.cs: Only set the status used flag if we get back a Field.
14657
14658         * attribute.cs: Temporary hack, so Paolo can keep working.
14659
14660 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14661
14662         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14663         the unmanaged type in the case we have a MarshalAs attribute.
14664
14665         (Resolve): Handle the case when we are parsing the special MarshalAs
14666         attribute [we need to store the unmanaged type to use later]
14667
14668         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14669         MarshalAs Attribute.
14670
14671         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14672         on parameters and accordingly set the marshalling info.
14673
14674 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14675
14676         * class.cs: Optimizing slightly by removing redundant code after
14677         we switched to the `NoTypes' return value.
14678         (Property.DefineMethod): use NoTypes here too.
14679
14680         This fixes the bug I introduced in my last batch of changes.
14681
14682 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14683
14684         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14685
14686         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14687         Enums since those are types too. 
14688
14689         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14690
14691         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14692         thanks to a call during the lookup process.
14693
14694 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14695
14696         * statement.cs (Foreach): Lots of work to accomodate a particular
14697         kind of foreach statement that I had not kept in mind.  It is
14698         possible to have foreachs on classes that provide a GetEnumerator
14699         method that return objects that implement the "pattern" for using
14700         a foreach, there is no need to support GetEnumerator
14701         specifically. 
14702
14703         This is needed to compile nant.
14704
14705         * decl.cs: Only report 114 if the member is not `Finalize' and if
14706         the warning level is at least 2.
14707
14708         * class.cs: Moved the compare function from Method to
14709         MethodSignature. 
14710
14711         (MethodSignature.InheritableMemberSignatureCompare): Add new
14712         filter function that is used to extract inheritable methods from a
14713         class. 
14714
14715         (Method.Define): Use the new `inheritable_method_signature_filter'
14716         delegate
14717
14718         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14719         command. 
14720
14721 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14722
14723         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14724
14725         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14726
14727         * expression.cs: Pass location information to
14728         ConvertImplicitStandard. 
14729
14730         * class.cs: Added debugging code to track return values from
14731         interfaces. 
14732
14733 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14734
14735         * expression.cs (Is.DoResolve): If either side of the `is' is an
14736         interface, do not flag the warning.
14737
14738         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14739         for interfaces
14740
14741         * report.cs: Allow for --fatal to be used with --probe.
14742
14743         * typemanager.cs (NoTypes): Move the definition for the empty Type
14744         array here. 
14745
14746         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14747         properties. 
14748         (TypeContainer.DefineProxy): New function used to proxy to parent
14749         implementations when implementing interfaces.
14750         (TypeContainer.ParentImplements): used to lookup if our parent
14751         implements a public function that is required by an interface.
14752         (TypeContainer.VerifyPendingMethods): Hook this up.
14753
14754         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14755         `modules' and `assemblies' arraylists into arrays.  We only grow
14756         these are the very early start up of the program, so this improves
14757         the speedof LookupType (nicely measured).
14758
14759         * expression.cs (MakeByteBlob): Replaced unsafe code with
14760         BitConverter, as suggested by Paolo.
14761
14762         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14763         folding of string concatenation, but if either side is a string,
14764         and the other is not, then return null, and let the runtime use
14765         the concatenation on the string plus the object (using
14766         `Object.ToString'). 
14767
14768 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14769
14770         Constant Folding has been implemented now.
14771
14772         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14773         the error instead on types that are not supported in one's
14774         complement. 
14775
14776         * constant.cs (Constant and all children): New set of functions to
14777         perform implict and explicit conversions.
14778
14779         * ecore.cs (EnumConstant): Implement the new functions to perform
14780         conversion by proxying to the child expression.
14781
14782         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14783         own separate setting that can not be turned off from the command
14784         line using --unchecked or --checked and is only controlled using
14785         the checked/unchecked statements and expressions.  This setting is
14786         used by the constant folder to flag errors.
14787
14788         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14789         ConstantCheckState as well.   
14790
14791         During Resolve, they also have to flag the state, because the
14792         constant folder runs completely in the Resolve phase.
14793
14794         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14795         well.
14796
14797 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14798
14799         * cfold.cs: New file, this file contains the constant folder.
14800
14801         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14802         argument to track whether we are using the resulting address to
14803         load or store a value and provide better error messages. 
14804
14805         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14806         new AddressOf arguments.
14807
14808         * statement.cs (Foreach.EmitCollectionForeach): Update
14809
14810         * expression.cs (Argument.Emit): Call AddressOf with proper
14811         arguments to track usage.
14812
14813         (New.DoEmit): Call AddressOf with new arguments.
14814
14815         (Unary.Emit): Adjust AddressOf call.
14816
14817 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14818
14819         * cs-parser.jay (member_access): Change the case for pre-defined types
14820         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14821         this suggestion.
14822
14823         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14824         a method body.
14825
14826         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14827         essentially like methods and apply attributes like MethodImplOptions to them too.
14828
14829         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14830         not being null.
14831
14832         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14833         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14834         is the DeclSpace.
14835
14836         * Update code everywhere accordingly.
14837
14838         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14839
14840         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14841
14842 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14843
14844         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14845         try performing lookups against those instead of jumping straight into using
14846         the 'using' clauses.
14847
14848         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14849
14850         (LookupType): Perform lookups in implicit parents too.
14851
14852         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14853         sequence as RootContext.LookupType. 
14854
14855         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14856         the various cases of namespace lookups into this method.
14857
14858 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14859
14860         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14861         in positional arguments)
14862
14863         * class.cs (Operator): Update the AllowedModifiers to contain
14864         extern. 
14865
14866         * cs-parser.jay: Update operator declaration to allow for the
14867         operator body to be empty.
14868
14869         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14870         values. 
14871
14872 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14873
14874         * class.cs (Method.Emit): Label parameters.
14875
14876         * driver.cs: Return 1 or 0 as the program exit code.
14877
14878 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14879
14880         * expression.cs: Special case the `null' object when trying to
14881         auto-compute the type, as anything can be explicitly converted to
14882         that. 
14883
14884         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14885         spotting this Paolo.
14886
14887         (Expression.ImplicitNumericConversion): Perform comparissions of
14888         the type using the underlying type in the case of an enumeration
14889         rather than using the enumeration type for the compare.
14890
14891         Cope with the underlying == type case, which is not possible to
14892         catch before. 
14893
14894         (Expression.ConvertNumericExplicit): Perform comparissions of
14895         the type using the underlying type in the case of an enumeration
14896         rather than using the enumeration type for the compare.
14897
14898         * driver.cs: If the user does not supply an extension, assume .exe
14899
14900         * cs-parser.jay (if_statement): Rewrote so that we can track the
14901         location for the if statement.
14902
14903         * expression.cs (Binary.ConstantFold): Only concat strings when
14904         the operation is "+", not everything ;-)
14905
14906         * statement.cs (Statement.EmitBoolExpression): Take a location
14907         argument. 
14908         (If, While, Do): Track location.
14909
14910         * expression.cs (Binary.ResolveOperator): In the object + string
14911         case, I was missing a call to ConvertImplicit
14912
14913 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14914
14915         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14916         Location arguments. Ensure we use RootContext.LookupType to do our work
14917         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14918
14919         * interface.cs (PopulateMethod): Handle the type of the parameter being
14920         null gracefully.
14921
14922         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14923         have a params method with no fixed arguments and a call is made with no
14924         arguments.
14925
14926 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14927
14928         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14929         the verbatim-string-literal
14930
14931         * support.cs (InternalParameters.ParameterModifier): handle null
14932         fixed parameters.
14933         (InternalParameters.ParameterType): ditto.
14934
14935         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14936         duplicating the name of the variable parameter.
14937         (GetParameterByName): Fix bug where we were not looking up array
14938         paramters if they were the only present (thanks Paolo!).
14939         (GetParameterInfo): We only have an empty set of types if both
14940         fixed and array are set to null.
14941         (GetParameterInfo-idx): Handle FixedParameter == null
14942
14943         * cs-parser.jay: Handle the case where there is no catch
14944         statements (missing null test).
14945
14946 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
14947
14948         * driver.cs (MainDriver): Be conservative on our command line
14949         handling.
14950
14951         Catch DirectoryNotFoundException when calling GetFiles.
14952
14953         (SplitPathAndPattern): Used to split the input specification into
14954         a path and a pattern that we can feed to Directory.GetFiles.
14955
14956 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14957
14958         * statement.cs (Fixed): Implement the last case of the Fixed
14959         statement (string handling).
14960
14961         * expression.cs (StringPtr): New class used to return a char * to
14962         a string;  Used by the Fixed statement.
14963
14964         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14965
14966         * expression.cs (Binary.ResolveOperator): Remove redundant
14967         MemberLookup pn parent type.
14968         Optimize union call, we do not need a union if the types are the same.
14969         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14970         type.
14971
14972         Specialize the use of MemberLookup everywhere, instead of using
14973         the default settings. 
14974
14975         (StackAlloc): Implement stackalloc keyword.
14976
14977         * cs-parser.jay: Add rule to parse stackalloc.
14978
14979         * driver.cs: Handle /h, /help, /?
14980
14981         * expression.cs (MakeByteBlob): Removed the hacks we had in place
14982         before we supported unsafe code.
14983
14984         * makefile: add --unsafe to the self compilation of mcs.
14985
14986 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
14987
14988         * expression.cs (PointerArithmetic): New class that is used to
14989         perform pointer arithmetic.
14990         (Binary.Resolve): Handle pointer arithmetic
14991         Handle pointer comparission.
14992         (ArrayPtr): Utility expression class that is used to take the
14993         address of an array.
14994
14995         (ElementAccess): Implement array access for pointers
14996
14997         * statement.cs (Fixed): Implement fixed statement for arrays, we
14998         are missing one more case before we are done.
14999
15000         * expression.cs (Indirection): Implement EmitAssign and set the
15001         ExprClass to Variable.  This allows pointer dereferences to be
15002         treated as variables, and to have values assigned to them.
15003
15004         * ecore.cs (Expression.StoreFromPtr): New utility function to
15005         store values dereferencing.
15006
15007 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15008
15009         * expression.cs (Binary.ResolveOperator): Ensure that we are
15010         not trying to operate on a void type - this fixes the reported
15011         bug.
15012
15013         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15014         the parent implementation is sealed.
15015
15016         * ../errors/cs0239.cs : Add.
15017
15018         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15019
15020         * typemanager.cs (unverifiable_code_type): Corresponds to 
15021         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15022         which have unsafe code in them.
15023
15024         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15025         unsafe context.
15026
15027 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15028
15029         * cs-tokenizer.cs: Add support for @"litreal strings"
15030
15031         Make tokenizer accept pre-processor directives
15032         on any column (remove the old C-like limitation). 
15033
15034         * rootcontext.cs (EmitCode): Emit any global attributes.
15035         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15036
15037         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15038
15039         * cs-parser.jay: Add support for global attributes.  
15040
15041 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * expression.cs (Indirection): New helper class.  Unary will
15044         create Indirection classes to be able to implement the
15045         IMemoryLocation interface on it.
15046
15047 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15048
15049         * cs-parser.jay (fixed_statement): reference the right statement.
15050
15051         * statement.cs (Fixed.Emit): Finish implementing the fixed
15052         statement for the &x case.
15053
15054 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15055
15056         * class.cs (Property.Define, Method.Define): Remove newslot when
15057         `implementing'.  
15058
15059         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15060         wrong.  NewSlot should only be used if the `new' keyword is present.
15061
15062         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15063         locating our system dir.  Sorry about this.
15064
15065 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15066
15067         * driver.cs (GetSystemDir): Compute correctly the location of our
15068         system assemblies.  I was using the compiler directory instead of
15069         the library directory.
15070
15071 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15072
15073         * expression.cs (BetterFunction): Put back in what Miguel commented out
15074         since it is the correct fix. The problem is elsewhere ;-)
15075
15076         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15077         parameters of the parms method are themselves compatible or not !
15078
15079         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15080         to check that a class implements an interface before saying that an implicit
15081         conversion was allowed. Use ImplementsInterface to do the checking.
15082
15083 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15084
15085         * class.cs (Method.Define): Track whether we are an explicit
15086         implementation or not.  And only call DefineMethodOverride if we
15087         are an explicit implementation.
15088
15089         (Property.DefineMethod): Ditto.
15090
15091 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15092
15093         * expression.cs (BetterFunction): Catch hideous bug which was
15094          preventing us from detecting ambiguous calls due to implicit casts i.e
15095         cs0121.
15096
15097 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15098
15099         * support.cs (Pair): Remove un-needed method.  I figured why I was
15100         getting the error in cs-parser.jay, the variable in a foreach loop
15101         is readonly, and the compiler does not really treat this as a variable.
15102
15103         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15104         instead of EQUALS in grammar.  
15105
15106         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15107
15108         * expression.cs (Unary.DoResolve): Check whether the argument is
15109         managed or not.
15110
15111 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15112
15113         * support.cs: Api for Pair to set a value.  Despite the fact that
15114         the variables are public the MS C# compiler refuses to compile
15115         code that accesses the field if the variable is part of a foreach
15116         statement. 
15117
15118         * statement.cs (Fixed): Begin implementation of the fixed
15119         statement.
15120
15121         (Block.AddVariable): Return the VariableInfo on success and null
15122         on failure instead of true/false. 
15123
15124         * cs-parser.jay (foreach): Catch errors on variables already
15125         defined (we were ignoring this value before) and properly unwind
15126         the block hierarchy
15127
15128         (fixed_statement): grammar for the fixed statement.
15129
15130 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15131
15132         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15133         pointer types to be incretemented.
15134
15135         (SizeOf): Implement.
15136
15137         * cs-parser.jay (pointer_member_access): Implement
15138         expr->IDENTIFIER production.
15139
15140         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15141         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15142         on safe contexts.
15143
15144         (Unary): Implement indirection.
15145
15146         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15147         use in non-unsafe context).
15148
15149         (SimpleName.DoResolve): Check for pointers in field access on safe
15150         contexts. 
15151
15152         (Expression.LoadFromPtr): Factor the load-indirect code in this
15153         function.  This was duplicated in UnboxCast and ParameterReference
15154
15155 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15156
15157         * expression.cs (ComposedCast): report an error if a pointer cast
15158         is used in a safe region.
15159
15160         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15161         pointer type casts in unsafe context.
15162
15163         * codegen.cs (EmitContext): Set up IsUnsafe.
15164
15165         * cs-parser.jay (non_expression_type): Add productions for pointer
15166         casts. 
15167
15168         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15169         code.  We should not use force into static mode if the method is
15170         not virtual.  Fixes bug in MIS
15171
15172         * statement.cs (Do.Emit, While.Emit, For.Emit,
15173         Statement.EmitBoolExpression): Add support to Do and While to
15174         propagate infinite loop as `I do return' semantics.
15175
15176         Improve the For case to also test for boolean constants.
15177
15178         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15179         to the list of attributes we can add.
15180
15181         Remove `EmitContext' argument.
15182
15183         * class.cs (Method.Define): Apply parameter attributes.
15184         (Constructor.Define): Apply parameter attributes.
15185         (MethodCore.LabelParameters): Move here the core of labeling
15186         parameters. 
15187
15188         * support.cs (ReflectionParameters.ParameterModifier,
15189         InternalParameters.ParameterModifier): Use IsByRef on the type and
15190         only return the OUT bit for these parameters instead of in/out/ref
15191         flags.
15192
15193         This is because I miss-understood things.  The ParameterInfo.IsIn
15194         and IsOut represent whether the parameter has the [In] and [Out]
15195         attributes set.  
15196
15197 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15198
15199         * ecore.cs (FieldExpr.Emit): Release temporaries.
15200
15201         * assign.cs (LocalTemporary.Release): new function.
15202
15203         * codegen.cs (EmitContext.GetTemporaryStorage,
15204         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15205         temporary storage.  Now we can "put back" localbuilders when we
15206         are done with them
15207
15208 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15209
15210         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15211         need to make a copy of the variable to generate verifiable code.
15212
15213 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15214
15215         * driver.cs: Compute dynamically the system directory.
15216
15217         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15218         Slower, but more generally useful.  Used by the abstract
15219         registering implementation. 
15220
15221         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15222         the rules for the special rule on Type/instances.  First check if
15223         we have the same name, and if so, try that special static path
15224         rather than the instance path.
15225
15226 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15227
15228         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15229         for, while and if.
15230
15231         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15232         Enum, ValueType, Delegate or Array for non-corlib compiles.
15233
15234         * cs-tokenizer.cs: Catch long identifiers (645)
15235
15236         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15237         piece of code.
15238
15239         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15240         fix, we were returning too early, so we were not registering
15241         pending methods from abstract classes.
15242
15243         Do not register pending methods if the class is abstract.
15244
15245         * expression.cs (Conditional.DoResolve): Report circular implicit
15246         conversions when we neecd to compute it for conditional
15247         expressions. 
15248
15249         (Is.DoResolve): If the expression is always of the provided type,
15250         flag warning 183.  If the expression can not ever be of the
15251         provided type flag warning 184.
15252
15253         * class.cs: Catch 169 as well.
15254
15255         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15256         read. 
15257
15258 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15259
15260         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15261
15262 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15263
15264         * interface.cs: (PopulateMethod): Check for pointers being defined
15265         only if the unsafe context is active.
15266         (PopulateProperty): ditto.
15267         (PopulateIndexer): ditto.
15268
15269         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15270         specified.  If pointers are present, make sure that they are
15271         present in an unsafe context.
15272         (Constructor, Constructor.Define): ditto.
15273         (Field, Field.Define): ditto.
15274         (Property, Property.Define): ditto.
15275         (Event, Event.Define): ditto.
15276
15277         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15278         hashtable if there are classes or structs defined.
15279
15280         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15281         code, as the constant resolution moved.
15282
15283         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15284         the metadata, so we can flag error 133. 
15285
15286         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15287         pointer is being declared in an unsafe context.
15288
15289 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15290
15291         * modifiers.cs (Modifiers.Check): Require a Location argument.
15292         Report error 227 for Unsafe use.
15293
15294         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15295
15296         * statement.cs (For.Emit): If the test is null, then report that
15297         we do `return', as we wont reach anything afterwards.
15298
15299         (Switch.SwitchGoverningType): Track the expression that matched
15300         the conversion.
15301
15302         * driver.cs: Allow negative numbers as an error code to flag.
15303
15304         * cs-parser.jay: Handle 1551.
15305
15306         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15307
15308 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15309
15310         * cs-parser.jay: Report 1518 (type declaration can only contain
15311         class, struct, interface, enum or delegate)
15312
15313         (switch_label): Report 1523 (keywords `case' or `default' must
15314         preced code)
15315
15316         (opt_switch_sections): Report 1522 (empty switch)
15317
15318         * driver.cs: Report 1515 (response file specified multiple times)
15319         Report 1516 (Source file specified multiple times).
15320
15321         * expression.cs (Argument.Resolve): Signal 1510
15322
15323         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15324         access not allowed in static code)
15325
15326 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15327
15328         * typemanager.cs (IsPointerType): Utility method which we are going
15329         to need a lot.
15330
15331         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15332         the object type, so we take care of that.
15333
15334         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15335
15336         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15337         added to non-params parameters :-)
15338
15339         * typemanager.cs (CSharpName): Include 'void' type too. 
15340
15341         (void_ptr_type): Include in the set of core types.
15342
15343         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15344         duplicating code.
15345
15346         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15347         an unsafe context.
15348
15349         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15350         completely forgotten about it.
15351
15352 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15353
15354         * cs-parser.jay (pointer_type): Add. This begins our implementation
15355         of parsing rules for unsafe code.
15356
15357         (unsafe_statement): Implement.
15358
15359         (embedded_statement): Modify to include the above.
15360
15361         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15362
15363         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15364         if the current context is an unsafe one.
15365
15366         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15367         are handled differently, we need separate rules for them.
15368
15369         (local_variable_declaration): Update to use local_variable_pointer_type
15370         to allow variable declarations of unmanaged pointer types.
15371
15372         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15373         in unsafe contexts.
15374
15375         * ../errors/cs0214.cs : Add.
15376
15377 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15378
15379         * makefile: remove 'response' file when cleaning.
15380
15381 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15382
15383         * cs-parser.jay: Report 1524.
15384
15385 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15386
15387         * typemanager.cs (RegisterMethod): drop checking if we have
15388         registered this from here
15389
15390 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15391
15392         * class.cs (Method.EmitDestructor): Implement calling our base
15393         destructor. 
15394
15395         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15396         value of InFinally.
15397
15398         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15399         this routine and will wrap the call in a try/catch block.  Deal
15400         with the case.
15401
15402 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15403
15404         * ecore.cs (Expression.MemberLookup): instead of taking a
15405         parameter `same_type' that was used to tell whether we could
15406         access private members we compute our containing type from the
15407         EmitContext.
15408
15409         (FieldExpr): Added partial support for volatile fields.  This does
15410         not work for volatile fields exposed from assemblies, as I can not
15411         figure out how to extract the modreq from it.
15412
15413         Updated all the source files to use this.
15414
15415         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15416         because it is referenced by MemberLookup very often. 
15417
15418 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15419
15420         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15421         TypeBuilder.GetCustomAttributes to retrieve what we need.
15422
15423         Get rid of redundant default_member_attr_type as this is the same as
15424         default_member_type which already exists.
15425
15426         * interface.cs, attribute.cs : Update accordingly.
15427
15428 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15429
15430         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15431         work for TYpeBuilders though.  Ravi, can you please fix this?
15432
15433         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15434
15435         * expression.cs (Argument.Emit): Handle the case of ref objects
15436         being passed to ref functions;  
15437
15438         (ParameterReference.EmitLoad): Loads the content of the pointer
15439         without dereferencing.
15440
15441 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15442
15443         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15444
15445 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15446
15447         * class.cs (Indexer.DefineMethod): Incorporate the interface
15448         type in the name of the method if we are doing explicit interface
15449         implementation.
15450
15451         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15452
15453         (BetterConversion): Fix extremely trivial bug where we were referring to
15454         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15455         again !
15456
15457         * ../errors/bug16.cs : Add although we have fixed it.
15458
15459 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15460
15461         * expression.cs (BaseIndexer): Begin implementation.
15462
15463         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15464
15465         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15466         production directly to remove a shift/reduce, and implement
15467         explicit interface implementation.
15468
15469         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15470         after a floating point suffix.
15471
15472         * expression.cs (DoNumericPromotions): Improved the conversion for
15473         uint/uint.  If we have a constant, we avoid doing a typecast to a
15474         larger type.
15475
15476         * class.cs (Indexer): Implement explicit interface implementation
15477         for indexers.
15478
15479 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15480
15481         * class.cs: make the default instance constructor public and hidebysig.
15482
15483 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15484
15485         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15486         so we can call it from elsewhere.
15487
15488         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15489         we emit it internally if the class has a defined indexer; otherwise the user
15490         emits it by decorating the class definition with the DefaultMemberAttribute.
15491
15492         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15493         attribute is not used on a type which defines an indexer.
15494
15495         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15496         character when we skip whitespace.
15497
15498         * ../errors/cs0646.cs : Add.
15499
15500 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15501
15502         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15503         again. 
15504
15505         * makefile: Add practical target `mcs3.exe' which builds the third
15506         generation compiler. 
15507
15508         * expression.cs (New): Fix structures constructor calling.
15509
15510         * class.cs (Property, Method, Indexer): Emit Final flag on the
15511         method if we are an interface implementation and we are not
15512         abstract. 
15513
15514         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15515         whether this property is referencing a `base' method.
15516
15517         * expression.cs (Invocation.EmitCall): take an extra argument:
15518         is_base, this is used to determine whether the `call' or
15519         `callvirt' opcode should be used.
15520
15521
15522         * delegate.cs: update EmitCall.
15523
15524         * class.cs (Method.Define): Set NewSlot for the cases where we are
15525         not implementing an interface method.
15526
15527         (Property.Define): ditto.
15528
15529 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15530
15531         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15532         'r'.  Allows mcs to parse itself fully.
15533
15534 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15535
15536         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15537         of the number of initializers that require the InitializeArray method.
15538
15539         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15540         update the above field where necessary.
15541
15542         (MakeByteBlob): Update accordingly.
15543
15544         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15545         greater than 2.
15546
15547         (EmitDynamicInitializers): Update in accordance with the new optimization.
15548
15549         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15550         same OpCode applies.
15551
15552         * cs-parser.jay : Fix some glaring errors I introduced.
15553
15554 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15555
15556         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15557         so that we can check for name clashes there too.
15558
15559         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15560         for interface indexers.
15561
15562         * interfaces.cs (Define): Emit the default member attribute.
15563
15564         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15565         variable was being referred to while setting the value ;-)
15566
15567 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15568
15569         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15570         byte-by-byte information when we know the data is zero.
15571
15572         Make the block always a multiple of 4, because
15573         DefineInitializedData has a bug.
15574
15575         * assign.cs: Fix, we should assign from the temporary, not from
15576         the source. 
15577
15578         * expression.cs (MakeByteBlob): Fix my incorrect code.
15579
15580 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15581
15582         * typemanager.cs (EnumToUnderlying): This function is used to get
15583         the underlying type from an enumeration, because it does not
15584         always work. 
15585
15586         * constant.cs: Use the I4_S form for values between -128 and 127.
15587
15588         * statement.cs (Block.LookupLabel): Looks up a label.
15589         (Block): Drop support for labeled blocks.
15590
15591         (LabeledStatement): New kind of statement that represents a label
15592         only.
15593
15594         (Goto): Finally implement this bad boy.
15595
15596         * cs-parser.jay: Update to reflect new mechanism to implement
15597         labels.
15598
15599 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15600
15601         * codegen.cs (EmitContext.This): a codegen property that keeps the
15602         a single instance of this instead of creating many different this
15603         instances. 
15604
15605         * delegate.cs (Delegate.DoResolve): Update to use the property;
15606
15607         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15608
15609         * expression.cs (BaseAccess.DoResolve): Ditto.
15610
15611 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15612
15613         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15614         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15615
15616         (InitCoreTypes): Update accordingly.
15617
15618         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15619         so we can quickly store the state.
15620
15621         (ApplyAttributes): Set the correct implementation flags
15622         for InternalCall methods.
15623
15624 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15625
15626         * expression.cs (EmitCall): if a method is not virtual, then do
15627         not use callvirt on it.
15628
15629         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15630         user defined stuff) requires the use of stobj, which takes an
15631         address on the stack instead of an array and an index.  So emit
15632         the Ldelema operation for it.
15633
15634         (EmitStoreOpcode): Use stobj for valuetypes.
15635
15636         (UnaryMutator.EmitCode): Use the right 1 value depending on
15637         whether we are dealing with int64/uint64, float or doubles.
15638
15639         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15640         constructors that I implemented last night.
15641
15642         (Constructor.IsDefault): Fix to work properly for static
15643         constructors.
15644
15645         * cs-parser.jay (CheckDef): report method signature errors.
15646         Update error number 103 to be 132.
15647
15648         * decl.cs: New AdditionResult enumeration value: MethodExists.
15649         Although we do this check for methods later on in the semantic
15650         analysis, catching repeated default constructors is so easy that
15651         we catch these here. 
15652
15653         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15654         promotions code.
15655
15656         (ParameterReference.EmitAssign, Emit): handle
15657         bools as bytes.
15658
15659         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15660         (ArrayAccess.EmitStoreOpcode): ditto.
15661
15662         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15663
15664         * expression.cs (MakeByteBlob): Complete all the missing types
15665         (uint, short, ushort, byte, sbyte)
15666
15667         * class.cs: Only init instance field initializers on instance
15668         constructors. 
15669
15670         Rename `constructors' to instance_constructors. 
15671
15672         (TypeContainer.AddConstructor): Only add constructors to the list
15673         if it is not static.
15674
15675         Make sure that we handle default_static_constructor independently
15676         everywhere where we handle instance_constructors
15677
15678 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15679
15680         * class.cs: Do not lookup or create a base initializer for a
15681         static constructor.
15682
15683         (ConstructorInitializer.Resolve): use the proper type to lookup
15684         for constructors.
15685
15686         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15687
15688         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15689         in DeclSpace. 
15690
15691         * decl.cs: CloseType is now an virtual method, the default
15692         implementation just closes this type.
15693
15694 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15695
15696         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15697         to PreserveSig by default. Also emit HideBySig on such methods.
15698
15699         Basically, set the defaults to standard values.
15700
15701         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15702         argument, if candidate is better, it can't be worse than the best !
15703
15704         (Invocation): Re-write bits to differentiate between methods being
15705         applicable in their expanded form and their normal form - for params
15706         methods of course.
15707
15708         Get rid of use_standard everywhere as only standard conversions are allowed
15709         in overload resolution. 
15710
15711         More spec conformance.
15712
15713 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15714
15715         * driver.cs: Add --timestamp, to see where the compiler spends
15716         most of its time.
15717
15718         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15719         `this' in static code.
15720
15721         (SimpleName.DoResolve): Implement in terms of a helper function
15722         that allows static-references to be passed upstream to
15723         MemberAccess.
15724
15725         (Expression.ResolveWithSimpleName): Resolve specially simple
15726         names when called by MemberAccess to implement the special
15727         semantics. 
15728
15729         (Expression.ImplicitReferenceConversion): Handle conversions from
15730         Null to reference types before others, as Null's type is
15731         System.Object. 
15732
15733         * expression.cs (Invocation.EmitCall): Handle the special case of
15734         calling methods declared on a reference type from a ValueType
15735         (Base classes System.Object and System.Enum)
15736
15737         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15738         the left hand side is a TypeExpr, not on every enumeration. 
15739
15740         (Binary.Resolve): If types are reference types, then do a cast to
15741         object on operators != and == of both arguments.
15742
15743         * typemanager.cs (FindMembers): Extract instance and static
15744         members if requested.
15745
15746         * interface.cs (PopulateProperty): Use void_type instead of null
15747         as the return type for the setter method.
15748
15749         (PopulateIndexer): ditto.
15750
15751 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15752
15753         * support.cs (ReflectionParameters): Fix minor bug where we
15754         were examining the wrong parameter for the ParamArray attribute.
15755
15756         Cope with requests for the type of the parameter at position
15757         greater than the params parameter's. We now return the element
15758         type of the params array as that makes more sense.
15759
15760         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15761         accordingly as we no longer have to extract the element type
15762         ourselves.
15763
15764         (Invocation.OverloadResolve): Update.
15765
15766 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15767
15768         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15769         against IEnumerator, test whether the return value is a descendant
15770         of the IEnumerator interface.
15771
15772         * class.cs (Indexer.Define): Use an auxiliary method to implement
15773         the other bits of the method definition.  Begin support for
15774         explicit interface implementation.
15775
15776         (Property.DefineMethod): Use TypeManager.void_type instead of null
15777         for an empty return value.
15778
15779 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15780
15781         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15782         dealing with a FieldExpr which is composed of a FieldBuilder, in
15783         the code path we did extract the constant, but we should have
15784         obtained the underlying value to be able to cast it (otherwise we
15785         end up in an infinite loop, this is what Ravi was running into).
15786
15787         (ArrayCreation.UpdateIndices): Arrays might be empty.
15788
15789         (MemberAccess.ResolveMemberAccess): Add support for section
15790         14.5.4.1 that deals with the special case of E.I when E is a type
15791         and something else, that I can be a reference to a static member.
15792
15793         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15794         handle a particular array type to create byte blobs, it is just
15795         something we dont generate byteblobs for.
15796
15797         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15798         arguments. 
15799
15800         * location.cs (Push): remove the key from the hashtable that we
15801         are about to add.   This happens for empty files.
15802
15803         * driver.cs: Dispose files after we have parsed them.
15804
15805         (tokenize): new function that only runs the tokenizer on its
15806         input, for speed testing.
15807
15808 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15809
15810         * class.cs (Event.Define): Define the private field only if there
15811         are no accessors defined.
15812
15813         * expression.cs (ResolveMemberAccess): If there is no associated
15814         field with the event, that means we have an event defined with its
15815         own accessors and we should flag error cs0070 since transforming
15816         ourselves into a field is not valid in that case.
15817
15818         * ecore.cs (SimpleName.DoResolve): Same as above.
15819
15820         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15821         and charset to sane values.
15822
15823 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15824
15825         * assign.cs (DoResolve): Perform check on events only if they 
15826         are being accessed outside the declaring type.
15827
15828         * cs-parser.jay (event_declarations): Update rules to correctly
15829         set the type of the implicit parameter etc.
15830
15831         (add_accessor, remove_accessor): Set current local parameters.
15832
15833         * expression.cs (Binary): For delegate addition and subtraction,
15834         cast the return value from the method into the appropriate delegate
15835         type.
15836
15837 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15838
15839         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15840         of these as the workaround is unnecessary.
15841
15842         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15843         delegate data - none of that is needed at all.
15844
15845         Re-write bits to extract the instance expression and the delegate method
15846         correctly.
15847
15848         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15849         on delegates too.
15850
15851         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15852         of attaching attributes instead of duplicating code everywhere.
15853
15854         * everywhere : Update code to do attribute emission using the above method.
15855
15856 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15857
15858         * expression.cs (IsParamsMethodApplicable): if there are not
15859         parameters, return immediately.
15860
15861         * ecore.cs: The 0 literal can be implicity converted to an enum
15862         type. 
15863
15864         (SimpleName.DoResolve): First lookup the type, then lookup the
15865         members. 
15866
15867         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15868         want to get its address.  If the InstanceExpression is not
15869         addressable, store the result in a temporary variable, then get
15870         the address of it.
15871
15872         * codegen.cs: Only display 219 errors on warning level or above. 
15873
15874         * expression.cs (ArrayAccess): Make it implement the
15875         IMemoryLocation interface.
15876
15877         (Binary.DoResolve): handle the operator == (object a, object b)
15878         and operator != (object a, object b) without incurring into a
15879         BoxedCast (because 5 != o should never be performed).
15880
15881         Handle binary enumerator operators.
15882
15883         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15884         value type, otherwise use Ldelem_ref.
15885
15886         Use precomputed names;
15887
15888         (AddressOf): Implement address of
15889
15890         * cs-parser.jay (labeled_statement): Fix recursive block
15891         addition by reworking the production.
15892
15893         * expression.cs (New.DoEmit): New has a special case:
15894                 
15895                  If we are dealing with a ValueType, we have a few
15896                  situations to deal with:
15897                 
15898                     * The target of New is a ValueType variable, that is
15899                       easy, we just pass this as the variable reference
15900                 
15901                     * The target of New is being passed as an argument,
15902                       to a boxing operation or a function that takes a
15903                       ValueType.
15904                 
15905                       In this case, we need to create a temporary variable
15906                       that is the argument of New.
15907
15908
15909 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15910
15911         * rootcontext.cs (LookupType): Check that current_type is not null before
15912         going about looking at nested types.
15913
15914         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15915         not implement the IAssignMethod interface any more.
15916
15917         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15918         where we tranform them into FieldExprs if they are being resolved from within
15919         the declaring type.
15920
15921         * ecore.cs (SimpleName.DoResolve): Do the same here.
15922
15923         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15924
15925         * ../errors/bug10.cs : Add.
15926
15927         * ../errors/cs0070.cs : Add.
15928
15929         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15930
15931         * assign.cs : Get rid of EventIsLocal everywhere.
15932
15933 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15934
15935         * ecore.cs (ConvertIntLiteral): finished the implementation.
15936
15937         * statement.cs (SwitchLabel): Convert the value we are using as a
15938         key before looking up the table.
15939
15940 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15941
15942         * codegen.cs (EmitTopBlock): Require a Location argument now.
15943
15944         * cs-parser.jay (constructor_declarator): We need to setup
15945         current_local_parameters before we parse the
15946         opt_constructor_initializer, to allow the variables to be bound
15947         to the constructor arguments.
15948
15949         * rootcontext.cs (LookupType): First lookup nested classes in our
15950         class and our parents before we go looking outside our class.
15951
15952         * expression.cs (ConstantFold): Extract/debox the values at the
15953         beginnning. 
15954
15955         * rootcontext.cs (EmitCode): Resolve the constants first before we
15956         resolve the types.  This is not really needed, but it helps debugging.
15957
15958         * statement.cs: report location.
15959
15960         * cs-parser.jay: pass location to throw statement.
15961
15962         * driver.cs: Small bug fix.
15963
15964         * report.cs: Updated format to be 4-zero filled digits.
15965
15966 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15967
15968         * expression.cs (CheckIndices): Fix minor bug where the wrong
15969         variable was being referred to ;-)
15970
15971         (DoEmit): Do not call EmitStaticInitializers when the 
15972         underlying type is System.Object.
15973
15974 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15975
15976         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15977         and do the usual workaround for SRE.
15978
15979         * class.cs (MyEventBuilder.EventType): New member to get at the type
15980         of the event, quickly.
15981
15982         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15983
15984         * assign.cs (Assign.DoResolve): Handle the case when the target
15985         is an EventExpr and perform the necessary checks.
15986
15987         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15988         interface.
15989
15990         (SimpleName.MemberStaticCheck): Include check for EventExpr.
15991
15992         (EventExpr): Set the type in the constructor itself since we 
15993         are meant to be born fully resolved.
15994
15995         (EventExpr.Define): Revert code I wrote earlier.
15996                 
15997         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
15998         instance expression is null. The instance expression is a This in that case
15999         or a null, depending on whether it is a static method or not.
16000
16001         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16002         refers to more than one method.
16003
16004         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16005         and accordingly flag errors.
16006
16007 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16008
16009         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16010
16011 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16012
16013         * location.cs (ToString): Provide useful rutine.
16014
16015 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16016
16017         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16018         objects, return the actual integral boxed.
16019
16020         * statement.cs (SwitchLabel): define an ILLabel for each
16021         SwitchLabel. 
16022
16023         (Switch.CheckSwitch): If the value is a Literal, extract
16024         the underlying literal.
16025
16026         Also in the unused hashtable we had, add the SwitchLabel so we can
16027         quickly look this value up.
16028
16029         * constant.cs: Implement a bunch of new constants.  Rewrite
16030         Literal based on this.  Made changes everywhere to adapt to this.
16031
16032         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16033         dereferencing array only once, and also copes with enumrations.
16034
16035         bytes are two bytes wide, not one.
16036
16037         (Cast): Perform constant conversions.
16038
16039         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16040         wrappers to the literals here.
16041
16042         * expression.cs (DoNumericPromotions): long literals can converted
16043         to ulong implicity (this is taken care of elsewhere, but I was
16044         missing this spot).
16045
16046         * ecore.cs (Expression.Literalize): Make the return type Literal,
16047         to improve type checking.
16048
16049         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16050
16051 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16052
16053         * literal.cs: Revert code from ravi that checked the bounds.  The
16054         bounds are sane by the definition of the type itself. 
16055
16056         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16057         need to actually look up in our parent hierarchy for interfaces
16058         implemented. 
16059
16060         * const.cs: Use the underlying type for enumerations
16061
16062         * delegate.cs: Compute the basename for the delegate creation,
16063         that should fix the delegate test case, and restore the correct
16064         Type Lookup semantics in rootcontext
16065
16066         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16067         referencing a nested type with the Reflection API is using the "+"
16068         sign. 
16069
16070         * cs-parser.jay: Do not require EOF token at the end.
16071
16072 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16073
16074         * rootcontext.cs (LookupType): Concatenate type names with
16075         a '.' instead of a '+' The test suite passes again.
16076
16077         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16078         field of the enumeration.
16079
16080         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16081         the case when the member is an EventExpr.
16082
16083         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16084         static has an associated instance expression.
16085
16086         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16087
16088         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16089
16090         * class.cs (Event.Define): Register event and perform appropriate checks
16091         for error #111.
16092
16093         We define the Add and Remove methods even if the use provides none because
16094         in that case, we provide default implementations ourselves.
16095
16096         Define a private field of the type of the event. This is done by the CSC compiler
16097         and we should be doing it too ;-)
16098
16099         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16100         More methods we use in code we generate.
16101
16102         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16103         is important.
16104
16105         (InitCoreTypes): Update accordingly for the above.
16106
16107         * class.cs (Event.Emit): Generate code for default accessors that we provide
16108
16109         (EmitDefaultMethod): Do the job in the above.
16110
16111         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16112         appropriate place.
16113
16114 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16115
16116         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16117         builders even if we were missing one.
16118
16119         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16120         pass the Basename as our class name instead of the Name.  The
16121         basename will be correctly composed for us.
16122
16123         * parameter.cs (Paramters): Now takes a Location argument.
16124
16125         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16126         make all the code call directly LookupType in RootContext and take
16127         this chance to pass the Location information everywhere.
16128
16129         * Everywhere: pass Location information.
16130
16131 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16132
16133         * class.cs (Constructor.Define): Updated way of detecting the
16134         length of the parameters.
16135
16136         (TypeContainer.DefineType): Use basename as the type name for
16137         nested types.
16138
16139         (TypeContainer.Define): Do not recursively define types here, as
16140         definition is taken care in order by the RootContext.
16141
16142         * tree.cs: Keep track of namespaces in a per-file basis.
16143
16144         * parameter.cs (Parameter.ComputeSignature): Update to use
16145         DeclSpace. 
16146
16147         (Parameters.GetSignature): ditto.
16148
16149         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16150         instead of a TypeContainer.
16151
16152         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16153         resolve names.  Because we need to be resolve in our context, not
16154         our parents.
16155
16156         * driver.cs: Implement response files.
16157
16158         * class.cs (TypeContainer.DefineType): If we are defined, do not
16159         redefine ourselves.
16160
16161         (Event.Emit): Emit the code for add/remove handlers.
16162         (Event.Define): Save the MethodBuilders for add/remove.
16163
16164         * typemanager.cs: Use pair here too.
16165
16166         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16167         DictionaryEntry requires the first argument to be non-null.  
16168
16169         (enum_declaration): Compute full name for registering the
16170         enumeration.
16171
16172         (delegate_declaration): Instead of using
16173         formal_parameter_list, use opt_formal_parameter_list as the list
16174         can be empty.
16175
16176         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16177         (EventParsing): New property that controls whether `add' and
16178         `remove' are returned as tokens or identifiers (for events);
16179
16180 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16181
16182         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16183         use MyEventBuilder only and let it wrap the real builder for us.
16184
16185         (MyEventBuilder): Revamp constructor etc.
16186
16187         Implement all operations that we perform on EventBuilder in precisely the same
16188         way here too.
16189
16190         (FindMembers): Update to use the EventBuilder member.
16191
16192         (Event.Emit): Update accordingly.
16193
16194 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16195
16196         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16197         by calling the appropriate methods.
16198
16199         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16200         useful.
16201
16202         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16203
16204 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16205
16206         * delegate.cs (Delegate.Populate): Check that the return type
16207         and various parameters types are indeed accessible.
16208
16209         * class.cs (Constructor.Define): Same here.
16210
16211         (Field.Define): Ditto.
16212
16213         (Event.Define): Ditto.
16214
16215         (Operator.Define): Check that the underlying Method defined itself
16216         correctly - so it's MethodBuilder should not be null.
16217
16218         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16219         expression happens to be null.
16220
16221         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16222         members but as of now we don't seem to be able to do anything really useful with it.
16223
16224         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16225         not the EventBuilder.
16226
16227 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16228
16229         * cs-tokenizer.cs: Add support for defines.
16230         Add support for #if, #elif, #else, #endif
16231
16232         (eval_var): evaluates a variable.
16233         (eval): stubbed for evaluating functions.
16234
16235         * cs-parser.jay: Pass the defines information
16236
16237         * driver.cs: Add --define command line option.
16238
16239         * decl.cs: Move MemberCore here.
16240
16241         Make it the base class for DeclSpace.  This allows us to catch and
16242         report 108 and 109 for everything now.
16243
16244         * class.cs (TypeContainer.Define): Extract all the members
16245         before populating and emit the warning 108 (new keyword required
16246         to override) instead of having each member implement this.
16247
16248         (MemberCore.Define): New abstract method, we will be using this in
16249         the warning reporting engine in Populate.
16250
16251         (Operator.Define): Adjust to new MemberCore protocol. 
16252
16253         * const.cs (Const): This does not derive from Expression, it is a
16254         temporary object we use to create fields, it is a MemberCore. 
16255
16256         * class.cs (Method.Define): Allow the entry point to be in a
16257         specific class.
16258
16259         * driver.cs: Rewrite the argument handler to clean it up a bit.
16260
16261         * rootcontext.cs: Made it just an auxiliary namespace feature by
16262         making everything static.
16263
16264         * driver.cs: Adapt code to use RootContext type name instead of
16265         instance variable.
16266
16267         * delegate.cs: Remove RootContext argument.
16268
16269         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16270         argument. 
16271
16272         * class.cs (Event.Define): The lookup can fail.
16273
16274         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16275
16276         * expression.cs: Resolve the this instance before invoking the code.
16277
16278 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16279
16280         * cs-parser.jay: Add a production in element_access that allows
16281         the thing to become a "type" reference.  This way we can parse
16282         things like "(string [])" as a type.
16283
16284         Note that this still does not handle the more complex rules of
16285         casts. 
16286
16287
16288         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16289
16290         * ecore.cs: (CopyNewMethods): new utility function used to
16291         assemble the list of methods from running FindMembers.
16292
16293         (MemberLookup): Rework FindMembers so that 
16294
16295 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16296
16297         * class.cs (TypeContainer): Remove Delegates who fail to be
16298         defined.
16299
16300         * delegate.cs (Populate): Verify that we dont get null return
16301         values.   TODO: Check for AsAccessible.
16302
16303         * cs-parser.jay: Use basename to emit error 574 (destructor should
16304         have the same name as container class), not the full name.
16305
16306         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16307         possible representation.  
16308
16309         Also implements integer type suffixes U and L.
16310
16311 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16312
16313         * expression.cs (ArrayCreation.DoResolve): We need to do the
16314         argument resolution *always*.
16315
16316         * decl.cs: Make this hold the namespace.  Hold the root context as
16317         well.
16318         (LookupType): Move here.
16319
16320         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16321
16322         * location.cs (Row, Name): Fixed the code, it was always returning
16323         references to the first file.
16324
16325         * interface.cs: Register properties defined through interfaces.
16326
16327         * driver.cs: Add support for globbing on the command line
16328
16329         * class.cs (Field): Make it derive from MemberCore as well.
16330         (Event): ditto.
16331
16332 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16333
16334         * class.cs (Event::Define): Check that the type of the event is a delegate
16335         type else flag error #66.
16336
16337         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16338         same.
16339
16340         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16341         values of EntryPoint, CharSet etc etc.
16342
16343         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16344
16345         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16346         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16347         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16348         which needs this to do its work.
16349
16350         * ../errors/cs0066.cs : Add.
16351
16352 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16353
16354         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16355         helper functions.
16356
16357         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16358         clears out the parameters field.
16359         (MemberSignatureCompare): Cleanup
16360
16361         (MemberCore): New base class used to share code between MethodCore
16362         and Property.
16363
16364         (RegisterRequiredImplementations) BindingFlags.Public requires
16365         either BindingFlags.Instace or Static.  Use instance here.
16366
16367         (Property): Refactored code to cope better with the full spec.
16368
16369         * parameter.cs (GetParameterInfo): Return an empty array instead
16370         of null on error.
16371
16372         * class.cs (Property): Abstract or extern properties have no bodies.
16373
16374         * parameter.cs (GetParameterInfo): return a zero-sized array.
16375
16376         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16377         method modifier validation to the typecontainer so we can reuse
16378         this on properties.
16379
16380         (MethodCore.ParameterTypes): return an empty sized array of types.
16381
16382         (Property.Define): Test property modifier validity.
16383
16384         Add tests for sealed/override too.
16385
16386         (Method.Emit): abstract or extern methods have no bodies.
16387
16388 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16389
16390         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16391         thing.
16392
16393         (Method::Define, ::Emit): Modify accordingly.
16394
16395         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16396
16397         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16398
16399         * makefile: Pass in /unsafe.
16400
16401 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16402
16403         * class.cs (MakeKey): Kill routine.
16404
16405         * class.cs (TypeContainer.Define): Correctly define explicit
16406         method implementations (they require the full interface name plus
16407         the method name).
16408
16409         * typemanager.cs: Deply the PtrHashtable here and stop using the
16410         lame keys.  Things work so much better.
16411
16412         This of course broke everyone who depended on `RegisterMethod' to
16413         do the `test for existance' test.  This has to be done elsewhere.
16414
16415         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16416         the object stupid Equals method (because, that like fails all over
16417         the place).  We still do not use it.
16418
16419         * class.cs (TypeContainer.SetRequiredInterface,
16420         TypeContainer.RequireMethods): Killed these two routines and moved
16421         all the functionality to RegisterRequiredImplementations.
16422
16423         (TypeContainer.RegisterRequiredImplementations): This routine now
16424         registers all the implementations required in an array for the
16425         interfaces and abstract methods.  We use an array of structures
16426         which can be computed ahead of time to reduce memory usage and we
16427         also assume that lookups are cheap as most classes will not
16428         implement too many interfaces.
16429
16430         We also avoid creating too many MethodSignatures.
16431
16432         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16433         clear the "pending" bit if we find that there are problems with
16434         the declaration.
16435
16436         (TypeContainer.VerifyPendingMethods): Update to report errors of
16437         methods that look like implementations but are not.
16438
16439         (TypeContainer.Define): Add support for explicit interface method
16440         implementation. 
16441
16442 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16443
16444         * typemanager.cs: Keep track of the parameters here instead of
16445         being a feature of the TypeContainer.
16446
16447         * class.cs: Drop the registration of parameters here, as
16448         InterfaceMethods are also interface declarations.
16449
16450         * delegate.cs: Register methods with the TypeManager not only with
16451         the TypeContainer.  This code was buggy.
16452
16453         * interface.cs: Full registation here.
16454
16455 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16456
16457         * expression.cs: Remove reducer for binary expressions, it can not
16458         be done this way.
16459
16460         * const.cs: Put here the code that used to go into constant.cs
16461
16462         * constant.cs: Put here the code for constants, this is a new base
16463         class for Literals.
16464
16465         * literal.cs: Make Literal derive from Constant.
16466
16467 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16468
16469         * statement.cs (Return.Emit): Report error 157 if the user
16470         attempts to return from a finally block.
16471
16472         (Return.Emit): Instead of emitting a return, jump to the end of
16473         the function.
16474
16475         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16476         LocalBuilder to store the result of the function.  ReturnLabel is
16477         the target where we jump.
16478
16479
16480 2001-12-09  Radek Doulik  <rodo@ximian.com>
16481
16482         * cs-parser.jay: remember alias in current namespace
16483
16484         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16485         namespaces
16486
16487         * class.cs (LookupAlias): lookup alias in my_namespace
16488
16489         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16490         aliases hashtable
16491         (LookupAlias): lookup alias in this and if needed in parent
16492         namespaces
16493
16494 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16495
16496         * support.cs: 
16497
16498         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16499         making things static.  I need this to avoid passing the
16500         TypeContainer when calling ParameterType.
16501
16502         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16503         that did string manipulation to compute the type and then call
16504         GetType.  Use Parameter.ParameterType instead.
16505
16506         * cs-tokenizer.cs: Consume the suffix for floating values.
16507
16508         * expression.cs (ParameterReference): figure out whether this is a
16509         reference parameter or not.  Kill an extra variable by computing
16510         the arg_idx during emission.
16511
16512         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16513         function that returns whether a parameter is an out/ref value or not.
16514
16515         (Parameter.ParameterType): The type of the parameter (base,
16516         without ref/out applied).
16517
16518         (Parameter.Resolve): Perform resolution here.
16519         (Parameter.ExternalType): The full type (with ref/out applied).
16520
16521         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16522         support for expressions on the using statement.
16523
16524 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16525
16526         * statement.cs (Using.EmitLocalVariableDecls): Split the
16527         localvariable handling of the using statement.
16528
16529         (Block.EmitMeta): Keep track of variable count across blocks.  We
16530         were reusing slots on separate branches of blocks.
16531
16532         (Try.Emit): Emit the general code block, we were not emitting it. 
16533
16534         Check the type of the declaration to be an IDisposable or
16535         something that can be implicity converted to it. 
16536
16537         Emit conversions if required.
16538
16539         * ecore.cs (EmptyExpression): New utility class.
16540         (Expression.ImplicitConversionExists): New utility function.
16541
16542 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16543
16544         * statement.cs (Using): Implement.
16545
16546         * expression.cs (LocalVariableReference): Support read only variables.
16547
16548         * statement.cs: Remove the explicit emit for the Leave opcode.
16549         (VariableInfo): Add a readonly field.
16550
16551 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16552
16553         * ecore.cs (ConvCast): new class used to encapsulate the various
16554         explicit integer conversions that works in both checked and
16555         unchecked contexts.
16556
16557         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16558         properly generate the overflow opcodes.
16559
16560 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16561
16562         * statement.cs: The correct type for the EmptyExpression is the
16563         element_type, not the variable type.  Ravi pointed this out.
16564
16565 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16566
16567         * class.cs (Method::Define): Handle PInvoke methods specially
16568         by using DefinePInvokeMethod instead of the usual one.
16569
16570         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16571         above to do the task of extracting information and defining the method.
16572
16573 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16574
16575         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16576         of the condition for string type.
16577
16578         (Emit): Move that here. 
16579
16580         (ArrayCreation::CheckIndices): Keep string literals in their expression
16581         form.
16582
16583         (EmitDynamicInitializers): Handle strings appropriately.
16584
16585 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16586
16587         * codegen.cs (EmitContext): Replace multiple variables with a
16588         single pointer to the current Switch statement.
16589
16590         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16591         EmitContext.
16592
16593 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16594
16595         * statement.cs 
16596
16597         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16598         default'.
16599
16600         (Foreach.Emit): Foreach on arrays was not setting
16601         up the loop variables (for break/continue).
16602
16603         (GotoCase): Semi-implented.
16604
16605 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16606
16607         * attribute.cs (CheckAttribute): Handle system attributes by using
16608         Attribute.GetAttributes to examine information we need.
16609
16610         (GetValidPlaces): Same here.
16611
16612         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16613
16614         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16615
16616         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16617
16618         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16619
16620         (Method::Emit): Handle the case when we are a PInvoke method.
16621
16622 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16623
16624         * expression.cs: Use ResolveWithSimpleName on compound names.
16625
16626 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16627
16628         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16629         before trying to reduce it.
16630
16631         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16632
16633         * constant.cs (LookupConstantValue): Implement.
16634
16635         (EmitConstant): Use the above in emitting the constant.
16636
16637         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16638         that are user-defined by doing a LookupConstantValue on them.
16639
16640         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16641         too, like above.
16642
16643 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16644
16645         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16646
16647         (BaseAccess.DoResolve): Implement.
16648
16649         (MemberAccess.DoResolve): Split this routine into a
16650         ResolveMemberAccess routine that can be used independently
16651
16652 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16653
16654         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16655         As that share bits of the implementation.  Is returns a boolean,
16656         while As returns the Type that is being probed.
16657
16658 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16659
16660         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16661         instead of a Literal - much easier.
16662
16663         (EnumInTransit): Remove - utterly useless :-)
16664
16665         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16666
16667         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16668
16669         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16670         chain when we have no associated expression.
16671
16672 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16673
16674         * constant.cs (Define): Use Location while reporting the errror.
16675
16676         Also emit a warning when 'new' is used and there is no inherited
16677         member to hide.
16678
16679         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16680         populated.
16681
16682         (LookupEnumValue): Implement to lookup an enum member's value and define it
16683         if necessary.
16684
16685         (Populate): Re-write accordingly to use the above routine.
16686
16687 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16688
16689         * expression.cs (This): Fix prototype for DoResolveLValue to
16690         override the base class DoResolveLValue.
16691
16692         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16693         declarations) 
16694
16695         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16696         (we need to load the address of the field here).  This fixes
16697         test-22. 
16698
16699         (FieldExpr.DoResolveLValue): Call the DoResolve
16700         function to initialize the Instance expression.
16701
16702         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16703         correctly the GetEnumerator operation on a value type.
16704
16705         * cs-parser.jay: Add more simple parsing error catches.
16706
16707         * statement.cs (Switch): Add support for string switches.
16708         Handle null specially.
16709
16710         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16711
16712 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16713
16714         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16715
16716         (declare_local_constant): New helper function.
16717
16718         * statement.cs (AddConstant): Keep a separate record of constants
16719
16720         (IsConstant): Implement to determine if a variable is a constant.
16721
16722         (GetConstantExpression): Implement.
16723
16724         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16725
16726         * statement.cs (IsVariableDefined): Re-write.
16727
16728 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16729
16730         * class.cs (TypeContainer::FindMembers): Look for constants
16731         in the case when we are looking for MemberTypes.Field
16732
16733         * expression.cs (MemberAccess::DoResolve): Check that in the
16734         case we are a FieldExpr and a Literal, we are not being accessed
16735         by an instance reference.
16736
16737         * cs-parser.jay (local_constant_declaration): Implement.
16738
16739         (declaration_statement): Implement for constant declarations.
16740
16741 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16742
16743         * statement.cs (Switch): Catch double defaults.
16744
16745         (Switch): More work on the switch() statement
16746         implementation.  It works for integral values now, need to finish
16747         string support.
16748
16749
16750 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16751
16752         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16753         integer literals into other integer literals.  To be used by
16754         switch. 
16755
16756 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16757
16758         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16759         some memory.
16760
16761         (EmitDynamicInitializers): Cope with the above since we extract data
16762         directly from ArrayData now.
16763
16764         (ExpectInitializers): Keep track of whether initializers are mandatory
16765         or not.
16766
16767         (Bounds): Make it a hashtable to prevent the same dimension being 
16768         recorded for every element in that dimension.
16769
16770         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16771         from being found.
16772
16773         Also fix bug which was causing the indices to be emitted in the reverse
16774         order.
16775
16776 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16777
16778         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16779         unfinished.  They do not work, because the underlying code is
16780         sloppy.
16781
16782 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16783
16784         * cs-parser.jay: Remove bogus fixme.
16785
16786         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16787         on Switch statement.
16788
16789 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16790
16791         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16792         the same. 
16793
16794         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16795         parameter. Apparently, any expression is allowed. 
16796
16797         (ValidateInitializers): Update accordingly.
16798
16799         (CheckIndices): Fix some tricky bugs thanks to recursion.
16800
16801         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16802         I was being completely brain-dead.
16803
16804         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16805         and re-write acordingly.
16806
16807         (DelegateInvocation): Re-write accordingly.
16808
16809         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16810
16811         (MakeByteBlob): Handle types more correctly.
16812
16813         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16814         initialization from expressions but it is incomplete because I am a complete
16815         Dodo :-|
16816
16817 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16818
16819         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16820         on If.  Basically, we have to return `true' (ie, we do return to
16821         our caller) only if both branches of the if return.
16822
16823         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16824         short-circuit operators, handle them as short circuit operators. 
16825
16826         (Cast.DoResolve): Resolve type.
16827         (Cast.Cast): Take an expression as the target type.
16828
16829         * cs-parser.jay (cast_expression): Remove old hack that only
16830         allowed a limited set of types to be handled.  Now we take a
16831         unary_expression and we resolve to a type during semantic
16832         analysis.
16833
16834         Use the grammar productions from Rhys to handle casts (this is
16835         not complete like Rhys syntax yet, we fail to handle that corner
16836         case that C# has regarding (-x), but we will get there.
16837
16838 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16839
16840         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16841         field which is an array type.
16842
16843         * cs-parser.jay (declare_local_variables): Support array initialization too.
16844
16845         * typemanager.cs (MakeKey): Implement.
16846
16847         (everywhere): Use the above appropriately.
16848
16849         * cs-parser.jay (for_statement): Update for array initialization while
16850         declaring variables.
16851
16852         * ecore.cs : The error message was correct, it's the variable's names that
16853         were misleading ;-) Make the code more readable.
16854
16855         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16856         the correct type etc.
16857
16858         (ConvertExplicit): Handle Enum types by examining the underlying type.
16859
16860 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16861
16862         * parameter.cs (GetCallingConvention): Always return
16863         CallingConventions.Standard for now.
16864
16865 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16866
16867         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16868         and `r' after calling DoNumericPromotions.
16869
16870         * ecore.cs: Fix error message (the types were in the wrong order).
16871
16872         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16873         BindingFlags.Instance as well 
16874
16875         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16876         implicit int literal conversion in an empty cast so that we
16877         propagate the right type upstream.
16878
16879         (UnboxCast): new class used to unbox value types.
16880         (Expression.ConvertExplicit): Add explicit type conversions done
16881         by unboxing.
16882
16883         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16884         the target type before applying the implicit LongLiterals to ULong
16885         literal cast.
16886
16887 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16888
16889         * cs-parser.jay (for_statement): Reworked the way For works: now
16890         we declare manually any variables that are introduced in
16891         for_initializer to solve the problem of having out-of-band code
16892         emition (that is what got for broken).
16893
16894         (declaration_statement): Perform the actual variable declaration
16895         that used to be done in local_variable_declaration here.
16896
16897         (local_variable_declaration): Do not declare anything, just pass
16898         the information on a DictionaryEntry
16899
16900 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16901
16902         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16903         re-write of the logic to now make it recursive.
16904
16905         (UpdateIndices): Re-write accordingly.
16906
16907         Store element data in a separate ArrayData list in the above methods.
16908
16909         (MakeByteBlob): Implement to dump the array data into a byte array.
16910
16911 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16912
16913         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16914         into CheckIndices.
16915
16916         * constant.cs (Define): Implement.
16917
16918         (EmitConstant): Re-write fully.
16919
16920         Pass in location info.
16921
16922         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16923         respectively.
16924
16925         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16926         DictionaryEntry since we need location info too.
16927
16928         (constant_declaration): Update accordingly.
16929
16930         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16931         code into another method : UpdateIndices.
16932
16933 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16934
16935         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16936         some type checking etc.
16937
16938 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16939
16940         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16941         bits to provide dimension info if the user skips doing that.
16942
16943         Update second constructor to store the rank correctly.
16944
16945 2001-11-16  Ravi Pratap  <ravi@ximian.com>
16946
16947         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16948         and try to implement.
16949
16950         * ../errors/cs0150.cs : Add.
16951
16952         * ../errors/cs0178.cs : Add.
16953
16954 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16955
16956         * statement.cs: Implement foreach on multi-dimensional arrays. 
16957
16958         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16959         name of the params argument.
16960
16961         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16962         initializing the array.
16963
16964         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16965         we can use this elsewhere.
16966
16967         * statement.cs: Finish implementation of foreach for single
16968         dimension arrays.
16969
16970         * cs-parser.jay: Use an out-of-band stack to pass information
16971         around, I wonder why I need this.
16972
16973         foreach_block: Make the new foreach_block the current_block.
16974
16975         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16976         function used to return a static Parameters structure.  Used for
16977         empty parameters, as those are created very frequently.
16978
16979         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16980
16981 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16982
16983         * interface.cs : Default modifier is private, not public. The
16984         make verify test passes again.
16985
16986 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16987
16988         * support.cs (ReflectionParameters): Fix logic to determine
16989         whether the last parameter is a params one. Test 9 passes again.
16990
16991         * delegate.cs (Populate): Register the builders we define with
16992         RegisterParameterForBuilder. Test 19 passes again.
16993
16994         * cs-parser.jay (property_declaration): Reference $6 instead
16995         of $$ to get at the location.
16996
16997         (indexer_declaration): Similar stuff.
16998
16999         (attribute): Ditto.
17000
17001         * class.cs (Property): Register parameters for the Get and Set methods
17002         if they exist. Test 23 passes again.
17003
17004         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17005         call to EmitArguments as we are sure there aren't any params arguments. 
17006         Test 32 passes again.
17007
17008         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17009         IndexOutOfRangeException. 
17010
17011         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17012         Test 33 now passes again.
17013
17014 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17015
17016         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17017         broke a bunch of things.  Will have to come up with a better way
17018         of tracking locations.
17019
17020         * statement.cs: Implemented foreach for single dimension arrays.
17021
17022 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17023
17024         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17025         an error.  This removes the lookup from the critical path.
17026
17027         * cs-parser.jay: Removed use of temporary_loc, which is completely
17028         broken. 
17029
17030 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17031
17032         * support.cs (ReflectionParameters.ParameterModifier): Report
17033         whether the argument is a PARAMS argument or not.
17034
17035         * class.cs: Set the attribute `ParamArrayAttribute' on the
17036         parameter argument.
17037
17038         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17039         and cons_param_array_attribute (ConstructorInfo for
17040         ParamArrayAttribute)., 
17041
17042         * codegen.cs: Emit the return using the `Return' statement, that
17043         way we can report the error correctly for missing return values. 
17044
17045         * class.cs (Method.Emit): Clean up.
17046
17047         * expression.cs (Argument.Resolve): Take another argument: the
17048         location where this argument is used.  Notice that this is not
17049         part of the "Argument" class as to reduce the size of the
17050         structure (we know the approximate location anyways).
17051
17052         Test if the argument is a variable-reference, if not, then
17053         complain with a 206.
17054
17055         (Argument.Emit): Emit addresses of variables.
17056
17057         (Argument.FullDesc): Simplify.
17058
17059         (Invocation.DoResolve): Update for Argument.Resolve.
17060
17061         (ElementAccess.DoResolve): ditto.
17062
17063         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17064         method should be virtual, as this method is always virtual.
17065
17066         (NewDelegate.DoResolve): Update for Argument.Resolve.
17067
17068         * class.cs (ConstructorInitializer.DoResolve): ditto.
17069
17070         * attribute.cs (Attribute.Resolve): ditto.
17071
17072 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17073
17074         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17075
17076         * expression.cs (ParameterReference): Drop IStackStorage and implement
17077         IAssignMethod instead. 
17078
17079         (LocalVariableReference): ditto.
17080
17081         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17082         IAssignMethod instead. 
17083
17084 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17085
17086         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17087         enumerations that are used in heavily used structures derive from
17088         byte in a laughable and pathetic attempt to reduce memory usage.
17089         This is the kind of pre-optimzations that you should not do at
17090         home without adult supervision.
17091
17092         * expression.cs (UnaryMutator): New class, used to handle ++ and
17093         -- separatedly from the other unary operators.  Cleans up the
17094         code, and kills the ExpressionStatement dependency in Unary.
17095
17096         (Unary): Removed `method' and `Arguments' from this class, making
17097         it smaller, and moving it all to SimpleCall, so I can reuse this
17098         code in other locations and avoid creating a lot of transient data
17099         strucutres when not required.
17100
17101         * cs-parser.jay: Adjust for new changes.
17102
17103 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17104
17105         * enum.cs (Enum.Populate): If there is a failure during
17106         definition, return
17107
17108         * cs-parser.jay (opt_enum_base): we used to catch type errors
17109         here, but this is really incorrect.  The type error should be
17110         catched during semantic analysis.
17111
17112 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17113
17114         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17115         current_local_parameters as expected since I, in my stupidity, had forgotten
17116         to do this :-)
17117
17118         * attribute.cs (GetValidPlaces): Fix stupid bug.
17119
17120         * class.cs (Method::Emit): Perform check on applicability of attributes.
17121
17122         (Constructor::Emit): Ditto.
17123
17124         (Field::Emit): Ditto.
17125
17126         (Field.Location): Store location information.
17127
17128         (Property, Event, Indexer, Operator): Ditto.
17129
17130         * cs-parser.jay (field_declaration): Pass in location for each field.
17131
17132         * ../errors/cs0592.cs : Add.
17133
17134 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17135
17136         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17137
17138         (InitCoreTypes): Update accordingly.
17139
17140         (RegisterAttrType, LookupAttr): Implement.
17141
17142         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17143         info about the same.
17144
17145         (Resolve): Update to populate the above as necessary.
17146
17147         (Error592): Helper.
17148
17149         (GetValidPlaces): Helper to the above.
17150
17151         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17152
17153         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17154
17155 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17156
17157         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17158
17159         * ../errors/cs0617.cs : Add.
17160
17161 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17162
17163         * enum.cs (Emit): Rename to Populate to be more consistent with what
17164         we expect it to do and when exactly it is called.
17165
17166         * class.cs, rootcontext.cs : Update accordingly.
17167
17168         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17169         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17170
17171         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17172
17173         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17174         of a fieldinfo using the above, when dealing with a FieldBuilder.
17175
17176 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17177
17178         * ../errors/cs0031.cs : Add.
17179
17180         * ../errors/cs1008.cs : Add.
17181
17182         * ../errrors/cs0543.cs : Add.
17183
17184         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17185         enum type.
17186
17187         (FindMembers): Implement.
17188
17189         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17190         enums and delegates too.
17191
17192         (enum_types): Rename to builder_to_enum.
17193
17194         (delegate_types): Rename to builder_to_delegate.
17195
17196         * delegate.cs (FindMembers): Implement.
17197
17198 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17199
17200         * typemanager.cs (IsEnumType): Implement.
17201
17202         * enum.cs (Emit): Re-write parts to account for the underlying type
17203         better and perform checking etc.
17204
17205         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17206         of the underlying type.
17207
17208         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17209         value
17210
17211         * enum.cs (error31): Helper to report error #31.
17212
17213         * cs-parser.jay (enum_declaration): Store location of each member too.
17214
17215         * enum.cs (member_to_location): New hashtable. 
17216
17217         (AddEnumMember): Update location hashtable.
17218
17219         (Emit): Use the location of each member while reporting errors.
17220
17221 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17222
17223         * cs-parser.jay: A for_initializer if is a
17224         local_variable_declaration really ammount to have an implicit
17225         block with the variable declaration and no initializer for for.
17226
17227         * statement.cs (For.Emit): Cope with null initializers.
17228
17229         This fixes the infinite loop on for initializers.
17230
17231 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17232
17233         * enum.cs: More cleanup.
17234
17235         * ecore.cs: Remove dead code.
17236
17237         * class.cs (Property.Emit): More simplification.
17238         (Event.Emit): ditto.
17239
17240         Reworked to have less levels of indentation.
17241
17242 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17243
17244         * class.cs (Property): Emit attributes.
17245
17246         (Field): Ditto.
17247
17248         (Event): Ditto.
17249
17250         (Indexer): Ditto.
17251
17252         (Operator): Ditto.
17253
17254         * enum.cs (Emit): Ditto.
17255
17256         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17257         Enums too.
17258
17259         * class.cs (Field, Event, etc.): Move attribute generation into the
17260         Emit method everywhere.
17261
17262         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17263         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17264         as we had no way of defining nested enums !
17265
17266         * rootcontext.cs : Adjust code accordingly.
17267
17268         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17269
17270 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17271
17272         * expression.cs (EvalConstantExpression): Move into ecore.cs
17273
17274         * enum.cs (Enum): Rename some members and make them public and readonly
17275         according to our convention.
17276
17277         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17278         nothing else.
17279
17280         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17281
17282         (Enum::Emit): Write a simple version for now which doesn't try to compute
17283         expressions. I shall modify this to be more robust in just a while.
17284
17285         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17286
17287         (TypeContainer::CloseType): Create the Enum types too.
17288
17289         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17290
17291         * expression.cs (EvalConstantExpression): Get rid of completely.
17292
17293         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17294         user-defined values and other cases.
17295
17296         (IsValidEnumLiteral): Helper function.
17297
17298         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17299         out there in the case we had a literal FieldExpr.
17300
17301         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17302
17303         (Literalize): Revamp a bit to take two arguments.
17304
17305         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17306
17307 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17308
17309         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17310
17311         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17312
17313         (Resolve): Use the above to ensure we have proper initializers.
17314
17315 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17316
17317         * expression.cs (Expression::EvalConstantExpression): New method to 
17318         evaluate constant expressions.
17319
17320         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17321
17322 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17323
17324         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17325         in an array.
17326
17327         (Binary.ResolveOperator): Handle operator != (object a, object b)
17328         and operator == (object a, object b);
17329
17330         (Binary.DoNumericPromotions): Indicate whether the numeric
17331         promotion was possible.
17332
17333         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17334         Implement.  
17335
17336         Made the ArrayAccess implement interface IAssignMethod instead of
17337         IStackStore as the order in which arguments are passed reflects
17338         this.
17339
17340         * assign.cs: Instead of using expr.ExprClass to select the way of
17341         assinging, probe for the IStackStore/IAssignMethod interfaces.
17342
17343         * typemanager.cs: Load InitializeArray definition.
17344
17345         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17346         static data that can be used to initialize arrays. 
17347
17348 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17349
17350         * expression.cs: Handle operator== and operator!= for booleans.
17351
17352         (Conditioal.Reduce): Implement reducer for the ?: operator.
17353
17354         (Conditional.Resolve): Implement dead code elimination.
17355
17356         (Binary.Resolve): Catch string literals and return a new
17357         concatenated string.
17358
17359         (Unary.Reduce): Implement reduction of unary expressions.
17360
17361         * ecore.cs: Split out the expression core handling here.
17362
17363         (Expression.Reduce): New method used to perform constant folding
17364         and CSE.  This is needed to support constant-expressions. 
17365
17366         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17367         targets, and optimize for !x.
17368
17369 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17370
17371         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17372         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17373         set custom atttributes.
17374
17375         * literal.cs (Literal::GetValue): New abstract method to return the actual
17376         value of the literal, cast as an object.
17377
17378         (*Literal): Implement GetValue method.
17379
17380         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17381         expressions to the arraylist but objects of type Argument.
17382
17383         * class.cs (TypeContainer::Emit): Emit our attributes too.
17384
17385         (Method::Emit, Constructor::Emit): Ditto.
17386
17387         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17388         to be ignoring earlier.
17389
17390 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17391
17392         * attribute.cs (AttributeSection::Define): Implement to do the business
17393         of constructing a CustomAttributeBuilder.
17394
17395         (Attribute): New trivial class. Increases readability of code.  
17396
17397         * cs-parser.jay : Update accordingly.
17398
17399         (positional_argument_list, named_argument_list, named_argument): New rules
17400
17401         (attribute_arguments): Use the above so that we are more correct.
17402
17403 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17404
17405         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17406         to perform all checks for a method with a params parameter.
17407
17408         (Invocation::OverloadResolve): Update to use the above method and therefore
17409         cope correctly with params method invocations.
17410
17411         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17412         params too.
17413
17414         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17415         constructors in our parent too because we can't afford to miss out on 
17416         protected ones ;-)
17417
17418         * attribute.cs (AttributeSection): New name for the class Attribute
17419
17420         Other trivial changes to improve readability.
17421
17422         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17423         use the new class names.
17424
17425 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17426
17427         * class.cs (Method::Define): Complete definition for params types too
17428
17429         (Indexer::Define): Ditto.
17430
17431         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17432         Cope everywhere with a request for info about the array parameter.
17433
17434 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17435
17436         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17437
17438         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17439         local_variable_type to extract the string corresponding to the type.
17440
17441         (local_variable_type): Fixup the action to use the new helper method.
17442
17443         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17444         go.
17445
17446         * expression.cs : Clean out code which uses the above.
17447
17448 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17449
17450         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17451         and bale out if necessary by returning a false.
17452
17453         (RegisterProperty): Ditto.
17454
17455         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17456         and print out appropriate error messages.
17457
17458         * interface.cs (everywhere): Ditto.
17459
17460         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17461         location to constructor.
17462
17463         * class.cs (Property, Event, Indexer): Update accordingly.
17464
17465         * ../errors/cs111.cs : Added.
17466
17467         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17468         of a method, as laid down by the spec.
17469
17470         (Invocation::OverloadResolve): Use the above method.
17471
17472 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17473
17474         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17475         now take a TypeContainer and a Parameters object.
17476
17477         (ParameterData): Modify return type of ParameterModifier method to be 
17478         Parameter.Modifier and not a string.
17479
17480         (ReflectionParameters, InternalParameters): Update accordingly.
17481
17482         * expression.cs (Argument::GetParameterModifier): Same here.
17483
17484         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17485         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17486         symbol in it at all so maybe this is only for now.
17487
17488 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17489
17490         * support.cs (InternalParameters): Constructor now takes an extra argument 
17491         which is the actual Parameters class.
17492
17493         (ParameterDesc): Update to provide info on ref/out modifiers.
17494
17495         * class.cs (everywhere): Update call to InternalParameters to pass in
17496         the second argument too.
17497
17498         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17499         to return the modifier info [ref/out etc]
17500
17501         (InternalParameters, ReflectionParameters): Implement the above.
17502
17503         * expression.cs (Argument::ParameterModifier): Similar function to return
17504         info about the argument's modifiers.
17505
17506         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17507         too.
17508
17509         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17510         a new SetFormalParameters object which we pass to InternalParameters.
17511
17512 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17513
17514         * expression.cs (NewArray): Merge into the ArrayCreation class.
17515
17516 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17517
17518         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17519         NewUserdefinedArray into one as there wasn't much of a use in having
17520         two separate ones.
17521
17522         * expression.cs (Argument): Change field's name to ArgType from Type.
17523
17524         (Type): New readonly property which returns the proper type, taking into 
17525         account ref/out modifiers.
17526
17527         (everywhere): Adjust code accordingly for the above.
17528
17529         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17530         whether we are emitting for a ref or out parameter.
17531
17532         * expression.cs (Argument::Emit): Use the above field to set the state.
17533
17534         (LocalVariableReference::Emit): Update to honour the flag and emit the
17535         right stuff.
17536
17537         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17538
17539         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17540
17541         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17542
17543         (ReflectionParameters, InternalParameters): Implement the above method.
17544
17545         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17546         reporting errors.
17547
17548         (Invocation::FullMethodDesc): Ditto. 
17549
17550 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17551
17552         * cs-parser.jay: Add extra production for the second form of array
17553         creation. 
17554
17555         * expression.cs (ArrayCreation): Update to reflect the above
17556         change. 
17557
17558         * Small changes to prepare for Array initialization.
17559
17560 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * typemanager.cs (ImplementsInterface): interface might be null;
17563         Deal with this problem;
17564
17565         Also, we do store negative hits on the cache (null values), so use
17566         this instead of calling t.GetInterfaces on the type everytime.
17567
17568 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17569
17570         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17571
17572         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17573         split functionality out into different classes.
17574
17575         (New::FormArrayType): Move into NewBuiltinArray.
17576
17577         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17578         quite useless.
17579
17580         (NewBuiltinArray): New class to handle creation of built-in arrays.
17581
17582         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17583         account creation of one-dimensional arrays.
17584
17585         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17586
17587         (NewUserdefinedArray::DoResolve): Implement.
17588
17589         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17590
17591         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17592         we maintain inside the TypeManager. This is necessary to perform lookups on the
17593         module builder.
17594
17595         (LookupType): Update to perform GetType on the module builders too.     
17596
17597         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17598
17599         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17600
17601 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17602
17603         * expression.cs (New::DoResolve): Implement guts of array creation.
17604
17605         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17606
17607 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17608
17609         * expression.cs: Fix bug I introduced lsat night that broke
17610         Delegates. 
17611
17612         (Expression.Resolve): Report a 246 error (can not resolve name)
17613         if we find a SimpleName in the stream.
17614
17615         (Expression.ResolveLValue): Ditto.
17616
17617         (Expression.ResolveWithSimpleName): This function is a variant of
17618         ResolveName, this one allows SimpleNames to be returned without a
17619         warning.  The only consumer of SimpleNames is MemberAccess
17620
17621 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17622
17623         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17624         might arrive here.  I have my doubts that this is correct.
17625
17626         * statement.cs (Lock): Implement lock statement.
17627
17628         * cs-parser.jay: Small fixes to support `lock' and `using'
17629
17630         * cs-tokenizer.cs: Remove extra space
17631
17632         * driver.cs: New flag --checked, allows to turn on integer math
17633         checking. 
17634
17635         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17636         Threading.Monitor.Exit 
17637
17638 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17639
17640         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17641         Expression Class to be IndexerAccess.
17642
17643         Notice that Indexer::DoResolve sets the eclass to Value.
17644
17645 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17646
17647         * class.cs (TypeContainer::Emit): Emit code for indexers.
17648
17649         * assign.cs (IAssignMethod): New interface implemented by Indexers
17650         and Properties for handling assignment.
17651
17652         (Assign::Emit): Simplify and reuse code. 
17653
17654         * expression.cs (IndexerAccess, PropertyExpr): Implement
17655         IAssignMethod, clean up old code. 
17656
17657 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17658
17659         * typemanager.cs (ImplementsInterface): New method to determine if a type
17660         implements a given interface. Provides a nice cache too.
17661
17662         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17663         method.
17664
17665         (ConvertReferenceExplicit): Ditto.
17666
17667         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17668         various methods, with correct names etc.
17669
17670         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17671         Operator.UnaryNegation.
17672
17673         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17674         we have a unary plus or minus operator.
17675
17676         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17677         UnaryMinus.
17678
17679         * everywhere : update accordingly.
17680
17681         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17682         respectively.
17683
17684         * class.cs (Method::Define): For the case where we are implementing a method
17685         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17686         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17687
17688 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17689
17690         * interface.cs (FindMembers): Implement to work around S.R.E
17691         lameness.
17692
17693         * typemanager.cs (IsInterfaceType): Implement.
17694
17695         (FindMembers): Update to handle interface types too.
17696
17697         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17698         use IsAssignableFrom as that is not correct - it doesn't work.
17699
17700         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17701         and accordingly override EmitStatement.
17702
17703         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17704         using the correct logic :-)
17705
17706 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17707
17708         * ../errors/cs-11.cs : Add to demonstrate error -11 
17709
17710 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17711
17712         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17713         then pass this as a hint to ResolveLValue.
17714
17715         * expression.cs (FieldExpr): Add Location information
17716
17717         (FieldExpr::LValueResolve): Report assignment to readonly
17718         variable. 
17719
17720         (Expression::ExprClassFromMemberInfo): Pass location information.
17721
17722         (Expression::ResolveLValue): Add new method that resolves an
17723         LValue. 
17724
17725         (Expression::DoResolveLValue): Default invocation calls
17726         DoResolve. 
17727
17728         (Indexers): New class used to keep track of indexers in a given
17729         Type. 
17730
17731         (IStackStore): Renamed from LValue, as it did not really describe
17732         what this did.  Also ResolveLValue is gone from this interface and
17733         now is part of Expression.
17734
17735         (ElementAccess): Depending on the element access type
17736
17737         * typemanager.cs: Add `indexer_name_type' as a Core type
17738         (System.Runtime.CompilerServices.IndexerNameAttribute)
17739
17740         * statement.cs (Goto): Take a location.
17741
17742 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17743
17744         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17745         if two delegates are compatible.
17746
17747         (NewDelegate::DoResolve): Update to take care of the case when
17748         we instantiate a delegate from another delegate.
17749
17750         * typemanager.cs (FindMembers): Don't even try to look up members
17751         of Delegate types for now.
17752
17753 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17754
17755         * delegate.cs (NewDelegate): New class to take care of delegate
17756         instantiation.
17757
17758         * expression.cs (New): Split the delegate related code out into 
17759         the NewDelegate class.
17760
17761         * delegate.cs (DelegateInvocation): New class to handle delegate 
17762         invocation.
17763
17764         * expression.cs (Invocation): Split out delegate related code into
17765         the DelegateInvocation class.
17766
17767 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17768
17769         * expression.cs (New::DoResolve): Implement delegate creation fully
17770         and according to the spec.
17771
17772         (New::DoEmit): Update to handle delegates differently.
17773
17774         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17775         because of which we were printing out arguments in reverse order !
17776
17777         * delegate.cs (VerifyMethod): Implement to check if the given method
17778         matches the delegate.
17779
17780         (FullDelegateDesc): Implement.
17781
17782         (VerifyApplicability): Implement.
17783
17784         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17785         delegate invocations too.
17786
17787         (Invocation::Emit): Ditto.
17788
17789         * ../errors/cs1593.cs : Added.
17790
17791         * ../errors/cs1594.cs : Added.
17792
17793         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17794
17795 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17796
17797         * typemanager.cs (intptr_type): Core type for System.IntPtr
17798
17799         (InitCoreTypes): Update for the same.
17800
17801         (iasyncresult_type, asynccallback_type): Ditto.
17802
17803         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17804         correct.
17805
17806         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17807         too.
17808
17809         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17810         the builders for the 4 members of a delegate type :-)
17811
17812         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17813         type.
17814
17815         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17816
17817         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17818
17819 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17820
17821         * statement.cs (Break::Emit): Implement.   
17822         (Continue::Emit): Implement.
17823
17824         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17825         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17826         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17827         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17828         end loop
17829
17830         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17831         properties that track the label for the current loop (begin of the
17832         loop and end of the loop).
17833
17834 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17835
17836         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17837         use of emitting anything at all.
17838
17839         * class.cs, rootcontext.cs : Get rid of calls to the same.
17840
17841         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17842
17843         (Populate): Define the constructor correctly and set the implementation
17844         attributes.
17845
17846         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17847         have been defined.
17848
17849         (AddDelegateType): Implement.
17850
17851         (IsDelegateType): Implement helper method.
17852
17853         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17854
17855         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17856         and accordingly handle it.
17857
17858         * delegate.cs (Populate): Take TypeContainer argument.
17859         Implement bits to define the Invoke method. However, I still haven't figured out
17860         how to take care of the native int bit :-(
17861
17862         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17863         Qualify the name of the delegate, not its return type !
17864
17865         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17866         conversion.
17867
17868         (StandardConversionExists): Checking for array types turns out to be recursive.
17869
17870         (ConvertReferenceExplicit): Implement array conversion.
17871
17872         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17873
17874 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17875
17876         * cs-parser.jay (delegate_declaration): Store the fully qualified
17877         name as it is a type declaration.
17878
17879         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17880         readonly.
17881
17882         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17883         as TypeContainer::DefineType.
17884
17885         (Populate): Method in which all the definition of the various methods (Invoke)
17886         etc is done.
17887
17888         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17889         see.
17890
17891         (CloseDelegate): Finally creates the delegate.
17892
17893         * class.cs (TypeContainer::DefineType): Update to define delegates.
17894         (Populate, Emit and CloseType): Do the same thing here too.
17895
17896         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17897         delegates in all these operations.
17898
17899 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17900
17901         * expression.cs: LocalTemporary: a new expression used to
17902         reference a temporary that has been created.
17903
17904         * assign.cs: Handle PropertyAccess back here, so that we can
17905         provide the proper semantic access to properties.
17906
17907         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17908         a few more explicit conversions. 
17909
17910         * modifiers.cs: `NEW' modifier maps to HideBySig.
17911
17912         * expression.cs (PropertyExpr): Make this into an
17913         ExpressionStatement, and support the EmitStatement code path. 
17914
17915         Perform get/set error checking, clean up the interface.
17916
17917         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17918         them into toplevel access objects.
17919
17920 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17921
17922         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17923         SRE.
17924
17925         * typemanager.cs: Keep track here of our PropertyBuilders again to
17926         work around lameness in SRE.
17927
17928 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17929
17930         * expression.cs (LValue::LValueResolve): New method in the
17931         interface, used to perform a second resolution pass for LValues. 
17932
17933         (This::DoResolve): Catch the use of this in static methods.
17934
17935         (This::LValueResolve): Implement.
17936
17937         (This::Store): Remove warning, assigning to `this' in structures
17938         is 
17939
17940         (Invocation::Emit): Deal with invocation of
17941         methods on value types.  We need to pass the address to structure
17942         methods rather than the object itself.  (The equivalent code to
17943         emit "this" for structures leaves the entire structure on the
17944         stack instead of a pointer to it). 
17945
17946         (ParameterReference::DoResolve): Compute the real index for the
17947         argument based on whether the method takes or not a `this' pointer
17948         (ie, the method is static).
17949
17950         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17951         value types returned from functions when we need to invoke a
17952         method on the sturcture.
17953
17954
17955 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17956
17957         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17958         defining the type in the Modulebuilder or Typebuilder. This is to take
17959         care of nested types which need to be defined on the TypeBuilder using
17960         DefineNestedMethod.
17961
17962         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17963         methods in RootContext, only ported to be part of TypeContainer.
17964
17965         (TypeContainer::GetInterfaceOrClass): Ditto.
17966
17967         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17968
17969         * interface.cs (Interface::DefineInterface): New method. Does exactly
17970         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17971         too.
17972
17973         (Interface::GetInterfaces): Move from RootContext here and port.
17974
17975         (Interface::GetInterfaceByName): Same here.
17976
17977         * rootcontext.cs (ResolveTree): Re-write.
17978
17979         (PopulateTypes): Re-write.
17980
17981         * class.cs (TypeContainer::Populate): Populate nested types too.
17982         (TypeContainer::Emit): Emit nested members too.
17983
17984         * typemanager.cs (AddUserType): Do not make use of the FullName property,
17985         instead just use the name argument passed in as it is already fully
17986         qualified.
17987
17988         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17989         to TypeContainer mapping to see if a type is user-defined.
17990
17991         * class.cs (TypeContainer::CloseType): Implement. 
17992
17993         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
17994         the default constructor.
17995
17996         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
17997         twice.
17998
17999         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18000
18001         * interface.cs (CloseType): Create the type here.
18002
18003         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18004         the hierarchy.
18005
18006         Remove all the methods which are now in TypeContainer.
18007
18008 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18009
18010         * delegate.cs (Define): Re-write bits to define the delegate
18011         correctly.
18012
18013 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18014
18015         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18016
18017         * expression.cs (ImplicitReferenceConversion): handle null as well
18018         as a source to convert to any reference type.
18019
18020         * statement.cs (Return): Perform any implicit conversions to
18021         expected return type.  
18022
18023         Validate use of return statement.  
18024
18025         * codegen.cs (EmitContext): Pass the expected return type here.
18026
18027         * class.cs (Method, Constructor, Property): Pass expected return
18028         type to EmitContext.
18029
18030 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18031
18032         * expression.cs: Make DoResolve take an EmitContext instead of a
18033         TypeContainer.
18034
18035         Replaced `l' and `location' for `loc', for consistency.
18036
18037         (Error, Warning): Remove unneeded Tc argument.
18038
18039         * assign.cs, literal.cs, constant.cs: Update to new calling
18040         convention. 
18041
18042         * codegen.cs: EmitContext now contains a flag indicating whether
18043         code is being generated in a static method or not.
18044
18045         * cs-parser.jay: DecomposeQI, new function that replaces the old
18046         QualifiedIdentifier.  Now we always decompose the assembled
18047         strings from qualified_identifier productions into a group of
18048         memberaccesses.
18049
18050 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18051
18052         * rootcontext.cs: Deal with field-less struct types correctly now
18053         by passing the size option to Define Type.
18054
18055         * class.cs: Removed hack that created one static field. 
18056
18057 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18058
18059         * statement.cs: Moved most of the code generation here. 
18060
18061 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18062
18063         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18064         seem very right.
18065
18066         (ElementAccess): Remove useless bits for now - keep checks as the spec
18067         says.
18068
18069 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18070
18071         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18072         and start performing checks according to the spec.
18073
18074 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18075
18076         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18077         rank_specifiers instead.
18078
18079         (rank_specifiers): Change the order in which the rank specifiers are stored
18080
18081         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18082
18083         * expression.cs (ElementAccess): Implement the LValue interface too.
18084
18085 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18086
18087         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18088         except that user defined conversions are not included.
18089
18090         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18091         perform the conversion of the return type, if necessary.
18092
18093         (New::DoResolve): Check whether we are creating an array or an object
18094         and accordingly do the needful.
18095
18096         (New::Emit): Same here.
18097
18098         (New::DoResolve): Implement guts of array creation.
18099
18100         (New::FormLookupType): Helper function.
18101
18102 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18103
18104         * codegen.cs: Removed most of the code generation here, and move the
18105         corresponding code generation bits to the statement classes. 
18106
18107         Added support for try/catch/finalize and throw.
18108
18109         * cs-parser.jay: Added support for try/catch/finalize.
18110
18111         * class.cs: Catch static methods having the flags override,
18112         virtual or abstract.
18113
18114         * expression.cs (UserCast): This user cast was not really doing
18115         what it was supposed to do.  Which is to be born in fully resolved
18116         state.  Parts of the resolution were being performed at Emit time! 
18117
18118         Fixed this code.
18119
18120 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18121
18122         * expression.cs: Implicity convert the result from UserCast.
18123
18124 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18125
18126         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18127         prevented it from working correctly. 
18128
18129         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18130         merely ConvertImplicit.
18131
18132 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18133
18134         * typemanager.cs: Make the LookupTypeContainer function static,
18135         and not per-instance.  
18136
18137         * class.cs: Make static FindMembers (the one that takes a Type
18138         argument). 
18139
18140         * codegen.cs: Add EmitForeach here.
18141
18142         * cs-parser.jay: Make foreach a toplevel object instead of the
18143         inline expansion, as we need to perform semantic analysis on it. 
18144
18145 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18146
18147         * expression.cs (Expression::ImplicitUserConversion): Rename to
18148         UserDefinedConversion.
18149
18150         (Expression::UserDefinedConversion): Take an extra argument specifying 
18151         whether we look for explicit user conversions too.
18152
18153         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18154
18155         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18156
18157         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18158         with the appropriate arguments.
18159
18160         * cs-parser.jay (cast_expression): Record location too.
18161
18162         * expression.cs (Cast): Record location info.
18163
18164         (Expression::ConvertExplicit): Take location argument.
18165
18166         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18167         to determine if we are doing explicit conversions.
18168
18169         (UserCast::Emit): Update accordingly.
18170
18171         (Expression::ConvertExplicit): Report an error if everything fails.
18172
18173         * ../errors/cs0030.cs : Add.
18174
18175 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18176
18177         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18178         virtual and newslot bits. 
18179
18180         * class.cs (TypeContainer::RegisterRequiredImplementations):
18181         Record methods we need.
18182
18183         (TypeContainer::MakeKey): Helper function to make keys for
18184         MethodBases, since the Methodbase key is useless.
18185
18186         (TypeContainer::Populate): Call RegisterRequiredImplementations
18187         before defining the methods.   
18188
18189         Create a mapping for method_builders_to_methods ahead of time
18190         instead of inside a tight loop.
18191
18192         (::RequireMethods):  Accept an object as the data to set into the
18193         hashtable so we can report interface vs abstract method mismatch.
18194
18195 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18196
18197         * report.cs: Make all of it static.
18198
18199         * rootcontext.cs: Drop object_type and value_type computations, as
18200         we have those in the TypeManager anyways.
18201
18202         Drop report instance variable too, now it is a global.
18203
18204         * driver.cs: Use try/catch on command line handling.
18205
18206         Add --probe option to debug the error reporting system with a test
18207         suite. 
18208
18209         * report.cs: Add support for exiting program when a probe
18210         condition is reached.
18211
18212 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18213
18214         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18215         we do a forcible conversion regardless of type, to check if 
18216         ForceConversion returns a null.
18217
18218         (Binary::error19): Use location to report error.
18219
18220         (Unary::error23): Use location here too.
18221
18222         * ../errors/cs0019.cs : Check in.
18223
18224         * ../errors/cs0023.cs : Check in.
18225
18226         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18227         case of a non-null MethodInfo object with a length of 0 !
18228
18229         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18230         an applicable member - according to the spec :-)
18231         Also fix logic to find members in base types.
18232
18233         (Unary::ResolveOperator): Same here.
18234
18235         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18236         as I was getting thoroughly confused between this and error19 :-)
18237
18238         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18239         (::FindMostEncompassedType): Implement.
18240         (::FindMostEncompassingType): Implement.
18241         (::StandardConversionExists): Implement.
18242
18243         (UserImplicitCast): Re-vamp. We now need info about most specific
18244         source and target types so that we can do the necessary conversions.
18245
18246         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18247         mathematical union with no duplicates.
18248
18249 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18250
18251         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18252         in order from base classes to child classes, so that we can in
18253         child classes look up in our parent for method names and
18254         attributes (required for handling abstract, virtual, new, override
18255         constructs: we need to instrospect our base class, and if we dont
18256         populate the classes in order, the introspection might be
18257         incorrect.  For example, a method could query its parent before
18258         the parent has any methods and would determine that the parent has
18259         no abstract methods (while it could have had them)).
18260
18261         (RootContext::CreateType): Record the order in which we define the
18262         classes.
18263
18264 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18265
18266         * class.cs (TypeContainer::Populate): Also method definitions can
18267         fail now, keep track of this.
18268
18269         (TypeContainer::FindMembers): Implement support for
18270         DeclaredOnly/noDeclaredOnly flag.
18271
18272         (Constructor::Emit) Return the ConstructorBuilder.
18273
18274         (Method::Emit) Return the MethodBuilder. 
18275         Check for abstract or virtual methods to be public.
18276
18277         * rootcontext.cs (RootContext::CreateType): Register all the
18278         abstract methods required for the class to be complete and the
18279         interface methods that must be implemented. 
18280
18281         * cs-parser.jay: Report error 501 (method requires body if it is
18282         not marked abstract or extern).
18283
18284         * expression.cs (TypeOf::Emit): Implement.
18285
18286         * typemanager.cs: runtime_handle_type, new global type.
18287
18288         * class.cs (Property::Emit): Generate code for properties.
18289
18290 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18291
18292         * expression.cs (Unary::ResolveOperator): Find operators on base type
18293         too - we now conform exactly to the spec.
18294
18295         (Binary::ResolveOperator): Same here.
18296
18297         * class.cs (Operator::Define): Fix minor quirk in the tests.
18298
18299         * ../errors/cs0215.cs : Added.
18300
18301         * ../errors/cs0556.cs : Added.
18302
18303         * ../errors/cs0555.cs : Added.
18304
18305 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18306
18307         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18308         single integer which is really efficient
18309
18310 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18311
18312         *  expression.cs (Expression::ImplicitUserConversion): Use location
18313         even in the case when we are examining True operators.
18314  
18315         * class.cs (Operator::Define): Perform extensive checks to conform
18316         with the rules for operator overloading in the spec.
18317
18318         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18319         some of the other conversions mentioned in the spec.
18320
18321         * typemanager.cs (array_type): New static member for the System.Array built-in
18322         type.
18323
18324         (cloneable_interface): For System.ICloneable interface.
18325
18326         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18327         we start resolving the tree and populating types.
18328
18329         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18330  
18331 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18332
18333         * expression.cs (Expression::ExprClassFromMemberInfo,
18334         Expression::Literalize): Create literal expressions from
18335         FieldInfos which are literals.
18336
18337         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18338         type casts, because they were wrong.  The test suite in tests
18339         caught these ones.
18340
18341         (ImplicitNumericConversion): ushort to ulong requires a widening
18342         cast. 
18343
18344         Int32 constant to long requires widening cast as well.
18345
18346         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18347         for integers because the type on the stack is not i4.
18348
18349 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18350
18351         * expression.cs (report118): require location argument. 
18352
18353         * parameter.cs: Do not dereference potential null value.
18354
18355         * class.cs: Catch methods that lack the `new' keyword when
18356         overriding a name.  Report warnings when `new' is used without
18357         anything being there to override.
18358
18359         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18360
18361         * class.cs: Only add constructor to hashtable if it is non-null
18362         (as now constructors can fail on define).
18363
18364         (TypeManager, Class, Struct): Take location arguments.
18365
18366         Catch field instance initialization in structs as errors.
18367
18368         accepting_filter: a new filter for FindMembers that is static so
18369         that we dont create an instance per invocation.
18370
18371         (Constructor::Define): Catch errors where a struct constructor is
18372         parameterless 
18373
18374         * cs-parser.jay: Pass location information for various new
18375         constructs. 
18376
18377         * delegate.cs (Delegate): take a location argument.
18378
18379         * driver.cs: Do not call EmitCode if there were problesm in the
18380         Definition of the types, as many Builders wont be there. 
18381
18382         * decl.cs (Decl::Decl): Require a location argument.
18383
18384         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18385         into integers, and find the most appropiate integer for it.
18386
18387         * literal.cs: Implement ULongLiteral.
18388
18389         * rootcontext.cs: Provide better information about the location of
18390         failure when CreateType fails.
18391
18392 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18393
18394         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18395         as well.
18396
18397         * expression.cs (Binary::CheckShiftArguments): Add missing type
18398         computation.
18399         (Binary::ResolveOperator): Add type to the logical and and logical
18400         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18401         before.
18402
18403         (Binary::DoNumericPromotions): In the case where either argument
18404         is ulong (and most signed types combined with ulong cause an
18405         error) perform implicit integer constant conversions as well.
18406
18407 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18408
18409         * expression.cs (UserImplicitCast): Method should always be
18410         non-null. 
18411         (Invocation::BetterConversion): Simplified test for IntLiteral.
18412
18413         (Expression::ImplicitNumericConversion): Split this routine out.
18414         Put the code that performs implicit constant integer conversions
18415         here. 
18416
18417         (Expression::Resolve): Become a wrapper around DoResolve so we can
18418         check eclass and type being set after resolve.
18419
18420         (Invocation::Badness): Remove this dead function
18421
18422         (Binary::ResolveOperator): Do not compute the expensive argumnets
18423         unless we have a union for it.
18424
18425         (Probe::Emit): Is needs to do an isinst and then
18426         compare against null.
18427
18428         (::CanConvert): Added Location argument.  If the Location argument
18429         is null (Location.Null), then we do not report errors.  This is
18430         used by the `probe' mechanism of the Explicit conversion.  We do
18431         not want to generate an error for something that the user
18432         explicitly requested to be casted.  But the pipeline for an
18433         explicit cast first tests for potential implicit casts.
18434
18435         So for now, if the Location is null, it means `Probe only' to
18436         avoid adding another argument.   Might have to revise this
18437         strategy later.
18438
18439         (ClassCast): New class used to type cast objects into arbitrary
18440         classes (used in Explicit Reference Conversions).
18441
18442         Implement `as' as well.
18443
18444         Reverted all the patches from Ravi below: they were broken:
18445
18446                 * The use of `level' as a mechanism to stop recursive
18447                   invocations is wrong.  That was there just to catch the
18448                   bug with a strack trace but not as a way of addressing
18449                   the problem.
18450
18451                   To fix the problem we have to *understand* what is going
18452                   on and the interactions and come up with a plan, not
18453                   just get things going.
18454
18455                 * The use of the type conversion cache that I proposed
18456                   last night had an open topic: How does this work across
18457                   protection domains.  A user defined conversion might not
18458                   be public in the location where we are applying the
18459                   conversion, a different conversion might be selected
18460                   (ie, private A->B (better) but public B->A (worse),
18461                   inside A, A->B applies, but outside it, B->A will
18462                   apply).
18463
18464                 * On top of that (ie, even if the above is solved),
18465                   conversions in a cache need to be abstract.  Ie, `To
18466                   convert from an Int to a Short use an OpcodeCast', not
18467                   `To convert from an Int to a Short use the OpcodeCast on
18468                   the variable 5' (which is what this patch was doing).
18469
18470 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18471
18472         * expression.cs (Invocation::ConversionExists): Re-write to use
18473         the conversion cache
18474
18475         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18476         cache all conversions done, not just user-defined ones.
18477
18478         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18479         to determine if a conversion exists instead of acutually trying to 
18480         perform the conversion. It's faster too.
18481
18482         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18483         and only then attempt the implicit conversion.
18484
18485 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18486
18487         * expression.cs (ConvertImplicit): Use a cache for conversions
18488         already found. Check level of recursion and bail out if necessary.
18489
18490 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18491
18492         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18493         Export standard methods that we expect for string operations.
18494
18495         * statement.cs (Block::UsageWarning): Track usage of variables and
18496         report the errors for not used variables.
18497
18498         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18499         operator. 
18500
18501 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18502
18503         * codegen.cs: remove unnneded code 
18504
18505         * expression.cs: Removed BuiltinTypeAccess class
18506
18507         Fix the order in which implicit conversions are
18508         done.  
18509
18510         The previous fixed dropped support for boxed conversions (adding a
18511         test to the test suite now)
18512
18513         (UserImplicitCast::CanConvert): Remove test for source being null,
18514         that code is broken.  We should not feed a null to begin with, if
18515         we do, then we should track the bug where the problem originates
18516         and not try to cover it up here.
18517
18518         Return a resolved expression of type UserImplicitCast on success
18519         rather than true/false.  Ravi: this is what I was talking about,
18520         the pattern is to use a static method as a "constructor" for
18521         objects. 
18522
18523         Also, do not create arguments until the very last minute,
18524         otherwise we always create the arguments even for lookups that
18525         will never be performed. 
18526
18527         (UserImplicitCast::Resolve): Eliminate, objects of type
18528         UserImplicitCast are born in a fully resolved state. 
18529
18530         * typemanager.cs (InitCoreTypes): Init also value_type
18531         (System.ValueType). 
18532
18533         * expression.cs (Cast::Resolve): First resolve the child expression.
18534
18535         (LValue): Add new method AddressOf to be used by
18536         the `&' operator.  
18537
18538         Change the argument of Store to take an EmitContext instead of an
18539         ILGenerator, because things like FieldExpr need to be able to call
18540         their children expression to generate the instance code. 
18541
18542         (Expression::Error, Expression::Warning): Sugar functions for
18543         reporting errors.
18544
18545         (Expression::MemberLookup): Accept a TypeContainer instead of a
18546         Report as the first argument.
18547
18548         (Expression::ResolvePrimary): Killed.  I still want to improve
18549         this as currently the code is just not right.
18550
18551         (Expression::ResolveMemberAccess): Simplify, but it is still
18552         wrong. 
18553
18554         (Unary::Resolve): Catch errors in AddressOf operators.
18555
18556         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18557         index to a byte for the short-version, or the compiler will choose
18558         the wrong Emit call, which generates the wrong data.
18559
18560         (ParameterReference::Emit, ::Store): same.
18561
18562         (FieldExpr::AddressOf): Implement.
18563
18564         * typemanager.cs: TypeManager: made public variable instead of
18565         property.
18566
18567         * driver.cs: document --fatal.
18568
18569         * report.cs (ErrorMessage, WarningMessage): new names for the old
18570         Error and Warning classes.
18571
18572         * cs-parser.jay (member_access): Turn built-in access to types
18573         into a normal simplename
18574
18575 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18576
18577         * expression.cs (Invocation::BetterConversion): Fix to cope
18578         with q being null, since this was introducing a bug.
18579
18580         * expression.cs (ConvertImplicit): Do built-in conversions first.
18581
18582 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18583
18584         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18585
18586 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18587
18588         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18589         I had introduced long ago (what's new ?).
18590
18591         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18592         the work of all the checking. 
18593         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18594         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18595
18596         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18597         that is the right way. 
18598
18599         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18600         overloading resolution. Use everywhere instead of cutting and pasting code.
18601
18602         (Binary::ResolveOperator): Use MakeUnionSet.
18603
18604         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18605         we have to convert to bool types. Not complete yet.
18606
18607 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18608
18609         * typemanager.cs (TypeManager::CSharpName): support ushort.
18610
18611         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18612         to provide an expression that performsn an implicit constant int
18613         conversion (section 6.1.6).
18614         (Expression::ConvertImplicitRequired): Reworked to include
18615         implicit constant expression conversions.
18616
18617         (Expression::ConvertNumericExplicit): Finished.
18618
18619         (Invocation::Emit): If InstanceExpression is null, then it means
18620         that we perform a call on this.
18621
18622 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18623
18624         * expression.cs (Unary::Emit): Remove some dead code.
18625         (Probe): Implement Resolve and Emit for `is'.
18626         (Expression::ConvertImplicitRequired): Attempt to do constant
18627         expression conversions here.  Maybe should be moved to
18628         ConvertImplicit, but I am not sure.
18629         (Expression::ImplicitLongConstantConversionPossible,
18630         Expression::ImplicitIntConstantConversionPossible): New functions
18631         that tell whether is it possible to apply an implicit constant
18632         expression conversion.
18633
18634         (ConvertNumericExplicit): Started work on explicit numeric
18635         conversions.
18636
18637         * cs-parser.jay: Update operator constants.
18638
18639         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18640         (Parameters::GetSignature): Hook up VerifyArgs here.
18641         (Parameters::VerifyArgs): Verifies that no two arguments have the
18642         same name. 
18643
18644         * class.cs (Operator): Update the operator names to reflect the
18645         ones that the spec expects (as we are just stringizing the
18646         operator names).
18647
18648         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18649         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18650         previous usage did only work for our methods.
18651         (Expression::ConvertImplicit): Handle decimal implicit numeric
18652         conversions as well.
18653         (Expression::InternalTypeConstructor): Used to invoke constructors
18654         on internal types for default promotions.
18655
18656         (Unary::Emit): Implement special handling for the pre/post
18657         increment/decrement for overloaded operators, as they need to have
18658         the same semantics as the other operators.
18659
18660         (Binary::ResolveOperator): ditto.
18661         (Invocation::ConversionExists): ditto.
18662         (UserImplicitCast::Resolve): ditto.
18663
18664 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18665
18666         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18667         operator, return after emitting body. Regression tests pass again !
18668
18669         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18670         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18671         (Invocation::OverloadResolve): Ditto.
18672         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18673
18674         * everywhere : update calls to the above methods accordingly.
18675
18676 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18677
18678         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18679
18680         * expression.cs (ExpressionStatement): New base class used for
18681         expressions that can appear in statements, so that we can provide
18682         an alternate path to generate expression that do not leave a value
18683         on the stack.
18684
18685         (Expression::Emit, and all the derivatives): We no longer return
18686         whether a value is left on the stack or not.  Every expression
18687         after being emitted leaves a single value on the stack.
18688
18689         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18690         facilties of ExpressionStatement if possible.
18691
18692         * cs-parser.jay: Update statement_expression.
18693
18694 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18695
18696         * driver.cs: Change the wording of message
18697
18698 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18699
18700         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18701         the type of the expression to the return type of the method if
18702         we have an overloaded operator match ! The regression tests pass again !
18703         (Unary::ResolveOperator): Ditto.
18704
18705         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18706         to find "op_Implicit", not "implicit" ;-)
18707         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18708         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18709
18710         * everywhere : Correct calls to the above accordingly.
18711
18712         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18713         (ConvertImplicit): Do user-defined conversion if it exists.
18714
18715 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18716
18717         * assign.cs: track location.
18718         (Resolve): Use implicit conversions on assignment.
18719
18720         * literal.cs: Oops.  Not good, Emit of short access values should
18721         pass (Bytes) or the wrong argument will be selected.
18722
18723         * expression.cs (Unary::Emit): Emit code for -expr.
18724
18725         (Unary::ResolveOperator): Handle `Substract' for non-constants
18726         (substract from zero from the non-constants).
18727         Deal with Doubles as well. 
18728
18729         (Expression::ConvertImplicitRequired): New routine that reports an
18730         error if no implicit conversion exists. 
18731
18732         (Invocation::OverloadResolve): Store the converted implicit
18733         expressions if we make them
18734
18735 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18736
18737         * class.cs (ConstructorInitializer): Take a Location argument.
18738         (ConstructorBaseInitializer): Same here.
18739         (ConstructorThisInitializer): Same here.
18740
18741         * cs-parser.jay : Update all calls accordingly.
18742
18743         * expression.cs (Unary, Binary, New): Take location argument.
18744         Update accordingly everywhere.
18745
18746         * cs-parser.jay : Update all calls to the above to take a location
18747         argument.
18748
18749         * class.cs : Ditto.
18750
18751 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18752
18753         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18754         (Invocation::BetterConversion): Same here
18755         (Invocation::ConversionExists): Ditto.
18756
18757         (Invocation::ConversionExists): Implement.
18758
18759 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18760
18761         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18762         Also take an additional TypeContainer argument.
18763
18764         * All over : Pass in TypeContainer as argument to OverloadResolve.
18765
18766         * typemanager.cs (CSharpName): Update to check for the string type and return
18767         that too.
18768
18769         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18770         a given method.
18771
18772 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18773
18774         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18775         (Invocation::BetterFunction): Implement.
18776         (Invocation::BetterConversion): Implement.
18777         (Invocation::ConversionExists): Skeleton, no implementation yet.
18778
18779         Okay, things work fine !
18780
18781 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18782
18783         * typemanager.cs: declare and load enum_type, delegate_type and
18784         void_type. 
18785
18786         * expression.cs (Expression::Emit): Now emit returns a value that
18787         tells whether a value is left on the stack or not.  This strategy
18788         might be reveted tomorrow with a mechanism that would address
18789         multiple assignments.
18790         (Expression::report118): Utility routine to report mismatches on
18791         the ExprClass.
18792
18793         (Unary::Report23): Report impossible type/operator combination
18794         utility function.
18795
18796         (Unary::IsIncrementableNumber): Whether the type can be
18797         incremented or decremented with add.
18798         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18799         complemented. 
18800         (Unary::ResolveOperator): Implement ++, !, ~,
18801
18802         (Invocation::Emit): Deal with new Emit convetion.
18803
18804         * All Expression derivatives: Updated their Emit method to return
18805         whether they leave values on the stack or not.
18806
18807         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18808         stack for expressions that are statements. 
18809
18810 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18811
18812         * expression.cs (LValue): New interface.  Must be implemented by
18813         LValue objects.
18814         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18815         LValue interface.
18816
18817         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18818         interface for generating code, simplifies the code.
18819
18820 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18821
18822         * expression.cs (everywhere): Comment out return statements in ::Resolve
18823         methods to avoid the warnings.
18824
18825 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18826
18827         * driver.cs (parse): Report error 2001 if we can not open the
18828         source file.
18829
18830         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18831         not resolve it.
18832
18833         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18834         object. 
18835
18836         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18837         otherwise nested blocks end up with the same index.
18838
18839         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18840
18841         * expression.cs:  Instead of having FIXMEs in the Resolve
18842         functions, throw exceptions so it is obvious that we are facing a
18843         bug. 
18844
18845         * cs-parser.jay (invocation_expression): Pass Location information.
18846
18847         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18848         Use a basename for those routines because .NET does not like paths
18849         on them. 
18850
18851         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18852         already defined.
18853
18854 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18855
18856         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18857         are loading the correct data types (throws an exception if not).
18858         (TypeManager::InitCoreTypes): Use CoreLookupType
18859
18860         * expression.cs (Unary::ResolveOperator): return the child
18861         expression for expressions which are just +expr.
18862         (Unary::ResolveOperator): Return negative literals for -LITERAL
18863         expressions (otherwise they are Unary {Literal}).
18864         (Invocation::Badness): Take into account `Implicit constant
18865         expression conversions'.
18866
18867         * literal.cs (LongLiteral): Implement long literal class.
18868         (IntLiteral): export the `Value' of the intliteral. 
18869
18870 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18871
18872         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18873
18874         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18875         instead of 'Operator'
18876
18877         * expression.cs (Binary::ResolveOperator): Update accordingly.
18878         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18879         and 'Minus'
18880
18881         * cs-parser.jay (unary_expression): Update to use the new names.
18882
18883         * gen-treedump.cs (GetUnary): Same here.
18884
18885         * expression.cs (Unary::Resolve): Implement.
18886         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18887         operators are found instead of making noise ;-)
18888         (Unary::ResolveOperator): New method to do precisely the same thing which
18889         Binary::ResolveOperator does for Binary expressions.
18890         (Unary.method, .Arguments): Add.
18891         (Unary::OperName): Implement.   
18892         (Unary::ForceConversion): Copy and Paste !
18893
18894         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18895         a unary operator.
18896
18897         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18898         for the inbuilt operators. Only overloading works for now ;-)
18899
18900 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18901
18902         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18903         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18904
18905         * expression.cs (This::Emit): Implement. 
18906         (This::Resolve): Implement.
18907         (TypeOf:Resolve): Implement.
18908         (Expression::ResolveSimpleName): Add an implicit this to instance
18909         field references. 
18910         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18911         Bind instance variable to Field expressions.
18912         (FieldExpr::Instance): New field used to track the expression that
18913         represents the object instance.
18914         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18915         binding 
18916         (FieldExpr::Emit): Implement.
18917
18918         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18919         the last instruction contains a return opcode to avoid generating
18920         the last `ret' instruction (this generates correct code, and it is
18921         nice to pass the peverify output).
18922
18923         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18924         initializer for static and instance variables.
18925         (Constructor::Emit): Allow initializer to be null in the case of
18926         static constructors.  Only emit initializer for instance
18927         constructors. 
18928
18929         (TypeContainer::FindMembers): Return a null array if there are no
18930         matches.
18931
18932         Also fix the code for the MemberTypes.Method branch, as it was not
18933         scanning that for operators (or tried to access null variables before).
18934
18935         * assign.cs (Assign::Emit): Handle instance and static fields. 
18936
18937         * TODO: Updated.
18938
18939         * driver.cs: Stop compilation if there are parse errors.
18940
18941         * cs-parser.jay (constructor_declaration): Provide default base
18942         initializer for non-static constructors.
18943         (constructor_declarator): Do not provide a default base
18944         initializers if none was specified.
18945         Catch the fact that constructors should not have parameters.
18946
18947         * class.cs: Do not emit parent class initializers for static
18948         constructors, that should be flagged as an error.
18949
18950 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18951
18952         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18953         Move back code into TypeContainer::Populate.
18954
18955 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18956
18957         * class.cs (TypeContainer::AddConstructor): Fix the check to
18958         compare against Name, not Basename. 
18959         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18960
18961         * cs-parser.jay : Update accordingly.
18962
18963         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18964         for methods, don't forget to look into the operators too.
18965         (RegisterMethodBuilder): Helper method to take care of this for
18966         methods, constructors and operators.
18967         (Operator::Define): Completely revamp.
18968         (Operator.OperatorMethod, MethodName): New fields.
18969         (TypeContainer::Populate): Move the registering of builders into
18970         RegisterMethodBuilder.
18971         (Operator::Emit): Re-write.
18972
18973         * expression.cs (Binary::Emit): Comment out code path to emit method
18974         invocation stuff for the case when we have a user defined operator. I am
18975         just not able to get it right !
18976
18977 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18978
18979         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18980         argument. 
18981
18982         (Expression::MemberLookup): Provide a version that allows to
18983         specify the MemberTypes and BindingFlags. 
18984
18985         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18986         so it was not fetching variable information from outer blocks.
18987
18988         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18989         Beforefieldinit as it was buggy.
18990
18991         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
18992         that Ravi put here.  
18993
18994         * class.cs (Constructor::Emit): Only emit if block is not null.
18995         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
18996         deal with this by semantically definining it as if the user had
18997         done it.
18998
18999         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19000         constructors as we now "emit" them at a higher level.
19001
19002         (TypeContainer::DefineDefaultConstructor): Used to define the
19003         default constructors if none was provided.
19004
19005         (ConstructorInitializer): Add methods Resolve and Emit. 
19006
19007         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19008
19009 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19010
19011         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19012         the default constructor builder with our hashtable for methodbuilders
19013         to methodcores.
19014
19015         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19016         and argument_count is 0 in which case we have a match.
19017         (Binary::ResolveOperator): More null checking and miscellaneous coding
19018         style cleanup.
19019
19020 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19021
19022         * rootcontext.cs (IsNameSpace): Compare against null.
19023
19024         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19025
19026         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19027         and Unary::Operator.
19028
19029         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19030         accordingly.
19031
19032         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19033         we have overloaded operators.
19034         (Binary::ResolveOperator): Implement the part which does the operator overload
19035         resolution.
19036
19037         * class.cs (Operator::Emit): Implement.
19038         (TypeContainer::Emit): Emit the operators we have too.
19039
19040         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19041         the case when we have a user-defined operator.
19042
19043 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19044
19045         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19046
19047 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19048
19049         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19050         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19051         (Constructor::Emit): Implement.
19052         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19053         if we have no work to do. 
19054         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19055         Emit method.
19056
19057         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19058         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19059
19060         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19061         of parent.parent.
19062
19063 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19064
19065         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19066         in the source.
19067         (Tree::RecordNamespace): Method to do what the name says ;-)
19068         (Tree::Namespaces): Property to get at the namespaces hashtable.
19069
19070         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19071         keep track.
19072
19073         * rootcontext.cs (IsNamespace): Fixed it :-)
19074
19075 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19076
19077         * class.cs (TypeContainer::FindMembers): Add support for
19078         constructors. 
19079         (MethodCore): New class that encapsulates both the shared aspects
19080         of a Constructor and a Method.  
19081         (Method, Constructor): Factored pieces into MethodCore.
19082
19083         * driver.cs: Added --fatal which makes errors throw exceptions.
19084         Load System assembly as well as part of the standard library.
19085
19086         * report.cs: Allow throwing exceptions on errors for debugging.
19087
19088         * modifiers.cs: Do not use `parent', instead use the real type
19089         container to evaluate permission settings.
19090
19091         * class.cs: Put Ravi's patch back in.  He is right, and we will
19092         have to cope with the
19093
19094 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19095
19096         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19097         FamORAssem, not FamANDAssem.
19098
19099 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19100
19101         * driver.cs: Added --parse option that only parses its input files
19102         and terminates.
19103
19104         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19105         incorrect.  IsTopLevel is not used to tell whether an object is
19106         root_types or not (that can be achieved by testing this ==
19107         root_types).  But to see if this is a top-level *class* (not
19108         necessarly our "toplevel" container). 
19109
19110 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19111
19112         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19113         parent instead of a direct call to GetType.
19114
19115 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19116
19117         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19118         Modifiers.TypeAttr. This should just be a call to that method.
19119
19120         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19121         object so that we can determine if we are top-level or not.
19122
19123         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19124         TypeContainer too.
19125
19126         * enum.cs (Enum::Define): Ditto.
19127
19128         * modifiers.cs (FieldAttr): Re-write.
19129
19130         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19131         (TypeContainer::HaveStaticConstructor): New property to provide access
19132         to precisely that info.
19133
19134         * modifiers.cs (MethodAttr): Re-write.
19135         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19136
19137         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19138         of top-level types as claimed.
19139
19140 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19141
19142         * expression.cs (MemberLookup): Fruitless attempt to lookup
19143         constructors.  Maybe I need to emit default constructors?  That
19144         might be it (currently .NET emits this for me automatically).
19145         (Invocation::OverloadResolve): Cope with Arguments == null.
19146         (Invocation::EmitArguments): new function, shared by the new
19147         constructor and us.
19148         (Invocation::Emit): Handle static and instance methods.  Emit
19149         proper call instruction for virtual or non-virtual invocations.
19150         (New::Emit): Implement.
19151         (New::Resolve): Implement.
19152         (MemberAccess:Resolve): Implement.
19153         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19154         to track instances.
19155         (FieldExpr::Resolve): Set type.
19156
19157         * support.cs: Handle empty arguments.
19158                 
19159         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19160         SimpleLookup): Auxiliary routines to help parse a qualifier
19161         identifier.  
19162
19163         Update qualifier_identifier rule.
19164
19165         * codegen.cs: Removed debugging messages.
19166
19167         * class.cs: Make this a global thing, this acts just as a "key" to
19168         objects that we might have around.
19169
19170         (Populate): Only initialize method_builders_to_methods once.
19171
19172         * expression.cs (PropertyExpr): Initialize type from the
19173         PropertyType. 
19174
19175         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19176         Resolve pattern.  Attempt to implicitly convert value to boolean.
19177         Emit code.
19178
19179         * expression.cs: Set the type for the int32/int32 argument case.
19180         (Binary::ResolveOperator): Set the return type to boolean for
19181         comparission operators
19182
19183         * typemanager.cs: Remove debugging print code.
19184
19185         (Invocation::Resolve): resolve type.
19186
19187         * class.cs: Allocate a MemberInfo of the correct size, as the code
19188         elsewhere depends on the test to reflect the correct contents.
19189
19190         (Method::) Keep track of parameters, due to System.Reflection holes
19191
19192         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19193         mapping here.
19194
19195         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19196         of the exact size and return that.
19197
19198         (Class::LookupMethodByBuilder): New function that maps
19199         MethodBuilders to its methods.  Required to locate the information
19200         on methods because System.Reflection bit us again.
19201
19202         * support.cs: New file, contains an interface ParameterData and
19203         two implementations: ReflectionParameters and InternalParameters
19204         used to access Parameter information.  We will need to grow this
19205         as required.
19206
19207         * expression.cs (Invocation::GetParameterData): implement a cache
19208         and a wrapper around the ParameterData creation for methods. 
19209         (Invocation::OverloadResolve): Use new code.
19210
19211 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19212
19213         * class.cs (TypeContainer::EmitField): Remove and move into 
19214         (Field::Define): here and modify accordingly.
19215         (Field.FieldBuilder): New member.
19216         (TypeContainer::Populate): Update accordingly.
19217         (TypeContainer::FindMembers): Implement.
19218
19219 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19220
19221         * statement.cs: (VariableInfo::VariableType): New field to be
19222         initialized with the full type once it is resolved. 
19223
19224 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19225
19226         * parameter.cs (GetParameterInfo): Use a type cache to compute
19227         things only once, and to reuse this information
19228
19229         * expression.cs (LocalVariableReference::Emit): Implement.
19230         (OpcodeCast::Emit): fix.
19231
19232         (ParameterReference::Resolve): Implement.
19233         (ParameterReference::Emit): Implement.
19234
19235         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19236         that are expressions need to stay as Expressions.
19237
19238         * typemanager.cs (CSharpName): Returns the C# name of a type if
19239         possible. 
19240
19241         * expression.cs (Expression::ConvertImplicit): New function that
19242         implements implicit type conversions.
19243
19244         (Expression::ImplicitReferenceConversion): Implements implicit
19245         reference conversions.
19246
19247         (EmptyCast): New type for transparent casts.
19248
19249         (OpcodeCast): New type for casts of types that are performed with
19250         a sequence of bytecodes.
19251
19252         (BoxedCast): New type used for casting value types into reference
19253         types.  Emits a box opcode.
19254
19255         (Binary::DoNumericPromotions): Implements numeric promotions of
19256         and computation of the Binary::Type.
19257
19258         (Binary::EmitBranchable): Optimization.
19259
19260         (Binary::Emit): Implement code emission for expressions.
19261
19262         * typemanager.cs (TypeManager): Added two new core types: sbyte
19263         and byte.
19264
19265 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19266
19267         * class.cs (TypeContainer::FindMembers): Method which does exactly
19268         what Type.FindMembers does, only we don't have to use reflection. No
19269         implementation yet.
19270
19271         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19272         typecontainer objects as we need to get at them.
19273         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19274
19275         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19276         typecontainer object.
19277
19278         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19279         of just a Report object.
19280
19281 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19282
19283         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19284         "remove_"
19285         (TypeContainer::Populate): Now define the delegates of the type too.
19286         (TypeContainer.Delegates): Property to access the list of delegates defined
19287         in the type.
19288
19289         * delegates.cs (Delegate::Define): Implement partially.
19290
19291         * modifiers.cs (TypeAttr): Handle more flags.
19292
19293 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19294
19295         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19296         and not <=
19297         (Operator::Define): Re-write logic to get types by using the LookupType method
19298         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19299         (Indexer::Define): Ditto.
19300         (Event::Define): Ditto.
19301         (Property::Define): Ditto.
19302
19303 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19304
19305         * class.cs (TypeContainer::Populate): Now define operators too. 
19306         (TypeContainer.Operators): New property to access the list of operators
19307         in a type.
19308         (Operator.OperatorMethodBuilder): New member to hold the method builder
19309         for the operator we are defining.
19310         (Operator::Define): Implement.
19311
19312 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19313
19314         * class.cs (Event::Define): Make the prefixes of the accessor methods
19315         addOn_ and removeOn_ 
19316
19317         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19318         of the location being passed in too. Ideally, this should go later since all
19319         error reporting should be done through the Report object.
19320
19321         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19322         (Populate): Iterate thru the indexers we have and define them too.
19323         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19324         for the get and set accessors.
19325         (Indexer::Define): Implement.
19326
19327 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19328
19329         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19330         my previous implementation, did not work.
19331
19332         * typemanager.cs: Add a couple of missing types (the longs).
19333
19334         * literal.cs: Use TypeManager.bool_type instead of getting it.
19335
19336         * expression.cs (EventExpr): New kind of expressions.
19337         (Expressio::ExprClassFromMemberInfo): finish
19338
19339 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19340
19341         * assign.cs: Emit stores to static fields differently.
19342
19343 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19344
19345         * Merge in changes and adjust code to tackle conflicts. Backed out my
19346         code in Assign::Resolve ;-) 
19347
19348 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19349
19350         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19351         instead Report.Error and also pass in the location.
19352         (CSharpParser::Lexer): New readonly property to return the reference
19353         to the Tokenizer object.
19354         (declare_local_variables): Use Report.Error with location instead of plain 
19355         old error.
19356         (CheckDef): Ditto.
19357
19358         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19359         (Operator.CheckBinaryOperator): Ditto.
19360
19361         * cs-parser.jay (operator_declarator): Update accordingly.
19362
19363         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19364         (CheckBinaryOperator): Same here.
19365
19366         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19367         on the name without any prefixes of namespace names etc. This is because we
19368         already might have something already fully qualified like 
19369         'System.Console.WriteLine'
19370
19371         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19372
19373 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19374
19375         * cs-tokenizer.cs (location): Return a string which also contains
19376         the file name.
19377
19378         * expression.cs (ElementAccess): New class for expressions of the
19379         type 'element access.'
19380         (BaseAccess): New class for expressions of the type 'base access.'
19381         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19382         respectively.
19383
19384         * cs-parser.jay (element_access): Implement action.
19385         (base_access): Implement actions.
19386         (checked_expression, unchecked_expression): Implement.
19387
19388         * cs-parser.jay (local_variable_type): Correct and implement.
19389         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19390
19391         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19392
19393         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19394         name and the specifiers.
19395
19396         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19397
19398         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19399         making them all public ;-)
19400
19401         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19402         class anyways.
19403
19404 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19405
19406         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19407         PropertyExprs.
19408         (FieldExpr, PropertyExprs): New resolved expressions.
19409         (SimpleName::MemberStaticCheck): Perform static checks for access
19410         to non-static fields on static methods. Maybe this should be
19411         generalized for MemberAccesses. 
19412         (SimpleName::ResolveSimpleName): More work on simple name
19413         resolution. 
19414
19415         * cs-parser.jay (primary_expression/qualified_identifier): track
19416         the parameter index.
19417
19418         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19419         (EmitContext::EmitBoolExpression): Chain to expression generation
19420         instead of temporary hack.
19421         (::EmitStatementExpression): Put generic expression code generation.
19422
19423         * assign.cs (Assign::Emit): Implement variable assignments to
19424         local variables, parameters and fields.
19425
19426 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19427
19428         * statement.cs (Block::GetVariableInfo): New method, returns the
19429         VariableInfo for a variable name in a block.
19430         (Block::GetVariableType): Implement in terms of GetVariableInfo
19431
19432         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19433         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19434
19435 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19436
19437         * cs-parser.jay (operator_declaration): Continue on my quest : update
19438         to take attributes argument.
19439         (event_declaration): Ditto.
19440         (enum_declaration): Ditto.
19441         (indexer_declaration): Ditto.
19442
19443         * class.cs (Operator::Operator): Update constructor accordingly.
19444         (Event::Event): Ditto.
19445
19446         * delegate.cs (Delegate::Delegate): Same here.
19447
19448         * enum.cs (Enum::Enum): Same here.
19449
19450 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19451
19452         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19453
19454         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19455
19456         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19457         being passed around as an arraylist.
19458         (Attributes::AddAttribute): Method to add attribute sections.
19459
19460         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19461         (struct_declaration): Update accordingly.
19462         (constant_declaration): Update.
19463         (field_declaration): Update.
19464         (method_header): Update.
19465         (fixed_parameter): Update.
19466         (parameter_array): Ditto.
19467         (property_declaration): Ditto.
19468         (destructor_declaration): Ditto.
19469
19470         * class.cs (Struct::Struct): Update constructors accordingly.
19471         (Class::Class): Ditto.
19472         (Field::Field): Ditto.
19473         (Method::Method): Ditto.
19474         (Property::Property): Ditto.
19475         (TypeContainer::OptAttribute): update property's return type.
19476
19477         * interface.cs (Interface.opt_attributes): New member.
19478         (Interface::Interface): Update to take the extra Attributes argument.
19479
19480         * parameter.cs (Parameter::Parameter): Ditto.
19481
19482         * constant.cs (Constant::Constant): Ditto.
19483
19484         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19485         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19486         the attributes as a parameter.
19487         (InterfaceProperty): Update constructor call.
19488         (InterfaceEvent): Ditto.
19489         (InterfaceMethod): Ditto.
19490         (InterfaceIndexer): Ditto.
19491
19492         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19493         pass the attributes too.
19494         (interface_event_declaration): Ditto.
19495         (interface_property_declaration): Ditto.
19496         (interface_method_declaration): Ditto.
19497         (interface_declaration): Ditto.
19498
19499 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19500
19501         * class.cs (Method::Define): Track the "static Main" definition to
19502         create an entry point. 
19503
19504         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19505         EntryPoint if we find it. 
19506
19507         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19508         (EmitContext::ig): Make this variable public.
19509
19510         * driver.cs: Make the default output file be the first file name
19511         with the .exe extension.  
19512
19513         Detect empty compilations
19514
19515         Handle various kinds of output targets.  Handle --target and
19516         rename -t to --dumper.
19517
19518         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19519         methods inherited from Expression return now an Expression.  This
19520         will is used during the tree rewriting as we resolve them during
19521         semantic analysis.
19522
19523         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19524         the spec.  Missing entirely is the information about
19525         accessability of elements of it.
19526
19527         (Expression::ExprClassFromMemberInfo): New constructor for
19528         Expressions that creates a fully initialized Expression based on
19529         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19530         a Type.
19531
19532         (Invocation::Resolve): Begin implementing resolution of invocations.
19533
19534         * literal.cs (StringLiteral):  Implement Emit.
19535
19536 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19537
19538         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19539         member.
19540
19541 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19542
19543         * cs-parser.jay (attribute_arguments): Implement actions.
19544         (attribute): Fix bug in production. Implement action.
19545         (attribute_list): Implement.
19546         (attribute_target): Implement.
19547         (attribute_target_specifier, opt_target_specifier): Implement
19548         (CheckAttributeTarget): New method to check if the attribute target
19549         is valid.
19550         (attribute_section): Implement.
19551         (opt_attributes): Implement.
19552
19553         * attribute.cs : New file to handle attributes.
19554         (Attribute): Class to hold attribute info.
19555
19556         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19557         (attribute_section): Modify production to use 2 different rules to 
19558         achieve the same thing. 1 s/r conflict down !
19559         Clean out commented, useless, non-reducing dimension_separator rules.
19560
19561         * class.cs (TypeContainer.attributes): New member to hold list
19562         of attributes for a type.
19563         (Struct::Struct): Modify to take one more argument, the attribute list.
19564         (Class::Class): Ditto.
19565         (Field::Field): Ditto.
19566         (Method::Method): Ditto.
19567         (Property::Property): Ditto.
19568
19569         * cs-parser.jay (struct_declaration): Update constructor call to
19570         pass in the attributes too.
19571         (class_declaration): Ditto.
19572         (constant_declaration): Ditto.
19573         (field_declaration): Ditto.
19574         (method_header): Ditto.
19575         (fixed_parameter): Ditto.
19576         (parameter_array): Ditto.
19577         (property_declaration): Ditto.
19578
19579         * constant.cs (Constant::Constant): Update constructor similarly.
19580         Use System.Collections.
19581
19582         * parameter.cs (Parameter::Parameter): Update as above.
19583
19584 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19585
19586         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19587         (TypeContainer.delegates): New member to hold list of delegates.
19588
19589         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19590         this time as I seem to be on crack ;-)
19591
19592 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19593
19594         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19595         tell whether an identifier represents a namespace.
19596
19597         * expression.cs (NamespaceExpr): A namespace expression, used only
19598         temporarly during expression resolution.
19599         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19600         utility functions to resolve names on expressions.
19601
19602 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19603
19604         * codegen.cs: Add hook for StatementExpressions. 
19605
19606         * class.cs: Fix inverted test for static flag in methods.
19607
19608 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19609
19610         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19611         to make it coincide with MS' number.
19612         (Operator::CheckBinaryOperator): Ditto.
19613
19614         * ../errors/errors.txt : Remove error numbers added earlier.
19615
19616         * ../errors/cs1019.cs : Test case for error # 1019
19617
19618         * ../errros/cs1020.cs : Test case for error # 1020
19619
19620         * cs-parser.jay : Clean out commented cruft.
19621         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19622         used anywhere - non-reducing rule.
19623         (namespace_declarations): Non-reducing rule - comment out.
19624
19625         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19626         with TypeContainer::AddEnum.
19627
19628         * delegate.cs : New file for delegate handling classes.
19629         (Delegate): Class for declaring delegates.
19630
19631         * makefile : Update.
19632
19633         * cs-parser.jay (delegate_declaration): Implement.
19634
19635 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19636
19637         * class.cs (Event::Define): Implement.
19638         (Event.EventBuilder): New member.
19639
19640         * class.cs (TypeContainer::Populate): Update to define all enums and events
19641         we have.
19642         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19643         readonly fields for all these cases ?
19644
19645 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19646
19647         * class.cs (Property): Revamp to use the convention of making fields readonly.
19648         Accordingly modify code elsewhere.
19649
19650         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19651         the Define method of the Property class.
19652
19653         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19654         trivial bug.
19655         (TypeContainer::Populate): Update to define all the properties we have. Also
19656         define all enumerations.
19657
19658         * enum.cs (Define): Implement.
19659
19660 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19661
19662         * cs-parser.jay (overloadable_operator): The semantic value is an
19663         enum of the Operator class.
19664         (operator_declarator): Implement actions.
19665         (operator_declaration): Implement.
19666
19667         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19668         validity of definitions.
19669         (Operator::CheckBinaryOperator): Static method to check for binary operators
19670         (TypeContainer::AddOperator): New method to add an operator to a type.
19671
19672         * cs-parser.jay (indexer_declaration): Added line to actually call the
19673         AddIndexer method so it gets added ;-)
19674
19675         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19676         already taken care of by the MS compiler ?  
19677
19678 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19679
19680         * class.cs (Operator): New class for operator declarations.
19681         (Operator::OpType): Enum for the various operators.
19682
19683 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19684
19685         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19686         ostensibly handle this in semantic analysis.
19687
19688         * cs-parser.jay (general_catch_clause): Comment out
19689         (specific_catch_clauses, specific_catch_clause): Ditto.
19690         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19691         (catch_args, opt_catch_args): New productions.
19692         (catch_clause): Rewrite to use the new productions above
19693         (catch_clauses): Modify accordingly.
19694         (opt_catch_clauses): New production to use in try_statement
19695         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19696         and re-write the code in the actions to extract the specific and
19697         general catch clauses by being a little smart ;-)
19698
19699         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19700         Hooray, try and catch statements parse fine !
19701
19702 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19703
19704         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19705         string from the hashtable of variables.
19706
19707         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19708         I end up making that mistake ;-)
19709         (catch_clauses): Fixed gross error which made Key and Value of the 
19710         DictionaryEntry the same : $1 !!
19711
19712 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19713
19714         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19715
19716         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19717         when the add and remove accessors are specified. 
19718
19719 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19720
19721         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19722         information about indexer_declarator.
19723         (indexer_declarator): Implement actions.
19724         (parsing_indexer): New local boolean used to keep track of whether
19725         we are parsing indexers or properties. This is necessary because 
19726         implicit_parameters come into picture even for the get accessor in the 
19727         case of an indexer.
19728         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19729
19730         * class.cs (Indexer): New class for indexer declarations.
19731         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19732         (TypeContainer::indexers): New member to hold list of indexers for the
19733         type.
19734
19735 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19736
19737         * cs-parser.jay (add_accessor_declaration): Implement action.
19738         (remove_accessor_declaration): Implement action.
19739         (event_accessors_declaration): Implement
19740         (variable_declarators): swap statements for first rule - trivial.
19741
19742         * class.cs (Event): New class to hold information about event
19743         declarations.
19744         (TypeContainer::AddEvent): New method to add an event to a type
19745         (TypeContainer::events): New member to hold list of events.
19746
19747         * cs-parser.jay (event_declaration): Implement actions.
19748
19749 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19750
19751         * cs-parser.jay (dim_separators): Implement. Make it a string
19752         concatenating all the commas together, just as they appear.
19753         (opt_dim_separators): Modify accordingly
19754         (rank_specifiers): Update accordingly. Basically do the same
19755         thing - instead, collect the brackets here.
19756         (opt_rank_sepcifiers): Modify accordingly.
19757         (array_type): Modify to actually return the complete type string
19758         instead of ignoring the rank_specifiers.
19759         (expression_list): Implement to collect the expressions
19760         (variable_initializer): Implement. We make it a list of expressions
19761         essentially so that we can handle the array_initializer case neatly too.
19762         (variable_initializer_list): Implement.
19763         (array_initializer): Make it a list of variable_initializers
19764         (opt_array_initializer): Modify accordingly.
19765
19766         * expression.cs (New::NType): Add enumeration to help us
19767         keep track of whether we have an object/delegate creation
19768         or an array creation.
19769         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19770         members to hold data about array creation.
19771         (New:New): Modify to update NewType
19772         (New:New): New Overloaded contructor for the array creation
19773         case.
19774
19775         * cs-parser.jay (array_creation_expression): Implement to call
19776         the overloaded New constructor.
19777
19778 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19779
19780         * class.cs (TypeContainer::Constructors): Return member
19781         constructors instead of returning null.
19782
19783 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19784
19785         * typemanager.cs (InitCoreTypes): Initialize the various core
19786         types after we have populated the type manager with the user
19787         defined types (this distinction will be important later while
19788         compiling corlib.dll)
19789
19790         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19791         on Expression Classification.  Now all expressions have a method
19792         `Resolve' and a method `Emit'.
19793
19794         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19795         generation from working.     Also add some temporary debugging
19796         code. 
19797
19798 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19799
19800         * codegen.cs: Lots of code generation pieces.  This is only the
19801         beginning, will continue tomorrow with more touches of polish.  We
19802         handle the fundamentals of if, while, do, for, return.  Others are
19803         trickier and I need to start working on invocations soon.
19804
19805         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19806         s.InitStatement. 
19807
19808         * codegen.cs (EmitContext): New struct, used during code
19809         emission to keep a context.   Most of the code generation will be
19810         here. 
19811
19812         * cs-parser.jay: Add embedded blocks to the list of statements of
19813         this block.  So code generation proceeds in a top down fashion.
19814
19815 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19816
19817         * statement.cs: Add support for multiple child blocks.
19818
19819 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19820
19821         * codegen.cs (EmitCode): New function, will emit the code for a
19822         Block of code given a TypeContainer and its ILGenerator. 
19823
19824         * statement.cs (Block): Standard public readonly optimization.
19825         (Block::Block constructors): Link children. 
19826         (Block::Child): Child Linker.
19827         (Block::EmitVariables): Emits IL variable declarations.
19828
19829         * class.cs: Drop support for MethodGroups here, delay until
19830         Semantic Analysis.
19831         (Method::): Applied the same simplification that I did before, and
19832         move from Properties to public readonly fields.
19833         (Method::ParameterTypes): Returns the parameter types for the
19834         function, and implements a cache that will be useful later when I
19835         do error checking and the semantic analysis on the methods is
19836         performed.
19837         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19838         and made a method, optional argument tells whether this is a class
19839         or a structure to apply the `has-this' bit.
19840         (Method::GetCallingConvention): Implement, returns the calling
19841         convention. 
19842         (Method::Define): Defines the type, a second pass is performed
19843         later to populate the methods.
19844
19845         (Constructor::ParameterTypes): implement a cache similar to the
19846         one on Method::ParameterTypes, useful later when we do semantic
19847         analysis. 
19848
19849         (TypeContainer::EmitMethod):  New method.  Emits methods.
19850
19851         * expression.cs: Removed MethodGroup class from here.
19852
19853         * parameter.cs (Parameters::GetCallingConvention): new method.
19854
19855 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19856
19857         * class.cs (TypeContainer::Populate): Drop RootContext from the
19858         argument. 
19859
19860         (Constructor::CallingConvention): Returns the calling convention.
19861         (Constructor::ParameterTypes): Returns the constructor parameter
19862         types. 
19863
19864         (TypeContainer::AddConstructor): Keep track of default constructor
19865         and the default static constructor.
19866
19867         (Constructor::) Another class that starts using `public readonly'
19868         instead of properties. 
19869
19870         (Constructor::IsDefault): Whether this is a default constructor. 
19871
19872         (Field::) use readonly public fields instead of properties also.
19873
19874         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19875         track of static constructors;  If none is used, turn on
19876         BeforeFieldInit in the TypeAttributes. 
19877
19878         * cs-parser.jay (opt_argument_list): now the return can be null
19879         for the cases where there are no arguments. 
19880
19881         (constructor_declarator): If there is no implicit `base' or
19882         `this', then invoke the default parent constructor. 
19883
19884         * modifiers.cs (MethodAttr): New static function maps a set of
19885         modifiers flags into a MethodAttributes enum
19886         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19887         MethodAttr, TypeAttr to represent the various mappings where the
19888         modifiers are used.
19889         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19890
19891 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19892
19893         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19894         method arguments.
19895
19896         * interface.cs (PopulateIndexer): Implemented the code generator
19897         for interface indexers.
19898
19899 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19900
19901         * interface.cs (InterfaceMemberBase): Now we track the new status
19902         here.  
19903
19904         (PopulateProperty): Implement property population.  Woohoo!  Got
19905         Methods and Properties going today. 
19906
19907         Removed all the properties for interfaces, and replaced them with
19908         `public readonly' fields. 
19909
19910 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19911
19912         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19913         initialize their hashtables/arraylists only when they are needed
19914         instead of doing this always.
19915
19916         * parameter.cs: Handle refs and out parameters.
19917
19918         * cs-parser.jay: Use an ArrayList to construct the arguments
19919         instead of the ParameterCollection, and then cast that to a
19920         Parameter[] array.
19921
19922         * parameter.cs: Drop the use of ParameterCollection and use
19923         instead arrays of Parameters.
19924
19925         (GetParameterInfo): Use the Type, not the Name when resolving
19926         types. 
19927
19928 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19929
19930         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19931         and instead use public readonly fields.
19932
19933         * class.cs: Put back walking code for type containers.
19934
19935 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19936
19937         * class.cs (MakeConstant): Code to define constants.
19938
19939         * rootcontext.cs (LookupType): New function.  Used to locate types 
19940
19941
19942 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19943
19944         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
19945         this System.Reflection code is.  Kudos to Microsoft
19946
19947         * typemanager.cs: Implement a type cache and avoid loading all
19948         types at boot time.  Wrap in LookupType the internals.  This made
19949         the compiler so much faster.  Wow.  I rule!
19950
19951         * driver.cs: Make sure we always load mscorlib first (for
19952         debugging purposes, nothing really important).
19953
19954         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19955         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19956
19957         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19958         on namespaces that have been imported using the `using' keyword.
19959
19960         * class.cs (TypeContainer::TypeAttr): Virtualize.
19961         (Class::TypeAttr): Return attributes suitable for this bad boy.
19962         (Struct::TypeAttr): ditto.
19963         Handle nested classes.
19964         (TypeContainer::) Remove all the type visiting code, it is now
19965         replaced with the rootcontext.cs code
19966
19967         * rootcontext.cs (GetClassBases): Added support for structs. 
19968
19969 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19970
19971         * interface.cs, statement.cs, class.cs, parameter.cs,
19972         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19973         Drop use of TypeRefs, and use strings instead.
19974
19975 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
19976
19977         * rootcontext.cs: 
19978
19979         * class.cs (Struct::Struct): set the SEALED flags after
19980         checking the modifiers.
19981         (TypeContainer::TypeAttr): new property, returns the
19982         TypeAttributes for a class.  
19983
19984         * cs-parser.jay (type_list): Oops, list production was creating a
19985         new list of base types.
19986
19987         * rootcontext.cs (StdLib): New property.
19988         (GetInterfaceTypeByName): returns an interface by type name, and
19989         encapsulates error handling here.
19990         (GetInterfaces): simplified.
19991         (ResolveTree): Encapsulated all the tree resolution here.
19992         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
19993         types. 
19994
19995         * driver.cs: Add support for --nostdlib, to avoid loading the
19996         default assemblies.
19997         (Main): Do not put tree resolution here. 
19998
19999         * rootcontext.cs: Beginning of the class resolution.
20000
20001 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20002
20003         * rootcontext.cs: Provide better error reporting. 
20004
20005         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20006
20007         * rootcontext.cs (CreateInterface): Handle the case where there
20008         are no parent interfaces.
20009
20010         (CloseTypes): Routine to flush types at the end.
20011         (CreateInterface): Track types.
20012         (GetInterfaces): Returns an array of Types from the list of
20013         defined interfaces.
20014
20015         * typemanager.c (AddUserType): Mechanism to track user types (puts
20016         the type on the global type hash, and allows us to close it at the
20017         end). 
20018
20019 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20020
20021         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20022         RecordInterface instead.
20023
20024         * cs-parser.jay: Updated to reflect changes above.
20025
20026         * decl.cs (Definition): Keep track of the TypeBuilder type that
20027         represents this type here.  Not sure we will use it in the long
20028         run, but wont hurt for now.
20029
20030         * driver.cs: Smaller changes to accomodate the new code.
20031
20032         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20033         when done. 
20034
20035         * rootcontext.cs (CreateInterface):  New method, used to create
20036         the System.TypeBuilder type for interfaces.
20037         (ResolveInterfaces): new entry point to resolve the interface
20038         hierarchy. 
20039         (CodeGen): Property, used to keep track of the code generator.
20040
20041 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20042
20043         * cs-parser.jay: Add a second production for delegate_declaration
20044         with `VOID'.
20045
20046         (enum_body): Put an opt_comma here instead of putting it on
20047         enum_body or enum_member_declarations so we can handle trailing
20048         commas on enumeration members.  Gets rid of a shift/reduce.
20049
20050         (type_list): Need a COMMA in the middle.
20051
20052         (indexer_declaration): Tell tokenizer to recognize get/set
20053
20054         * Remove old targets.
20055
20056         * Re-add the parser target.
20057
20058 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20059
20060         * cs-parser.jay: Add precendence rules for a number of operators
20061         ot reduce the number of shift/reduce conflicts in the grammar.
20062
20063 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20064
20065         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20066         and put it here.
20067
20068         Get rid of old crufty code.
20069
20070         * rootcontext.cs: Use this to keep track of the parsed
20071         representation and the defined types available to the program. 
20072
20073         * gen-treedump.cs: adjust for new convention.
20074
20075         * type.cs: Split out the type manager, and the assembly builder
20076         from here. 
20077
20078         * typemanager.cs: the type manager will live here now.
20079
20080         * cil-codegen.cs: And the code generator here. 
20081
20082 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20083
20084         * makefile: Fixed up for easy making.
20085
20086 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20087
20088         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20089         the 
20090
20091         (unary_expression): Expand pre_increment_expression and
20092         post_decrement_expression to reduce a shift/reduce.
20093
20094 2001-07-11  Simon Cozens
20095
20096         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20097
20098         Improve allow_keyword_as_indent name.
20099
20100 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20101
20102         * Adjustments for Beta2. 
20103
20104 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20105
20106         * decl.cs: Added `Define' abstract method.
20107         (InTransit): new property, used to catch recursive definitions. 
20108
20109         * interface.cs: Implement `Define'. 
20110
20111         * modifiers.cs: Map Modifiers.constants to
20112         System.Reflection.TypeAttribute flags.
20113
20114         * class.cs: Keep track of types and user-defined types.
20115         (BuilderInit): New method for creating an assembly
20116         (ResolveType): New function to launch the resolution process, only
20117         used by interfaces for now.
20118
20119         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20120         that are inserted into the name space. 
20121
20122 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20123
20124         * ARGH.  I have screwed up my tree so many times due to the use of
20125         rsync rather than using CVS.  Going to fix this at once. 
20126
20127         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20128         load types.
20129
20130 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20131
20132         * Experiment successful: Use System.Type rather that our own
20133         version of Type.  
20134
20135 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20136
20137         * cs-parser.jay: Removed nsAliases from here.
20138
20139         Use new namespaces, handle `using XXX;' 
20140
20141         * namespace.cs: Reimplemented namespace handling, use a recursive
20142         definition of the class.  Now we can keep track of using clauses
20143         and catch invalid using clauses.
20144
20145 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20146
20147         * gen-treedump.cs: Adapted for all the renaming.
20148
20149         * expression.cs (Expression): this class now has a Type property
20150         which returns an expression Type.
20151
20152         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20153         `Type', as this has a different meaning now in the base
20154
20155 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20156
20157         * interface.cs, class.cs: Removed from all the sources the
20158         references to signature computation, as we can not do method
20159         signature computation during the parsing time, as we are not
20160         trying to solve at that point distinguishing:
20161
20162         class X {
20163                 void a (Blah x) {}
20164                 void a (NS.Blah x) {}
20165         }
20166
20167         Which depending on the context might be valid or not, as we do not
20168         know if Blah is the same thing as NS.Blah at that point.
20169
20170         * Redid everything so the code uses TypeRefs now instead of
20171         Types.  TypeRefs are just temporary type placeholders, that need
20172         to be resolved.  They initially have a pointer to a string and the
20173         current scope in which they are used.  This is used later by the
20174         compiler to resolve the reference to an actual Type. 
20175
20176         * DeclSpace is no longer a CIR.Type, and neither are
20177         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20178         are all DeclSpaces, but no Types. 
20179
20180         * type.cs (TypeRefManager): This implements the TypeRef manager,
20181         which keeps track of all the types that need to be resolved after
20182         the parsing has finished. 
20183
20184 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20185
20186         * ARGH.  We are going to have to store `foreach' as a class rather
20187         than resolving it, as we need to verify error 1579 after name
20188         resolution.   *OR* we could keep a flag that says `This request to
20189         IEnumerator comes from a foreach statement' which we can then use
20190         to generate the error.
20191
20192 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20193
20194         * class.cs (TypeContainer.AddMethod): we now add methods to the
20195         MethodGroup instead of the method hashtable.  
20196
20197         * expression.cs: Add MethodGroup abstraction, which gets us one
20198         step closer to the specification in the way we handle method
20199         declarations.  
20200
20201         * cs-parser.jay (primary_expression): qualified_identifier now
20202         tried to match up an identifier to a local variable reference or
20203         to a parameter reference.
20204
20205         current_local_parameters is now a parser global variable that
20206         points to the current parameters for the block, used during name
20207         lookup.
20208
20209         (property_declaration): Now creates an implicit `value' argument to
20210         the set accessor.
20211
20212 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20213
20214         * parameter.cs: Do not use `param' arguments as part of the
20215         signature, per the spec.
20216
20217 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20218
20219         * decl.cs: Base class for classes, structs and interfaces.  This
20220         is the "Declaration Space" 
20221
20222         * cs-parser.jay: Use CheckDef for checking declaration errors
20223         instead of having one on each function.
20224
20225         * class.cs: Factor out some code for handling error handling in
20226         accordance to the "Declarations" section in the "Basic Concepts"
20227         chapter in the ECMA C# spec.
20228
20229         * interface.cs: Make all interface member classes derive from
20230         InterfaceMemberBase.
20231
20232 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20233
20234         * Many things: all interfaces are parsed and generated in
20235         gen-treedump.  Support for member variables, constructors,
20236         destructors, properties, constants is there.
20237
20238         Beginning of the IL backend, but very little done, just there for
20239         testing purposes. 
20240
20241 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20242
20243         * cs-parser.jay: Fix labeled statement.
20244
20245         * cs-tokenizer.cs (escape): Escape " and ' always.
20246         ref_line, ref_name: keep track of the line/filename as instructed
20247         by #line by the compiler.
20248         Parse #line.
20249
20250 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20251
20252         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20253         to match the values in System.CodeDOM.
20254
20255         Divid renamed to Divide.
20256
20257         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20258         statements. 
20259         (Statements.set): remove.
20260
20261         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20262         statements. 
20263
20264         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20265         falseStatements always have valid values. 
20266
20267         * cs-parser.jay: Use System.CodeDOM now.
20268