**** Merged r40699 from MCS ****
[mono.git] / mcs / gmcs / ChangeLog
1 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #71992.
4         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5         'ignore_cs0104' parameter.  Pass it to ...
6         (NamespaceEntry.Lookup): ... this.
7         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
8         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9         (TypeLookupExpression.DoResolveAsTypeStep): Update.
10         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
11         Update.  Request that cs0104 errors be ignored.
12         (ComposedCast.ResolveAsTypeStep): Update.
13
14 2005-02-14  Raja R Harinath  <rharinath@novell.com>
15
16         Fix #59209.
17         * expression.cs (Invocation.BetterFunction): Remove support for
18         comparing virtual functions and their overrides.
19         (Invocation.IsOverride): New.
20         (Invocation.OverloadResolve): Don't consider 'override' functions
21         during candidate selection.  Store them in a lookaside list.
22         If the selected method is a 'virtual' function, use the list to
23         find any overrides that are closer to the LHS type.
24
25 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
26
27         * expression.cs (New.DoResolve): Add complex core type reduction.
28         (New.Constantify): Converts complex core type syntax like 'new int ()'
29         to simple constant.
30         
31 2005-02-14  Raja R Harinath  <rharinath@novell.com>
32
33         * decl.cs (EntryType.EntryType): New constructor to create an
34         updated copy of a cache entry.
35         (MemberCache.AddMethods): Use it.
36         (MemberCache.ClearDeclaredOnly): Remove.
37         (MemberCache.MemberCache): Update.
38
39 2005-02-11  Miguel de Icaza  <miguel@novell.com>
40
41         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
42         variable.  This one is represents the actual low-level declaration
43         of the method, as opposed to the semantic level `IsStatic'.   
44
45         An anonymous method which is hosted into a static method might be
46         actually an instance method.  IsStatic would reflect the
47         container, while MethodIsStatic represents the actual code
48         generated.
49
50         * expression.cs (ParameterReference): Use the new MethodIsStatic
51         instead of IsStatic.
52
53         * anonymous.cs (AnonymousMethod.Compatible): Pass the
54         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
55         set on the current EmitContext. 
56
57         * expression.cs (Cast): Overload DoResolveLValue so we can pass
58         resolve our casted expression as an LValue.  This triggers the
59         proper LValue processing that is later required by Assign.
60
61         This fixes 72347.
62
63         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
64
65 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
66
67         C# 2.0 Fixed buffer implementation
68
69         * anonymous.cs: Update after RegisterHelperClass renaming.
70
71         * attribute.cs (AttributeTester.fixed_buffer_cache):
72         Cache of external fixed buffers.
73         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
74         implementation if field is fixed buffer else null.
75
76         * class.cs
77         (TypeContainer.AddField): Accept FieldMember instead of Field.
78         (FieldBase.IsFieldClsCompliant): Extracted code from
79         VerifyClsCompliance descendant customization.
80         (FixedField): New class handles fixed buffer fields.
81         (FixedFieldExternal): Keeps information about imported fixed
82         buffer.
83         (IFixedField): Make access to internal or external fixed buffer
84         same.
85
86         * cs-parser.jay: Add fixed buffer parsing.
87
88         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
89         buffer.
90
91         * expression.cs (Indirection): Extended implementation to accept
92         fixed buffer field.
93         (PointerArithmetic.Emit): Get element from fixed buffer as well.
94         (ElementAccess.MakePointerAccess): Get type as parameter.
95         (DoResolve): Add fixed buffer field expression conversion.
96         (DoResolveLValue): Ditto.
97         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
98         (ArrayPtr): Derives from FixedBufferPtr.
99         (ArrayPtr.Emit): Add extra emit for array elements.
100
101         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
102
103         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
104         for compiler generated types.
105         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
106
107         * statement.cs (Fixed): Refactored to be easier add fixed buffer
108         and consume less memory.
109         (Fixed.Resolve): Add fixed buffer case.
110
111         * typemanager.cs (compiler_generated_attr_ctor,
112         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
113         (HasElementType): Add our own implementation to work on every
114         runtime.
115
116 2005-02-11  Miguel de Icaza  <miguel@novell.com>
117
118         * anonymous.cs (CaptureContext): Track whether `this' has been
119         referenced.   
120
121         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
122         only captured `this' if it was implicitly done (instance
123         methods/variables were used). 
124
125         * codegen.cs (EmitContext.CaptureThis): New method to flag that
126         `this' must be captured.
127
128 2005-01-30  Miguel de Icaza  <miguel@novell.com>
129  
130         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
131         is null it means that there has been no need to capture anything,
132         so we just create a sibling.
133
134         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
135
136         Just a partial fix.  The other half is fairly elusive.
137         
138 2005-02-10  Raja R Harinath  <rharinath@novell.com>
139
140         Fix #52586, cs0121-4.cs.
141         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
142         and return a hashtable.
143         (MemberCache.ClearDeclaredOnly): New.
144         (MemberCache.MemberCache): Update to change.  Make a deep copy of
145         the method_hash of a base type too.
146         (MemberCache.AddMethods): Adapt to having a deep copy of the base
147         type methods.  Overwrite entries with the same MethodHandle so
148         that the ReflectedType is correct.  The process leaves in base
149         virtual functions and their overrides as distinct entries.
150         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
151         matters since it was boxed in a ArrayList before.
152         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
153         modifier.
154         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
155         case of a virtual function and its override (choose the overload
156         as better).
157         (Invocation.OverloadResolve): Avoid 'override' members during
158         'applicable_type' calculation.
159
160 2005-02-09  Raja R Harinath  <rharinath@novell.com>
161
162         Combine two near-redundant caches.
163         * typemanager.cs (method_params): Rename from method_internal_params.
164         (TypeManager.GetParameterData): New.  Replace
165         Invocation.GetParameterData.
166         (TypeManager.LookupParametersByBuilder): Remove.
167         * expression.cs (Invocation.method_parameter_cache): Remove.
168         (Invocation.GetParameterData): Remove.
169         Update to changes.
170         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
171         Update to changes.
172
173 2005-02-08  Raja R Harinath  <rharinath@novell.com>
174
175         Fix #72015.
176         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
177         TypeManager.multicast_delegate_type is null, resolve it by looking
178         up "System.MulticastDelegate".
179         * rootcontext.cs (RootContext.ResolveCore): Simplify.
180
181 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
182             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
183             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
184
185         Fix cs0164.cs.
186         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
187         (LabeledStatement.AddReference): New.  Set 'referenced'.
188         (Goto.Resolve): Use it.
189
190 2005-02-05  John Luke  <john.luke@gmail.com>
191
192         * driver.cs: remove duplicate -doc line in Usage ()
193
194 2005-02-04  Raja R Harinath  <rharinath@novell.com>
195
196         * location.cs (Location.AddFile): Fix CS2002 error report.
197
198 2005-02-02  Martin Baulig  <martin@ximian.com>
199
200         * delegate.cs (Delegate.DefineType): Report an internal error if
201         TypeManager.multicast_delegate_type is null.  See bug #72015 for
202         details.        
203
204 2005-02-02  Raja R Harinath  <rharinath@novell.com>
205
206         Fix a crasher in a variant of #31984.
207         * const.cs (Constant.CheckBase): New override that defers the
208         new-or-override check in case the base type hasn't been populated
209         yet.
210         (Constant.Define): Ensure the new-or-override check is performed.
211
212 2005-02-01  Duncan Mak  <duncan@ximian.com>
213
214         * const.cs (LookupConstantValue): Check that `ce' is not null
215         before calling GetValue ().
216
217 2005-02-01  Raja R Harinath  <rharinath@novell.com>
218
219         Fix test-334.cs (#69519).
220         * cs-parser.jay (using_alias_directive): Pass in an expression to
221         NamespaceEntry.UsingAlias.
222         (using_namespace_directive): Pass in an expression to
223         NamespaceEntry.Using.
224         (namespace_name): Don't flatten to a string.
225         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
226         (NamespaceEntry.AliasEntry.Resolve): Lookup using
227         ResolveAsTypeStep.
228         (NamespaceEntry.UsingEntry): Likewise.
229         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
230         changes.
231         (NamespaceEntry.LookupForUsing): Remove.
232         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
233         names.
234         (NamespaceEntry.Lookup): Remove support for dotted names.
235
236 2005-02-01  Raja R Harinath  <rharinath@novell.com>
237
238         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
239         split into two.
240         (NamespaceEntry.ImplicitParent): Compute on demand.
241         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
242         parallels the current.
243         (NamespaceEntry.LookupForUsing): Use it.
244         (NamespaceEntry.Lookup): If the current namespace-entry is
245         implicit, don't search aliases and using tables.
246
247 2005-02-01  Raja R Harinath  <rharinath@novell.com>
248
249         Fix #31984.
250         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
251         BaseCache here.
252         (TypeContainer.BaseCache): Compute on demand.
253         (TypeContainer.FindMembers): Define constants and types if they're
254         not already created.
255         (FieldMember.Define): Move resetting of ec.InUnsafe before error
256         check.
257         * const.cs (Constant.Define): Make idempotent.
258
259 2005-01-29  Miguel de Icaza  <miguel@novell.com>
260
261         * pending.cs: Produce better code (no nops produced by using Ldarg
262         + value).
263         
264         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
265         i - 1' it should be arg + 1.
266
267         Fixes bug #71819.
268
269 2005-01-28  Raja R Harinath  <rharinath@novell.com>
270
271         * attribute.cs (Attribute.CheckAttributeType): Make private
272         non-virtual.
273         (Attribute.ResolveType): Make virtual.
274         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
275         handling of RootContext.Tree.Types.
276
277 2005-01-27  Raja R Harinath  <rharinath@novell.com>
278
279         Update attribute-handling to use the SimpleName/MemberAccess
280         mechanisms.
281         * cs-parser.jay (attribute): Pass in an expression to the
282         constructors of Attribute and GlobalAttribute.
283         * attribute.cs (Attribute): Take an expression for the name.
284         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
285         passed in attribute name expression.
286         (Attribute.CheckAttributeType): Use it.
287         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
288         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
289         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
290         argument to prevent error messages if the lookup fails.
291
292 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
293
294         * expression.cs (Indirection): Implemented IVariable interface
295         to support indirection in AddressOf operator.
296         (PointerArithmetic.Emit): Add optimalization for case where
297         result can be precomputed.
298
299 2005-01-26  Martin Baulig  <martin@ximian.com>
300
301         * class.cs (TypeContainer.AttributeTargets): Return the correct
302         AttributeTargets depending on our `Kind' instead of throwing an
303         exception; fixes #71632.
304
305 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
306
307         Fix #71257
308         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
309         constant members.
310
311 2005-03-17  Martin Baulig  <martin@ximian.com>
312
313         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
314         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
315
316 2005-03-17  Martin Baulig  <martin@ximian.com>
317
318         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
319         to bool so we can return an error condition.
320         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
321         returned an error.
322
323 2005-03-17  Martin Baulig  <martin@ximian.com>
324
325         * generic.cs (TypeMananager.IsIEnumerable): New public method.
326
327         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
328         converting from an array-type of T to `IEnumerable<T>'.
329
330 2005-03-16  Martin Baulig  <martin@ximian.com>
331
332         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
333         (Nullable.LiftedUnaryMutator): New public class.
334
335         * expression.cs (UnaryMutator.DoResolve): Added support for
336         Nullable Types.
337
338 2005-03-14  Martin Baulig  <martin@ximian.com>
339
340         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
341
342 2005-03-14  Martin Baulig  <martin@ximian.com>
343
344         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
345         the comparision operators `<', `>', `<=' and `>='.
346
347 2005-03-13  Martin Baulig  <martin@ximian.com>
348
349         * generic.cs
350         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
351         avoid confusion with the `NullLiteral'.
352         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
353
354 2005-03-13  Martin Baulig  <martin@ximian.com>
355
356         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
357         comparing arbitrary types with the null literal.
358
359 2005-03-13  Martin Baulig  <martin@ximian.com>
360
361         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
362         boolean operators '&&', '||', '&' and '|'.
363         (Nullable.OperatorTrueOrFalse): New public class.
364
365         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
366         instead of a `StaticCallExpr'; added support for nullables.
367
368 2005-03-10  Martin Baulig  <martin@ximian.com>
369
370         * expression.cs
371         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
372         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
373
374 2005-03-07  Martin Baulig  <martin@ximian.com>
375
376         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
377         it work if `expr' is not an IMemoryLocation.
378         (Nullable.Lifted): Implement IMemoryLocation.
379         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
380         target type.
381
382 2005-03-05  Martin Baulig  <martin@ximian.com>
383
384         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
385         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
386         (Nullable): Added support for lifted unary and binary operators.
387
388         * expression.cs (Unary.DoResolve): Added support for nullable types.
389         (Binary.DoResolve): Likewise.
390         (Conditional.DoResolve): Likewise.
391
392 2005-03-02  Martin Baulig  <martin@ximian.com>
393
394         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
395
396         * class.cs (ClassPart.SetParameterInfo): Override this.
397         (PartialContainer.SetParameterInfo): Override this.
398         (TypeContainer.CheckConstraints): New protected method.
399         (PartialContainer.CheckConstraints): Override this and check
400         whether the same contraints were specified in all parts of a
401         partial generic type definition.
402         (PartialContainer.UpdateConstraints): New public method.
403
404         * generic.cs (TypeParameter.UpdateConstraints): New public method.
405
406 2005-03-02  Martin Baulig  <martin@ximian.com>
407
408         Committing a patch from Carlos Alberto Cortez to fix #72887.
409
410         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
411         casts from `T []' to `int []'.
412
413 2005-03-02  Martin Baulig  <martin@ximian.com>
414
415         * generic.cs (TypeManager.IsEqual): Make this symmetric.
416
417         * expression.cs (Binary.ResolveOperator): When resolving a
418         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
419         `=='.  Fixes #71866.  See gen-127.cs.
420
421 2005-03-02  Martin Baulig  <martin@ximian.com>
422
423         * class.cs (TypeContainer.DoDefineMembers): We also need a default
424         static constructor in static classes.
425
426 2005-03-02  Martin Baulig  <martin@ximian.com>
427
428         * generic.cs
429         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
430         (Nullable.LiftedConversion): Added support for user-defined
431         conversions.
432
433         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
434
435         * cs-parser.jay: Use ComposedCast everywhere instead of
436         NullableType, so we don't need to check for NullableType
437         everywhere.
438         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
439         case where we'll be resolved into a `parenthesized_expression_0'
440         afterwards.
441
442         * convert.cs
443         (Convert.UserDefinedConversion): Added nullable conversions.
444
445 2005-02-28  Martin Baulig  <martin@ximian.com>
446
447         * generic.cs (TypeManager.IsNullableType): New static method.
448         (Nullable): New abstract class.
449         (Nullable.NullLiteral): New public class.
450         (Nullable.LiftedConversion): New public class.
451
452         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
453         `builtin_types opt_nullable'.
454
455         * convert.cs
456         (Convert.ImplicitConversionStandard): Added nullable conversions.
457         (Convert.ExplicitConversionStandard): Likewise.
458         (Convert.ExplicitConversion): Likewise.
459
460 2005-02-26  Martin Baulig  <martin@ximian.com>
461
462         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
463         begin with a "?", for instance "?[]".  Don't do a type lookup if
464         `dim' is empty.
465
466 2005-02-25  Martin Baulig  <martin@ximian.com>
467
468         The first part of Nullable Types :-)
469
470         * generic.cs (NullableType): New public class.
471         (NullCoalescingOperator): New public class.
472         (TypeArguments.Resolve): Add a CS0306 check.
473
474         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
475         (opt_nullable): New rule.
476         (type): Added `opt_nullable' to `namespace_or_type_name',
477         `builtin_types' and `pointer_type'.
478         (array_type): Added `opt_nullable'.
479         (opt_rank_specifier_or_nullable): New rule; this is the
480         combination of `opt_rank_specifier' and `opt_nullable'.
481         (opt_error): New rule; catch errors here.
482         (nullable_type_or_conditional): New rule; we use this to check for
483         nullable and still detect the conditional operator.
484         (local_variable_type): Use `opt_rank_specifier_or_nullable'
485         instead `opt_rank_specifier'.
486
487         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
488         for nullables.
489
490 2005-02-24  Martin Baulig  <martin@ximian.com>
491
492         * README, README.Changes: Removed; they're old and obsolete.
493
494 2005-02-22  Martin Baulig  <martin@ximian.com>
495
496         * generic.cs (TypeParameter.Resolve): If resolving the constraints
497         returned an error, set `constraints' to null to avoid a crash
498         later on.
499         (TypeParameter.ResolveType): Likewise.
500
501 2005-02-22  Martin Baulig  <martin@ximian.com>
502
503         * generic.cs
504         (Constraints.ResolveTypes): Protect against being called twice.
505         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
506         (TypeParameter.ResolveType): New public method; calls
507         constraints.ResolveTypes().
508         (TypeParameter.DefineType): Moved constraints.ResolveType() out
509         into the new ResolveType().
510         (GenericMethod.Define): Call ResolveType() on all our
511         TypeParameter's.        
512
513 2005-02-21  Martin Baulig  <martin@ximian.com>
514
515         * generic.cs
516         (TypeManager.generic_nullable_type): New static public field.
517         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
518
519         * rootcontext.cs
520         (RootContext.ResolveCore): Resolve "System.Nullable`1".
521
522 2005-02-15  Martin Baulig  <martin@ximian.com>
523
524         * generic.cs (ConstructedType.Constraints): Correctly check
525         constraints if the argument type is a type parameter; fixes
526         #72326. 
527
528 2005-02-02  Martin Baulig  <martin@ximian.com>
529
530         * delegate.cs (Delegate.DefineType): Report an internal error if
531         TypeManager.multicast_delegate_type is null.  See bug #72015 for
532         details.        
533
534 2005-01-29  Miguel de Icaza  <miguel@novell.com>
535
536         * pending.cs: Produce better code (no nops produced by using Ldarg
537         + value).
538         
539         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
540         i - 1' it should be arg + 1.
541
542         Fixes bug #71819.
543         
544 2005-01-26  Martin Baulig  <martin@ximian.com>
545
546         * cs-parser.jay (indexer_declarator): Don't report an error if we
547         have type parameters since we can be an explicit interface
548         implementation; fixes #71449.
549
550 2005-01-26  Martin Baulig  <martin@ximian.com>
551
552         * class.cs (TypeContainer.AttributeTargets): Return the correct
553         AttributeTargets depending on our `Kind' instead of throwing an
554         exception; fixes #71632.
555
556 2005-01-26  Martin Baulig  <martin@ximian.com>
557
558         * delegate.cs (Delegate.DefineType): Correctly define our type
559         parameters.  Fixes #71483.
560
561 2005-01-25  Raja R Harinath  <rharinath@novell.com>
562
563         Fix #71602.
564         * expression.cs (MemberAccess.DoResolve): Don't complain with
565         cs0572 when the LHS of a member access has identical name and type
566         name.
567
568 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
569
570         Fix #71651, #71675
571         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
572         CreatePermission.
573         Create custom PermissionSet only for PermissionSetAttribute.
574
575 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
576
577         Fix #71649
578         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
579         delegates in static class.
580
581 2005-01-24  Martin Baulig  <martin@ximian.com>
582
583         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
584         merging an implicit block, just use its reachability.
585
586         * statement.cs (Block.Resolve): Make the unreachable code check
587         work wrt. implicit blocks; see test-337 from #63842.
588
589 2005-01-21  Alp Toker  <alp@atoker.com>
590  
591         * cs-parser.jay: destructor_declaration's container is PartialContainer
592         not Class when partial types are used, so use Kind prop instead of
593         'is'.
594         
595 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
596
597         * cs-parser.jay: Improve error reporting when an interface
598         declares new types.
599
600 2005-01-20  Dick Porter  <dick@ximian.com>
601
602         * support.cs: SeekableStreamReader fix from Sandor Dobos
603         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
604         chars are read.  Fixes bug 70369.
605
606 2005-01-20  Raja R Harinath  <rharinath@novell.com>
607
608         * cs-parser.jay (catch_clause): Simplify current_block handling
609         somewhat.
610
611 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
612
613         * convert.cs (ImplicitStandardConversionExists): Synchronize the
614         code with ImplicitStandardConversion to handle the implicit
615         conversion of method groups into valid delegate invocations. 
616
617         The problem is that in parameter handling we were using this code
618         path.  Fixes bug #64698
619
620 2005-01-19  Raja R Harinath  <rharinath@novell.com>
621
622         * cs-parser.jay: Fix several infelicities.
623         - Avoid assigning to the parser value stack.  Code like 
624           '$3 = null' is unclean.  Synthesize a value for the code block
625           instead. 
626         - Avoid using oob_stack for storing location information.  Use ...
627         (_mark_): ... this.  New (empty) rule.  Saves the current location
628         in $$.
629         (foreach_statement): Avoid using oob_stack for current_block
630         handling.  Use technique used in for_statement and
631         using_statement.  Synthesize a value for the code block to store
632         additional intermediate information.
633
634 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
635
636         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
637         of a different type is only allowed to private fields of a
638         containing type, not on fields of a base class.
639
640         See test-174.cs and error cs0122-9.cs
641
642 2005-01-13  Raja R Harinath  <rharinath@novell.com>
643
644         Fix test-335.cs (bug #58126).
645         * cs-parser.jay (argument): Split out non-expression parts of the
646         rule into 'non_simple_argument'.
647         (invocation_expression): Support parenthesized invocations with
648         multiple arguments, and with single non-simple arguments.
649
650 2005-01-13  Raja R Harinath  <rharinath@novell.com>
651
652         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
653         places.
654
655 2005-01-12  Raja R Harinath  <rharinath@novell.com>
656
657         Fix cs0038-1.cs, cs1640-6.cs.
658         * ecore.cs (Expression.Resolve): Remove special-case for
659         SimpleName in error-handling.
660         (Expression.almostMatchedMembers): Relax access permission to
661         protected.
662         (Expression.MemberLookupFailed): Handle duplicates in
663         almostMatchedMembers list.
664         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
665         * expression.cs (New.DoResolve): Report CS1540 for more cases.
666         * typemanager.cs (GetFullNameSignature): Use the MethodBase
667         overload if the passed in MemberInfo is a MethodBase.
668
669 2005-01-25  Martin Baulig  <martin@ximian.com>
670
671         * doc.cs
672         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
673
674 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
675
676         Fix #70749
677         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
678         for non-CAS & merge permission sets properly.
679
680 2005-01-11  Raja R Harinath  <rharinath@novell.com>
681
682         Improve standard-compliance of simple name and member access 
683         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
684         * ecore.cs (FullNamedExpression): New abstract base class 
685         for Namespaces and TypeExpressions.
686         (ResolveFlags.SimpleName): Remove.
687         (SimpleName): Remove support for dotted names.
688         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
689         DeclSpace.FindType and DeclSpace.LookupType.
690         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
691         (Expression.ExprClassName): Make member function.
692         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
693         a namespace.  Remove creation of dotted "SimpleName"s.
694         (MemberAccess.DoResolve): Likewise.
695         * decl.cs (DeclSpace.Cache): Make private.
696         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
697         (DeclSpace.FindType): Update.
698         (DeclSpace.LookupType): Move here from RootContext.  Return a 
699         FullNamedExpression.
700         * namespace.cs (Namespace): Derive from FullNamedExpression
701         so that it can be part of expression resolution.
702         (Namespace.Lookup): Return an FullNamedExpression.
703         (NamespaceEntry.LookupAlias): Lookup aliases only in current
704         namespace.
705         * rootcontext.cs (NamespaceLookup): Remove.
706         (LookupType): Move to DeclSpace.
707         * attribute.cs (CheckAttributeType): Update.
708         * doc.cs (FindDocumentedType): Remove allowAlias argument.
709         (FindDocumentedTypeNonArray): Likewise.
710
711 2005-01-11  Raja R Harinath  <rharinath@novell.com>
712
713         Fix cs0509.cs, cs1632.cs.
714         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
715         is the same as IsInterface.
716         (TypeContainer.GetClassBases): Likewise.
717         * statement.cs (LabeledStatement.ig): New field.
718         (LabeledStatement.LabelTarget): Save ILGenerator which created the
719         label.
720         (LabeledStatement.DoEmit): Check that the label was created with
721         the same ILGenerator.
722
723 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
724
725         Fix #71058
726         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
727         accessors to its properties.
728
729         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
730         from accessors to property.
731         
732 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
733
734         Fix #70722
735         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
736         only for overrides.
737         
738 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
739
740         * attribute.cs: Check for null and empty strings.  
741
742         I have lost another battle to Paolo.
743
744 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
745
746         Fix #70942
747         * class.cs (PropertyMethod): Set Parent field in ctors.
748         (SetMethod.InternalParameters): Add unsafe switch hack.
749         Override MarkForDuplicationCheck where it is appropriate.
750
751         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
752         It says whether container allows members with the same name.
753         Base default is no.
754         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
755         Removed is_method parameter.
756
757 2005-01-06  Duncan Mak  <duncan@ximian.com>
758
759         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
760         because the previous change led to incorrect reporting of CS1032
761         ("Cannot define/undefine preprocessor symbols after first token in
762         file"). Instead of using `tokens_seen' as the only flag that
763         triggers CS1040, introduce `comments_seen'. This new flag is used
764         to signify having seen comments on the current line, so it is
765         unset after a newline.
766
767 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
768
769         * doc.cs : When searching for a type, find nested type too.
770           This fixes bug #71040.
771
772 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
773
774         * doc.cs :
775           - Warn missing member comment on those classes which also does not
776             have doc comments. Fixed bug #71041.
777           - Don't warn missing doc comment on default constructor.
778             Fixed bug #71042.
779
780 2005-01-06  Duncan Mak  <duncan@ximian.com>
781
782         * cs-tokenizer.cs (xtoken): After handling traditional C-style
783         comments, set `tokens_seen' to true. This allows us to detect
784         misplaced preprocessor directives (i.e. not at the beginning of
785         the a line, nor after whitespaces). In that case, report error
786         CS1040. This fixes bug #56460.
787
788         * cs-parser.jay (interface_member_declaration): Add checks for
789         IsExplicitImpl, and report CS0541 error if an interface member is
790         defined as an explicit interface declaration.
791
792 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
793
794         Fix #70817
795         * class.cs (PropertyMethod): Set Parent field in ctors.
796         (SetMethod.InternalParameters): Add unsafe switch hack.
797         
798         * decl.cs (MemberCore.Parent): Cannot be readonly.
799
800 2005-01-06  Raja R Harinath  <rharinath@novell.com>
801
802         * decl.cs (DeclSpace.ResolveType): Remove.
803         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
804         Merge in code from ...
805         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
806         * class.cs, enum.cs: Update to changes.
807
808 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
809
810         * anonymous.cs: Ensure that we init the scope of our parent if it
811         has not been initialized yet.
812
813 2004-12-30  Duncan Mak  <duncan@ximian.com>
814
815         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
816         if field.FieldBuilder is null. Fixes #70758.
817
818         * convert.cs: Fixed some typos and updated some of the comments.
819         (ImplicitStandardConversionExists):
820         (TryImplicitIntConversion): If `target_type' is an interface and
821         the type of `ic' implements this interface, return true or a new
822         BoxedCast instead of null. This fixes #70468.
823
824 2004-12-29  Duncan Mak  <duncan@ximian.com>
825
826         * expression.cs (Argument.Emit): Check that Expr is
827         IMemoryLocation before casting to it, and report CS1510 otherwise.
828
829         This fixes #70402.
830
831 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
832
833         * statement.cs (Block.ThisVariable): remove the recursion here, to
834         make the --profile more sane.
835
836 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
837
838         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
839         assembly, by JB Evain.
840
841 2004-12-17  Raja R Harinath  <rharinath@novell.com>
842
843         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
844           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
845         "parent" refers to enclosing type/class.  "base" refers to superclass.
846
847 2004-12-17  Raja R Harinath  <rharinath@novell.com>
848
849         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
850         Ensure that we only have GlobalAttributes.
851         * attribute.cs (Attribute.Emit): Make non-virtual.
852         (GlobalAttribute.Emit): Remove.
853         (Attribute.Resolve): Make virtual.
854         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
855         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
856         the argument. Don't create one.
857         (Attribute.GetObsoleteAttribute): Likewise.
858         (Attribute.GetClsCompliantAttributeValue): Likewise.
859         * class.cs, decl.cs: Update to changes.
860
861 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
862
863         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
864         
865         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
866         
867         * statement.cs (Foreach.Resolve): Add error 186 report.
868
869 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
870
871         * expression.cs (Conditional.DoResolve): Add warning 429.
872         
873         * statement.cs (If.Resolve): Add warning 665.
874
875 2004-12-16  Raja R Harinath  <rharinath@novell.com>
876
877         New invariant: RootContext.Tree.Types.NamespaceEntry == null
878         except when in the parser, and in GlobalAttribute.
879         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
880         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
881         RootContext.Tree.Types.NamespaceEntry once work is done.
882         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
883         and resets RootContext.Tree.Types.NamespaceEntry.
884
885 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
886
887         * cs-parser.jay: Don't create a block for every variable.
888
889 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
890
891         * location.cs: Provide extra information.
892
893         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
894         variables from the captured environment, it is the ldarg_0.
895
896 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
897
898         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
899         find a conclusion.
900         
901         * class.cs: Changed warning level for 169 to avoid developer
902         displeasure from warning flooding. It will be changed back when they
903         fix most of current BCL warnings.
904         
905         * RootContext.cs: Pushed default WarningLevel to 3.
906         
907         * statement.cs: Removed unused variable.
908
909 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
910
911         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
912         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
913         Add error 502 report.
914         (StaticClass.DefineType): Add error 441 report.
915         (Class.AllowedModifiersProp): New virtual property as temporary
916         extension to AllowedModifiers.
917         (Class.DefineType): Add error 418 report. Moved ModFlags check here
918         to share implementation with StaticClass and don't call virtual
919         methods from ctor.
920         
921         * driver.cs (MainDriver): Add error 1558 test.
922
923         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
924         report. Moved error 36 test here.
925
926         * statement.cs (Throw.Resolve): Add error 724 report.
927
928         * typemanager.cs: Add out_attribute_type core type.
929         
930 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
931
932         * class.cs (TypeContainer.VerifyClsCompliance): Add error
933         3018 report.
934         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
935
936         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
937         3017 report.
938         
939         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
940
941         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
942         Add error 3023 report.
943         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
944
945         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
946         implementation.
947
948 2004-12-12  John Luke  <john.luke@gmail.com>
949
950         * driver.cs (AddArgs): take -- into account when
951         adding arguments, fixes bug 65710 
952
953 2004-12-12  Martin Baulig  <martin@ximian.com>
954
955         * expression.cs (Unary.TryReduceNegative): Added support for
956         SByteConstant and ByteConstant.
957         (Unary.Reduce): Check error values from TryReduceNegative().
958
959 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
960
961         * attributes.cs (Attribute.Resolve): Avoid multiple error report
962         and report exception as error 182.
963
964 2004-12-10  Raja R Harinath  <rharinath@novell.com>
965
966         * driver.cs (Main): Fix message when there are warnings.
967
968 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
969
970         * delegate.cs: Fixed my fix from yesterday, sorry about that.
971
972 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
973
974         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
975         Reduced number of warnings.
976         
977         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
978
979 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
980
981         * driver.cs: Removed message.
982
983         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
984
985 2004-12-08    <vargaz@freemail.hu>
986
987         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
988
989 2004-12-08  Martin Baulig  <martin@ximian.com>
990
991         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
992         instead of a CS3002 for properties and indexer.
993
994 2004-12-08  Martin Baulig  <martin@ximian.com>
995
996         * decl.cs (MemberName.ToString): Make this work again.
997
998 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
999
1000         * attribute.cs (Resolve): Add error 591 detection.
1001
1002         * class.cs (FieldMember.Define): Add error 1547 detection.
1003         (Indexer.Define): Add error 620 detection.
1004         (Operator.Define): Add error 590 detection.
1005
1006         * ecore.cs: Missing argument for error 79.
1007
1008         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1009         detection.
1010
1011 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1012
1013         Fix #70106
1014         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1015         only.
1016
1017 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1018
1019         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1020           Some operator comments were suppressed.
1021         * doc.cs : Implicit/explicit operator name in doc comments are like
1022           "op_Explicit(type)~returnType", so added suffix handling.
1023
1024 2005-01-21  Alp Toker  <alp@atoker.com>
1025
1026         * cs-parser.jay: destructor_declaration's container is PartialContainer
1027         not Class when partial types are used, so use Kind prop instead of 'is'.
1028
1029 2004-12-12  Martin Baulig  <martin@ximian.com>
1030
1031         * expression.cs (Unary.TryReduceNegative): Added support for
1032         SByteConstant and ByteConstant.
1033         (Unary.Reduce): Check error values from TryReduceNegative().
1034
1035 2004-12-11  Martin Baulig  <martin@ximian.com>
1036
1037         * support.cs (ReflectionParameters.ParameterName): If we have a
1038         `gpd', call `ParameterName' on it.
1039
1040         * parameter.cs (Parameter.GetParameterAttributes): New static method.
1041
1042         * pending.cs (PendingImplementation.DefineProxy): Call
1043         DefineParameter() for all of the MethodBuilder's arguments.
1044
1045 2004-12-09  Martin Baulig  <martin@ximian.com>
1046
1047         * doc.cs (DocUtil): Make this a static class.
1048
1049 2004-12-09  Martin Baulig  <martin@ximian.com>
1050
1051         * expression.cs (Invocation.InferType): Moved the type inference
1052         implementation into TypeManager.
1053
1054         * generics.cs (TypeManager): Moved the type inference
1055         implementation here.
1056
1057 2004-12-09  Martin Baulig  <martin@ximian.com>
1058
1059         * typemanager.cs (TypeManager): Make this a partial class.
1060
1061         * generics.cs
1062         (TypeManager): Move the generics part of `TypeManager' here.
1063
1064 2004-12-08  Martin Baulig  <martin@ximian.com>
1065
1066         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1067         instead of a CS3002 for properties and indexer.  Added CS3024
1068         check for generic interfaces.
1069
1070         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
1071         instances are not CLS-compliant.
1072
1073 2004-12-08  Martin Baulig  <martin@ximian.com>
1074
1075         * cs-parser.jay
1076         (void_pointer_expression): New rule for `void*', `void**' etc.
1077         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
1078
1079 2004-12-08  Martin Baulig  <martin@ximian.com>
1080
1081         * expression.cs (Invocation.InferType): Removed the hack for
1082         MethodCore.MayUnify().  
1083
1084         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
1085         this actually work.
1086
1087         * class.cs (MethodCore.MayUnify): Use
1088         TypeManager.MayBecomeEqualGenericTypes().       
1089
1090 2004-12-08  Martin Baulig  <martin@ximian.com>
1091
1092         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
1093         parameter, box it.  Fixes #69233.
1094
1095 2004-12-08  Martin Baulig  <martin@ximian.com>
1096
1097         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
1098         have the ctor constraint.  Fixes #68326.
1099
1100 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1101
1102         * cs-parser.jay : interface comment was not consumed because of
1103           extra opt_semicolon before doc handling.
1104
1105 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1106
1107         Fix test-327.cs, test-328.cs, and put in early infrastructure
1108         for eventually fixing #52697.
1109         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1110         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1111         from other methods.
1112         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1113         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1114         (VerifyUsing, error246): Update.
1115         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1116         'NamespaceEntry.LookupNamespaceOrType'.
1117
1118 2004-12-07  Martin Baulig  <martin@ximian.com>
1119
1120         * driver.cs: Call it "BETA SOFTWARE" :-)
1121
1122 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1123
1124         Fix crash on cs0657-17.cs.
1125         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1126         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1127         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1128         the case where the NamespaceEntry gets overwritten.
1129
1130 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1131
1132         Fixed #69195, #56821
1133         * ecore.cs (ResolveBoolean): Tiny refactoring.
1134
1135         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1136         of right expression resolving when left is false constant and
1137         operator is LogicalAnd OR true constant and operator is LogicalOr.
1138
1139         * statement.cs (ResolveUnreachable): Always reports warning.
1140
1141 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1142
1143         * class.cs: Distinguish between 1721 and 1722 (just a little help
1144         for the programmer).
1145
1146 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1147
1148         * delegate.cs: Only allow this on new versions of the language. 
1149
1150 2004-12-02  Duncan Mak  <duncan@ximian.com>
1151
1152         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1153         Expression class.
1154         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1155         here as a static method. Take an additional bool out parameter
1156         `must_do_cs1540_check' for signaling to InstanceResolve.
1157         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1158         member field from PropertyExpr class and made it an argument of
1159         the method instead.
1160         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1161         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1162         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1163         and `remove_accessor' as well as InstanceResolve: report CS0122
1164         where applicable.
1165
1166         Fixes #70129.
1167
1168 2004-12-07  Martin Baulig  <martin@ximian.com>
1169
1170         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
1171         and CS0692 where appropriate.
1172
1173 2004-12-06  Martin Baulig  <martin@ximian.com>
1174
1175         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
1176         IsDuplicateImplementation() and improved it.
1177
1178         * expression.cs (Invocation.InferTypeArguments): Added
1179         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
1180         and removed the "ref" modifier from `infered_types'.
1181
1182         * decl.cs (MemberName.ToString): Removed the exception.
1183
1184 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1185
1186         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1187           comments are allowed.
1188
1189 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1190
1191         * delegate.cs: Add checks for subtypes in paramaters and return values
1192         in VerifyMethod () to add support for Covariance/Contravariance
1193         in delegates.
1194         
1195 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1196
1197         * report.cs: Remove extra closing parenthesis.
1198
1199         * convert.cs (Error_CannotImplicitConversion): If the name of the
1200         types are the same, provide some extra information.
1201
1202 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1203
1204         Fix bug #70102
1205         * attribute.cs (Resolve): Improved implementation of params
1206         attribute arguments.
1207
1208         * support.cs (ParameterData): Add HasParams to be faster.
1209
1210 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1211
1212         all things are for /doc support:
1213
1214         * doc.cs: new file that supports XML documentation generation.
1215         * mcs.exe.sources: added doc.cs.
1216         * driver.cs:
1217           Handle /doc command line option.
1218           Report error 2006 instead of 5 for missing file name for /doc.
1219           Generate XML documentation when required, after type resolution.
1220         * cs-tokenizer.cs:
1221           Added support for picking up documentation (/// and /** ... */),
1222           including a new XmlCommentState enumeration.
1223         * cs-parser.jay:
1224           Added lines to fill Documentation element for field, constant,
1225           property, indexer, method, constructor, destructor, operator, event
1226           and class, struct, interface, delegate, enum.
1227           Added lines to warn incorrect comment.
1228         * rootcontext.cs :
1229           Added Documentation field (passed only when /doc was specified).
1230         * decl.cs:
1231           Added DocComment, DocCommentHeader, GenerateDocComment() and
1232           OnGenerateDocComment() and some supporting private members for
1233           /doc feature to MemberCore.
1234         * class.cs:
1235           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1236         * delegate.cs:
1237           Added overriden DocCommentHeader.
1238         * enum.cs:
1239           Added overriden DocCommentHeader and GenerateDocComment().
1240
1241 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1242
1243         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1244         unwrapping the enumeration values, chain to
1245         DoConstantNumericPromotions again, so we can promote things to the
1246         fundamental types (takes care of enums that are bytes, sbytes).
1247
1248         Fixes bug #62054.
1249
1250 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1251
1252         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1253         Fix long-standing bug in type-lookup.  Use FindType instead of
1254         LookupType when ec.ResolvingTypeTree.
1255         (Attribute.ResolveType, Attribute.Resolve)
1256         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1257         Update to changes.
1258         (Attributes.Search): Remove internal version.  Update.
1259         (Attributes.SearchMulti): Update.
1260         (Attributes.GetClsCompliantAttribute): Remove.
1261         (Attributes.GetIndexerNameAttribute): Remove.
1262         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1263         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1264         * class.cs (Indexer.Define): Likewise.
1265
1266 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1267
1268         Fix bug #68790
1269         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1270         MarshallByReference members access.
1271
1272         * expression.cs: Use CheckMarshallByRefAccess;
1273         Better error CS0197 message.
1274
1275         * report.cs: Print whole related error message.
1276
1277 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1278
1279         * class (GetClassBases): Better error 60 report.
1280         (EventProperty): Disabled warning 67 detection.
1281
1282 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1283
1284         Fix bug #60324
1285         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1286
1287         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1288         precise values.
1289
1290 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1291
1292         Fix bug #49488
1293         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1294
1295         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1296
1297 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
1298
1299         * attribute.cs (Attribute.Resolve): Refine error reporting and
1300         report a cs0117 if the identifier does not exist, to distinguish
1301         from 0617 which is a miss-use of the actual identifier.
1302
1303         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1304         between cs0070 and cs0079.
1305
1306         * class.cs (MemberBase.DoDefine): When reporting a wrong
1307         accessibility level, we use MethodCore to compare instead of
1308         Method (this was a regression in some refactoring effort).
1309
1310         So now we correctly report cs0056 again.
1311
1312         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1313         testing the target_type (which was known to be object_type) and
1314         not the source type (which is anonymous_method).
1315
1316         Fixed reporting of error cs1660.
1317
1318         * expression.cs (UserCast.Source): Expose the underlying cast.
1319
1320         * statement.cs (Switch.SwitchGoverningType): Sort the list of
1321         allowed types to find a match to int32 first (most common).
1322
1323         In addition, it ignores any ImplicitUserConversions that did an
1324         internal implicit conversion (as the switch statement allows only
1325         one integral conversion to exist).
1326
1327         * class.cs (PartialContainer.Create): rename `name' to
1328         `member_name' for clarity.  Then replace the string calls with a
1329         call to MemberName.GetPartialName, as now using
1330         MemberName.ToString is an error (this is due to the side effects
1331         it had, that were fixed in the past).
1332
1333         This will restore the error reporting on a number of partial class
1334         errors that were missusing this (and getting an exception as a
1335         results, which is now just a plain textual warning, because
1336         yyparse debug output would crash otherwise).
1337
1338 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1339
1340         * Makefile (PROGRAM_INSTALL_DIR): Remove.
1341
1342 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1343
1344         * rootcontext.cs (LookupType): Make sure to cache lookups that
1345         don't give us a negative result. This saves about 5% of corlib
1346         compilation time.
1347
1348 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1349
1350         * report.cs (AbstractMessage.Print): messages are sent to stderr
1351
1352         * class.cs (TypeContainer.GetClassBases): It is an error to have a
1353         non-interface in the list of interfaces (at this point, either
1354         parent was properly set, or a base class is being listed in the
1355         interfaces section).
1356
1357         This flags error 1722, and resolves the crash from bug 69259.
1358
1359 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1360
1361         * statement.cs (Using.EmitExpressionFinally): make this work right
1362         for valuetypes. Fixes 69926.
1363
1364 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1365
1366         * const.cs (Const.ChangeType): Cope with the "0 literal can be
1367         converted to an enum" here, before we try to change the underlying
1368         type.  This code exists, but it is a different code path than the
1369         one used while encoding constants.
1370
1371         (ImplicitReferenceConversionExists): In addition, resynchronized
1372         the code here, so it matches the same code in
1373         ImplicitReferenceConversionExists for the `from any class-type S
1374         to any interface-type T'.       
1375
1376 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
1377
1378         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1379
1380 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
1381
1382         * cs-parser.jay: Use verbosity accordingly. 
1383
1384 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1385
1386         * expression.cs (Unary.ResolveOperator): Do not report warning;
1387         AddressOf reads from variable.
1388         
1389         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1390
1391 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1392
1393         Fix bug #69462
1394
1395         * attribute.cs (Attributable): Removed CheckTargets.
1396         (Attributes.Emit): Explicit attribute targets are tested here.
1397
1398         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1399         not enabled for interfaces.
1400
1401         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1402         (GetAssemblyName): Ouch next bug there.
1403
1404 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1405
1406         * expression.cs: Error 275 added.
1407         
1408 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1409
1410         Fix bug #69177 (Implemented decimal constant support)
1411
1412         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1413         (BinaryFold): Add DecimalConstant.
1414
1415         * const.cs (Define): Decimal constant 
1416         (is not constant.
1417         (ChangeType): Add decimal type handling.
1418         (LookupConstantValue): Don't set value for decimal type but
1419         emit DecimalConstantAttribute. Needed for constant optimization.
1420
1421         * constant.cs (ToDecimal): New method.
1422         (ConvertToDecimal): New method.
1423         (IntConstant): Implemented ConvertToDecimal.
1424         (DecimalConstant.Emit): Emit optimized version for decimals in
1425         int range.
1426
1427         * expression.cs (ResolveOperator): Changed order of constant
1428         reduction to work correctly with native types which have
1429         overloaded operators.
1430         (ResolveMemberAccess): Extract constant value from attribute
1431         for decimal type.
1432
1433         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1434
1435         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1436         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1437         (ChangeType): Decimal is special.
1438         (TypeToCoreType): Add decimal type.
1439
1440 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1441
1442         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1443         decimal types.
1444
1445 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1446
1447         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1448         test cs1667-5.cs.
1449
1450 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1451
1452         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1453
1454         * pending.cs (PendingImplementation): Grab only interfaces.
1455
1456 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1457
1458         * statement.cs (ForeachHelperMethods): Add location member and
1459         error 202 detection.
1460
1461 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1462
1463         * expression.cs (DoResolveBase): Fixed wrong warning for out
1464         variables.
1465
1466 2004-12-04  Martin Baulig  <martin@ximian.com>
1467
1468         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
1469         to check whether the conversion is ok.
1470
1471         * typemanager.cs (TypeManager.GetTypeArguments): Just return
1472         `Type.EmptyTypes' if we're not a generic TypeContainer.
1473
1474 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1475
1476         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1477         old bug: when converting from the null literal to a pointer,
1478         return an EmptyCast, not the NullLiteral.
1479
1480         This fixes #69921, the recent null_type changes probably made this
1481         bug more prominent.
1482
1483 2004-12-03  Martin Baulig  <martin@ximian.com>
1484
1485         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1486         method as our child, call AnonymousMethod.Compatible() on it.
1487
1488 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1489
1490         * class.cs (FieldBase): Use an unused bit field from the field to
1491         encode the `has_offset' property from the FieldMember.  This saves
1492         a couple of Ks on bootstrap compilation.
1493
1494         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1495         method as our child, return the AnonymousMethod resolved
1496         expression.
1497
1498         * expression.cs (New.DoResolve): Allow return values from
1499         NewDelegate to also include AnonymousMethods.
1500
1501         Fixes #70150.
1502
1503 2004-11-29  Raja R Harinath  <rharinath@novell.com>
1504
1505         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
1506         cs1648 report.
1507         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
1508         System.Runtime.InteropServices._Exception, since it's a base
1509         interface of the core type System.Exception in the net_2_0 profile.
1510
1511 2004-11-27  Martin Baulig  <martin@ximian.com>
1512
1513         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
1514
1515 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1516
1517         * Makefile: Convert to use executable.make.
1518         * gmcs.exe.sources: New.
1519
1520 2004-11-25  Martin Baulig  <martin@ximian.com>
1521
1522         * expression.cs (Invocation.InferType): Added support for byref types.
1523
1524 2004-11-25  Martin Baulig  <martin@ximian.com>
1525
1526         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1527         in TypeManager.TypeToCoreType().
1528
1529 2004-11-25  Martin Baulig  <martin@ximian.com>
1530
1531         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1532         "Dispose" method from the `current_type'.
1533         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1534         DoDefineMembers() instead of using the MethodBuilder; this is
1535         required for generic iterators.
1536
1537         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1538
1539 2004-11-24  Martin Baulig  <martin@ximian.com>
1540
1541         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1542
1543 2004-11-20  Martin Baulig  <martin@ximian.com>
1544
1545         * expression.cs (Invocation.InferType): Correctly infer generic
1546         instances; see gen-103.cs.
1547         (Invocation.InferTypeArguments): If a generic method doesn't have
1548         any unbound type parameters, we don't need to infer anything.
1549
1550 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1551
1552         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1553
1554 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1555
1556         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1557         (TypeHandle.GetMemberCache): New.
1558         (TypeHandle.TypeHandle): Update.
1559         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1560         (TypeManager.LookupParentInterfacesCache):
1561         Rename from LookupInterfaceCache.  Optimize slightly.
1562         (TypeManager.MemberLookup_FindMembers): Update.
1563         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1564         multi-type variant.
1565         (AddCacheContents): Rename from AddHashtable.
1566         * class.cs (TypeContainer.parent_container): Remove.
1567         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1568         (TypeContainer.DoDefineMembers): Don't initialize it.
1569         Update to name changes.
1570         
1571 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1572
1573         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1574         that factors the code to check access modifiers on override.  
1575
1576         (PropertyBase): Use the code here.
1577
1578         Patch from Lluis S'anchez, fixes bug #69361.
1579
1580 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1581
1582         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1583         routine that is used to report the use of a captured variable
1584         whose address has been taken.
1585
1586         There are two checks: one when variables are being captured and
1587         the other check is when the address of a variable is taken. 
1588         
1589         (because an anonymous methods might be resolved before *or* after
1590         the address has been taken) and 
1591
1592         * expression.cs (Conditional.DoResolve): Remove the special
1593         casing that Martin added to trueExpr and falseExpr being both
1594         NullLiteral.  We get the right behavior now just by introducing
1595         the null_type into the compiler. 
1596
1597         * convert.cs (ExplicitConversion): Change the code to use
1598         null_type instead of testing `expr is NullLiteral'.
1599         (ImplicitConversionStandard): use null_type too.
1600         (ImplicitReferenceConversionExists): use null_type too.
1601         (ImplicitReferenceConversion): use null_type too.
1602
1603         * literal.cs: The type of `NullLiteral' is now null_type instead
1604         of object_type. 
1605         (Resolve): Set the type here.
1606
1607         * typemanager.cs: Introduce null_type.
1608
1609 2004-11-18  Martin Baulig  <martin@ximian.com>
1610
1611         * rootcontext.cs
1612         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1613
1614 2004-11-18  Martin Baulig  <martin@ximian.com>
1615
1616         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1617
1618 2004-11-18  Martin Baulig  <martin@ximian.com>
1619
1620         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1621         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1622         call ResolveConstructedType() on it to resolve it without checking
1623         constraints.
1624         (Constraints.ResolveTypes): Check them here.
1625         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1626         but don't check constraints.
1627         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1628         check constraints here.
1629         (ConstructedType.ResolveConstructedType): New public method.  This
1630         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1631         resolve ourselves without checking constraints.
1632
1633         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1634
1635 2004-11-18  Martin Baulig  <martin@ximian.com>
1636
1637         * decl.cs
1638         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1639
1640         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1641
1642 2004-11-18  Martin Baulig  <martin@ximian.com>
1643
1644         * ecore.cs (TypeExpr.ResolveType): Removed.
1645         (Expression.ResolveAsTypeTerminal): We always return a fully
1646         resolved `TypeExpr', so we can just access its `Type'.
1647
1648         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1649
1650 2004-11-17  Martin Baulig  <martin@ximian.com>
1651
1652         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1653         sure we don't return any unresolved TypeExpr's.
1654         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1655         a `TypeExpr'.
1656         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1657
1658         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1659         unresolved `ConstructedType's.
1660
1661 2004-11-17  Martin Baulig  <martin@ximian.com>
1662
1663         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1664
1665 2004-11-17  Martin Baulig  <martin@ximian.com>
1666
1667         * ecore.cs
1668         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1669
1670         * decl.cs (DeclSpace.ResolveType): Removed.
1671         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1672
1673 2004-11-17  Martin Baulig  <martin@ximian.com>
1674
1675         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1676         direction, like FindMembers() does.  Fixes #69546, testcase is in
1677         test-315.cs.    
1678
1679 2004-11-16  Martin Baulig  <martin@ximian.com>
1680
1681         This is based on a patch from Marek Safar, see bug #69082.
1682         Fixes bugs #63705 and #67130.
1683
1684         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1685         method; create a MemberCache for an interface type and cache the
1686         result.
1687
1688         * decl.cs (IMemberContainer.ParentContainer): Removed.
1689         (IMemberContainer.ParentCache): New property.
1690         (MemberCache.SetupCacheForInterface): Removed.
1691         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1692         to create a cache for an interface's "parent".
1693
1694         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1695         interfaces too.
1696
1697 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1698
1699         * statement.cs: Avoid adding bools to a hashtable.
1700
1701 2004-11-15  Martin Baulig  <martin@ximian.com>
1702
1703         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1704
1705 2004-11-11  Martin Baulig  <martin@ximian.com>
1706
1707         * typemanager.cs (TypeManager.GetMethodName): New method.
1708
1709         * class.cs (MethodData.Define): Include the generic arity in the
1710         name of an explicit interface; also add it to the method name.
1711
1712         * pending.cs (PendingImplementation.InterfaceMethod): The method
1713         name now includes the generic arity.
1714
1715 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1716
1717         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1718         calling an unsafe method from a safe location.
1719
1720 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1721
1722         Fix #69167
1723         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1724
1725 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1726
1727         * namespace.cs (VerifyUsing): use GetPartialName instead of
1728         ToString. 
1729
1730 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1731
1732         * statement.cs (Return.Resolve): Fix regression in typo: if
1733         `in_exc', we have to request a NeedReturnLabel, this was a typo
1734         introduced in the anonymous method check-in.  Fixes #69131.
1735
1736         * Indexers were using the ShortName when defining themselves,
1737         causing a regression in the compiler bootstrap when applying the
1738         patch from 2004-11-02 (first part), now they use their full name
1739         and the bug is gone.
1740
1741 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1742
1743         * driver.cs: Strip the path from the names of embedded resources. Fixes
1744         #68519.
1745
1746 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1747
1748         Fix error message regression: cs0104-2.cs.
1749         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1750         (AliasEntry.Resolve): Update.
1751         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1752         'silent' flag.
1753         (RootContext.LookupType): Update.
1754
1755 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1756
1757         * cs-parser.jay: Add support for handling accessor modifiers
1758         * class: Add support port accessor modifiers and error checking,
1759         define PropertyMethod.Define as virtual (not abstract anymore)
1760         * ecore.cs: Add checking for proeprties access with access modifiers
1761         * iterators.cs: Modify Accessor constructor call based in the modified
1762         constructor
1763 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1764
1765         * expression.cs (StringConcat): Handle being called twice,
1766         as when we have a concat in a field init with more than two
1767         ctors in the class
1768
1769 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1770
1771         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1772         special case explicit implementations, we should always produce
1773         the .property or .event declaration.
1774         
1775         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1776         since it will not return correct data if people use this
1777         unresolved in the presence of using statements (see test-313).
1778
1779         * class.cs (MethodData.Define): If we are an explicit interface
1780         implementation, set the method name to the full name of the
1781         interface plus the name of the method.  
1782
1783         Notice that using the method.MethodName.GetFullName() does not
1784         work, as it will only contain the name as declared on the source
1785         file (it can be a shorthand in the presence of using statements)
1786         and not the fully qualifed type name, for example:
1787
1788         using System;
1789
1790         class D : ICloneable {
1791                 object ICloneable.Clone ()  {
1792                 }
1793         }
1794
1795         Would produce a method called `ICloneable.Clone' instead of
1796         `System.ICloneable.Clone'.
1797
1798         * namespace.cs (Alias.Resolve): Use GetPartialName.
1799         
1800 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1801
1802         * cs-parser.jay: Add error 1055 report.
1803
1804 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1805
1806         * assign.cs (Assign.DoResolve): Only do the transform of
1807         assignment into a New if the types are compatible, if not, fall
1808         through and let the implicit code deal with the errors and with
1809         the necessary conversions. 
1810
1811 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1812
1813         * cs-parser.jay: Add error 1031 report.
1814
1815         * cs-tokenizer.cs: Add location for error 1038.
1816
1817 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1818
1819         * cs-parser.jay: Add error 1016 report.
1820
1821 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1822
1823         * cs-parser.jay: Add errors 1575,1611 report.
1824
1825 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1826
1827         * cs-parser.jay: Add error 1001 report.
1828
1829 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1830
1831         Fix #68850
1832         * attribute.cs (GetMarshal): Add method argument for
1833         caller identification.
1834
1835         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1836         agument for GetMarshal and RuntimeMissingSupport.
1837
1838 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1839
1840         * attribute.cs (ExtractSecurityPermissionSet): Removed
1841         TypeManager.code_access_permission_type.
1842
1843         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1844
1845 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1846
1847         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1848         for obsolete use of a variable here.   Fixes regression on errors
1849         cs0619-25 and cs0619-26.
1850
1851 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1852
1853         Fix #62358, implemented security attribute encoding.
1854
1855         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1856         Tests permitted SecurityAction for assembly or other types.
1857         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1858         data from SecurityPermissionAttribute to PermisionSet class.
1859
1860         * class.cs (ApplyAttributeBuilder): Added special handling
1861         for System.Security.Permissions.SecurityAttribute based types.
1862
1863         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1864         special handling for System.Security.Permissions.SecurityAttribute
1865         based types.
1866
1867         * enum.cs (ApplyAttributeBuilder): Added special handling
1868         for System.Security.Permissions.SecurityAttribute based types.
1869
1870         * parameter.cs (ApplyAttributeBuilder): Added special handling
1871         for System.Security.Permissions.SecurityAttribute based types.
1872
1873         * rootcontext.cs: Next 2 core types.
1874
1875         * typemanager.cs (TypeManager.security_permission_attr_type):
1876         Built in type for the SecurityPermission Attribute.
1877         (code_access_permission_type): Build in type.
1878
1879 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1880
1881         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1882         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1883         all of this information into
1884         EmitContext.EmitCapturedVariableInstance.
1885         
1886         * codegen.cs (EmitCapturedVariableInstance): move here the
1887         funcionality of emitting an ldarg.0 in the presence of a
1888         remapping.   This centralizes the instance emit code.
1889
1890         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1891         then emit a load of this: it means that we have reached the
1892         topmost ScopeInfo: the one that contains the pointer to the
1893         instance of the class hosting the anonymous method.
1894
1895         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1896         captures to the topmost CaptureContext.
1897
1898 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1899
1900         * expression.cs (LocalVariableReference): Move the knowledge about
1901         the iterators into codegen's EmitCapturedVariableInstance.
1902
1903 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1904
1905         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1906         all code paths return a value from an anonymous method (it is the
1907         same as the 161 error, but for anonymous methods).
1908
1909 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1910
1911         The introduction of anonymous methods in the compiler changed
1912         various ways of doing things in the compiler.  The most
1913         significant one is the hard split between the resolution phase
1914         and the emission phases of the compiler.
1915
1916         For instance, routines that referenced local variables no
1917         longer can safely create temporary variables during the
1918         resolution phase: they must do so from the emission phase,
1919         since the variable might have been "captured", hence access to
1920         it can not be done with the local-variable operations from the runtime.
1921         
1922         * statement.cs 
1923
1924         (Block.Flags): New flag `IsTopLevel' to indicate that this block
1925         is a toplevel block.
1926
1927         (ToplevelBlock): A new kind of Block, these are the blocks that
1928         are created by the parser for all toplevel method bodies.  These
1929         include methods, accessors and anonymous methods.
1930
1931         These contain some extra information not found in regular blocks:
1932         A pointer to an optional CaptureContext (for tracking captured
1933         local variables and parameters).  A pointer to the parent
1934         ToplevelBlock.
1935         
1936         (Return.Resolve): Catch missmatches when returning a value from an
1937         anonymous method (error 1662).
1938         Invoke NeedReturnLabel from the Resolve phase instead of the emit
1939         phase.
1940
1941         (Break.Resolve): ditto.
1942
1943         (SwitchLabel): instead of defining the labels during the
1944         resolution phase, we now turned the public ILLabel and ILLabelCode
1945         labels into methods called GetILLabelCode() and GetILLabel() that
1946         only define the label during the Emit phase.
1947
1948         (GotoCase): Track the SwitchLabel instead of the computed label
1949         (its contained therein).  Emit the code by using
1950         SwitchLabel.GetILLabelCode ().
1951
1952         (LocalInfo.Flags.Captured): A new flag has been introduce to track
1953         whether the Local has been captured or not.
1954
1955         (LocalInfo.IsCaptured): New property, used to tell whether the
1956         local has been captured.
1957         
1958         * anonymous.cs: Vastly updated to contain the anonymous method
1959         support.
1960
1961         The main classes here are: CaptureContext which tracks any
1962         captured information for a toplevel block and ScopeInfo used to
1963         track the activation frames for various local variables.   
1964
1965         Each toplevel block has an optional capture context associated
1966         with it.  When a method contains an anonymous method both the
1967         toplevel method and the anonymous method will create a capture
1968         context.   When variables or parameters are captured, they are
1969         recorded on the CaptureContext that owns them, for example:
1970
1971         void Demo () {
1972              int a;
1973              MyDelegate d = delegate {
1974                  a = 1;
1975              }
1976         }
1977
1978         Here `a' will be recorded as captured on the toplevel
1979         CapturedContext, the inner captured context will not have anything
1980         (it will only have data if local variables or parameters from it
1981         are captured in a nested anonymous method.
1982
1983         The ScopeInfo is used to track the activation frames for local
1984         variables, for example:
1985
1986         for (int i = 0; i < 10; i++)
1987                 for (int j = 0; j < 10; j++){
1988                    MyDelegate d = delegate {
1989                         call (i, j);
1990                    }
1991                 }
1992
1993         At runtime this captures a single captured variable `i', but it
1994         captures 10 different versions of the variable `j'.  The variable
1995         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
1996         recorded on a child.  
1997
1998         The toplevel ScopeInfo will also track information like the `this'
1999         pointer if instance variables were referenced (this is necessary
2000         as the anonymous method lives inside a nested class in the host
2001         type of the method). 
2002
2003         (AnonymousMethod): Expanded to track the Toplevel, implement
2004         `AnonymousMethod.Compatible' to tell whether an anonymous method
2005         can be converted to a target delegate type. 
2006
2007         The routine now also produces the anonymous method content
2008
2009         (AnonymousDelegate): A helper class that derives from
2010         DelegateCreation, this is used to generate the code necessary to
2011         produce the delegate for the anonymous method that was created. 
2012
2013         * assign.cs: API adjustments for new changes in
2014         Convert.ImplicitStandardConversionExists.
2015
2016         * class.cs: Adjustments to cope with the fact that now toplevel
2017         blocks are of type `ToplevelBlock'. 
2018
2019         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2020         insteda of standard blocks.
2021
2022         Flag errors if params arguments are passed to anonymous methods.
2023
2024         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2025         `CurrentAnonymousMethod' which points to the current Anonymous
2026         Method.  The variable points to the AnonymousMethod class that
2027         holds the code being compiled.  It is set in the new EmitContext
2028         created for the anonymous method.
2029
2030         (EmitContext.Phase): Introduce a variable and an enumeration to
2031         assist in enforcing some rules about when and where we are allowed
2032         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2033         only one that enfonces this right now).
2034
2035         (EmitContext.HaveCaptureInfo): new helper method that returns
2036         whether we have a CapturedContext initialized.
2037
2038         (EmitContext.CaptureVariable): New method used to register that a
2039         LocalInfo must be flagged for capturing. 
2040
2041         (EmitContext.CapturedParameter): New method used to register that a
2042         parameters must be flagged for capturing. 
2043         
2044         (EmitContext.CapturedField): New method used to register that a
2045         field must be flagged for capturing. 
2046
2047         (EmitContext.HaveCapturedVariables,
2048         EmitContext.HaveCapturedFields): Return whether there are captured
2049         variables or fields. 
2050
2051         (EmitContext.EmitMethodHostInstance): This is used to emit the
2052         instance for the anonymous method.  The instance might be null
2053         (static methods), this (for anonymous methods that capture nothing
2054         and happen to live side-by-side with the current method body) or a
2055         more complicated expression if the method has a CaptureContext.
2056
2057         (EmitContext.EmitTopBlock): Routine that drives the emission of
2058         code: it will first resolve the top block, then emit any metadata
2059         and then emit the code.  The split is done so that we can extract
2060         any anonymous methods and flag any captured variables/parameters.
2061         
2062         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2063         during this phase, the ILGenerator should not be used as labels
2064         and local variables declared here might not be accessible to any
2065         code that is part of an anonymous method.  
2066
2067         Exceptions to this include the temporary variables that are
2068         created by some statements internally for holding temporary
2069         variables. 
2070         
2071         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2072         metadata for a cb
2073
2074         (EmitContext.TemporaryReturn): This method is typically called
2075         from the Emit phase, and its the only place where we allow the
2076         ReturnLabel to be defined other than the EmitMeta.  The reason is
2077         that otherwise we would have to duplicate a lot of logic in the
2078         Resolve phases of various methods that today is on the Emit
2079         phase. 
2080
2081         (EmitContext.NeedReturnLabel): This no longer creates the label,
2082         as the ILGenerator is not valid during the resolve phase.
2083
2084         (EmitContext.EmitThis): Extended the knowledge in this class to
2085         work in anonymous methods in addition to iterators. 
2086
2087         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2088         code is necessary on the stack to access the instance to a local
2089         variable (the variable will be accessed as a field).
2090
2091         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2092         EmitContext.EmitAddressOfParameter): Routines to support
2093         parameters (not completed at this point). 
2094         
2095         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2096         will also remove the parameters.
2097
2098         * convert.cs (Convert): Define a `ConstantEC' which points to a
2099         null.  This is just to prefity some code that uses
2100         ImplicitStandardConversion code and do not have an EmitContext
2101         handy.
2102
2103         The idea is to flag explicitly that at that point in time, it is
2104         known that the conversion will not trigger the delegate checking
2105         code in implicit conversions (which requires a valid
2106         EmitContext). 
2107
2108         Everywhere: pass new EmitContext parameter since
2109         ImplicitStandardConversionExists now requires it to check for
2110         anonymous method conversions. 
2111
2112         (Convert.ImplicitStandardConversionExists): If the type of an
2113         expression is the anonymous_method_type, and the type is a
2114         delegate, we invoke the AnonymousMethod.Compatible method to check
2115         whether an implicit conversion is possible. 
2116
2117         (Convert.ImplicitConversionStandard): Only do implicit method
2118         group conversions if the language level is not ISO_1.
2119
2120         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2121         MethodInfo for the Invoke method.  used by Delegate and
2122         AnonymousDelegate.
2123
2124         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2125         method conversions if the target type is a delegate.
2126
2127         Removed extra debugging nops.
2128
2129         (LocalVariableReference): Turn the `local_info' into a public
2130         field. 
2131
2132         Add `prepared' field, the same hack used for FieldExprs to cope
2133         with composed assignments, as Local variables do not necessarily
2134         operate purely on the stack as they used to: they can be captured
2135         fields. 
2136
2137         Add `temp' for a temporary result, like fields.
2138
2139         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2140
2141         It now copes with Local variables that are captured and emits the
2142         proper instance variable to load it from a field in the captured
2143         case. 
2144
2145         (ParameterReference.DoResolveBase): During the resolve phase,
2146         capture parameters if we are in an anonymous method.
2147
2148         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2149         anonymous method, use the EmitContext helper routines to emit the
2150         parameter reference.
2151
2152         * iterators.cs: Set RemapToProxy to true/false during the
2153         EmitDispose class.
2154
2155         * parameters.cs (GetParameterByName): New helper method. 
2156
2157         * typemanager.cs (anonymous_method_type) a new type that
2158         represents an anonyous method.  This is always an internal type,
2159         used as a fencepost to test against the anonymous-methodness of an
2160         expression. 
2161         
2162 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2163
2164         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2165         561 report.
2166         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2167
2168 2004-11-10  Martin Baulig  <martin@ximian.com>
2169
2170         * expression.cs (Invocation.BetterFunction): If two methods have
2171         equal parameter types, but only one of them is generic, the
2172         non-generic one wins.
2173         (New.DoResolve): Don't set `is_struct' to false if we're a generic
2174         instance; just use `Type.IsValueType' to determine whether
2175         something is a struct or not.
2176         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
2177         so we can be called multiple times.
2178
2179 2004-11-10  Martin Baulig  <martin@ximian.com>
2180
2181         * generic.cs (TypeParameter.DefineConstraints): New public method.
2182         (TypeParameter.CheckAccessLevel): Override this and return true.
2183         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
2184         override ResolveType() anymore.
2185         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
2186
2187 2004-11-10  Martin Baulig  <martin@ximian.com>
2188
2189         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
2190         call DeclSpace.ResolveNestedType() on it.
2191
2192 2004-11-10  Martin Baulig  <martin@ximian.com>
2193
2194         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
2195         non-null, call ParameterModifier() on it.
2196
2197 2004-11-10  Martin Baulig  <martin@ximian.com>
2198
2199         * iterators.cs
2200         (Iterators): Added `current_type' and `this_type' fields.
2201         (Iterators.DefineIterator): Create a new EmitContext and store it
2202         in `ec'; compute `this_type'.
2203
2204 2004-11-10  Martin Baulig  <martin@ximian.com>
2205
2206         * typemanager.cs
2207         (TypeManager.IsPrivateAccessible): New public method.
2208         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
2209
2210 2004-11-10  Martin Baulig  <martin@ximian.com>
2211
2212         * class.cs (TypeContainer.DefineType): Call
2213         TypeBuilder.DefineGenericParameters() before resolving the type
2214         parameters.
2215         (MethodData.parent_method): New protected field.
2216         (MethodData..ctor): Added `MethodInfo parent_method' argument.
2217         (MethodData.Define): Compute `parent_method'.
2218
2219         * decl.cs
2220         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2221         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2222         (DeclSpace.ec): New protected field; store the EmitContext here.
2223         (DeclSpace.EmitContext): New public property.
2224         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
2225         (DeclSpace.ResolveNestedType): New public method.
2226         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
2227         (DeclSpace.NestedAccessible): Added `Type tb' argument.
2228         (DeclSpace.FamilyAccessible): Likewise.
2229         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
2230         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2231         EmitContext.
2232
2233         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
2234         field.
2235
2236         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2237         (Enum.Emit): Don't create a new EmitContext.
2238
2239 2004-10-18  Martin Baulig  <martin@ximian.com>
2240
2241         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2242         `Type' directly, but call ResolveType() on it.
2243         (Catch.Resolve): Likewise.
2244         (Foreach.Resolve): Likewise.
2245
2246 2004-10-18  Martin Baulig  <martin@ximian.com>
2247
2248         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2249         `Type' directly, but call ResolveType() on it.
2250         (Probe.DoResolve): Likewise.
2251         (ArrayCreation.LookupType): Likewise.
2252         (TypeOf.DoResolve): Likewise.
2253         (SizeOf.DoResolve): Likewise.
2254
2255 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2256
2257         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2258         the ResolveType.
2259
2260 2004-10-17  John Luke  <john.luke@gmail.com>
2261
2262         * class.cs (Operator.GetSignatureForError): use CSharpName
2263
2264         * parameter.cs (Parameter.GetSignatureForError): Returns
2265         correct name even if was not defined.
2266
2267 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2268
2269         Fix #65816.
2270         * class.cs (TypeContainer.EmitContext): New property.
2271         (DefineNestedTypes): Create an emitcontext for each part.
2272         (MethodCore.DoDefineParameters): Use container's emitcontext.
2273         Pass type array to InternalParameters.
2274         (MemberBase.DoDefine): Use container's emitcontext.
2275         (FieldMember.Define): Likewise.
2276         (Event.Define): Likewise.
2277         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2278         Pass type array to InternalParameters.
2279         (SetIndexerMethod.GetParameterInfo): Likewise.
2280         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2281         * delegate.cs (Define): Pass emitcontext to
2282         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2283         array to InternalParameters.
2284         * expression.cs (ParameterReference.DoResolveBase): Pass
2285         emitcontext to GetParameterInfo.
2286         (ComposedCast.DoResolveAsTypeStep): Remove check on
2287         ec.ResolvingTypeTree.
2288         * parameter.cs (Parameter.Resolve): Change argument to
2289         EmitContext.  Use ResolveAsTypeTerminal.
2290         (Parameter.GetSignature): Change argument to EmitContext.
2291         (Parameters.ComputeSignature): Likewise.
2292         (Parameters.ComputeParameterTypes): Likewise.
2293         (Parameters.GetParameterInfo): Likewise.
2294         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2295         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2296         * support.cs (InternalParameters..ctor): Remove variant that takes
2297         a DeclSpace.
2298         * typemanager.cs (system_intptr_expr): New.
2299         (InitExpressionTypes): Initialize it.
2300
2301 2004-10-12  Chris Toshok  <toshok@ximian.com>
2302
2303         * cs-parser.jay: fix location for try_statement and catch_clause.
2304
2305 2004-10-18  Martin Baulig  <martin@ximian.com>
2306
2307         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2308         `Type' directly, but call ResolveType() on it.
2309         (MemberBase.DoDefine): Likewise.
2310
2311         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2312         `Type' directly, but call ResolveType() on it.
2313         (ComposedCast.DoResolveAsTypeStep): Likewise.
2314
2315         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2316         `Type' directly, but call ResolveType() on it.
2317
2318 2004-10-17  John Luke  <john.luke@gmail.com>
2319
2320         * class.cs (Operator.GetSignatureForError): use CSharpName
2321
2322         * parameter.cs (Parameter.GetSignatureForError): Returns
2323         correct name even if was not defined.
2324
2325 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2326
2327         Fix #65816.
2328         * class.cs (TypeContainer.EmitContext): New property.
2329         (DefineNestedTypes): Create an emitcontext for each part.
2330         (MethodCore.DoDefineParameters): Use container's emitcontext.
2331         Pass type array to InternalParameters.
2332         (MemberBase.DoDefine): Use container's emitcontext.
2333         (FieldMember.Define): Likewise.
2334         (Event.Define): Likewise.
2335         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2336         Pass type array to InternalParameters.
2337         (SetIndexerMethod.GetParameterInfo): Likewise.
2338         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2339         * delegate.cs (Define): Pass emitcontext to
2340         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2341         array to InternalParameters.
2342         * expression.cs (ParameterReference.DoResolveBase): Pass
2343         emitcontext to GetParameterInfo.
2344         (ComposedCast.DoResolveAsTypeStep): Remove check on
2345         ec.ResolvingTypeTree.
2346         * parameter.cs (Parameter.Resolve): Change argument to
2347         EmitContext.  Use ResolveAsTypeTerminal.
2348         (Parameter.GetSignature): Change argument to EmitContext.
2349         (Parameters.ComputeSignature): Likewise.
2350         (Parameters.ComputeParameterTypes): Likewise.
2351         (Parameters.GetParameterInfo): Likewise.
2352         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2353         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2354         * support.cs (InternalParameters..ctor): Remove variant that takes
2355         a DeclSpace.
2356         * typemanager.cs (system_intptr_expr): New.
2357         (InitExpressionTypes): Initialize it.
2358
2359 2004-10-12  Chris Toshok  <toshok@ximian.com>
2360
2361         * cs-parser.jay: fix location for try_statement and catch_clause.
2362
2363 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2364
2365         More DeclSpace.ResolveType avoidance.
2366         * decl.cs (MemberCore.InUnsafe): New property.
2367         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2368         with newly created EmitContext.
2369         (FieldMember.Define): Likewise.
2370         * delegate.cs (Delegate.Define): Likewise.
2371         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2372         only if normal name-lookup fails.
2373         (TypeExpr.DoResolve): Enable error-checking.
2374         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2375         (SizeOf.DoResolve): Likewise.
2376         (ComposedCast.DoResolveAsTypeStep): Likewise.
2377         (StackAlloc.DoResolve): Likewise.
2378         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2379         (Block.Unsafe): New property.
2380         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2381         (Unsafe): Set 'unsafe' flag of contained block.
2382         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2383         (Fixed.Resolve): Likewise.
2384         (Catch.Resolve): Likewise.
2385         (Using.ResolveLocalVariableDecls): Likewise.
2386         (Foreach.Resolve): Likewise.
2387
2388 2004-10-05  John Luke <john.luke@gmail.com>
2389
2390         * cs-parser.jay: add location to error CS0175
2391
2392 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2393
2394         * ecore.cs (Expression.Constantity): Add support for turning null
2395         into a constant.
2396
2397         * const.cs (Const.Define): Allow constants to be reference types
2398         as long as the value is Null.
2399
2400 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2401
2402         * namespace.cs (NamespaceEntry.Using): No matter which warning
2403         level is set, check if this namespace name has already been added.
2404
2405 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2406
2407         * expression.cs: reftype [!=]= null should always use br[true,false].
2408         # 67410
2409
2410 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2411
2412         Fix #67108
2413         * attribute.cs: Enum conversion moved to 
2414         GetAttributeArgumentExpression to be applied to the all
2415         expressions.
2416
2417 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2418
2419         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2420         * class.c (TypeContainer.DefineType): Flag error if
2421         base types aren't accessible due to access permissions.
2422         * decl.cs (DeclSpace.ResolveType): Move logic to
2423         Expression.ResolveAsTypeTerminal.
2424         (DeclSpace.ResolveTypeExpr): Thin layer over
2425         Expression.ResolveAsTypeTerminal.
2426         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2427         Refactor code into NestedAccess.  Use it.
2428         (DeclSpace.NestedAccess): New.
2429         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2430         argument to silence errors.  Check access permissions.
2431         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2432         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2433         (Cast.DoResolve): Likewise.
2434         (New.DoResolve): Likewise.
2435         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2436         (TypeOf.DoResolve): Likewise.
2437
2438         * expression.cs (Invocation.BetterConversion): Return the Type of
2439         the better conversion.  Implement section 14.4.2.3 more faithfully.
2440         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2441         section 14.4.2.2 explicit.
2442         (Invocation.OverloadResolve): Update.
2443         (Invocation): Remove is_base field.
2444         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2445         (Invocation.Emit): Likewise.
2446
2447 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2448
2449         * cs-parser.jay: Reverted 642 warning fix.
2450
2451 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2452
2453         Fix bug #66615
2454         * decl.cs (FindMemberWithSameName): Indexer can have more than
2455         1 argument.
2456
2457 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2458
2459         * expression.cs (LocalVariableReference.DoResolveLValue):
2460         Do not report warning 219 for out values.
2461         (EmptyExpression.Null): New member to avoid extra allocations.
2462
2463 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2464
2465         * cs-parser.jay: Fix wrong warning 642 report.
2466
2467         * cs-tokenizer.cs (CheckNextToken): New helper;
2468         Inspect next character if is same as expected.
2469
2470 2004-09-23  Martin Baulig  <martin@ximian.com>
2471
2472         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2473         (Convert.ImplicitReferenceConversionExists): Likewise.
2474
2475 2004-11-09  Raja R Harinath  <rharinath@novell.com>
2476
2477         * Makefile (DISTFILES): Comment out a few missing files.
2478
2479 2004-10-29  Raja R Harinath  <rharinath@novell.com>
2480
2481         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
2482         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
2483         (gmcs.exe): Invoke bootstrap-libs.
2484         (clean-local): Clean the net_2_0_bootstrap profile too.
2485         (PROGRAM_INSTALL_DIR): New.
2486         (install-local): Use it.
2487
2488 2004-10-13  Martin Baulig  <martin@ximian.com>
2489
2490         * generic.cs (TypeManager.InflatedConstraints): New nested class.
2491         (TypeParameter.DefineType): If we're a method type parameter and
2492         that method is overriding something, "inflate" its constraints.
2493
2494 2004-10-12  Martin Baulig  <martin@ximian.com>
2495
2496         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
2497         and have type arguments, create and resolve a ConstructedType.
2498
2499 2004-10-12  Martin Baulig  <martin@ximian.com>
2500
2501         * decl.cs (MemberCache.FindMemberToOverride): Use
2502         TypeManager.IsEqual() to compare the parameters and Type.Equals()
2503         to compare the invocationType.
2504
2505         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
2506         When comparing two type parameters, only do the signature-only
2507         comparision for method type parameters.
2508
2509 2004-10-11  Martin Baulig  <martin@ximian.com>
2510
2511         * report.cs: Don't make --fatal abort on warnings, we have
2512         -warnaserror for that.
2513
2514 2004-10-11  Martin Baulig  <martin@ximian.com>
2515
2516         * typemanager.cs
2517         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
2518         (TypeManager.IsEqual): Call ourself recursively instead of using
2519         Type.IsEqual(). 
2520
2521 2004-10-11  Martin Baulig  <martin@ximian.com>
2522
2523         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2524         on our own type parameters, not on the ones we inherit from a containing
2525         class.
2526
2527         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2528         the comparision.
2529
2530         * generic.cs (TypeParameter.Define): We may only be called once.
2531
2532         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2533         instead of TypeManager.IsEqual().
2534
2535 2004-09-28  Martin Baulig  <martin@ximian.com>
2536
2537         * generic.cs
2538         (GenericConstraints.EffectiveBaseClass): New public property.
2539         (TypeParameter.GenericConstraints): New public property.
2540         (ConstructedType.CheckConstraints): Improved.
2541
2542         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2543         (Convert.TypeParameterConversion): New private method; use this in
2544         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2545         for all conversions related to type parameters.
2546
2547 2004-09-24  Martin Baulig  <martin@ximian.com>
2548
2549         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2550         type parameter conversions for type parameters which are known to
2551         be reference types.
2552
2553 2004-09-24  Martin Baulig  <martin@ximian.com>
2554
2555         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2556         `IsValueType' properties.
2557
2558         * support.cs (ReflectionConstraints): Use
2559         Type.GetGenericParameterConstraints() instead of the old hack.
2560
2561 2004-09-24  Martin Baulig  <martin@ximian.com>
2562
2563         * generic.cs (GenericConstraints): Moved here and made it an
2564         abstract class.
2565
2566         * support.cs (GenericConstraints): Moved to generic.cs.
2567
2568 2004-09-24  Martin Baulig  <martin@ximian.com>
2569
2570         * support.cs
2571         (ReflectionConstraints): Un-nested this class and made it public.
2572
2573         * typemanager.cs
2574         (TypeManager.GetTypeParameterConstraints): New public method.
2575         (TypeManager.HasConstructorConstraint): Use the attributes.
2576
2577 2004-09-24  Martin Baulig  <martin@ximian.com>
2578
2579         * support.cs (GenericConstraints): Replaced `HasConstructor',
2580         `IsReferenceType' and `IsValueType' with `Attributes'.
2581         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2582         method and made the .ctor public.
2583
2584         * generic.cs (Constraints.Attributes): New public property.
2585         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2586         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2587         `IsValueType' -> `HasValueTypeConstraint'.
2588
2589 2004-09-23  Martin Baulig  <martin@ximian.com>
2590
2591         * generic.cs (Constraints): Reflect latest runtime changes.
2592
2593 2004-09-23  Martin Baulig  <martin@ximian.com>
2594
2595         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2596         (Convert.ImplicitReferenceConversionExists): Likewise.
2597
2598 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2599
2600         * class.cs (Operator.Define): Add error 448 and 559 report.
2601         
2602 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2603
2604         * class.cs (MemberBase.IsTypePermitted): New protected
2605         method for checking error CS0610.
2606
2607 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2608
2609         * class.cs (TypeContainer.HasExplicitLayout): New property
2610         Returns whether container has StructLayout attribute set Explicit.
2611         (FieldMember): New abstract class for consts and fields.
2612         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2613         (Field): Reuse FieldMember.
2614
2615         * const.cs (Const): Reuse FieldMember.
2616
2617         * rootcontext.cs: EmitConstants call moved to class.
2618
2619 2004-09-22  Martin Baulig  <martin@ximian.com>
2620
2621         Marek and me just fixed one of our oldest bugs: #28562 :-)
2622
2623         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2624
2625         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2626         we're an EnumConstant, just return that.
2627         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2628         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2629         to get the value which'll actually be written into the attribute.
2630         However, we have to use GetValue() to access the attribute's value
2631         in the compiler.        
2632
2633 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2634
2635         * constant.cs (Constant.IsNegative): New abstract property
2636         IsNegative.
2637
2638         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2639         (StackAlloc.DoResolve): Reused IsNegative.
2640
2641 2004-09-22  Martin Baulig  <martin@ximian.com>
2642
2643         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2644         public method; like LookupTypeContainer, but also works for
2645         generic instances.
2646
2647         * report.cs (Report.SymbolRelatedToPreviousError): Use
2648         TypeManager.LookupGenericTypeContainer().       
2649
2650 2004-09-22  Martin Baulig  <martin@ximian.com>
2651
2652         Thanks to Peter Sestoft for this bug report.
2653
2654         * expression.cs (Conditional): If both the `trueExpr' and the
2655         `falseExpr' is a NullLiteral, return a NullLiteral.
2656
2657 2004-09-22  Martin Baulig  <martin@ximian.com>
2658
2659         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2660         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2661         for the "get_Current" call.
2662
2663 2004-09-21  Martin Baulig  <martin@ximian.com>
2664
2665         * convert.cs (Convert.ImplicitReferenceConversion): When
2666         converting to an interface type, first check whether we're
2667         converting from a reference type.
2668
2669 2004-09-14  Martin Baulig  <martin@ximian.com>
2670
2671         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2672
2673 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2674
2675         Fixed bug #61902
2676         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2677         called and is obsolete then this member suppress message
2678         when call is inside next [Obsolete] method or type.
2679
2680         * expression.cs: Use TestObsoleteMethodUsage member.
2681
2682 2004-09-14  Martin Baulig  <martin@ximian.com>
2683
2684         * genericparser.cs: Removed.
2685
2686 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2687
2688         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2689
2690 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2691
2692         * attribute.cs (Attribute.Resolve): Add error 653 report.
2693
2694         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2695         report.
2696         (Method.ApplyAttributeBuilder): Add error 685 report.
2697         (Operator.Define): Add error 564 report.
2698
2699         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2700
2701         * expression.cs (Invocation.DoResolve): Add error
2702         245 and 250 report.
2703
2704         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2705         error 674 report.
2706
2707 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2708
2709         * class.cs (ConstructorInitializer.Resolve):
2710         Wrong error number (515->516).
2711
2712 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2713
2714         * class.cs (Indexer.Define): Add error 631 report.
2715
2716 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2717
2718         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2719
2720 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2721
2722         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2723
2724 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2725
2726         * cs-parser.jay: Added error CS0241 report.
2727
2728 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2729
2730         * cs-parser.jay (fixed_statement): Introduce a scope for the
2731         declaration in the 'fixed' statement.
2732
2733 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2734
2735         * cs-parser.jay: Added CS0230 error report.
2736
2737 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2738
2739         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2740
2741 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2742
2743         * expression.cs (Argument.Resolve): Added error CS0192 and
2744         CS0199 report.
2745
2746 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2747
2748         C# 2.0 #pragma warning feature
2749
2750         * cs-tokenizer.cs (PreProcessPragma): New method; 
2751         Handles #pragma directive.
2752
2753         * report.cs (WarningRegions): New class; Support
2754         class for #pragma warning directive. It tests whether
2755         warning is enabled for a given line.
2756
2757 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2758
2759         * const.cs: Add more descriptive error report, tahnks to
2760         Sebastien. 
2761
2762 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2763
2764         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2765
2766 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2767
2768         * expression.cs: Apply patch from Ben: Remove dead code from
2769         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2770         as that code just threw an exception anwyays.
2771
2772         * const.cs: Remove the call to the turnintoconstant, for details
2773         see bug: #63144
2774         
2775         * literal.cs: The type of the null-literal is the null type;  So
2776         we use a placeholder type (literal.cs:System.Null, defined here)
2777         for it.
2778
2779         * expression.cs (Conditional.DoResolve): Remove some old code that
2780         is no longer needed, conversions have been fixed.
2781
2782         (ArrayCreationExpression.DoResolve): Return false if we fail to
2783         resolve the inner expression.
2784
2785 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2786
2787         Fix test-290.cs.
2788         * cs-parser.jay (delegate_declaration): Record a delegate
2789         declaration as a type declaration.
2790         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2791
2792 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2793
2794         * parameter.cs: Do not crash if the type can not be resolved. 
2795
2796         * expression.cs: Report errors with unsafe pointers, fixes #64896
2797
2798 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2799
2800         * expression.cs: Pointer arith always needs to do a conv.i
2801         if the operand is a long. fix 65320
2802
2803 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2804
2805         Fixed cs0619-37.cs, cs0619-38.cs
2806
2807         * enum.cs (GetObsoleteAttribute): Removed.
2808
2809         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2810         on Enum member is double staged. The first is tested member
2811         and then enum.
2812
2813 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2814
2815         Fixed #56986, #63631, #65231
2816
2817         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2818         adds member to name container.
2819         (TypeContainer.AddToTypeContainer): New method, adds type to
2820         name container.
2821         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2822         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2823         AddOperator): Simplified by reusing AddToMemberContainer.
2824         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2825         instead of field.
2826         (Method.CheckForDuplications): Fixed implementation to test all
2827         possibilities.
2828         (MemberBase): Detection whether member is explicit interface
2829         implementation is now in constructor.
2830         (MemberBase.UpdateMemberName): Handles IndexerName.
2831         (Accessor): Changed to keep also location information.
2832         (AbstractPropertyEventMethod): Is derived from MemberCore.
2833         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2834         will be emited or not.
2835         (PropertyBase.AreAccessorsDuplicateImplementation):
2836         Tests whether accessors are not in collision with some method.
2837         (Operator): Is derived from MethodCore to simplify common
2838         operations.
2839
2840         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2841         must be performed.
2842         (DeclSpace.AddToContainer): Adds the member to defined_names
2843         table. It tests for duplications and enclosing name conflicts.
2844
2845         * enum.cs (EnumMember): Clean up to reuse the base structures
2846
2847 2004-09-03  Martin Baulig  <martin@ximian.com>
2848
2849         Merged latest changes into gmcs.  Please keep this comment in
2850         here, it makes it easier for me to see what changed in MCS since
2851         the last time I merged.
2852
2853 2004-09-03  Martin Baulig  <martin@ximian.com>
2854
2855         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2856         into TypeContainer, to make partial classes work again.
2857
2858 2004-09-03  Martin Baulig  <martin@ximian.com>
2859
2860         * rootcontext.cs (RootContext.V2): Removed.
2861
2862 2004-03-23  Martin Baulig  <martin@ximian.com>
2863
2864         * expression.cs (Invocation.OverloadResolve): Added `bool
2865         may_fail' argument and use it instead of the Location.IsNull() hack.
2866
2867 2004-09-09  Martin Baulig  <martin@ximian.com>
2868
2869         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2870
2871 2004-09-09  Martin Baulig  <martin@ximian.com>
2872
2873         * generic.cs (TypeParameter.DefineType): Added support for
2874         explicit interface methods.
2875
2876 2004-09-09  Martin Baulig  <martin@ximian.com>
2877
2878         * README.Changes: New document.  Started to list important changes
2879         between MCS and GMCS here.
2880
2881 2004-09-08  Martin Baulig  <martin@ximian.com>
2882
2883         * class.cs
2884         (TypeContainer.CheckRecursiveDefinition): New protected method.
2885         (TypeContainer.DefineType): Move the CS0146 check into
2886         CheckRecursiveDefinition().     
2887
2888 2004-09-06  Martin Baulig  <martin@ximian.com>
2889
2890         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2891         types for the constructor constraint.
2892
2893 2004-09-03  Martin Baulig  <martin@ximian.com>
2894
2895         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2896         into TypeContainer, to make partial classes work again.
2897
2898 2004-09-03  Martin Baulig  <martin@ximian.com>
2899
2900         * rootcontext.cs (RootContext.V2): Removed.
2901
2902 2004-03-23  Martin Baulig  <martin@ximian.com>
2903
2904         * expression.cs (Invocation.OverloadResolve): Added `bool
2905         may_fail' argument and use it instead of the Location.IsNull() hack.
2906
2907 2004-09-03  Martin Baulig  <martin@ximian.com>
2908
2909         Merged latest changes into gmcs.  Please keep this comment in
2910         here, it makes it easier for me to see what changed in MCS since
2911         the last time I merged.
2912
2913 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2914
2915         Fix #61128.
2916         * expression.cs (BetterConversion): Don't allow either conversion 
2917         to be null.  Remove redundant implicit conversion test when 'q ==
2918         null' -- when this function is invoked, we already know that the
2919         implicit conversion exists.
2920         (BetterFunction): Assume that 'best' is non-null.  Remove
2921         redundant reimplementation of IsApplicable when 'best' is null.
2922         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2923         number of arguments.
2924         (IsAncestralType): Extract from OverloadResolve.
2925         (OverloadResolve): Make robust to the MethodGroupExpr being
2926         unsorted.  Implement all the logic of Section 14.5.5.1, and
2927         support overloading of methods from multiple applicable types.
2928         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
2929
2930         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2931         (RealError, Warning): Append type of report to related symbol.
2932
2933 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
2934
2935         * enum.cs: Fixed CLS-Compliance checks for enum members.
2936         Error tests cs3008-8.cs, cs3014-8.cs
2937
2938 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2939
2940         Fixed bug #62342, #63102
2941         * class.cs: ImplementIndexer uses member.IsExplicitImpl
2942         like ImplementMethod.
2943
2944 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2945
2946         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2947         Fixed bug #65170.
2948
2949 2004-09-02  Martin Baulig  <martin@ximian.com>
2950
2951         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2952         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2953         on the MethodBase.
2954
2955 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
2956
2957         C# 2.0 Static classes implemented
2958
2959         * class.cs (TypeContainer): instance_constructors,
2960         initialized_fields, initialized_static_fields,
2961         default_constructor, base_inteface_types are protected to be
2962         accessible from StaticClass.
2963         (TypeContainer.DefineDefaultConstructor): New virtual method
2964         for custom default constructor generating
2965         (StaticClass): New class to handle "Static classes" feature.
2966
2967         * cs-parser.jay: Handle static keyword on class like instance
2968         of StaticClass.
2969
2970         * driver.cs: Added "/langversion" command line switch with two
2971         options (iso-1, default).
2972
2973 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
2974
2975         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
2976
2977 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
2978
2979         * delegate.cs: Style.
2980
2981 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2982
2983         * delegate.cs: Add seperate instance expr field for miguel.
2984
2985 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2986
2987         * PointerArithmetic (Resolve): make sure we are not doing
2988         pointer arith on void*. Also, make sure we are resolved
2989         by not setting eclass until resolve.
2990
2991         All callers: Make sure that PointerArithmetic gets resolved.
2992
2993 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2994
2995         * ArrayCreation (LookupType): If the type does not resolve 
2996         to an array, give an error.
2997
2998 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
2999
3000         * statement.cs (Try.Resolve): Fixed bug #64222
3001
3002 2004-08-27  Martin Baulig  <martin@ximian.com>
3003
3004         * class.cs
3005         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3006         crash here.     
3007
3008 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3009
3010         * ecore.cs (Constantify): Get underlying type via
3011         System.Enum.GetUnderlyingType to avoid StackOverflow on the
3012         Windows in special cases.
3013
3014 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3015
3016         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3017         for obtaining also private methods.
3018         (GetRemoveMethod): Used GetRemoveMethod (true)
3019         for obtaining also private methods.
3020
3021 2004-09-02  Martin Baulig  <martin@ximian.com>
3022
3023         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3024         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3025         on the MethodBase.
3026
3027 2004-08-27  Martin Baulig  <martin@ximian.com>
3028
3029         * class.cs
3030         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3031         crash here.     
3032
3033 2004-08-25  Martin Baulig  <martin@ximian.com>
3034
3035         * support.cs (ReflectionParameters..ctor): If this is a generic
3036         method, retrieve and store its type parameters.
3037         (InternalParameters..ctor): Added `TypeParameter[]' argument.
3038         (ReflectionParameters.GenericConstraints): The argument specifies
3039         the type parameter, not the method parameter.
3040         (InternalParameters.GenericConstraints): Likewise.
3041
3042         * generic.cs (TypeParameter.DefineType): Correctly handle
3043         constraints wrt. generic methods in interfaces and their
3044         implementations.        
3045
3046 2004-08-24  Martin Baulig  <martin@ximian.com>
3047
3048         * generic.cs (TypeParameter.IsSubclassOf): New public method.
3049         (Constraints.IsSubclassOf): New internal method.
3050
3051         * typemanager.cs (TypeManager.FindMembers): Added special support
3052         for GenericTypeParameterBuilder's.      
3053         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
3054         type parameters.
3055
3056 2004-08-24  Martin Baulig  <martin@ximian.com>
3057
3058         * typemanager.cs
3059         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3060         this for accessibility checks.
3061         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3062         IsNestedFamilyAccessible.
3063         (TypeManager.IsSubclassOf): New method, do what the name actually
3064         says.   
3065
3066 2004-08-24  Martin Baulig  <martin@ximian.com>
3067
3068         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
3069         as a SimpleName, include the generic arity.
3070
3071 2004-08-24  Martin Baulig  <martin@ximian.com>
3072
3073         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3074         MethodAttributes.HideBySig for operators.
3075
3076 2004-08-23  Martin Baulig  <martin@ximian.com>
3077
3078         Back to the old error reporting system :-)
3079
3080         * report.cs (Message): Removed.
3081         (Report.MessageData, ErrorData, WarningData): Removed.
3082         (Report.Error, Warning): Back to the old system.
3083
3084 2004-08-23  Martin Baulig  <martin@ximian.com>
3085
3086         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3087
3088         * class.cs (TypeContainer.ParentContainer): New public virtual
3089         method; replaces the explicit interface implementation.
3090         (ClassPart.ParentContainer): Override.
3091
3092 2004-08-23  Martin Baulig  <martin@ximian.com>
3093
3094         * statement.cs (Switch): Added support for constant switches; see
3095         #59428 or test-285.cs.
3096
3097 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3098
3099         Fixed bug #62740.
3100         * statement.cs (GetEnumeratorFilter): Removed useless
3101         logic because C# specs is strict. GetEnumerator must be
3102         public.
3103
3104 2004-08-22  Martin Baulig  <martin@ximian.com>
3105
3106         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3107         a switch and may break, reset the barrier.  Fixes #59867.
3108
3109 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3110
3111         CLS-Compliance speed up (~5% for corlib)
3112
3113         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3114         New method. Tests container for CLS-Compliant names
3115
3116         * class.cs (TypeContainer.VerifyClsName): New method.
3117         Checks whether container name is CLS Compliant.
3118         (Constructor): Implements IMethodData.
3119
3120         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3121         low-case table for CLS Compliance test.
3122         (MemberCache.VerifyClsParameterConflict): New method.
3123         Checks method parameters for CS3006 error.
3124
3125         * enum.cs (EnumMember): Is derived from MemberCore.
3126         (Enum.VerifyClsName): Optimized for better performance.
3127
3128 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3129
3130         * report.cs: Renamed Error_T to Error and changed all
3131         references.
3132
3133 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3134
3135         * class.cs (TypeContainer.IndexerArrayList): New inner class
3136         container for indexers.
3137         (TypeContainer.DefaultIndexerName): New constant for default
3138         indexer name. Replaced all "Item" with this constant.
3139         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3140
3141         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3142         DefaultMemberAttribute constructor.
3143
3144 2004-08-05  Martin Baulig  <martin@ximian.com>
3145
3146         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3147         Fix bug #59429.
3148
3149 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3150
3151         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3152         multi platforms problem.
3153
3154         * compiler.csproj: Included shared files.
3155
3156 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3157
3158         Fix bug 60333, 55971 in the more general way
3159         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3160         Added arg_type argument for constant conversion.
3161         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3162
3163 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3164
3165         Fix bug #59760
3166         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3167         OperatorArrayList, MethodCoreArrayList for typecontainer
3168         containers. Changed class member types to these new types.
3169         (MethodArrayList.DefineMembers): Added test for CS0659.
3170
3171 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3172
3173         * cfold.cs: Synchronize the folding with the code in expression.cs
3174         Binary.DoNumericPromotions for uint operands.
3175
3176         * attribute.cs: Revert patch from Raja, it introduced a regression
3177         while building Blam-1.2.1 (hard to isolate a test case).
3178
3179 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3180
3181         Fix for #55382
3182         * class.cs:
3183         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3184         name collision.
3185         (MethodCore.parent_method): New member. The method we're overriding
3186         if this is an override method.
3187         (MethodCore.CheckBase): Moved from Method class and made common.
3188         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3189         private.
3190         (MethodCore.CheckForDuplications): New abstract method. For custom
3191         member duplication search in a container
3192         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3193         method and its return type.
3194         (Event.conflict_symbol): New member. Symbol with same name in the
3195         parent class.
3196
3197         * decl.cs:
3198         (MemberCache.FindMemberWithSameName): New method. The method
3199         is looking for conflict with inherited symbols.
3200
3201 2004-08-04  Martin Baulig  <martin@ximian.com>
3202
3203         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3204
3205         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3206
3207 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3208
3209         * report.cs (Message): New enum for better error, warning reference in
3210         the code.
3211         (MessageData): New inner abstract class. It generally handles printing of
3212         error and warning messages.
3213         Removed unused Error, Warning, Message methods.
3214
3215 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3216
3217         Fix for cs0592-8.cs test
3218         * attribute.cs
3219         (Attributable.ValidAttributeTargets): Made public.
3220         (Attribute.ExplicitTarget): New member for explicit target value.
3221         (Attribute.CheckTargets): Now we translate explicit attribute
3222         target to Target here.
3223
3224 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3225
3226         * ecore.cs (MethodGroupExpr): new IsBase property.
3227
3228         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3229
3230         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3231         rather than an instance expr.
3232
3233         (DelegateCreation.Emit): Use the method group rather than
3234         the instance expression. Also, if you have base.Foo as the
3235         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3236
3237         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3238
3239         (NewDelegate.DoResolve): Only check for the existance of Invoke
3240         if the method is going to be needed. Use MethodGroupExpr.
3241
3242         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3243
3244         * expression.cs: For pointer arith., make sure to use
3245         the size of the type, not the size of the pointer to
3246         the type.
3247
3248 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3249
3250         Fix for #60722
3251         * class.cs (Class): Added error CS0502 test.
3252
3253 2004-08-03  John Luke  <jluke@cfl.rr.com>
3254             Raja R Harinath  <rharinath@novell.com>
3255
3256         Fix for #60997.
3257         * attribute.cs (Attribute.complained_before): New flag.
3258         (Attribute.ResolveType, Attribute.Resolve),
3259         (Attribute.DefinePInvokeMethod): Set it.
3260         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3261         
3262 2004-08-03  Martin Baulig  <martin@ximian.com>
3263
3264         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3265         use a user-defined operator; we still need to do numeric
3266         promotions in case one argument is a builtin type and the other
3267         one has an implicit conversion to that type.  Fixes #62322.
3268
3269 2004-08-18  Martin Baulig  <martin@ximian.com>
3270
3271         * class.cs (Method.Define): Use the correct method name when
3272         creating the MethodBuilder for a generic method.
3273
3274 2004-08-17  Martin Baulig  <martin@ximian.com>
3275
3276         * generic.cs (Constraints): Support type parameter constraints.
3277
3278 2004-08-16  Martin Baulig  <martin@ximian.com>
3279
3280         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
3281         (Token.GENERIC_DIMENSION): New token; this is returned if we
3282         encounter an unbound generic type in a typeof() expression.
3283
3284         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
3285         this token is only generated while parsing a typeof() expression.
3286         (typeof_expression): Removed the old unbound_type hack.
3287
3288         * generic.cs (TypeArguments.IsUnbound): New public property.
3289
3290         * decl.cs (MemberName): Added support for unbound types.
3291
3292 2004-08-14  Martin Baulig  <martin@ximian.com>
3293
3294         * typemanager.cs
3295         (TypeManager.IsEqualGenericInstance): New static method.
3296         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
3297         just used to check accessibility, so follow the rules of 26.1.6.        
3298
3299         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
3300         ConstructedType instead of a TypeExpression if we have type arguments.
3301
3302         * cs-parser.jay (typeof_expression): Support unbound generic types.
3303
3304         * ecore.cs (UnboundTypeExpression): New public class.
3305
3306 2004-08-12  Martin Baulig  <martin@ximian.com>
3307
3308         * typemanager.cs (TypeManager.IsNestedChildOf): Use
3309         TypeManager.IsEqual() rather than `=='.
3310
3311         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
3312         generic instances as well.
3313
3314 2004-08-12  Martin Baulig  <martin@ximian.com>
3315
3316         * expression.cs (Invocation.InferType): We can only infer method
3317         type parameters.  Fixes #62647.
3318
3319 2004-08-11  Martin Baulig  <martin@ximian.com>
3320
3321         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
3322         before resolving the base classes.
3323
3324 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3325
3326         * Makefile: install .mdb file too.
3327
3328 2004-08-05  Martin Baulig  <martin@ximian.com>
3329
3330         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
3331         initializer, the current type is just the TypeBuilder, not the
3332         instantiated generic type.
3333         (FieldExpr.IsFieldInitializer): New public property.
3334
3335 2004-08-04  Martin Baulig  <martin@ximian.com>
3336
3337         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3338
3339         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3340
3341 2004-08-03  Martin Baulig  <martin@ximian.com>
3342
3343         * class.cs (MethodData.Define): If we're an explicit
3344         implementation, remove the generic arity from the type name.
3345
3346 2004-08-03  Martin Baulig  <martin@ximian.com>
3347
3348         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3349         use a user-defined operator; we still need to do numeric
3350         promotions in case one argument is a builtin type and the other
3351         one has an implicit conversion to that type.  Fixes #62322.
3352
3353 2004-08-02  Martin Baulig  <martin@ximian.com>
3354
3355         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
3356         `TypeExpr[]' array.
3357         (TypeContainer.GetClassBases): Return the unexpanded list of
3358         interfaces; we expand them later.
3359         (TypeContainer.DefineType): After creating the TypeBuilder, call
3360         TypeManager.ExpandInterfaces() to get an expanded and resolved
3361         list of interfaces.
3362
3363         * ecore.cs (TypeExpr.GetInterfaces): Removed
3364
3365         * generics.cs (Constraints.InterfaceConstraints): Remove.
3366         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
3367         register the interface constraints.
3368
3369         * typemanager.cs
3370         (TypeManager.AddUserType): Removed the `ifaces' argument.
3371         (TypeManager.AddTypeParameter): Likewise.
3372         (TypeManager.AddUserInterface): Removed, was unused.
3373         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
3374         `TypeExpr[]' array for the interfaces.
3375         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
3376         has been defined, returns a list of the resolved interfaces types.
3377         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
3378         (TypeManager.GetExplicitInterfaces): Likewise.  
3379
3380 2004-08-02  Martin Baulig  <martin@ximian.com>
3381
3382         * expression.cs (Invocation.EmitCall): If we're invoking a method
3383         on a type parameter, use the new `Constrained' prefix opcode.
3384
3385 2004-08-02  Martin Baulig  <martin@ximian.com>
3386
3387         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3388         (LocalInfo.IsThis): New public property.
3389         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3390
3391 2004-08-01  Martin Baulig  <martin@ximian.com>
3392
3393         * class.cs (TypeContainer.GetClassBases): Don't set the default
3394         here since we may get called from GetPartialBases().
3395         (TypeContainer.DefineType): If GetClassBases() didn't return a
3396         parent, use the default one.
3397
3398 2004-07-30  Martin Baulig  <martin@ximian.com>
3399
3400         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3401
3402         * class.cs (SourceMethod): New public class, derive from the
3403         symbol writer's ISourceMethod.
3404         (Method): Use the new symbol writer API.
3405
3406         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3407         as argument and use the new symbol writer.
3408
3409         * location.cs
3410         (SourceFile): Implement the symbol writer's ISourceFile.
3411         (Location.SymbolDocument): Removed.
3412         (Location.SourceFile): New public property.
3413
3414         * symbolwriter.cs: Use the new symbol writer API.
3415
3416 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3417
3418         * Makefile (install-local): Remove.  Functionality moved to
3419         executable.make.
3420
3421 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3422
3423         * Makefile: Install mcs.exe.config file together with mcs.exe.
3424         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3425         correct runtime version.
3426         
3427 2004-07-25  Martin Baulig  <martin@ximian.com>
3428
3429         * class.cs
3430         (TypeContainer.RegisterOrder): Removed, this was unused.
3431         (TypeContainer, interface_order): Removed.
3432         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3433         TypeContainer as argument since we can also be called with a
3434         `PartialContainer' for a partial class/struct/interface.
3435         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3436         of checking whether we're an `Interface' - we could be a
3437         `PartialContainer'.
3438         (PartialContainer.Register): Override; call
3439         AddClass()/AddStruct()/AddInterface() on our parent.
3440
3441         * cs-parser.jay (interface_member_declaration): Add things to the
3442         `current_container', not the `current_class'.
3443
3444         * rootcontext.cs (RegisterOrder): The overloaded version which
3445         takes an `Interface' was unused, removed.
3446
3447         * typemanager.cs (TypeManager.LookupInterface): Return a
3448         `TypeContainer', not an `Interface'.
3449         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3450         contain a `PartialContainer' for an interface, so check it's
3451         `Kind' to figure out what it is.
3452
3453 2004-07-25  Martin Baulig  <martin@ximian.com>
3454
3455         * class.cs (Class.DefaultTypeAttributes): New public constant.
3456         (Struct.DefaultTypeAttributes): Likewise.
3457         (Interface.DefaultTypeAttributes): Likewise.
3458         (PartialContainer.TypeAttr): Override this and add the
3459         DefaultTypeAttributes.
3460
3461 2004-07-25  Martin Baulig  <martin@ximian.com>
3462
3463         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3464         we can just use the `Parent' field instead.
3465
3466 2004-07-25  Martin Baulig  <martin@ximian.com>
3467
3468         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3469
3470 2004-07-25  Martin Baulig  <martin@ximian.com>
3471
3472         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3473         our parts before defining any methods.
3474         (TypeContainer.VerifyImplements): Make this virtual.
3475         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3476         on our PartialContainer.
3477
3478 2004-07-25  Martin Baulig  <martin@ximian.com>
3479
3480         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3481
3482         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3483         argument, we can just use the `Parent' field instead.
3484
3485         * class.cs
3486         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3487         (MemberBase.DoDefine): Likewise.
3488
3489 2004-07-24  Martin Baulig  <martin@ximian.com>
3490
3491         * decl.cs (MemberCore.Parent): New public field.
3492         (DeclSpace.Parent): Moved to MemberCore.
3493
3494         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3495         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3496         parent's .ctor.
3497         (FieldBase, Field, Operator): Likewise.
3498         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3499         (EventField, Event): Likewise.
3500
3501 2004-07-23  Martin Baulig  <martin@ximian.com>
3502
3503         * class.cs (PartialContainer): New public class.
3504         (ClassPart): New public class.
3505         (TypeContainer): Added support for partial classes.
3506         (TypeContainer.GetClassBases): Splitted some of the functionality
3507         out into GetNormalBases() and GetPartialBases().
3508
3509         * cs-tokenizer.cs (Token.PARTIAL): New token.
3510         (Tokenizer.consume_identifier): Added some hacks to recognize
3511         `partial', but only if it's immediately followed by `class',
3512         `struct' or `interface'.
3513
3514         * cs-parser.jay: Added support for partial clases.
3515
3516 2004-07-23  Martin Baulig  <martin@ximian.com>
3517
3518         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3519         a `DeclSpace' and also made it readonly.
3520         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3521         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3522         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3523
3524         * cs-parser.jay: Pass the `current_class', not the
3525         `current_container' (at the moment, this is still the same thing)
3526         to a new Method, Property, Event, Indexer or Constructor.
3527
3528 2004-07-23  Martin Baulig  <martin@ximian.com>
3529
3530         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3531         and removed the `current_interface' one.
3532         (struct_declaration, class_declaration, interface_declaration):
3533         Set `current_class' to the newly created class/struct/interface;
3534         set their `Bases' and call Register() before parsing their body.
3535
3536 2004-07-23  Martin Baulig  <martin@ximian.com>
3537
3538         * class.cs (Kind): New public enum.
3539         (TypeContainer): Made this class abstract.
3540         (TypeContainer.Kind): New public readonly field.
3541         (TypeContainer.CheckDef): New public method; moved here from
3542         cs-parser.jay.
3543         (TypeContainer.Register): New public abstract method.
3544         (TypeContainer.GetPendingImplementations): New public abstract
3545         method.
3546         (TypeContainer.GetClassBases): Removed the `is_class' and
3547         `is_iface' parameters.
3548         (TypeContainer.DefineNestedTypes): Formerly known as
3549         DoDefineType().
3550         (ClassOrStruct): Made this class abstract.
3551
3552         * tree.cs (RootTypes): New public type. 
3553
3554 2004-07-20  Martin Baulig  <martin@ximian.com>
3555
3556         * tree.cs (Tree.RecordNamespace): Removed.
3557         (Tree.Namespaces): Removed.
3558
3559         * rootcontext.cs (RootContext.IsNamespace): Removed.
3560
3561         * cs-parser.jay (namespace_declaration): Just create a new
3562         NamespaceEntry here.
3563
3564 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3565
3566         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3567         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3568         entry to make sure it runs in the correct runtime version.
3569         
3570 2004-07-18  Martin Baulig  <martin@ximian.com>
3571
3572         * generic.cs (ConstructedType.CheckConstraints): Improved
3573         constraints checking.
3574
3575 2004-07-18  Martin Baulig  <martin@ximian.com>
3576
3577         * expression.cs (Invocation.BetterMethod): Call
3578         TypeManager.TypeToCoreType() on all types and removed my previous
3579         hack; we're already doig the right thing here.
3580
3581 2004-07-17  Martin Baulig  <martin@ximian.com>
3582
3583         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3584
3585 2004-07-16  Martin Baulig  <martin@ximian.com>
3586
3587         * iterators.cs: Added generics support.
3588
3589 2004-07-16  Martin Baulig  <martin@ximian.com>
3590
3591         * iterators.cs: Rewrote this.  We're now using one single Proxy
3592         class for both the IEnumerable and the IEnumerator interface and
3593         `Iterator' derives from Class so we can use the high-level API.
3594
3595         * class.cs (TypeContainer.AddIterator): New method.
3596         (TypeContainer.DoDefineType): New protected virtual method, which
3597         is called from DefineType().
3598         (TypeContainer.DoDefineMembers): Call DefineType() and
3599         DefineMembers() on all our iterators.
3600         (TypeContainer.Emit): Call Emit() on all our iterators.
3601         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3602
3603         * codegen.cs (EmitContext.CurrentIterator): New public field.
3604
3605 2004-07-15  Martin Baulig  <martin@ximian.com>
3606
3607         * typemanager.cs
3608         (TypeManager.not_supported_exception_type): New type.   
3609
3610 2004-07-14  Martin Baulig  <martin@ximian.com>
3611
3612         * typemanager.cs
3613         (TypeManager.generic_ienumerable_type): New type.
3614         (TypeManager.generic_ienumerator_type): New type.
3615
3616         * rootcontext.cs
3617         (RootContext.interfaces_first_stage): Added
3618         "System.Collections.Generic.IEnumerator`1" and
3619         "System.Collections.Generic.IEnumerable`1".     
3620
3621 2004-07-14  Martin Baulig  <martin@ximian.com>
3622
3623         * iterators.cs: Use real error numbers.
3624
3625 2004-07-14  Martin Baulig  <martin@ximian.com>
3626
3627         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3628         requires this to be a System.Collection.IEnumerable and not a
3629         class implementing that interface.
3630         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3631
3632 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3633
3634         * class.cs: Fixed previous fix, it broke some error tests.
3635
3636 2004-07-12  Martin Baulig  <martin@ximian.com>
3637
3638         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3639         Fixes #61293.
3640
3641 2004-07-14  Martin Baulig  <martin@ximian.com>
3642
3643         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3644         an exclamation mark (!) for the generic arity to reflect the
3645         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3646
3647 2004-07-13  Martin Baulig  <martin@ximian.com>
3648
3649         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3650         specifiers being part of a type argument.
3651
3652 2004-07-13  Martin Baulig  <martin@ximian.com>
3653
3654         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3655         name for generic types.
3656
3657 2004-07-13  Martin Baulig  <martin@ximian.com>
3658
3659         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3660         bit to fix #60119.
3661
3662 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3663
3664         * assign.cs (LocalTemporary): Add new argument: is_address,If
3665         `is_address' is true, then the value that we store is the address
3666         to the real value, and not the value itself.
3667         
3668         * ecore.cs (PropertyExpr): use the new local temporary
3669         stuff to allow us to handle X.Y += z (where X is a struct)
3670
3671 2004-07-08  Martin Baulig  <martin@ximian.com>
3672
3673         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3674         not always return, just like we're doing in Using.Resolve().
3675
3676 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3677
3678         * cs-parser.jay (fixed_statement): flag this as Pinned.
3679
3680 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3681
3682         * typemanager.cs (TypeManager): Removed MakePinned method, this
3683         mechanism is replaced with the .NET 2.x compatible mechanism of
3684         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3685
3686         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3687         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3688         `IsFixed' property which has a different meaning.
3689
3690 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3691
3692         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3693         visible from inside a nested class, not just the names of the
3694         immediately enclosing class.
3695         Fix for bug #60730.
3696
3697 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3698
3699         * expression.cs (BetterConversion): Remove buggy special-case
3700         handling of "implicit constant expression conversions".  At this
3701         point, we already know that the conversion is possible -- we're
3702         only checking to see which is better.
3703
3704 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3705
3706         * cs-parser.jay: Added error CS0210 test.
3707
3708 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3709
3710         * cs-parser.jay: Added error CS0134 test.
3711
3712 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3713
3714         Fix bug #52507
3715         * cs-parser.jay: Added error CS0145 test.
3716
3717 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3718
3719         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3720
3721 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3722         
3723         * expression.cs (StackAlloc.Resolve): The argument may not
3724         be a constant; deal with this case.
3725         
3726 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3727
3728         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3729         GetIndexerAttributeValue.
3730         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3731
3732         * class.cs (Indexer.Define): Added error tests for CS0415,
3733         CS0609.
3734
3735 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3736
3737         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3738         property code.
3739
3740 2004-06-23  Martin Baulig  <martin@ximian.com>
3741
3742         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3743         neither return nor throw, reset the barrier as well.  Fixes #60457.
3744
3745 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3746
3747         * class.cs : EventAttributes is now set to None by default.
3748           This fixes bug #60459.
3749
3750 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3751
3752         Fix bug #60219
3753         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3754         Don't throw exception but return null (it's sufficient now).
3755
3756 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3757
3758         * typemanager.cs (GetArgumentTypes): Faster implementation.
3759
3760 2004-06-18  Martin Baulig  <martin@ximian.com>
3761
3762         * attribute.cs (Attribute.Resolve): Check whether we're an
3763         EmptyCast which a Constant child.  Fixes #60333.
3764
3765 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3766
3767         * statement.cs (EmitCollectionForeach): Account for the fact that
3768         not all valuetypes are in areas which we can take the address of.
3769         For these variables, we store to a temporary variable. Also, make
3770         sure that we dont emit a `callvirt' on a valuetype method.
3771
3772 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3773
3774         * expression.cs (StackAlloc.DoReSolve): Added test for
3775         negative parameter (CS0247).
3776
3777 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3778
3779         Fix bug #59792
3780         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3781
3782 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3783
3784         Fix bug #59781
3785         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3786         ulong.
3787
3788 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3789
3790         Fix bug #58254 & cs1555.cs, cs1556.cs
3791         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3792
3793 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3794
3795         * cs-parser.jay: Added error CS1669 test for indexers.
3796
3797 2004-06-18  Martin Baulig  <martin@ximian.com>
3798
3799         * generics.cs (GenericMethod.ctor): Don't take an Attributes
3800         argument.  Fixes #60441.
3801
3802 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
3803         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3804         The name needs to have the actual name of the method in order
3805         for other tests (such as the one in OverloadResolve for Invoke
3806         on a delegate) to work. As well, it does not really help
3807         error reporting because the method group had multiple methods.
3808         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3809         Make profiling work.
3810         
3811 2004-06-13  Martin Baulig  <martin@ximian.com>
3812
3813         * cs-parser.jay: Don't allow generic attributes.
3814
3815 2004-06-13  Martin Baulig  <martin@ximian.com>
3816
3817         * class.cs (MemberBase.DoDefineBase): New protected method.
3818         (MemberBase.DoDefine): Compute the `flags' in the new
3819         DoDefineBase() which must be called first.
3820         (Method.Define): Call DoDefineBase() first so we have the flags
3821         when defining the generic method.
3822
3823         * cs-parser.jay (interface_method_declaration): Support generic methods.
3824
3825 2004-06-13  Martin Baulig  <martin@ximian.com>
3826
3827         * decl.cs (TypeName): Removed.
3828         (MemberName): Removed TypeName and MemberNow; now we just have
3829         MemberName.
3830
3831         * cs-parser.jay: Don't distinguish between type arguments and type
3832         parameters in the grammar and simplified the rules a bit.  The
3833         reduce/reduce conflicts are now gone (except the one we inherited
3834         from mcs).
3835
3836 2004-06-11  Martin Baulig  <martin@ximian.com>
3837
3838         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3839         call this twice: for params and varargs methods.
3840
3841 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3842
3843         * class.cs:
3844         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3845
3846 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3847
3848         * attribute.cs (Attribute.GetValidTargets): Made public.
3849
3850         * class.cs: 
3851         (AbstractPropertyEventMethod): New class for better code sharing.
3852         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3853         CS1667 report.
3854         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3855
3856 2004-06-09  Martin Baulig  <martin@ximian.com>
3857
3858         * cs-parser.jay: Removed a reduce/reduce conflict.
3859
3860 2004-06-03  Martin Baulig  <martin@ximian.com>
3861
3862         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3863         GetSimpleName() and return a SimpleName.
3864
3865         * ecore.cs (SimpleName.Arguments): New public field.
3866         (SimpleName): Added overloaded ctor which takes an additional
3867         TypeArguments argument.
3868         (SimpleName.SimpleNameResolve): Added support for generic methods.
3869         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
3870         formerly in MemberAccess.DoResolve(), but we also need it in
3871         SimpleNameResolve().
3872
3873         * expression.cs (MemberAccess.DoResolve): Use the new
3874         MethodGroupExpr.ResolveGeneric().       
3875
3876 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3877
3878         * decl.cs: If possible, use lookuptypedirect here. We can only do
3879         this if there is no `.' after the namespace. Avoids using
3880         LookupType, which does lots of slow processing.
3881         (FindNestedType) New method, does what it says :-).
3882         * namespace.cs: use LookupTypeDirect.
3883         * rootcontext.cs: use membercache, if possible.
3884         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3885
3886 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3887
3888         * expression.cs:
3889         According to the spec, 
3890
3891         In a member access of the form E.I, if E is a single identifier,
3892         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3893         field, property, localvariable, or parameter with the same type as
3894         the meaning of E as a type-name (§3.8), then both possible
3895         meanings of E are permitted.
3896
3897         We did not check that E as a simple-name had the same type as E as
3898         a type name.
3899
3900         This trivial check gives us 5-7% on bootstrap time.
3901
3902 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3903
3904         * expression.cs (Invocation.OverloadResolve): Avoid the
3905         use of hashtables and boxing here by allocating on demand.
3906
3907 2004-05-30  Martin Baulig  <martin@ximian.com>
3908
3909         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3910         we're doing a silent lookup.  Don't try to lookup nested types in
3911         TypeManager.object_type (thanks to Ben Maurer).
3912
3913 2004-05-30  Martin Baulig  <martin@ximian.com>
3914
3915         Committing a patch from Ben Maurer.
3916
3917         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3918
3919 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3920
3921         * convert.cs: add a trivial cache for overload operator resolution.
3922
3923 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
3924
3925         * attribute.cs
3926         (AttributeTester.GetObsoleteAttribute): Returns instance of
3927         ObsoleteAttribute when type is obsolete.
3928
3929         * class.cs
3930         (TypeContainer.VerifyObsoleteAttribute): Override.
3931         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3932         (MethodCode.VerifyObsoleteAttribute): Override.
3933         (MemberBase.VerifyObsoleteAttribute): Override.
3934
3935         * decl.cs
3936         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3937         and report proper error.
3938
3939         *delegate.cs
3940         (Delegate.VerifyObsoleteAttribute): Override.
3941
3942         * ecore.cs
3943         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3944         and report proper error.
3945         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3946
3947         * enum.cs
3948         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3949         and enum member.
3950
3951         * expression.cs
3952         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
3953         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
3954         Added test for ObsoleteAttribute.
3955
3956         * statement.cs
3957         (Catch): Derived from Statement.
3958
3959 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3960
3961         * decl.cs: If possible, use lookuptypedirect here. We can only do
3962         this if there is no `.' after the namespace. Avoids using
3963         LookupType, which does lots of slow processing.
3964         (FindNestedType) New method, does what it says :-).
3965         * namespace.cs: use LookupTypeDirect.
3966         * rootcontext.cs: use membercache, if possible.
3967         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3968
3969 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3970
3971         * expression.cs:
3972         According to the spec, 
3973
3974         In a member access of the form E.I, if E is a single identifier,
3975         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3976         field, property, localvariable, or parameter with the same type as
3977         the meaning of E as a type-name (§3.8), then both possible
3978         meanings of E are permitted.
3979
3980         We did not check that E as a simple-name had the same type as E as
3981         a type name.
3982
3983         This trivial check gives us 5-7% on bootstrap time.
3984
3985 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3986
3987         Fixed bug #59071 & cs0160.cs
3988         * statement.cs (Try.Resolve): Check here whether order of catch
3989         clauses matches their dependencies.
3990
3991 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3992
3993         Fixed bug #58624
3994         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
3995         unsafe type.
3996
3997 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3998
3999         * expression.cs (Invocation.OverloadResolve): Avoid the
4000         use of hashtables and boxing here by allocating on demand.
4001
4002 2004-05-30  Martin Baulig  <martin@ximian.com>
4003
4004         * rootcontext.cs (RootContext.LookupType): Don't cache things if
4005         we're doing a silent lookup.  Don't try to lookup nested types in
4006         TypeManager.object_type (thanks to Ben Maurer).
4007
4008 2004-05-30  Martin Baulig  <martin@ximian.com>
4009
4010         Committing a patch from Ben Maurer.
4011
4012         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
4013
4014 2004-05-29  Martin Baulig  <martin@ximian.com>
4015
4016         * class.cs (IMethodData.ShouldIgnore): New method.
4017
4018         * typemanager.cs (TypeManager.MethodFlags): Don't take a
4019         `Location' argument, we don't need it anywhere.  Use
4020         `IMethodData.ShouldIgnore ()' instead of
4021         `MethodData.GetMethodFlags ()'.
4022         (TypeManager.AddMethod): Removed.
4023         (TypeManager.AddMethod2): Renamed to AddMethod.
4024
4025 2004-05-29  Martin Baulig  <martin@ximian.com>
4026
4027         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4028
4029         * convert.cs (Convert.ImplicitReferenceConversion): If we're
4030         converting from a class type S to an interface type and we already
4031         have an object on the stack, don't box it again.  Fixes #52578.
4032
4033 2004-05-29  Martin Baulig  <martin@ximian.com>
4034
4035         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4036         Added support for `params' parameters.  Fixes #59267.
4037
4038 2004-05-29  Martin Baulig  <martin@ximian.com>
4039
4040         * literal.cs (NullPointer): Provide a private .ctor which sets
4041         `type' to TypeManager.object_type.  Fixes #59048.
4042
4043 2004-05-29  Martin Baulig  <martin@ximian.com>
4044
4045         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4046         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
4047
4048         * ecore.cs (EventExpr.instance_expr): Make the field private.
4049
4050 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
4051
4052         Fixed bug #50080 & cs0214-2.cs
4053         * expression.cs (Cast.DoResolve): Check unsafe context here.
4054         
4055         * statement.cs (Resolve.DoResolve): Likewise.
4056
4057 2004-05-26  Martin Baulig  <martin@ximian.com>
4058
4059         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4060
4061         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4062         (RootContext.LookupType): Pass down the `silent' flag.
4063
4064 2004-05-25  Martin Baulig  <martin@ximian.com>
4065
4066         * expression.cs
4067         (MethodGroupExpr.IdenticalTypeName): New public property.
4068         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4069         expression actually refers to a type.
4070
4071 2004-05-25  Martin Baulig  <martin@ximian.com>
4072
4073         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4074         for #56176 and made it actually work.
4075
4076 2004-05-25  Martin Baulig  <martin@ximian.com>
4077
4078         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4079         (FieldExpr, PropertyExpr): Override and implement
4080         CacheTemporaries.  Fixes #52279.
4081
4082 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
4083
4084         * location.cs: In the new compiler listing a file twice is a
4085         warning, not an error.
4086
4087 2004-05-24  Martin Baulig  <martin@ximian.com>
4088
4089         * enum.cs (Enum.DefineType): For the `BaseType' to be a
4090         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
4091
4092 2004-05-24  Martin Baulig  <martin@ximian.com>
4093
4094         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4095         walking the `using' list.  Fixes #53921.
4096
4097 2004-05-24  Martin Baulig  <martin@ximian.com>
4098
4099         * const.cs (Const.LookupConstantValue): Added support for
4100         EmptyCast's; fixes #55251.
4101
4102 2004-05-24  Martin Baulig  <martin@ximian.com>
4103
4104         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4105         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4106         which does the CS0135 check.  The reason is that we first need to
4107         check whether the variable actually exists.
4108
4109 2004-05-24  Martin Baulig  <martin@ximian.com>
4110
4111         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4112         than RootContext.LookupType() to find the explicit interface
4113         type.  Fixes #58584.
4114
4115 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4116
4117         * Makefile: Simplify.  Use executable.make.
4118         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4119
4120 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4121
4122         * decl.cs:
4123         * enum.cs:
4124         Use the invariant culture when doing String.Compare for CLS case
4125         sensitivity.
4126         
4127 2004-05-23  Martin Baulig  <martin@ximian.com>
4128
4129         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4130         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4131
4132         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4133
4134 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4135
4136         * class.cs (MemberBase.Define): Reuse MemberType member for 
4137         resolved type. Other methods can use it too.
4138
4139 2004-05-23  Martin Baulig  <martin@ximian.com>
4140
4141         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4142         the variable also exists in the current block (otherwise, we need
4143         to report a CS0103).  Fixes #58670.
4144
4145 2004-05-23  Martin Baulig  <martin@ximian.com>
4146
4147         * flowanalysis.cs (Reachability.Reachable): Compute this
4148         on-the-fly rather than storing it as a field.
4149
4150 2004-05-23  Martin Baulig  <martin@ximian.com>
4151
4152         * flowanalysis.cs (Reachability.And): Manually compute the
4153         resulting `barrier' from the reachability.      
4154        
4155 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4156
4157         Fix bug #57835
4158         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4159         instance of ObsoleteAttribute when symbol is obsolete.
4160
4161         * class.cs
4162         (IMethodData): Extended interface for ObsoleteAttribute support.
4163
4164 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4165
4166         * attribute.cs: Fix bug #55970
4167
4168 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4169
4170         Fix bug #52705
4171         * attribute.cs
4172         (GetObsoleteAttribute): New method. Creates the instance of
4173         ObsoleteAttribute.
4174         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4175         ObsoleteAttribute when member is obsolete.
4176         (AttributeTester.Report_ObsoleteMessage): Common method for
4177         Obsolete error/warning reporting.
4178
4179         * class.cs
4180         (TypeContainer.base_classs_type): New member for storing parent type.
4181
4182         * decl.cs
4183         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4184         for this MemberCore.
4185
4186 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4187
4188         * attribute.cs, const.cs: Fix bug #58590
4189
4190 2004-05-21  Martin Baulig  <martin@ximian.com>
4191
4192         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4193         out parameters if the end of the method is unreachable.  Fixes
4194         #58098. 
4195
4196 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4197
4198         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4199         Hari was right, why extra method.
4200
4201 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4202
4203         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4204
4205 2004-05-20  Martin Baulig  <martin@ximian.com>
4206
4207         * delegate.cs: Convert this file to Unix mode - like the original
4208         version in mcs is.
4209
4210 2004-05-20  Martin Baulig  <martin@ximian.com>
4211
4212         * attribute.cs: Convert this file to Unix mode - like the original
4213         version in mcs is.
4214
4215 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4216
4217        Fix bug #58688 (MCS does not report error when the same attribute
4218        is assigned twice)
4219
4220        * attribute.cs (Attribute.Emit): Distinction between null and default.
4221
4222 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4223
4224        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4225        of a top-level attribute without an attribute target.
4226        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4227        Make non-static.
4228        (Attribute.Conditional_GetConditionName), 
4229        (Attribute.Obsolete_GetObsoleteMessage): Update.
4230        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4231        part of ScanForIndexerName.
4232        (Attribute.CanIgnoreInvalidAttribute): New function.
4233        (Attribute.ScanForIndexerName): Move to ...
4234        (Attributes.ScanForIndexerName): ... here.
4235        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4236        (Attributes.Search): New internal variant that can choose not to
4237        complain if types aren't resolved.  The original signature now
4238        complains.
4239        (Attributes.GetClsCompliantAttribute): Use internal variant, with
4240        complaints suppressed.
4241        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4242        only if it not useful.
4243        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4244        top-level for attributes that are shared between the assembly
4245        and a top-level class.
4246        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4247        * class.cs: Update to reflect changes.
4248        (DefineIndexers): Fuse loops.
4249        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4250        a couple more variants of attribute names.
4251
4252 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4253
4254         Fix bug #52585 (Implemented explicit attribute declaration)
4255
4256         * attribute.cs:
4257         (Attributable.ValidAttributeTargets): New abstract method. It gets
4258         list of valid attribute targets for explicit target declaration.
4259         (Attribute.Target): It holds target itself.
4260         (AttributeSection): Removed.
4261         (Attribute.CheckTargets): New method. It checks whether attribute
4262         target is valid for the current element.
4263
4264         * class.cs:
4265         (EventProperty): New class. For events that are declared like
4266         property (with add and remove accessors).
4267         (EventField): New class. For events that are declared like field.
4268         class.cs
4269
4270         * cs-parser.jay: Implemented explicit attribute target declaration.
4271
4272         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4273         Override ValidAttributeTargets.
4274
4275         * parameter.cs:
4276         (ReturnParameter): Class for applying custom attributes on 
4277         the return type.
4278         (ParameterAtribute): New class. Class for applying custom
4279         attributes on the parameter type.
4280
4281 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4282
4283         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4284         definitions. 
4285
4286         (Method): Allow UNSAFE here.
4287
4288         * modifiers.cs: Support unsafe reporting.
4289
4290 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4291
4292         * decl.cs: Fix bug #58478.
4293
4294 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4295
4296         * statement.cs: When checking for unreachable code on an EmptyStatement,
4297         set the location. Fixes bug #58488.
4298
4299 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4300
4301         * driver.cs: Add -pkg handling.
4302
4303         From Gonzalo: UseShelLExecute=false
4304
4305 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4306
4307         * attribute.cs:
4308         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4309         for attribute.
4310         (Attribute.IsClsCompliaceRequired): Moved to base for better
4311         accesibility.
4312         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4313         when attribute is AttributeUsageAttribute.
4314         (Attribute.GetValidTargets): Simplified.
4315         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4316         attribute for this type.
4317         (Attribute.ApplyAttributes): Method renamed to Emit and make
4318         non-static.
4319         (GlobalAttributeSection): New class for special handling of global
4320         attributes (assembly, module).
4321         (AttributeSection.Emit): New method.
4322
4323         * class.cs: Implemented Attributable abstract methods.
4324         (MethodCore.LabelParameters): Moved to Parameter class.
4325         (Accessor): Is back simple class.
4326         (PropertyMethod): Implemented Attributable abstract class.
4327         (DelegateMethod): Implemented Attributable abstract class.
4328         (Event): New constructor for disctintion between normal Event
4329         and Event with accessors.
4330
4331         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4332
4333         * codegen.cs, const.cs, decl.cs, delegate.cs:
4334         (CommonAssemblyModulClass): Implemented Attributable abstract class
4335         and simplified.
4336
4337         * enum.cs: Implement IAttributeSupport interface.
4338         (EnumMember): New class for emum members. Implemented Attributable
4339         abstract class
4340
4341         * parameter.cs:
4342         (ParameterBase): Is abstract.
4343         (ReturnParameter): New class for easier [return:] attribute handling.
4344
4345         * typemanager.cs: Removed builder_to_attr.
4346
4347 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4348
4349         Fix bug #57151.
4350         * attribute.cs (Attribute.GetPositionalValue): New function.
4351         * class.cs (TypeContainer.VerifyMembers): New function.
4352         (TypeContainer.Emit): Use it.
4353         (ClassOrStruct): New base class for Class and Struct.
4354         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4355         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4356         class.
4357         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4358         then each non-static field should have a FieldOffset attribute.
4359         Otherwise, none of the fields should have a FieldOffset attribute.
4360         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4361         and FieldOffset attributes.
4362         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4363         (TypeManager.field_offset_attribute_type): New core types.
4364         (TypeManager.InitCoreTypes): Initialize them.
4365
4366 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4367
4368         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4369         Return correct type.
4370         From bug #58270.
4371
4372 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4373
4374         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4375         be implicitly converted to ulong.
4376         
4377         * expression.cs: The logic for allowing operator &, | and ^ worked
4378         was wrong, it worked before because we did not report an error in
4379         an else branch.  Fixes 57895.
4380
4381         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4382         allow volatile fields to be reference types.
4383
4384 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4385
4386         * driver.cs: Add support for /debug-
4387
4388 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4389
4390         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4391         Add a 'complain' parameter to silence errors.
4392         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4393         silently overlooked type-resolutions.
4394         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4395         to reflect changes.
4396         (Attributes.Search): New function.
4397         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4398         (Attributes.GetAttributeFullName): Remove hack.
4399         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4400         Update to reflect changes.
4401         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4402         Use Attributes.Search instead of nested loops.
4403
4404 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4405
4406         * decl.cs:
4407         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4408         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4409         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4410
4411         * report.cs: (Report.Warning): Renamed to Warning_T because of
4412         parameter collision.
4413
4414 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4415
4416         * expression.cs (MemberAccess.ResolveMemberAccess):
4417         Exit with non-zero status after Report.Error.
4418         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4419         Likewise.
4420         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4421
4422 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4423
4424         * support.cs: Don't hang when the file is empty.
4425
4426 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4427
4428         * support.cs: In SeekableStreamReader, compute the preamble size of the
4429           underlying stream. Position changes should take into account that initial
4430           count of bytes.
4431
4432 2004-05-03  Todd Berman  <tberman@sevenl.net>
4433
4434         * driver.cs: remove unused GetSysVersion function.
4435
4436 2004-05-03  Todd Berman  <tberman@sevenl.net>
4437
4438         * driver.cs: Remove the hack from saturday, as well as the hack
4439         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4440         link_paths to get that bit proper.
4441
4442 2004-05-01  Todd Berman  <tberman@sevenl.net>
4443
4444         * driver.cs: Try a LoadFrom before a Load, this checks the current
4445         path. This is currently a bug in mono that is be fixed, however, this
4446         provides a workaround for now. This will be removed when the bug
4447         is fixed.
4448
4449 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4450
4451         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4452         incomplete key pairs (#57941).
4453
4454 2004-05-01  Todd Berman  <tberman@sevenl.net>
4455
4456         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4457         from the GAC
4458
4459 2004-04-30  Jackson Harper  <jackson@ximian.com>
4460
4461         * codegen.cs: Open keys readonly.
4462         
4463 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4464
4465         * typemanager.cs: don't report cyclic struct layout when a struct
4466         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4467         which has 2 Pango.Rectangle fields.
4468
4469 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4470
4471         * expression.cs: Handle IntPtr comparisons with IL code
4472         rather than a method call.
4473
4474 2004-04-29  Martin Baulig  <martin@ximian.com>
4475
4476         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4477         the list of PropertyInfo's in class hierarchy and find the
4478         accessor.  Fixes #56013.
4479
4480 2004-04-29  Martin Baulig  <martin@ximian.com>
4481
4482         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4483
4484 2004-04-29  Martin Baulig  <martin@ximian.com>
4485
4486         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4487
4488         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4489
4490 2004-04-29  Martin Baulig  <martin@ximian.com>
4491
4492         * class.cs (ConstructorInitializer.Resolve): Check whether the
4493         parent .ctor is accessible.  Fixes #52146.
4494
4495 2004-04-29  Martin Baulig  <martin@ximian.com>
4496
4497         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4498
4499         * statement.cs (Using.EmitLocalVariableDecls): Use
4500         TypeManager.idisposable_type, not typeof (IDisposable).
4501         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4502
4503 2004-04-29  Martin Baulig  <martin@ximian.com>
4504
4505         * class.cs (Event.Define): Don't emit the field and don't set
4506         RTSpecialName and SpecialName for events on interfaces.  Fixes
4507         #57703. 
4508
4509 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4510
4511         Refactor Attribute.ApplyAttributes.
4512         * attribute.cs (Attributable): New base class for objects that can
4513         have Attributes applied on them.
4514         (Attribute): Make AttributeUsage fields public.
4515         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4516         (Attribute.IsInternalCall): New property.
4517         (Attribute.UsageAttr): Convert to a public read-only property.
4518         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4519         (Attribute.ResolveType, Attribute.Resolve)
4520         (Attribute.ScanForIndexerName): Update to reflect changes.
4521         (Attribute.CheckAttributeTarget): Re-format.
4522         (Attribute.ApplyAttributes): Refactor, to various
4523         Attributable.ApplyAttributeBuilder methods.
4524         * decl.cs (MemberCore): Make Attributable.
4525         * class.cs (Accessor): Make Attributable.
4526         (MethodData.ApplyAttributes): Use proper attribute types, not
4527         attribute names.
4528         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4529         (TypeContainer.ApplyAttributeBuilder)
4530         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4531         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4532         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4533         (Operator.ApplyAttributeBuilder): New factored-out methods.
4534         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4535         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4536         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4537         * parameter.cs (ParameterBase): New Attributable base class
4538         that can also represent Return types.
4539         (Parameter): Update to the changes.
4540
4541 2004-04-29  Jackson Harper  <jackson@ximian.com>
4542
4543         * driver.cs: Prefer the corlib system version when looking for
4544         assemblies in the GAC. This is still a hack, but its a better hack
4545         now.
4546         
4547 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4548
4549         * decl.cs, enum.cs: Improved error 3005 reporting.
4550   
4551         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4552         (related_symbols): New private member for list of symbols
4553         related to reported error/warning.
4554         
4555         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4556
4557 2004-04-29  Martin Baulig  <martin@ximian.com>
4558
4559         * ecore.cs (Expression.Constantify): If we're an enum and
4560         TypeManager.TypeToCoreType() doesn't give us another type, use
4561         t.UnderlyingSystemType.  Fixes #56178.  
4562
4563 2004-04-29  Martin Baulig  <martin@ximian.com>
4564
4565         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4566         interfaces and for each interface, only add members directly
4567         declared in that interface.  Fixes #53255.
4568
4569 2004-04-28  Martin Baulig  <martin@ximian.com>
4570
4571         * expression.cs (ConditionalLogicalOperator): Use a temporary
4572         variable for `left' to avoid that we evaluate it more than once;
4573         bug #52588.
4574
4575 2004-04-28  Martin Baulig  <martin@ximian.com>
4576
4577         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4578         `void[]' (CS1547).
4579
4580 2004-04-28  Martin Baulig  <martin@ximian.com>
4581
4582         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4583         void (CS1547).
4584
4585         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4586         whether the type is not void (CS1547).
4587
4588 2004-04-28  Martin Baulig  <martin@ximian.com>
4589
4590         * expression.cs (Unary.DoResolveLValue): Override this and report
4591         CS0131 for anything but Operator.Indirection.
4592
4593 2004-04-28  Martin Baulig  <martin@ximian.com>
4594
4595         Committing a patch from Ben Maurer; see bug #50820.
4596
4597         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4598         check for classes.
4599
4600         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4601         classes.        
4602
4603 2004-04-28  Martin Baulig  <martin@ximian.com>
4604
4605         Committing a patch from Ben Maurer; see bug #50820.
4606
4607         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4608         check for classes.
4609
4610         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4611         classes.        
4612
4613 2004-04-28  Martin Baulig  <martin@ximian.com>
4614
4615         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4616         (Block.AddLabel): Call DoLookupLabel() to only search in the
4617         current block.
4618
4619 2004-04-28  Martin Baulig  <martin@ximian.com>
4620
4621         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4622         comparing StringConstants and NullLiterals in Equality and Inequality.
4623
4624 2004-04-28  Jackson Harper  <jackson@ximian.com>
4625
4626         * driver.cs: Attempt to load referenced assemblies from the
4627         GAC. This is the quick and dirty version of this method that
4628         doesnt take into account versions and just takes the first
4629         canidate found. Will be good enough for now as we will not have more
4630         then one version installed into the GAC until I update this method.
4631
4632 2004-04-28  Martin Baulig  <martin@ximian.com>
4633
4634         * typemanager.cs (TypeManager.CheckStructCycles): New public
4635         static method to check for cycles in the struct layout.
4636
4637         * rootcontext.cs (RootContext.PopulateTypes): Call
4638         TypeManager.CheckStructCycles() for each TypeContainer.
4639         [Note: We only need to visit each type once.]
4640
4641 2004-04-28  Martin Baulig  <martin@ximian.com>
4642
4643         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4644
4645         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4646         success and added `out object value'.  Use a `bool resolved' field
4647         to check whether we've already been called rather than
4648         `ConstantValue != null' since this breaks for NullLiterals.
4649
4650 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4651
4652         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4653         setting of this flag, since the 'set' method may be non-public.
4654
4655 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4656
4657         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4658         check on current_vector.Block.
4659
4660 2004-04-27  Martin Baulig  <martin@ximian.com>
4661
4662         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4663         a field initializer.  Fixes #56459.
4664
4665 2004-04-27  Martin Baulig  <martin@ximian.com>
4666
4667         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4668         we're not attempting to use an indexer.  Fixes #52154.
4669
4670 2004-04-27  Martin Baulig  <martin@ximian.com>
4671
4672         * statement.cs (Return): Don't create a return label if we don't
4673         need it; reverts my change from January 20th.  Thanks to Ben
4674         Maurer for this.
4675
4676 2004-04-27  Martin Baulig  <martin@ximian.com>
4677
4678         According to the spec, `goto' can only leave a nested scope, but
4679         never enter it.
4680
4681         * statement.cs (Block.LookupLabel): Only lookup in the current
4682         block, don't recurse into parent or child blocks.
4683         (Block.AddLabel): Check in parent and child blocks, report
4684         CS0140/CS0158 if we find a duplicate.
4685         (Block): Removed this indexer for label lookups.
4686         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4687         this already does the error reporting for us.
4688
4689         * flowanalysis.cs
4690         (FlowBranching.UsageVector.Block): New public variable; may be null.
4691         (FlowBranching.CreateSibling): Added `Block' argument.
4692         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4693         label for the target of a `goto' and check whether we're not
4694         leaving a `finally'.
4695
4696 2004-04-27  Martin Baulig  <martin@ximian.com>
4697
4698         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4699         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4700         just for returns).
4701
4702 2004-04-27  Martin Baulig  <martin@ximian.com>
4703
4704         * statement.cs (Block.AddLabel): Also check for implicit blocks
4705         and added a CS0158 check.
4706
4707 2004-04-27  Martin Baulig  <martin@ximian.com>
4708
4709         * flowanalysis.cs (FlowBranchingLoop): New class.
4710         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4711         UsageVector's instead of an ArrayList.
4712         (FlowBranching.Label): Likewise.
4713         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4714         (FlowBranching.AddBreakVector): New method.
4715
4716 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4717
4718         * attribute.cs: Small regression fix: only convert the type if we
4719         the type is different, fixes System.Drawing build.
4720
4721 2004-04-27  Martin Baulig  <martin@ximian.com>
4722
4723         * attribute.cs (Attribute.Resolve): If we have a constant value
4724         for a named field or property, implicity convert it to the correct
4725         type.
4726
4727 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4728
4729         * statement.cs (Block.Block): Implicit blocks share
4730         'child_variable_names' fields with parent blocks.
4731         (Block.AddChildVariableNames): Remove.
4732         (Block.AddVariable): Mark variable as "used by a child block" in
4733         every surrounding block.
4734         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4735         been used in a child block, complain about violation of "Invariant
4736         meaning in blocks" rule.
4737         * cs-parser.jay (declare_local_variables): Don't use
4738         AddChildVariableNames.
4739         (foreach_statement): Don't create an implicit block: 'foreach'
4740         introduces a scope.
4741
4742 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4743
4744         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4745         converting from 0L to ulong.  Fixes 57522.
4746
4747 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4748
4749         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4750         derived class hides via 'new' keyword field from base class (test-242.cs).
4751         TODO: Handle this in the more general way.
4752         
4753         * class.cs (CheckBase): Ditto.
4754
4755 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4756
4757         * decl.cs (caching_flags): New member for storing cached values
4758         as bit flags.
4759         (MemberCore.Flags): New enum where bit flags for caching_flags
4760         are defined.
4761         (MemberCore.cls_compliance): Moved to caching_flags.
4762         (DeclSpace.Created): Moved to caching_flags.
4763
4764         * class.cs: Use caching_flags instead of DeclSpace.Created
4765         
4766 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4767
4768         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4769         if we are only a derived class, not a nested class.
4770
4771         * typemanager.cs: Same as above, but do this at the MemberLookup
4772         level (used by field and methods, properties are handled in
4773         PropertyExpr).   Allow for the qualified access if we are a nested
4774         method. 
4775
4776 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4777
4778         * class.cs: Refactoring.
4779         (IMethodData): New inteface; Holds links to parent members
4780         to avoid member duplication (reduced memory allocation).
4781         (Method): Implemented IMethodData interface.
4782         (PropertyBase): New inner classes for get/set methods.
4783         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4784         (Event): New inner classes for add/remove methods.
4785         (Event.DelegateMethod): Implemented IMethodData interface.
4786
4787         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4788         EmitContext (related to class.cs refactoring).
4789
4790 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4791
4792         * delegate.cs (Delegate.VerifyApplicability): If the number of
4793         arguments are the same as the number of parameters, first try to
4794         verify applicability ignoring  any 'params' modifier on the last
4795         parameter.
4796         Fixes #56442.
4797
4798 2004-04-08  Martin Baulig  <martin@ximian.com>
4799
4800         Merged latest changes into gmcs.  Please keep this comment in
4801         here, it makes it easier for me to see what changed in MCS since
4802         the last time I merged.
4803
4804 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4805
4806         * class.cs (TypeContainer.AddIndexer): Use
4807         'ExplicitInterfaceName' to determine if interface name was
4808         explicitly specified.  'InterfaceType' is not initialized at this time.
4809         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4810         Indexers array is already in the required order.  Initialize
4811         'IndexerName' only if there are normal indexers.
4812         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4813         (TypeContainer.Emit): Emit DefaultMember attribute only if
4814         IndexerName is initialized.
4815         Fixes #56300.
4816
4817 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4818
4819         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4820         Fixes #57007
4821
4822 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4823
4824         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4825         attributes.
4826         Fix for #56456.
4827
4828         * attribute.cs (Attribute.Resolve): Check for duplicate named
4829         attributes.
4830         Fix for #56463.
4831
4832 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4833
4834         * iterators.cs (MarkYield): track whether we are in an exception,
4835         and generate code accordingly.  Use a temporary value to store the
4836         result for our state.
4837
4838         I had ignored a bit the interaction of try/catch with iterators
4839         since their behavior was not entirely obvious, but now it is
4840         possible to verify that our behavior is the same as MS .NET 2.0
4841
4842         Fixes 54814
4843
4844 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4845
4846         * iterators.cs: Avoid creating temporaries if there is no work to
4847         do. 
4848
4849         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4850         Enumerations, use TypeManager.EnumToUnderlying and call
4851         recursively. 
4852
4853         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4854         bug #57013
4855
4856         (This.Emit): Use EmitContext.EmitThis to emit our
4857         instance variable.
4858
4859         (This.EmitAssign): Ditto.
4860
4861         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4862         codepaths, we will move all the functionality into
4863         Mono.CSharp.This 
4864
4865         (FieldExpr.EmitAssign): Ditto.
4866
4867         This fixes several hidden bugs that I uncovered while doing a code
4868         review of this today.
4869
4870         * codegen.cs (EmitThis): reworked so the semantics are more clear
4871         and also support value types "this" instances.
4872
4873         * iterators.cs: Changed so that for iterators in value types, we
4874         do not pass the value type as a parameter.  
4875
4876         Initialization of the enumerator helpers is now done in the caller
4877         instead of passing the parameters to the constructors and having
4878         the constructor set the fields.
4879
4880         The fields have now `assembly' visibility instead of private.
4881
4882 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4883
4884         * expression.cs (Argument.Resolve): Check if fields passed as ref
4885         or out are contained in a MarshalByRefObject.
4886
4887         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4888         another compiler type.
4889
4890 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4891
4892         * class.cs (Indexer.Define): use the new name checking method.
4893         Also, return false on an error.
4894         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4895         (is_identifier_[start/part]_character): make static.
4896
4897 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4898
4899         * expression.cs (Binary.ResolveOperator): Do no append strings
4900         twice: since we can be invoked more than once (array evaluation)
4901         on the same concatenation, take care of this here.  Based on a fix
4902         from Ben (bug #56454)
4903
4904 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4905
4906         * codegen.cs: Fix another case where CS1548 must be reported (when 
4907         delay-sign isn't specified and no private is available #56564). Fix
4908         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4909         error when MCS is used on the MS runtime and we need to delay-sign 
4910         (which seems unsupported by AssemblyBuilder - see #56621).
4911
4912 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4913
4914         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4915         (TypeManager.ComputeNamespaces): Faster implementation for
4916         Microsoft runtime.
4917
4918         * compiler.csproj: Updated AssemblyName to mcs.
4919
4920 2004-05-11  Jackson Harper  <jackson@ximian.com>
4921
4922         * Makefile: Preserve MONO_PATH
4923         
4924 2004-05-11  Jackson Harper  <jackson@ximian.com>
4925
4926         * Makefile: Use mono and mcs to build gmcs
4927         
4928 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
4929
4930         * codegen.cs: Add patch from Robert Shade
4931         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
4932         sync with mcs.
4933
4934 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
4935
4936         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4937         incomplete key pairs (#57941).
4938
4939 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4940
4941         * codegen.cs: Fix another case where CS1548 must be reported (when 
4942         delay-sign isn't specified and no private is available #56564). Fix
4943         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4944         error when MCS is used on the MS runtime and we need to delay-sign 
4945         (which seems unsupported by AssemblyBuilder - see #56621).
4946
4947 2004-04-29  Jackson Harper  <jackson@ximian.com>
4948
4949         * Makefile: Set MONO_PATH to use the bootstrap corlib
4950         * driver.cs: Check the GAC for referenced assemblies.
4951                 
4952 2004-04-29  Martin Baulig  <martin@ximian.com>
4953
4954         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
4955
4956 2004-04-07  Martin Baulig  <martin@ximian.com>
4957
4958         * expression.cs (Binary.ResolveOperator): Added special case for
4959         Equality/Inequality between a type parameter and a null literal.
4960
4961 2004-04-07  Martin Baulig  <martin@ximian.com>
4962
4963         * convert.cs: Check null literal -> type parameter conversions.
4964
4965 2004-04-07  Martin Baulig  <martin@ximian.com>
4966
4967         * generic.cs (ConstructedType.CheckConstraints): Enforce the
4968         `class' and `struct' constraints.
4969
4970 2004-04-07  Martin Baulig  <martin@ximian.com>
4971
4972         * generic.cs (SpecialConstraint): New public enum.
4973         (Constraints.Resolve): Added support for the `class' and `struct'
4974         constraints.
4975
4976         * cs-parser.jay (type_parameter_constraint): Added support for the
4977         `class' and `struct' constraints.
4978
4979 2004-04-07  Martin Baulig  <martin@ximian.com>
4980
4981         * support.cs (GenericConstraints): Replaced `Types' by
4982         `ClassConstraint' and `InterfaceConstraints'; added
4983         `HasClassConstraint'.   
4984
4985 2004-04-07  Martin Baulig  <martin@ximian.com>
4986
4987         * generic.cs
4988         (Constraints.InterfaceConstraints): New public property.
4989         (Constraints.Types): Make this property public
4990         (TypeParameter): Implement IMemberContainer.
4991         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
4992         instead of a TypeBuilder/MethodBuilder; pass the interface
4993         constraints to TypeManager.AddTypeParameter().
4994         (TypeParameter.DefineType): Just take an EmitContext and no
4995         TypeBuilder/MethodBuilder.  Use the new public API.
4996
4997         * typemanager.cs (TypeManager.AddTypeParameter): Added
4998         `TypeExpr[]' argument; add the interfaces to the
4999         `builder_to_ifaces' hash.
5000         (TypeManager.LookupMemberContainer): For
5001         GenericTypeParameterBuilders, get the TypeParameter from the
5002         `builder_to_type_param'.
5003         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
5004         the TypeParameter and call FindMembers on it.
5005
5006 2004-04-07  Martin Baulig  <martin@ximian.com>
5007
5008         * class.cs
5009         (MethodCore.GenericMethod): Moved this field here from Method.
5010         (MethodCore.IsDuplicateImplementation): Take the number of type
5011         parameters into account if we're a generic method.
5012
5013         * expression.cs (Invocation.InferTypeArguments): Don't return true
5014         if `arguments' is null; we still need to check whether we actually
5015         don't need to infer anything in this case.
5016         (MemberAccess): Merged the functionality from GenericMemberAccess
5017         into this class.
5018
5019         * generic.cs (GenericMemberAccess): Removed.
5020
5021 2004-04-05  Martin Baulig  <martin@ximian.com>
5022
5023         * decl.cs (MemberCore): For generic classes, interfaces and
5024         structs, `Name' now includes the number of type parameters
5025         ("Stack!1.Node!1").
5026         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
5027         encode the number of type arguments in the type name.
5028
5029         * expression.cs (Expression.MemberLookup): Removed the
5030         `num_type_args' argument; we now encode the number of type
5031         arguments in the type name.
5032
5033         * ecore.cs (SimpleName): Encode the number of type arguments in
5034         the type name itself.
5035
5036         * generic.cs (ConstructedType): Likewise.
5037
5038         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
5039         `MemberName'; we now include the number of type parameters in the
5040         type name.
5041
5042         * typemanager.cs (TypeManager.CheckGeneric): Removed.
5043         (TypeManager.MemberLookup): Removed the
5044         `num_type_args' argument; we now encode the number of type
5045         arguments in the type name.     
5046
5047 2004-04-03  Martin Baulig  <martin@ximian.com>
5048
5049         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
5050         (MemberCore.MemberName): Moved here from MemberBase.
5051         (DeclSpace.SetParameterInfo): Just take the constraints as an
5052         ArrayList; we already have the type parameters in our
5053         `MemberName'; also do the CS0080 reporting here.
5054
5055         * cs-parser.jay (struct_declaration): Use `member_name' instead of
5056         `IDENTIFIER opt_type_parameter_list'; when constructing our
5057         `MemberName', it'll already include our type parameters.
5058         (class_declaration, interface_declaration): Likewise.
5059         (delegate_declaration): Likewise.
5060         (MakeName): Take a MemberName and return a MemberName.
5061         The following two changes are required to avoid shift/reduce conflicts:
5062         (member_name): Don't include a TypeName anymore; ie. this is now
5063         just 'IDENTIFIER opt_type_parameter_list'.
5064         (property_declaration, event_declaration): Use a
5065         `namespace_or_type_name' instead of a `member_name'.            
5066
5067 2004-04-03  Martin Baulig  <martin@ximian.com>
5068
5069         * decl.cs (MemberName): Renamed to `TypeName' and created a new
5070         `MemberName' class.
5071         (TypeName): Formerly known as MemberName.
5072
5073         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
5074         instead of a `MemberName'.
5075
5076         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
5077         (member_name): New rule; create a MemberName.
5078
5079 2004-04-02  Martin Baulig  <martin@ximian.com>
5080
5081         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
5082         (CS0305 and CS0308).
5083
5084 2004-04-02  Martin Baulig  <martin@ximian.com>
5085
5086         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
5087         support for nested types.
5088
5089 2004-04-02  Martin Baulig  <martin@ximian.com>
5090
5091         * ecore.cs (IAlias): New public interface.
5092         (TypeExpr, TypeExpression): Implement IAlias.
5093         (TypeAliasExpression): New public class.
5094
5095         * namespace.cs (Namespace): Implement IAlias.
5096         (Namespace.Lookup): Return an IAlias instead on an object.
5097         (Namespace.DefineName): Take an IAlias instead of an object.
5098         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
5099         an object.
5100         (NamespaceEntry.UsingAlias): Take a Membername instead of an
5101         Expression.
5102         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
5103         object.
5104         (NamespaceEntry.Lookup): Likewise.
5105
5106         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
5107         instead of a Type.      
5108
5109         * decl.cs (DeclSpace): Implement IAlias.
5110         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
5111
5112         * generic.cs (ConstructedType): Improved error checking.
5113
5114 2004-04-02  Martin Baulig  <martin@ximian.com>
5115
5116         * convert.cs: Added type parameter conversions.
5117
5118         * ecore.cs
5119         (UnboxCast.Emit): Emit an `unbox.any' for type params.
5120         (ClassCast.Emit): If the source type is a type parameter, box it.
5121         If the target type is a type parameter, emit an `unbox.any'
5122         instead of a `classcast'.1      
5123
5124 2004-04-01  Martin Baulig  <martin@ximian.com>
5125
5126         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
5127
5128 2004-04-01  Martin Baulig  <martin@ximian.com>
5129
5130         * generic.cs (ConstructedType.CheckConstraints): Use
5131         Convert.ImplicitStandardConversionExists(); user-defined implicit
5132         conversions are not allowed according to the spec.
5133
5134 2004-03-30  Martin Baulig  <martin@ximian.com>
5135
5136         * expression.cs (New): Added support for type parameters.
5137
5138         * typemanager.cs
5139         (TypeManager.activator_type): New public static field.
5140         (TypeManager.activator_create_instance): Likewise.
5141
5142 2004-03-30  Martin Baulig  <martin@ximian.com>
5143
5144         * typemanager.cs (TypeManager.HasConstructorConstraint): New
5145         public method.
5146
5147 2004-03-30  Martin Baulig  <martin@ximian.com>
5148
5149         * generic.cs (ConstructedType.CheckConstraints): Actually follow
5150         the spec here: the argument type must be convertible to the
5151         constraints.
5152
5153 2004-03-30  Martin Baulig  <martin@ximian.com>
5154
5155         * generic.cs
5156         (TypeParameter.Define, TypeParameter.DefineMethod): Call
5157         TypeManager.AddTypeParameter().
5158         (ConstructedType.CheckConstraints): Re-enable this and actually
5159         check whether we have a constructor constraint.
5160
5161         * typemanager.cs
5162         (TypeManager.builder_to_type_param): New static field.
5163         (TypeManager.AddTypeParameter): New static method.
5164         (TypeManager.LookupTypeParameter): New public method.
5165
5166 2004-03-30  Martin Baulig  <martin@ximian.com>
5167
5168         * generic.cs (TypeParameter.DefineType): Return a boolean and use
5169         the new API to actually define the constructor constraint.
5170
5171         * typemanager.cs
5172         (TypeManager.new_constraint_attr_type): New static field.
5173         (TypeManager.InitCoreTypes): Initialize it.
5174
5175 2004-03-30  Martin Baulig  <martin@ximian.com>
5176
5177         * generic.cs (Constraints): Completed error checking, use correct
5178         error numbers.
5179
5180 2004-03-29  Martin Baulig  <martin@ximian.com>
5181
5182         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
5183
5184         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5185         public version which takes a `ParameterData pd' instead of an
5186         `ArrayList args'.
5187
5188 2004-03-29  Martin Baulig  <martin@ximian.com>
5189
5190         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
5191         not a MethodInfo.       
5192
5193 2004-03-29  Martin Baulig  <martin@ximian.com>
5194
5195         * expression.cs (Argument.ResolveMethodGroup): If we're a
5196         ConstructedType, call GetMemberAccess() on it.  
5197
5198 2004-03-29  Martin Baulig  <martin@ximian.com>
5199
5200         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
5201         (MethodCore.CheckGenericOverride): When overriding a generic
5202         method, check whether the constraints match.
5203
5204         * support.cs (GenericConstraints): New public interface.
5205         (ParameterData.GenericConstraints): New public method.
5206
5207         * parameter.cs (Parameter.Resolve): Check whether we're a generic
5208         method parameter and compute our constraints if appropriate.
5209         (Parameter.GenericConstraints): New public property.
5210
5211         * generic.cs (Constraints): Implement GenericConstraints.
5212
5213 2004-03-29  Martin Baulig  <martin@ximian.com>
5214
5215         * decl.cs (MemberCache.FindMemberToOverride): Use
5216         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
5217
5218 2004-03-29  Martin Baulig  <martin@ximian.com>
5219
5220         * generic.cs (GenericMethod.Define): Resolve our type parameters.
5221
5222 2004-03-29  Martin Baulig  <martin@ximian.com>
5223
5224         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
5225         not allowed on non-generic declarations").
5226
5227 2004-03-29  Martin Baulig  <martin@ximian.com>
5228
5229         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5230         public version of this method.
5231
5232         * class.cs (MethodCore.IsDuplicateImplementation): Use
5233         Invocation.InferTypeArguments() to check this.
5234
5235 2004-03-29  Martin Baulig  <martin@ximian.com>
5236
5237         * convert.cs: Use TypeManager.IsDelegateType() instead of
5238         comparing types correctly.
5239
5240 2004-03-29  Martin Baulig  <martin@ximian.com>
5241
5242         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
5243         types directly to make it work for generic instances.
5244
5245         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
5246
5247 2004-03-29  Martin Baulig  <martin@ximian.com>
5248
5249         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
5250         support for arrays.     
5251
5252 2004-03-24  Martin Baulig  <martin@ximian.com>
5253
5254         * decl.cs (DeclSpace.FindType): Also use
5255         TypeManager.CheckGeneric() for types from the using clauses.
5256
5257 2004-03-23  Martin Baulig  <martin@ximian.com>
5258
5259         * expression.cs (Invocation.OverloadResolve): Added `bool
5260         may_fail' argument and use it instead of the Location.IsNull() hack.
5261
5262 2004-03-23  Martin Baulig  <martin@ximian.com>
5263
5264         * expression.cs (Invocation.InferType): Use correct type inference
5265         rules here.     
5266
5267 2004-03-23  Martin Baulig  <martin@ximian.com>
5268
5269         * ecore.cs (MethodGroupExpr.Name): Use
5270         TypeManager.CSharpSignature() instead of just the name.
5271
5272         * expression.cs (Invocation.OverloadResolve): Provide better error
5273         reporting.
5274         (Invocation.DoResolve): OverloadResolve() never returns null
5275         without reporting an error, so removed the error -6 reporting here.
5276
5277 2004-03-23  Martin Baulig  <martin@ximian.com>
5278
5279         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
5280         generic methods.
5281
5282         * cs-parser.jay (delegate_declaration): Support generic delegates.
5283
5284         * delegate.cs: Support generic delegates.
5285
5286 2004-03-22  Martin Baulig  <martin@ximian.com>
5287
5288         * expression.cs (Invocation.InferParamsTypeArguments): New static
5289         method; does type inference for params arguments.
5290
5291 2004-03-21  Martin Baulig  <martin@ximian.com>
5292
5293         * typemanager.cs (TypeManager.IsGenericMethod): New public static
5294         method; checks whether a method is a generic method.    
5295
5296         * expression.cs (Invocation.InferTypeArguments): New static method;
5297         infer type arguments for generic method invocation.
5298
5299         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
5300         property; we set this to true if we're resolving a generic method
5301         invocation and the user specified type arguments, ie. we're not
5302         doing type inference.
5303
5304 2004-03-20  Martin Baulig  <martin@ximian.com>
5305
5306         * class.cs (MethodData.DeclaringType): New public property.
5307         (MethodData.Define): Set DeclaringType here.
5308         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
5309         instead of OperatorMethodBuilder.DeclaringType.
5310
5311 2004-03-20  Martin Baulig  <martin@ximian.com>
5312
5313         * cs-tokenizer.cs (xtoken): Return a special
5314         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
5315
5316         * cs-parser.jay (default_value_expression): Switch to the new
5317         syntax (14.5.13).
5318
5319 2004-03-19  Martin Baulig  <martin@ximian.com>
5320
5321         * decl.cs (MemberName): New class.  We use this to "construct"
5322         namespace_or_type_name's.
5323
5324         * generics.cs (TypeArguments.GetDeclarations): New public method;
5325         returns the type arguments as a string[] and reports a CS0081 if
5326         one of them is not an identifier.
5327
5328         * class.cs (MemberBase): The .ctor now takes the name as a
5329         MemberName instead of a string.
5330         (MemberBase.ExplicitInterfaceName): Changed type from string to
5331         Expression.
5332         (MemberBase.DoDefine): If we're an explicit implementation, the
5333         InterfaceType may be a generic instance.
5334
5335         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
5336         (namespace_name): Call MemberName.GetName () to transform the
5337         MemberName into a string and ensure we don't have any type
5338         arguments.
5339         (type_name): Call MemberName.GetTypeExpression() to transfrom the
5340         MemberName into an expression.
5341         (method_header): Use namespace_or_type_name instead of member_name.     
5342
5343 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5344
5345         * rootcontext.cs: Add new types to the boot resolution.
5346
5347         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5348         MulticastDelegate is not allowed.
5349
5350         * typemanager.cs: Add new types to lookup: System.TypedReference
5351         and ArgIterator.
5352
5353         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5354         check for TypedReference or ArgIterator, they are not allowed. 
5355
5356         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5357         makes us properly catch 1510 in some conditions (see bug 56016 for
5358         details). 
5359
5360 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5361
5362         * CryptoConvert.cs: update from corlib version
5363         with endian fixes.
5364
5365 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5366
5367         * class.cs (Indexer.Define): Check indexername declaration
5368
5369 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5370
5371         * attribute.cs (IsClsCompliant): Fixed problem with handling
5372         all three states (compliant, not-compliant, undetected).
5373
5374 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5375
5376         * attribute.cs (Attribute): Location is now public.
5377         (Resolve): Store resolved arguments (pos_values) in attribute class.
5378         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5379         (GetClsCompliantAttributeValue): New method that gets
5380         CLSCompliantAttribute value.
5381         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5382         if exists else null.
5383         (AttributeTester): New class for CLS-Compliant verification routines.
5384
5385         * class.cs (Emit): Add CLS-Compliant verification.
5386         (Method.GetSignatureForError): Implemented.
5387         (Constructor.GetSignatureForError): Implemented
5388         (Constructor.HasCompliantArgs): Returns if constructor has
5389         CLS-Compliant arguments.
5390         (Constructor.Emit): Override.
5391         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5392         is needed to test only parameters.
5393         (FieldBase.GetSignatureForError): Implemented.
5394         (TypeContainer): New member for storing base interfaces.
5395         (TypeContainer.FindMembers): Search in base interfaces too.
5396
5397         * codegen.cs (GetClsComplianceAttribute): New method that gets
5398         assembly or module CLSCompliantAttribute value.
5399         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5400         for assembly.
5401         (ModuleClass.Emit): Add error 3012 test.
5402
5403         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5404
5405         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5406         state for all decl types.
5407         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5408         if CLS-Compliant tests are required.
5409         (IsClsCompliaceRequired): New method. Analyze whether code
5410         must be CLS-Compliant.
5411         (IsExposedFromAssembly): New method. Returns true when MemberCore
5412         is exposed from assembly.
5413         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5414         value or gets cached value.
5415         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5416         is explicitly marked with CLSCompliantAttribute.
5417         (IsIdentifierClsCompliant): New abstract method. This method is
5418         used to testing error 3005.
5419         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5420         for identifier and parameters CLS-Compliant testing.
5421         (VerifyClsCompliance): New method. The main virtual method for
5422         CLS-Compliant verifications.
5423         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5424         null. I don't know why is null (too many public members !).
5425         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5426         and get value of first CLSCompliantAttribute that found.
5427
5428         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5429         (VerifyClsCompliance): Override and add extra tests.
5430
5431         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5432         clscheck- disable CLS-Compliant verification event if assembly is has
5433         CLSCompliantAttribute(true).
5434
5435         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5436         ApllyAttribute is now called in emit section as in the other cases.
5437         Possible future Emit integration.
5438         (IsIdentifierClsCompliant): New override.
5439         (VerifyClsCompliance): New override.
5440         (GetEnumeratorName): Returns full enum name.
5441
5442         * parameter.cs (GetSignatureForError): Implemented.
5443
5444         * report.cs (WarningData): New struct for Warning message information.
5445         (LocationOfPreviousError): New method.
5446         (Warning): New method. Reports warning based on the warning table.
5447         (Error_T): New method. Reports error based on the error table.
5448
5449         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5450         verifications are done here.
5451
5452         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5453
5454         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5455         CLSCompliantAttribute.
5456         (all_imported_types): New member holds all imported types from other
5457         assemblies.
5458         (LoadAllImportedTypes): New method fills static table with exported types
5459         from all referenced assemblies.
5460         (Modules): New property returns all assembly modules.
5461
5462 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5463
5464         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5465         throwing a parser error.
5466
5467         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5468         which removes the hardcoded get_/set_ prefixes for properties, as
5469         IL allows for the properties to be named something else.  
5470
5471         Bug #56013
5472
5473         * expression.cs: Do not override operand before we know if it is
5474         non-null.  Fix 56207
5475
5476 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5477
5478         * typemanager.cs: support for pinned variables.
5479
5480 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5481
5482         * decl.cs, typemanager.cs: Avoid using an arraylist
5483         as a buffer if there is only one result set.
5484
5485 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5486
5487         * expression.cs: Make sure you cant call a static method
5488         with an instance expression, bug #56174.
5489
5490 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5491
5492         * class.cs (IsDuplicateImplementation): Improve error reporting to
5493         flag 663 (method only differs in parameter modifier).
5494
5495         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5496         in preprocessor directives.
5497
5498         * location.cs (LookupFile): Allow for the empty path.
5499
5500         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5501         better approach for some of that patch, but its failing with the
5502         CharSet enumeration.  For now try/catch will do.
5503
5504         * typemanager.cs: Do not crash if a struct does not have fields.
5505         Fixes 56150.
5506
5507 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5508
5509         * expression.cs: cs0213, cant fix a fixed expression.
5510         fixes 50231.
5511
5512 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5513
5514         * cs-parser.jay: detect invalid embeded statements gracefully.
5515         bug #51113.
5516
5517 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5518
5519         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5520         As a regex:
5521         s/
5522         the invocation type may not be a subclass of the tye of the item/
5523         The type of the item must be a subclass of the invocation item.
5524         /g
5525
5526         Fixes bug #50820.
5527
5528 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5529
5530         * attribute.cs: Added methods to get a string and a bool from an
5531         attribute. Required to information from AssemblyKeyFileAttribute,
5532         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5533         * codegen.cs: Modified AssemblyName creation to include support for
5534         strongnames. Catch additional exceptions to report them as CS1548.
5535         * compiler.csproj: Updated include CryptoConvert.cs.
5536         * compiler.csproj.user: Removed file - user specific configuration.
5537         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5538         Mono.Security assembly. The original class is maintained and tested in
5539         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5540         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5541         like CSC 8.0 (C# v2) supports.
5542         * Makefile: Added CryptoConvert.cs to mcs sources.
5543         * rootcontext.cs: Added new options for strongnames.
5544
5545 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5546
5547         * driver.cs: For --expect-error, report error code `2'
5548         if the program compiled with no errors, error code `1' if
5549         it compiled with an error other than the one expected.
5550
5551 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5552
5553         * compiler.csproj: Updated for Visual Studio .NET 2003.
5554         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5555         * compiler.sln: Updated for Visual Studio .NET 2003.
5556
5557 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5558
5559         * expression.cs: Fix bug #47234. We basically need to apply the
5560         rule that we prefer the conversion of null to a reference type
5561         when faced with a conversion to 'object' (csc behaviour).
5562
5563 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5564
5565         * statement.cs: Shorter form for foreach, eliminates
5566         a local variable. r=Martin.
5567
5568 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5569
5570         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5571         checks if we can use brtrue/brfalse to test for 0.
5572         * expression.cs: use the above in the test for using brtrue/brfalse.
5573         cleanup code a bit.
5574
5575 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5576
5577         * expression.cs: Rewrite string concat stuff. Benefits:
5578
5579         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5580         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5581         rather than a concat chain.
5582
5583         * typemanager.cs: Add lookups for more concat overloads.
5584
5585 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5586
5587         * expression.cs: Emit shorter il code for array init.
5588
5589         newarr
5590         dup
5591         // set 1
5592
5593         // set 2
5594
5595         newarr
5596         stloc.x
5597
5598         ldloc.x
5599         // set 1
5600
5601         ldloc.x
5602         // set 2
5603
5604 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5605
5606         * statement.cs: Before, two switch blocks would be merged if the
5607         total size of the blocks (end_item - begin_item + 1) was less than
5608         two times the combined sizes of the blocks.
5609
5610         Now, it will only merge if after the merge at least half of the
5611         slots are filled.
5612
5613         fixes 55885.
5614
5615 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5616
5617         * class.cs : csc build fix for GetMethods(). See bug #52503.
5618
5619 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5620
5621         * expression.cs: Make sure fp comparisons work with NaN.
5622         This fixes bug #54303. Mig approved this patch a long
5623         time ago, but we were not able to test b/c the runtime
5624         had a related bug.
5625
5626 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5627
5628         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5629
5630 2004-03-19  Martin Baulig  <martin@ximian.com>
5631
5632         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5633         two overloads may unify for some type parameter substitutions and
5634         report a CS0408 if appropriate.
5635
5636 2004-03-19  Martin Baulig  <martin@ximian.com>
5637
5638         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5639         error here and not in our caller.
5640
5641 2004-03-19  Martin Baulig  <martin@ximian.com>
5642
5643         * interface.cs: Completely killed this file.
5644         (Interface): We're now a TypeContainer and live in class.cs.
5645
5646         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5647         argument; we're now also called for interfaces.
5648         (TypeContainer.DefineMembers): Allow this method being called
5649         multiple times.
5650         (TypeContainer.GetMethods): New public method; formerly known as
5651         Interface.GetMethod().  This is used by PendingImplementation.
5652         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5653         it's now private and non-static.
5654         (Interface): Moved this here; it's now implemented similar to
5655         Class and Struct.
5656         (Method, Property, Event, Indexer): Added `bool is_interface'
5657         argument to their .ctor's.
5658         (MemberBase.IsInterface): New public field.
5659
5660         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5661         instances instead of InterfaceMethod, InterfaceProperty, etc.
5662         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5663         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5664
5665 2004-03-19  Martin Baulig  <martin@ximian.com>
5666
5667         * class.cs (MethodCore.IsDuplicateImplementation): New private
5668         method which does the CS0111 checking.
5669         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5670         Use IsDuplicateImplementation().
5671
5672 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5673
5674         * decl.cs (FindMemberToOverride): New method to find the correct
5675         method or property to override in the base class.
5676         * class.cs
5677             - Make Method/Property use the above method to find the
5678               version in the base class.
5679             - Remove the InheritableMemberSignatureCompare as it is now
5680               dead code.
5681
5682         This patch makes large code bases much faster to compile, as it is
5683         O(n) rather than O(n^2) to do this validation.
5684
5685         Also, it fixes bug 52458 which is that nested classes are not
5686         taken into account when finding the base class member.
5687
5688         Reviewed/Approved by Martin.
5689
5690 2004-03-17  Martin Baulig  <martin@ximian.com>
5691
5692         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5693         of type arguments into account; use the `real_num_type_args'
5694         approach like in DoResolveAsTypeStep().
5695
5696         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5697         nested types.
5698
5699 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5700
5701         * interface.cs: In all interface classes removed redundant
5702         member initialization.
5703
5704 2004-03-16  Martin Baulig  <martin@ximian.com>
5705
5706         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5707
5708 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5709
5710         * decl.cs (DefineTypeAndParents): New helper method to define a
5711         type's containers before the type itself is defined;  This is a
5712         bug exposed by the recent changes to Windows.Forms when an
5713         implemented interface was defined inside a class that had not been
5714         built yet.   
5715
5716         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5717
5718         (Check): Loop correctly to report errors modifiers
5719         (UNSAFE was not in the loop, since it was the same as TOP).
5720
5721         * interface.cs: Every interface member now takes a ModFlags,
5722         instead of a "is_new" bool, which we set on the base MemberCore. 
5723
5724         Every place where we called "UnsafeOk" in the interface, now we
5725         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5726         the unsafe settings from the member declaration instead of the
5727         container interface. 
5728
5729         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5730
5731         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5732         `set_indexer_name' to the pending bits (one per type).
5733
5734         We fixed a bug today that was picking the wrong method to
5735         override, since for properties the existing InterfaceMethod code
5736         basically ignored the method name.  Now we make sure that the
5737         method name is one of the valid indexer names.
5738
5739 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5740  
5741         * support.cs (SeekableStreamReader): Keep track of stream byte
5742         positions and don't mix them with character offsets to the buffer.
5743
5744         Patch from Gustavo Giráldez
5745
5746 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5747
5748         * interface.cs (InterfaceSetGetBase): Removed double member
5749         initialization, base class does it as well.
5750
5751 2004-03-13  Martin Baulig  <martin@ximian.com>
5752
5753         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5754         when compiling corlib.
5755
5756 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5757
5758         * convert.cs (ExplicitConversion): We were reporting an error on
5759         certain conversions (object_type source to a value type, when the
5760         expression was `null') before we had a chance to pass it through
5761         the user defined conversions.
5762
5763         * driver.cs: Replace / and \ in resource specifications to dots.
5764         Fixes 50752
5765
5766         * class.cs: Add check for duplicate operators.  Fixes 52477
5767
5768 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5769
5770         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5771         that are in the middle of the statements, not only at the end.
5772         Fixes #54987
5773
5774         * class.cs (TypeContainer.AddField): No longer set the
5775         `HaveStaticConstructor' flag, now we call it
5776         `UserDefineStaticConstructor' to diferentiate the slightly
5777         semantic difference.
5778
5779         The situation is that we were not adding BeforeFieldInit (from
5780         Modifiers.TypeAttr) to classes that could have it.
5781         BeforeFieldInit should be set to classes that have no static
5782         constructor. 
5783
5784         See:
5785
5786         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5787
5788         And most importantly Zoltan's comment:
5789
5790         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5791
5792         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5793          before its static fields are used', i.e. initialization does not need
5794          to be triggered by the first access to the type. Setting this flag
5795          helps the JIT to compile better code, since it can run the static
5796          constructor at JIT time, and does not need to generate code to call it
5797          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5798          this flag for lots of classes like String. 
5799          
5800          csc sets this flag if the type does not have an explicit static 
5801          constructor. The reasoning seems to be that if there are only static
5802          initalizers for a type, and no static constructor, then the programmer
5803          does not care when this initialization happens, so beforefieldinit
5804          can be used.
5805          
5806          This bug prevents the AOT compiler from being usable, since it 
5807          generates so many calls to mono_runtime_class_init that the AOT code
5808          is much slower than the JITted code. The JITted code is faster, 
5809          because it does not generate these calls if the vtable is type is
5810          already initialized, which is true in the majority of cases. But the
5811          AOT compiler can't do this."
5812
5813 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5814
5815         * class.cs (MethodData.Emit): Refactor the code so symbolic
5816         information is generated for destructors;  For some reasons we
5817         were taking a code path that did not generate symbolic information
5818         before. 
5819
5820 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5821
5822         * class.cs: Create a Constructor.CheckBase method that
5823         takes care of all validation type code. The method
5824         contains some code that was moved from Define.
5825
5826         It also includes new code that checks for duplicate ctors.
5827         This fixes bug #55148.
5828
5829 2004-03-09  Joshua Tauberer <tauberer@for.net>
5830
5831         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5832         a { ... }-style array creation invokes EmitStaticInitializers
5833         which is not good for reference-type arrays.  String, decimal
5834         and now null constants (NullCast) are not counted toward
5835         static initializers.
5836
5837 2004-03-05  Martin Baulig  <martin@ximian.com>
5838
5839         * location.cs (SourceFile.HasLineDirective): New public field;
5840         specifies whether the file contains or is referenced by a "#line"
5841         directive.
5842         (Location.DefineSymbolDocuments): Ignore source files which
5843         either contain or are referenced by a "#line" directive.        
5844
5845 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5846
5847         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5848         direct access to our parent, so check the method inline there.
5849
5850 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5851
5852         * expression.cs (Invocation.EmitCall): Miguel's last commit
5853         caused a regression. If you had:
5854
5855             T t = null;
5856             t.Foo ();
5857
5858         In Foo the implict this would be null.
5859
5860 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5861
5862         * expression.cs (Invocation.EmitCall): If the method is not
5863         virtual, do not emit a CallVirt to it, use Call.
5864
5865         * typemanager.cs (GetFullNameSignature): Improve the method to
5866         cope with ".ctor" and replace it with the type name.
5867
5868         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5869         as an argument the ConstructorBuilder where it is being defined,
5870         to catch the recursive constructor invocations.
5871
5872 2004-03-16  Martin Baulig  <martin@ximian.com>
5873
5874         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5875         ConstructedType, call ResolveType() on it to get the type rather
5876         than just using `expr.Type'.
5877
5878 2004-03-16  Martin Baulig  <martin@ximian.com>
5879
5880         * generics.cs (ConstructedType.GetMemberAccess): Take the
5881         EmitContext instead on the TypeExpr and use
5882         ec.TypeContainer.CurrentType/ec.ContainerType.
5883
5884 2004-03-16  Martin Baulig  <martin@ximian.com>
5885
5886         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5887         parameters before aliases.
5888
5889 2004-03-16  Martin Baulig  <martin@ximian.com>
5890
5891         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5892         New oublic function; checks whether two generic instances may become
5893         equal under some instantiations (26.3.1).
5894
5895         * class.cs (TypeContainer.Define): Call
5896         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5897         error.
5898
5899 2004-03-16  Martin Baulig  <martin@ximian.com>
5900
5901         * class.cs (TypeContainer.GetClassBases): Moved
5902         Error_TypeParameterAsBase() here and also check whether the base
5903         class is not an attribute.
5904
5905 2004-03-16  Martin Baulig  <martin@ximian.com>
5906
5907         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5908
5909 2004-03-16  Martin Baulig  <martin@ximian.com>
5910
5911         * class.cs (Error_TypeParameterAsBase): Use correct error number
5912         here (CS0689).  
5913
5914 2004-03-16  Martin Baulig  <martin@ximian.com>
5915
5916         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5917         for generics.
5918
5919         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5920         error reporting.
5921
5922 2004-03-15  Martin Baulig  <martin@ximian.com>
5923
5924         * typemanager.cs (TypeManager.GetFullName): New public method.
5925         (TypeManager.MemberLookup): Added `int_num_type_arguments'
5926         argument; only return members with the correct number of type
5927         arguments.
5928         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
5929         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
5930         whether the number of type arguments matches.
5931
5932         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
5933         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
5934
5935         * expression.cs (MemberAccess): Added public `NumTypeArguments'
5936         field; it's set by the protected .ctor when we're actually a
5937         GenericMemberAccess.
5938         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
5939         arguments and pass it to MemberLookupFinal ().
5940
5941         * ecore.cs (Expression.MemberLookup): Added `int
5942         num_type_arguments' argument; only return members with the correct
5943         number of type arguments.
5944         (Expression.MemberLookupFailed): Check whether the MemberLookup
5945         failed because we did not have the correct number of type
5946         arguments; report CS0305 in this case.
5947
5948         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
5949         `e.ResolveAsTypeTerminal()' already did so.
5950
5951 2004-03-15  Martin Baulig  <martin@ximian.com>
5952
5953         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
5954         we're a ConstructedType; in this case, the caller must report an
5955         error (for instance CS0131).
5956
5957         * generic.cs (TypeArguments): Added Location argument to the .ctor.
5958         (TypeArguments.Resolve): Actually report errors here.
5959
5960 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5961
5962         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5963         `set_indexer_name' to the pending bits (one per type).
5964
5965         We fixed a bug today that was picking the wrong method to
5966         override, since for properties the existing InterfaceMethod code
5967         basically ignored the method name.  Now we make sure that the
5968         method name is one of the valid indexer names.
5969
5970 2004-03-15  Martin Baulig  <martin@ximian.com>
5971
5972         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
5973         for generic instances.
5974
5975 2004-03-13  Martin Baulig  <martin@ximian.com>
5976
5977         * class.cs (TypeContainer.DefineType): Call
5978         TypeManager.AddUserType() immediately after creating the
5979         TypeBuilder; pass all type parameters when creating the
5980         CurrentType.
5981
5982         * decl.cs (DeclSpace.FindNestedType): New public method.
5983         (DeclSpace.FindType): Added `int num_type_args' argument; only
5984         return types with the correct number of type parameters.
5985         (DeclSpace.CountTypeParams): New public property.
5986
5987         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
5988         the number of type parameters; defaults to zero.
5989
5990         * generic.cs (TypeArguments.Count): New public property.
5991         (ConstructedType.DoResolveAsTypeStep): First call
5992         ds.FindNestedType() to find out whether we're nested in the
5993         current generic type; in this case, we inherit all type parameters
5994         from the current class.
5995
5996         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
5997         num_type_args' argument.
5998         (RootContext.LookupType): Added overloaded version which takes the
5999         number of type arguments; only return types with the correct
6000         number of type arguments.
6001
6002         * typemanager.cs (TypeManager.CheckGeneric): New public function;
6003         checks whether `Type t' has `int num_type_args'.
6004
6005 2004-03-13  Martin Baulig  <martin@ximian.com>
6006
6007         * generic.cs (GenericMethod.DefineType): New method; calls
6008         DefineType() on all the type parameters.
6009
6010         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
6011         (MethodData.Define): If we're a generic method, call
6012         GenericMethod.DefineType() to define the type parameters.       
6013
6014 2004-03-10  Martin Baulig  <martin@ximian.com>
6015
6016         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
6017         instead of IsAssignableFrom.    
6018
6019 2004-03-10  Martin Baulig  <martin@ximian.com>
6020
6021         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
6022
6023         * support.cs (ParameterData.HasArrayParameter): New property.
6024         (ReflectionParameters.ctor): Take a MethodBase instead of a
6025         ParameterInfo[].  If we have any type parameters, get the generic
6026         method definition and ask it whether we have variable arguments.
6027
6028 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
6029
6030         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
6031         routines to check if a type is an enumerable/enumerator allow
6032         classes that implement the IEnumerable or IEnumerator interfaces.
6033
6034         * class.cs (Property, Operator): Implement IIteratorContainer, and
6035         implement SetYields.
6036
6037         (Property.Define): Do the block swapping for get_methods in the
6038         context of iterators.   We need to check if Properties also
6039         include indexers or not.
6040
6041         (Operator): Assign the Block before invoking the
6042         OperatorMethod.Define, so we can trigger the Iterator code
6043         replacement. 
6044
6045         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
6046         Property and Operator classes are not created when we parse the
6047         declarator but until we have the block completed, so we use a
6048         singleton SimpleIteratorContainer.Simple to flag whether the
6049         SetYields has been invoked.
6050
6051         We propagate this setting then to the Property or the Operator to
6052         allow the `yield' to function.
6053
6054 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
6055
6056         * codegen.cs: Implemented attribute support for modules.
6057         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
6058         Assembly/Module functionality.
6059
6060         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
6061         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
6062         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
6063
6064 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
6065
6066         * interface.cs (FindMembers): The operation is performed on all base
6067         interfaces and not only on the first. It is required for future CLS Compliance patch.
6068
6069 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6070
6071         * statement.cs, codegen.cs:
6072         This patch deals with patterns such as:
6073
6074         public class List : IEnumerable {
6075
6076                 public MyEnumerator GetEnumerator () {
6077                         return new MyEnumerator(this);
6078                 }
6079
6080                 IEnumerator IEnumerable.GetEnumerator () {
6081                         ...
6082                 }
6083                 
6084                 public struct MyEnumerator : IEnumerator {
6085                         ...
6086                 }
6087         }
6088
6089         Before, there were a few things we did wrong:
6090         1) we would emit callvirt on a struct, which is illegal
6091         2) we emited ldarg when we needed to emit ldarga
6092         3) we would mistakenly call the interface methods on an enumerator
6093         type that derived from IEnumerator and was in another assembly. For example:
6094
6095         public class MyEnumerator : IEnumerator
6096
6097         Would have the interface methods called, even if there were public impls of the
6098         method. In a struct, this lead to invalid IL code.
6099
6100 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
6101
6102         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
6103           renamed to Emit.
6104
6105         * delegate.cs (Define): Fixed crash when delegate type is undefined.
6106
6107 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
6108
6109         * cs-parser.jay: Fix small regression: we were not testing V2
6110         compiler features correctly.
6111
6112         * interface.cs: If the emit context is null, then create one
6113
6114 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6115
6116         * decl.cs (GetSignatureForError): New virtual method to get full name
6117           for error messages.
6118
6119         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6120           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6121
6122         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6123           Duplicated members and code in these classes has been removed.
6124           Better encapsulation in these classes.
6125
6126 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
6127
6128         * assign.cs (Assign.DoResolve): When dealing with compound
6129         assignments, there is a new rule in ECMA C# 2.4 (might have been
6130         there before, but it is documented here) that states that in:
6131
6132         a op= b;
6133
6134         If b is of type int, and the `op' is a shift-operator, then the
6135         above is evaluated as:
6136
6137         a = (int) a op b 
6138
6139         * expression.cs (Binary.ResolveOperator): Instead of testing for
6140         int/uint/long/ulong, try to implicitly convert to any of those
6141         types and use that in pointer arithmetic.
6142
6143         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6144         method to print information for from the type, not from the
6145         null-method we were given.
6146
6147 2004-02-01  Duncan Mak  <duncan@ximian.com>
6148
6149         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6150         parsing for cmd, fixes bug #53694.
6151
6152 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6153
6154         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6155         in the member name duplication tests. Property and operator name duplication
6156         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6157
6158 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6159
6160         * interface.cs (PopulateMethod): Fixed crash when interface method
6161         returns not existing type (error test cs0246-3.cs).
6162
6163 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6164
6165         * cs-parser.jay (interface_accessors): Re-write actions to also
6166         store attributes attached to get and set methods. Fix spelling
6167         while at it.
6168
6169         (inteface_property_declaration): Modify accordingly.
6170
6171         (InterfaceAccessorInfo): New helper class to store information to pass
6172         around between rules that use interface_accessors.
6173
6174         * interface.cs (Emit): Apply attributes on the get and set
6175         accessors of properties and indexers too.
6176
6177         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6178         right MethodBuilder when applying attributes to the get and set accessors.
6179
6180 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6181
6182         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6183
6184 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6185
6186         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6187
6188 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6189
6190         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6191         changes that treat `yield' specially when present before `break'
6192         or `return' tokens.
6193
6194         * cs-tokenizer.cs: yield is no longer a keyword.
6195
6196 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6197
6198         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6199         setting for default constructors.
6200         For default constructors are almost every time set wrong Modifier. The
6201         generated IL code has been alright. But inside mcs this values was
6202         wrong and this was reason why several of my CLS Compliance tests
6203         failed.
6204
6205 2004-02-27  Martin Baulig  <martin@ximian.com>
6206
6207         * generics.cs (ConstructedType.ResolveType): Make the nested type
6208         stuff actually work.
6209
6210 2004-02-25  Martin Baulig  <martin@ximian.com>
6211
6212         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
6213         property; returns the type parameters just from the current type,
6214         ie. with the ones from outer classes.
6215         (DeclSpace.LookupGeneric): First search in the current class, then
6216         in outer classes.
6217         (DeclSpace.initialize_type_params): When hiding a type parameter
6218         from an outer class, put it into the `type_param_list' anyways.
6219
6220         * expression.cs (MemberAccess.expr): Made this field protected.
6221
6222         * class.cs (TypeContainer.Define): The `CurrentType' just contains
6223         the type parameters from the current class.
6224
6225         * generic.cs (ConstructedType.ResolveType): Support nested generic
6226         types by taking the type parameters which we inherit from outer
6227         classes into account.
6228         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
6229         support for nested generic types.
6230
6231 2004-02-23  Martin Baulig  <martin@ximian.com>
6232
6233         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
6234         field and check whether we're nested inside a generic type.
6235         (DeclSpace.ResolveType): If we're resolving to a generic type
6236         definition, create a ConstructedType and return its resolved type.
6237         (DeclSpace.initialize_type_params): New private method;
6238         initializes the `type_param_list' field from the type parameters
6239         from this and all enclosing classes.
6240         (DeclSpace.TypeParameters): Call initialize_type_params() unless
6241         we're already initialized.
6242
6243 2004-02-23  Martin Baulig  <martin@ximian.com>
6244
6245         * class.cs (Method.Define): Create the generic method before
6246         calling DoDefine().
6247         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
6248         the TypeContainer one); we use this for generic methods.
6249
6250         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
6251         parent's TypeBuilder.
6252
6253 2004-02-18  Martin Baulig  <martin@ximian.com>
6254
6255         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
6256         to check for equality.
6257
6258 2004-02-05  Martin Baulig  <martin@ximian.com>
6259
6260         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
6261         `ec.TypeContainer.CurrentType', use it instead of
6262         `ec.ContainerType' to check whether we're in the type's ctor.
6263
6264 2004-01-29  Martin Baulig  <martin@ximian.com>
6265
6266         * expression.cs (Invocation.DoResolve): If we're a
6267         `ConstructedType', then we're actually a generic method, so
6268         rewrite the expr as a GenericMemberAccess.
6269
6270         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
6271         here; manually parse it into a string.
6272
6273 2004-01-28  Martin Baulig  <martin@ximian.com>
6274
6275         * typemanager.cs (TypeManager.IsEqual): New static method.
6276         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
6277         check for equality instead of using `=='.
6278
6279 2004-01-26  Martin Baulig  <martin@ximian.com>
6280
6281         * decl.cs (DeclSpace.CurrentType): New public field.
6282
6283         * expression.cs (This.ResolveBase): If we have an
6284         `ec.TypeContainer.CurrentType', use it instead of
6285         `ec.ContainerType'.
6286
6287         * class.cs (TypeContainer.DefineType): If we're a generic type,
6288         create the `CurrentType' (unresolved).
6289         (TypeContainer.GenericType): New private field.
6290         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
6291         it and store it in `GenericType' before creating the MemberCache.
6292         (TypeContainer.GetMembers): If we have a `GenericType', call
6293         TypeManager.FindMembers() on it.
6294
6295         * interface.cs (Interface.GenericType): New private field.
6296         (Interface.DefineType): If we're a generic type, create the
6297         `CurrentType' (unresolved).
6298         (Interface.DefineMembers): If we have a `CurrentType', resolve it
6299         and store it in `GenericType' before creating the MemberCache.
6300         (Interface.GetMembers): If we have a `GenericType', call
6301         TypeManager.FindMembers() on it.
6302
6303 2004-01-22  Martin Baulig  <martin@ximian.com>
6304
6305         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6306         not a QualifiedIdentifier.  This is what `type_name_expression'
6307         was previously doing.
6308         (type_name_expression): Removed; the code is now in
6309         `namespace_or_type_name'.
6310         (qualified_identifier): Removed, use `namespace_or_type_name'
6311         instead.
6312         (QualifiedIdentifier): Removed this class.      
6313
6314 2004-01-22  Martin Baulig  <martin@ximian.com>
6315
6316         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6317         not a string as alias name.
6318
6319 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6320
6321         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6322         #52730 bug, and instead compute correctly the need to use a
6323         temporary variable when requesting an address based on the
6324         static/instace modified of the field and the constructor.
6325  
6326 2004-01-21  Martin Baulig  <martin@ximian.com>
6327
6328         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6329         class and namespace before looking up aliases.  Fixes #52517.
6330
6331 2004-01-21  Martin Baulig  <martin@ximian.com>
6332
6333         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6334         assinged in a 'try'; fixes exception4.cs.
6335
6336 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6337         * class.cs : Implemented parameter-less constructor for TypeContainer
6338
6339         * decl.cs: Attributes are now stored here. New property OptAttributes
6340
6341         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6342
6343         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6344
6345 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6346
6347         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6348           (CSharpSignature): New method for indexer and property signature.
6349
6350 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6351
6352         * pending.cs (IsVirtualFilter): Faster implementation.
6353
6354 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6355
6356         * typemanager.cs: Avoid inclusion of same assembly more than once.
6357
6358 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6359
6360         * cs-parser.jay: Fixed problem where the last assembly attribute
6361           has been applied also to following declaration (class, struct, etc.)
6362           
6363 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6364
6365         * class.cs: Added error CS0538, CS0539 reporting.
6366         Fixed crash on Microsoft runtime when field type is void.
6367
6368         * cs-parser.jay: Added error CS0537 reporting.
6369
6370         * pending.cs: Added error CS0535 reporting.
6371         Improved error report for errors CS0536, CS0534.
6372
6373 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6374
6375         Merge a few bits from the Anonymous Method MCS tree.
6376
6377         * statement.cs (ToplevelBlock): New class for toplevel methods,
6378         will hold anonymous methods, lifted variables.
6379
6380         * cs-parser.jay: Create toplevel blocks for delegates and for
6381         regular blocks of code. 
6382
6383 2004-01-20  Martin Baulig  <martin@ximian.com>
6384
6385         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6386         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6387         and `NeedExplicitReturn'; added `IsLastStatement'.
6388         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6389         have a `ReturnLabel' or we're not unreachable.
6390
6391         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6392         child's reachability; don't just override ours with it.  Fixes
6393         #58058 (lluis's example).
6394         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6395         InFinally(), InLoop(), InSwitch() and
6396         BreakCrossesTryCatchBoundary() methods.
6397
6398         * statement.cs (Return): Do all error checking in Resolve().
6399         Unless we are the last statement in a top-level block, always
6400         create a return label and jump to it.
6401         (Break, Continue): Do all error checking in Resolve(); also make
6402         sure we aren't leaving a `finally'.
6403         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6404         statement in a top-level block.
6405         (Block.Flags): Added `IsDestructor'.
6406         (Block.IsDestructor): New public property.
6407
6408 2004-01-20  Martin Baulig  <martin@ximian.com>
6409
6410         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6411
6412 2004-01-20  Martin Baulig  <martin@ximian.com>
6413
6414         * statement.cs (Statement.ResolveUnreachable): New public method.
6415         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6416         (Block.Resolve): Resolve unreachable statements.
6417
6418 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6419
6420         * expression.cs: We need to fix the case where we do
6421         not have a temp variable here.
6422
6423         * assign.cs: Only expression compound assignments need
6424         temporary variables.
6425
6426 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6427
6428         * flowanalysis.cs: Reduce memory allocation in a few ways:
6429           - A block with no variables should not allocate a bit
6430             vector for itself.
6431           - A method with no out parameters does not need any tracking
6432             for assignment of the parameters, so we need not allocate
6433             any data for it.
6434           - The arrays:
6435                 public readonly Type[] VariableTypes;
6436                 public readonly string[] VariableNames;
6437             Are redundant. The data is already stored in the variable
6438             map, so we need not allocate another array for it.
6439           - We need to add alot of checks for if (params | locals) == null
6440             due to the first two changes.
6441
6442 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6443
6444         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6445         implement IMemoryLocation, we store a copy on a local variable and
6446         take the address of it.  Patch from Benjamin Jemlich
6447
6448         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6449         to use a special "type_name_expression" rule which reduces the
6450         number of "QualifiedIdentifier" classes created, and instead
6451         directly creates MemberAccess expressions.
6452
6453 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6454
6455         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6456         that fixes #52853.  Null literal assignment to ValueType
6457
6458         * class.cs (MethodData.Emit): Instead of checking the name of the
6459         method to determine if its a destructor, create a new derived
6460         class from Method called Destructor, and test for that.  
6461
6462         * cs-parser.jay: Create a Destructor object instead of a Method.  
6463
6464         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6465
6466         Fixes: 52933
6467
6468 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6469
6470         * expression.cs (Binary.ResolveOperator): Perform an implicit
6471         conversion from MethodGroups to their delegate types on the
6472         Addition operation.
6473
6474         * delegate.cs: Introduce a new class DelegateCreation that is the
6475         base class for `NewDelegate' and `ImplicitDelegateCreation',
6476         factor some code in here.
6477
6478         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6479         conversion from MethodGroups to compatible delegate types. 
6480
6481         * ecore.cs (Expression.Resolve): Do not flag error 654
6482         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6483         we allow conversions from MethodGroups to delegate types now.
6484
6485         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6486         assignments in v2 either.
6487
6488 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6489
6490         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6491         static read-only fields in ctors.
6492
6493         Applied patch from Benjamin Jemlich 
6494
6495         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6496
6497 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6498
6499         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6500         here to return true, as they can be used like this:
6501
6502                 (XXX) int.MEMBER ()
6503
6504         Fixed 49836 and all the other dups
6505
6506 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6507
6508         * driver.cs: Implement /win32res and /win32icon.
6509
6510 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6511
6512         * cs-parser.jay: Add a rule to improve error handling for the
6513         common mistake of placing modifiers after the type.
6514
6515 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6516
6517         * cs-parser.jay (interface_event_declaration): Catch
6518         initialization of events on interfaces, and report cs0068
6519
6520         * cs-parser.jay (interface_event_declaration): Catch
6521         initialization of events. 
6522
6523         * ecore.cs: Better report missing constructors.
6524
6525         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6526         the error reporting done in the wrong place.  Fix.
6527
6528         * expression.cs (Binary.ResolveOperator): Catch the 
6529         operator + (E x, E y) error earlier, and later allow for implicit
6530         conversions in operator +/- (E e, U x) from U to the underlying
6531         type of E.
6532
6533         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6534         52596, if the container class is abstract, the default constructor
6535         is protected otherwise its public (before, we were always public).
6536
6537         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6538         fixed statement.
6539
6540         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6541         Jemlich that fixes bug #52597, MCS was generating invalid code for
6542         idisposable structs.   Thanks to Ben for following up with this
6543         bug as well.
6544
6545 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6546
6547         * driver.cs: Allow assemblies without code to be generated, fixes
6548         52230.
6549
6550 2004-01-07  Nick Drochak <ndrochak@gol.com>
6551
6552         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6553
6554 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6555
6556         * cs-parser.jay: Add rules to improve error reporting if fields or
6557         methods are declared at the namespace level (error 116)
6558
6559         * Add rules to catch event add/remove
6560
6561 2004-01-04  David Sheldon <dave-mono@earth.li>
6562
6563   * expression.cs: Added matching ")" to error message for 
6564   CS0077
6565
6566 2004-01-03 Todd Berman <tberman@gentoo.org>
6567
6568         * ecore.cs, attribute.cs:
6569         Applying fix from #52429.
6570
6571 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6572
6573         * ecore.cs, expression.cs, statement.cs:
6574         Total rewrite of how we handle branching. We
6575         now handle complex boolean expressions with fewer
6576         jumps. As well if (x == 0) no longer emits a ceq.
6577
6578         if (x is Foo) is much faster now, because we generate
6579         better code.
6580
6581         Overall, we get a pretty big improvement on our benchmark
6582         tests. The code we generate is smaller and more readable.
6583
6584         I did a full two-stage bootstrap. The patch was reviewed
6585         by Martin and Miguel.
6586
6587 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6588
6589         * cs-parser.jay: Make primary_expression not take a QI.
6590         we dont need this because the member_access rule covers
6591         us here. So we replace the rule with just IDENTIFIER.
6592
6593         This has two good effects. First, we remove a s/r conflict.
6594         Second, we allocate many fewer QualifiedIdentifier objects.
6595
6596 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6597
6598         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6599         set the correct information via SRE. This prevents
6600         hanging on the MS runtime. Fixes #29374.
6601
6602 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6603
6604         * convert.cs: correctly handle conversions to value types
6605         from Enum and ValueType as unboxing conversions.
6606
6607         Fixes bug #52569. Patch by Benjamin Jemlich.
6608
6609 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6610
6611         * expression.cs (BetterConversion): Prefer int -> uint
6612         over int -> ulong (csc's behaviour). This fixed bug #52046.
6613
6614 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6615
6616         * decl.cs (MemberCache.FindMembers): now returns a
6617         MemberInfo [].
6618
6619         * typemanager.cs: In general, go with with ^^.
6620         (CopyNewMethods): take an IList.
6621         (RealMemberLookup): Only allocate an arraylist
6622         if we copy from two sets of methods.
6623
6624         This change basically does two things:
6625         1) Fewer array lists allocated due to CopyNewMethods.
6626         2) the explicit cast in MemberList costed ALOT.
6627
6628 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6629
6630         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6631         a hashtable to avoid needless string allocations when an identifier is
6632         used more than once (the common case).
6633
6634 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6635
6636         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6637         is broken, it will not return anything. So, we
6638         have to use the information we have in mcs to
6639         do the task.
6640
6641         * typemanager.cs: Add a cache for GetInterfaces,
6642         since this will now be used more often (due to ^^)
6643
6644         (GetExplicitInterfaces) New method that gets the
6645         declared, not effective, interfaces on a type
6646         builder (eg, if you have interface IFoo, interface
6647         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6648         { IBar }.
6649
6650         This patch makes MCS able to bootstrap itself on
6651         Windows again.
6652
6653 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6654
6655         * expression.cs: Remove the Nop's that Miguel put
6656         in by mistake.
6657
6658 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6659
6660         * report.cs, codegen.cs: Give the real stack trace to
6661         the error when an exception is thrown.
6662
6663 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6664
6665         * decl.cs: only allocate hashtables for ifaces if 
6666         it is an iface!
6667
6668 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6669
6670         * expression.cs: fix the error from cs0121-2.cs
6671         (a parent interface has two child interfaces that
6672         have a function with the same name and 0 params
6673         and the function is called through the parent).
6674
6675 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6676
6677         * class.cs, rootcontext.cs, typmanager.cs: do not
6678         leak pointers.
6679
6680 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6681
6682         * codegen.cs: remove stack for the ec flow branching.
6683         It is already a linked list, so no need.
6684
6685 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6686
6687         * Makefile: Allow custom profiler here.
6688
6689 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6690
6691         * typemanager.cs (LookupType):
6692           - Use a static char [], because split takes
6693             a param array for args, so it was allocating
6694             every time.
6695           - Do not store true in a hashtable, it boxes.
6696
6697 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6698
6699         * flowanalysis.cs: bytify common enums.
6700
6701 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6702
6703         * modifiers.cs: Add a new set of flags for the
6704         flags allowed on explicit interface impls.
6705         * cs-parser.jay: catch the use of modifiers in
6706         interfaces correctly.
6707         * class.cs: catch private void IFoo.Blah ().
6708
6709         All related to bug #50572.
6710
6711 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6712
6713         * decl.cs: Rewrite the consistant accessability checking.
6714         Accessability is not linear, it must be implemented in
6715         a tableish way. Fixes #49704.
6716
6717 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6718
6719         * expression.cs: Handle negation in a checked context.
6720         We must use subtraction from zero. Fixes #38674.
6721
6722 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6723
6724         * class.cs: Ignore static void main in DLLs.
6725         * rootcontext.cs: Handle the target type here,
6726         since we are have to access it from class.cs
6727         * driver.cs: account for the above.
6728
6729 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6730
6731         * report.cs: Give line numbers and files if available.
6732
6733 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6734
6735         * driver.cs: Implement /addmodule.
6736
6737         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6738         ModuleBuilders.
6739
6740 2003-12-20  Martin Baulig  <martin@ximian.com>
6741
6742         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6743         (FieldBase.IsAssigned): Removed this field.
6744         (FieldBase.SetAssigned): New public method.
6745         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6746
6747 2003-12-20  Martin Baulig  <martin@ximian.com>
6748
6749         * expression.cs (LocalVariableReference.DoResolve): Don't set
6750         `vi.Used' if we're called from DoResolveLValue().
6751
6752         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6753         returns the usage vector it just merged into the current one -
6754         pass this one to UsageWarning().
6755         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6756         of the `EmitContext', don't call this recursively on our children.
6757
6758 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6759
6760         * driver.cs: Implement /target:module.
6761
6762 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6763
6764         * support.cs (CharArrayHashtable): New helper class.
6765
6766         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6767         char arrays, not strings, so we can avoid creating a string in
6768         consume_identifier if the identifier is a keyword.
6769
6770 2003-12-16  Martin Baulig  <martin@ximian.com>
6771
6772         * statement.cs (LocalInfo.Assigned): Removed this property.
6773         (LocalInfo.Flags): Removed `Assigned'.
6774         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6775         and uses flow analysis.
6776         (Block.UsageWarning): Made this method private.
6777         (Block.Resolve): Call UsageWarning() if appropriate.
6778
6779         * expression.cs (LocalVariableReference.DoResolve): Always set
6780         LocalInfo.Used here.
6781
6782 2003-12-13  Martin Baulig  <martin@ximian.com>
6783
6784         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6785         any value here; we're now using flow analysis to figure out
6786         whether a statement/block returns a value.
6787
6788 2003-12-13  Martin Baulig  <martin@ximian.com>
6789
6790         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6791         working again.
6792         (FlowBranching.MergeFinally): Don't call
6793         `branching.CheckOutParameters()' here, this is called in
6794         MergeTopBlock().
6795         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6796         when adding the `finally' vector.       
6797
6798 2003-12-13  Martin Baulig  <martin@ximian.com>
6799
6800         * flowanalysis.cs
6801         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6802         actually work and also fix #48962.
6803
6804 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6805
6806         * decl.cs: Do not check System.Object for nested types,
6807         since we know it does not have any. Big bang for buck:
6808
6809         BEFORE:
6810            Run 1:   8.35 seconds
6811            Run 2:   8.32 seconds
6812            corlib:  17.99 seconds
6813         AFTER:
6814            Run 1:   8.17 seconds
6815            Run 2:   8.17 seconds
6816            corlib:  17.39 seconds
6817
6818 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6819
6820         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6821         time we are returning 0 members, so we save alot here.
6822
6823 2003-12-11  Martin Baulig  <martin@ximian.com>
6824
6825         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6826         `MergeChild()', also just take the `FlowBranching' as argument;
6827         call Merge() on it and return the result.
6828         (FlowBranching.Merge): We don't need to do anything if we just
6829         have one sibling.
6830
6831 2003-12-11  Martin Baulig  <martin@ximian.com>
6832
6833         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6834         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6835         Maurer for this idea.
6836
6837 2003-12-11  Martin Baulig  <martin@ximian.com>
6838
6839         * flowanalysis.cs (MergeResult): This class is now gone; we now
6840         use the `UsageVector' for this.  The reason for this is that if a
6841         branching just has one sibling, we don't need to "merge" them at
6842         all - that's the next step to do.
6843         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6844         `MergeResult'.
6845
6846 2003-12-11  Martin Baulig  <martin@ximian.com>
6847
6848         Reworked flow analyis and made it more precise and bug-free.  The
6849         most important change is that we're now using a special `Reachability'
6850         class instead of having "magic" meanings of `FlowReturns'.  I'll
6851         do some more cleanups and optimizations and also add some more
6852         documentation this week.
6853
6854         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6855         largely reworked this class.
6856         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6857         the new `Reachability' class instead of having "magic" values here.
6858         (FlowBranching): We're now using an instance of `Reachability'
6859         instead of having separate `Returns', `Breaks' etc. fields.
6860
6861         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6862         based on flow analysis; ignore the return value of block.Emit ().
6863
6864 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6865
6866         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6867         if they are private.
6868
6869 2003-12-09  Martin Baulig  <martin@ximian.com>
6870
6871         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6872         call them directly on the UsageVector.
6873
6874 2003-12-09  Martin Baulig  <martin@ximian.com>
6875
6876         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6877         Changed return type from `FlowReturns' to `Reachability'.
6878
6879 2003-12-09  Martin Baulig  <martin@ximian.com>
6880
6881         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6882         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6883         `Reachable' fields with a single `Reachability' one.
6884
6885 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6886
6887         * class.cs (FindMembers): Remove foreach's.
6888
6889         Bootstrap times:
6890
6891         BEFORE
6892                 Run 1:   8.74 seconds
6893                 Run 2:   8.71 seconds
6894
6895         AFTER
6896                 Run 1:   8.64 seconds
6897                 Run 2:   8.58 seconds
6898
6899
6900 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6901
6902         * cs-parser.jay:
6903         * gen-treedump.cs:
6904         * statement.cs:
6905         This patch does a few things:
6906                 1. EmptyStatement is now a singleton, so it is never reallocated.
6907                 2. All blah is EmptyStatement constructs have been changed to
6908                    blah == EmptyStatement.Value, which is much faster and valid
6909                    now that EmptyStatement is a singleton.
6910                 3. When resolving a block, rather than allocating a new array for
6911                    the non-empty statements, empty statements are replaced with
6912                    EmptyStatement.Value
6913                 4. Some recursive functions have been made non-recursive.
6914         Mainly the performance impact is from (3), however (1) and (2) are needed for
6915         this to work. (4) does not make a big difference in normal situations, however
6916         it makes the profile look saner.
6917
6918         Bootstrap times:
6919
6920         BEFORE
6921         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6922         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6923         Total memory allocated: 56397 KB
6924
6925         AFTER
6926         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6927         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6928         Total memory allocated: 55666 KB
6929
6930 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6931
6932         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6933         than the hashtable in a hashtable version
6934
6935         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6936         we always end up concating a string. This results in a huge perf
6937         loss, because many strings have to be tracked by the GC. In this
6938         patch, we first use a hashtable that works with two keys, so that
6939         the strings do not need to be concat'ed.
6940
6941         Bootstrap times:
6942         BEFORE
6943                 Run 1:   8.74 seconds
6944                 Run 2:   8.71 seconds
6945
6946         AFTER
6947                 Run 1:   8.65 seconds
6948                 Run 2:   8.56 seconds
6949
6950 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6951
6952         * Makefile: Add a new target `do-time' that does a quick and simple
6953         profile, leaving easy to parse output.
6954
6955 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6956
6957         * codegen.cs (Init): Create the dynamic assembly with 
6958         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6959
6960 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6961
6962         * support.cs: Make the PtrHashtable use only one
6963         instance of its comparer.
6964
6965 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6966
6967         * typemanager.cs: Fix lookup of GetNamespaces.
6968
6969 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6970
6971         * expression.cs: Removed redundant line.
6972
6973         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6974         ArrayLists, use for loops with bounds.  
6975
6976         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6977         arraylist.
6978
6979         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6980         arraylists, use for loop with bounds.
6981
6982         The above three changes give us a 0.071 second performance
6983         improvement out of 3.294 seconds down to 3.223.  On my machine
6984         the above changes reduced the memory usage by 1,387 KB during
6985         compiler bootstrap.
6986
6987         * cs-parser.jay (QualifiedIdentifier): New class used to represent
6988         QualifiedIdentifiers.  Before we created a new string through
6989         concatenation, and mostly later on, the result would be
6990         manipulated by DecomposeQI through string manipulation.
6991
6992         This reduced the compiler memory usage for bootstrapping from
6993         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6994         compile times in 0.05 seconds.
6995
6996 2003-11-28  Dick Porter  <dick@ximian.com>
6997
6998         * support.cs: Do string compares with the Invariant culture.
6999
7000         * rootcontext.cs: 
7001         * gen-treedump.cs: 
7002         * expression.cs: 
7003         * driver.cs: 
7004         * decl.cs: 
7005         * codegen.cs: 
7006         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
7007         the comparison is done with the Invariant culture.
7008
7009 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
7010
7011         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7012         GetEnumerator method.
7013
7014         (ProbeCollectionType): Iterate starting at the most specific type
7015         upwards looking for a GetEnumerator
7016
7017         * expression.cs: Shift count can be up to 31 for int/uint and 63
7018         for long/ulong.
7019
7020 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
7021
7022         * statement.cs (Block.LookupLabel): Also look for the label on the
7023         children blocks.  Use a hash table to keep track of visited
7024         nodes. 
7025
7026         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7027         we actually did transform the other operand, otherwise fall back
7028         to the common codepath that casts to long.
7029
7030         * cs-tokenizer.cs: Use the same code pattern as the int case.
7031         Maybe I should do the parsing myself, and avoid depending on the
7032         Parse routines to get this done.
7033
7034 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
7035
7036         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7037         which fixes bug 51347.  This time test it.
7038
7039         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7040         attributes for example can not tell the difference between these.
7041         The difference was only a syntax feature of the language. 
7042
7043         * attribute.cs: Apply attributes to delegates.
7044
7045         * delegate.cs: Call the apply attributes method.
7046
7047 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
7048
7049         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7050         comparing 0 vs Byte.MinValue, not the value
7051
7052         (ImplicitConversionRequired): When reporting a conversion error,
7053         use error 31 to print out the constant error instead of the
7054         simpler 29.
7055
7056         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7057         which fixes bug 51347.
7058
7059 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
7060
7061         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
7062         which fixes the -warnaserror command line option.
7063
7064 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
7065
7066         * cfold.cs (DoNumericPromotions): During constant folding of
7067         additions on UIntConstant, special case intconstants with
7068         IntConstants like we do on the expression binary operator. 
7069
7070 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
7071
7072         * convert.cs (ImplicitReferenceConversion): We were missing a case
7073         (System.Enum are not value types or class types, so we need to
7074         classify them separatedly).
7075
7076         * driver.cs: We do not support error 2007.
7077
7078 2003-11-12 Jackson Harper <jackson@ximian.com>
7079
7080         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
7081         system directory. Also use the full file name so users can
7082         libraries names mscorlib-o-tron.dll in a non system dir.
7083         
7084 2004-01-04  David Sheldon <dave-mono@earth.li>
7085
7086         * expression.cs: Added matching ")" to error message for CS0077.
7087
7088 2003-12-19  Martin Baulig  <martin@ximian.com>
7089
7090         * typemanager.cs (TypeManager.IsEqualGenericType): New public
7091         static method; see documentation in the method.
7092         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
7093
7094         * convert.cs (Convert.ImplicitReferenceConversion,
7095         Convert.ImplicitReferenceConversionExists): Add support for
7096         generic type declarations; see gen-36.cs.
7097
7098 2003-12-19  Martin Baulig  <martin@ximian.com>
7099
7100         * pending.cs (Pending.InterfaceMethod): Use
7101         `Type.IsAssignableFrom()' instead of `=='.
7102
7103 2003-12-18  Martin Baulig  <martin@ximian.com>
7104
7105         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
7106         byref types first.
7107
7108         * convert.cs (Convert.ImplicitStandardConversionExists): Use
7109         `expr_type.Equals (target_type)' instead of `=='.
7110
7111 2003-12-08  Martin Baulig  <martin@ximian.com>
7112
7113         * generics.cs (Constraints.Types): Removed.
7114         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
7115         to Type's.
7116         (Constraints.ResolveTypes): New public method; resolves the
7117         TypeExpr's to Type's.
7118         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
7119         longer takes the constraints.
7120         (TypeParameter.DefineMethod): Likewise.
7121         (TypeParameter.DefineType): New public method.  Calls
7122         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
7123         the constraints.
7124
7125 2003-12-08  Martin Baulig  <martin@ximian.com>
7126
7127         * convert.cs (Convert.ImplicitConversionStandard): Use
7128         `expr_type.Equals (target_type)' instead of `=='.
7129
7130 2003-12-08  Martin Baulig  <martin@ximian.com>
7131
7132         * typemanager.cs (TypeManager.GetReferenceType): Call
7133         `Type.MakeByRefType ()'.
7134
7135 2003-12-08  Martin Baulig  <martin@ximian.com>
7136
7137         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
7138         just has some special meaning in some situations.  For instance,
7139         it is allowed to use `where' as the name of a variable etc.
7140
7141 2003-12-04  Martin Baulig  <martin@ximian.com>
7142
7143         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7144         `Type.MakeArrayType()' for array types.
7145
7146 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
7147
7148         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
7149         debugging message.
7150
7151         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
7152         corlib to compile.
7153
7154 2003-11-16  Martin Baulig  <martin@ximian.com>
7155
7156         * codegen.cs (EmitContext.IsGeneric): Removed.
7157
7158         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
7159         ResolveGeneric() on the DeclSpace.
7160
7161 2003-11-16  Martin Baulig  <martin@ximian.com>
7162
7163         * generic.cs (TypeArguments.Resolve):
7164         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
7165         `ResolveType()' on it to get the Type.
7166
7167 2003-11-15  Martin Baulig  <martin@ximian.com>
7168
7169         * generic.cs (ConstructedType.GetInterfaces): Override this.
7170
7171 2003-11-14  Martin Baulig  <martin@ximian.com>
7172
7173         * interface.cs (Interface.DefineType): Define all type parameters
7174         before adding the interfaces we inherit.
7175
7176 2003-11-11  Martin Baulig  <martin@ximian.com>
7177
7178         * generic.cs (ConstructedType.ResolveType): Always call
7179         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
7180
7181 2003-11-10  Martin Baulig  <martin@ximian.com>
7182
7183         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7184         (TypeManager.InitCoreTypes): Initialize them here, but instead of
7185         calling `ResolveType()' on them, directly assign their `Type'.
7186
7187 2003-11-08  Martin Baulig  <martin@ximian.com>
7188
7189         * generic.cs (ConstructedType): Override `IsClass' etc.
7190
7191 2003-11-08  Martin Baulig  <martin@ximian.com>
7192
7193         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7194         return value and the `out parent' parameter.
7195         (TypeContainer.DefineType): Moved the CS0644 check into
7196         GetClassBases().  Don't pass the interface types to the
7197         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7198         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7199
7200         * ecore.cs (TypeExpr.IsAttribute): New property.
7201         (TypeExpr.GetInterfaces): New method.
7202
7203         * interface.cs (Interface.GetInterfaceTypeByName): Return a
7204         TypeExpr instead of a Type.
7205         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7206         (Interface.DefineType): Don't pass the interface types to the
7207         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7208         them later and then call `TypeBulider.AddInterfaceImplementation()'.
7209
7210         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7211         instead of a `Type[]'.
7212         (TypeManager.RegisterBuilder): Likewise.
7213         (TypeManager.AddUserInterface): Likewise.
7214         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7215         `Type[]' and also return a `TypeExpr[]'.
7216         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7217
7218 2003-11-08  Martin Baulig  <martin@ximian.com>
7219
7220         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7221         Expression.     
7222
7223 2003-11-08  Martin Baulig  <martin@ximian.com>
7224
7225         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7226         TypeManager.ResolveExpressionTypes().
7227
7228         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7229         instead of an Expression.
7230         (TypeExpr): This is now an abstract base class for `TypeExpression'.
7231         (TypeExpression): New public class; formerly known as `TypeExpr'.
7232
7233         * expression.cs (ComposedCast): Derive from TypeExpr.
7234
7235         * typemanager.cs (TypeManager.system_*_expr): These are now
7236         TypExpr's instead of Expression's.
7237         (TypeManager.ResolveExpressionTypes): New public static function;
7238         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7239         of them.        
7240
7241 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
7242
7243         * expression.cs (New.DoResolve): Do not dereference value that
7244         might be a null return.
7245
7246         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7247         sure that the constant value has the right type.  Fixes an
7248         unreported bug, similar to 50425.
7249
7250         * const.cs (Const.LookupConstantValue): Call
7251         ImplicitStandardConversionExists before doing a conversion to
7252         avoid havng the TypeManager.ChangeType do conversions.
7253
7254         Reduced the number of casts used
7255
7256         (Const.ChangeType): New routine to enable reuse of the constant
7257         type changing code from statement.
7258
7259         * typemanager.cs (ChangeType): Move common initialization to
7260         static global variables.
7261
7262         Fixes #50425.
7263
7264         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7265         every value type to go through, even if it was void.  Fix that. 
7266
7267         * cs-tokenizer.cs: Use is_identifier_start_character on the start
7268         character of the define, and the is_identifier_part_character for
7269         the rest of the string.
7270
7271 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
7272
7273         * expression.cs (UnaryMutator.EmitCode): When I updated
7274         LocalVariableReference.DoResolve, I overdid it, and dropped an
7275         optimization done on local variable references.
7276
7277 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
7278
7279         * ecore.cs: Convert the return from Ldlen into an int.
7280
7281 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
7282
7283         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7284         the accessibility, this is a special case for toplevel non-public
7285         classes (internal for instance).
7286
7287 2003-10-20  Nick Drochak <ndrochak@gol.com>
7288
7289         * ecore.cs: Fix typo and build.  Needed another right paren.
7290
7291 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
7292
7293         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
7294         `internal' case regular and protected, but not allowing protected
7295         to be evaluated later.  Bug 49840
7296
7297 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
7298
7299         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7300         to kb.Nlast, and not the kb.nFirst to isolate the switch
7301         statement.
7302
7303         Extract the underlying type, so enumerations of long/ulong are
7304         treated like long/ulong.
7305
7306 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
7307
7308         * expression.cs (New): Overload the meaning of RequestedType to
7309         track the possible creation of the NewDelegate type, since
7310         DoResolve is invoked more than once for new constructors on field
7311         initialization.
7312
7313         See bugs: #48800 and #37014
7314
7315         * cs-parser.jay (declare_local_constants): Take an arraylist
7316         instead of a single constant.
7317
7318         (local_constant_declaration): It should take a
7319         constant_declarators, not a constant_declarator.  Fixes 49487
7320
7321         * convert.cs: Fix error report.
7322
7323 2003-10-13 Jackson Harper <jackson@ximian.com>
7324
7325         * typemanager.cs (TypeToCoreType): Add float and double this fixes
7326         bug #49611
7327         
7328 2003-11-03  Martin Baulig  <martin@ximian.com>
7329
7330         * expression.cs (ArrayAccess.GetStoreOpcode): Added
7331         `out bool has_type_arg'; if set, we need to pass the type to
7332         ig.Emit().
7333         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
7334         Stelem_Any/Ldelem_Any for generic parameters.   
7335
7336 2003-11-02  Martin Baulig  <martin@ximian.com>
7337
7338         * expression.cs (Invocation.EmitCall): Use
7339         `TypeManager.IsValueType()' to check whether it's a value type.
7340         Don't set `struct_call' when calling a method on a type parameter.
7341
7342 2003-11-02  Martin Baulig  <martin@ximian.com>
7343
7344         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
7345         and removed the TypeBuilder argument.
7346
7347         * typemanager.cs (TypeManager.IsValueType): Return
7348         `t.IsGenericParameter || t.IsValueType'.
7349
7350 2003-10-25  Martin Baulig  <martin@ximian.com>
7351
7352         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
7353         call ConstructedType.Resolve() on it.
7354
7355         * generic.cs (ConstructedType.Resolve): Set `type' on success.
7356
7357 2003-10-25  Martin Baulig  <martin@ximian.com>
7358
7359         * class.cs (TypeContainer.GetClassBases): Changed
7360         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
7361         CS8214 reporting here.
7362         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
7363         instead of a `Type' for our parent.  In case of a recursive
7364         declaration (see tests/gen-23.cs for an example), our parent is a
7365         ConstructedType and it doesn't have its type set.  So, first
7366         create our own TypeBuilder, then call constructed.Resolve() to get
7367         the parent's type and finally TypeBuilder.SetParent() it.
7368
7369         * ecore.cs (TypeExpr.Name): New public virtual property.
7370
7371         * generic.cs
7372         (ConstructedType): We're now a TypeExpr and not just an Expression.
7373         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
7374         arguments here; this is done later.
7375         (ConstructedType.Resolve): New public method to resolve the type
7376         arguments and bind them.
7377
7378 2003-10-21  Martin Baulig  <martin@ximian.com>
7379
7380         * convert.cs: Use `TypeManager.IsValueType' instead of
7381         'type.IsValueType' everywhere.
7382
7383         * typemanager.cs (TypeManager.IsValueType): Return true for type
7384         parameters.  The reason for this is that we need to box a type
7385         parameter when converting it to a reference type.
7386
7387         * cs-parser.jay: Added support for default value expressions.
7388
7389         * generics.cs (DefaultValueExpression): New public class.       
7390
7391 2003-10-17  Martin Baulig  <martin@ximian.com>
7392
7393         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
7394         TypeContainer so we can also use this for Interfaces.
7395         (TypeParameter.Resolve): Likewise.
7396
7397         * interface.cs (Interface.DefineType): Added support for generic
7398         interfaces.
7399
7400         * cs-parser.jay: Added support for generic structs and interfaces.
7401
7402 2003-10-17  Martin Baulig  <martin@ximian.com>
7403
7404         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
7405         call generic methods :-)
7406
7407 2003-10-16  Martin Baulig  <martin@ximian.com>
7408
7409         * cs-parser.jay (namespace_or_type_name): Only create a
7410         GenericMemberAccess if we actually have type arguments.
7411
7412 2003-10-13  Martin Baulig  <martin@ximian.com>
7413
7414         * class.cs (Method.Define): If we're a generic method, call
7415         TypeBuilder.DefineGenericMethod () before resolving
7416         the parameters.
7417         (MethodData): Added .ctor which takes an additional MethodBuilder
7418         argument; this is used for generic methods.
7419         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
7420         we already have a MethodBuilder.
7421
7422 2003-10-10  Martin Baulig  <martin@ximian.com>
7423
7424         * class.cs (Method): Added .ctor which takes a `GenericMethod'
7425         instead of a `DeclSpace'.  This is used for generic methods.
7426
7427         * cs-parser.jay (method_header): Added support for generic
7428         methods; create a `GenericMethod' instance and pass it to the
7429         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
7430         parameters and locals.
7431
7432         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
7433         since we already have the location.  Check whether we're a generic
7434         type declaration or a generic method and create the correct type
7435         parameter.
7436
7437         * generic.cs (TypeParameter.DefineMethod): New public method.
7438         (GenericMethod): New public class; derives from DeclSpace and is
7439         used for generic methods.       
7440
7441 2003-10-09  Martin Baulig  <martin@ximian.com>
7442
7443         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7444         to the .ctor.
7445         (MethodCore.DoDefineParameters): Removed the TypeContainer
7446         argument; use the DeclSpace which was passed to the .ctor instead.
7447         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7448         TypeContainer; we only need a DeclSpace here.
7449
7450 2003-10-09  Martin Baulig  <martin@ximian.com>
7451
7452         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7453         to the .ctor.
7454         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7455         EmitContext's .ctor.    
7456
7457 2003-10-09  Martin Baulig  <martin@ximian.com>
7458
7459         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7460         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7461         AsAccessible(), moved them as well.
7462
7463         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7464
7465 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7466
7467         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7468         generation for >=, as spotted by Paolo, bug 48679.  
7469         Patch from David Waite.
7470
7471         * cs-tokenizer.cs: Add handling for #pragma.
7472
7473         * cs-parser.jay: Allow for both yield and yield return in the
7474         syntax.  The anti-cobolization of C# fight will go on!
7475
7476         * class.cs (TypeBuilder.DefineType): Catch error condition here
7477         (Parent.DefineType erroring out and returning null).
7478
7479         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7480         coping with enumerations variables, we were mistakenly processing
7481         them as a regular value type instead of built-in types.  Fixes the
7482         bug #48063
7483
7484         * typemanager.cs (IsBuiltinOrEnum): New method.
7485
7486 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7487
7488         * cs-parser.jay: Upgrade: yield now needs the return clause.
7489
7490 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7491
7492         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7493
7494 2003-09-29  Martin Baulig  <martin@ximian.com>
7495
7496         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
7497         inflated generic methods.
7498
7499         * generics.cs (ConstructedType): Distinguish between open and
7500         closed constructed types; correctly resolve the arguments.
7501
7502 2003-09-22  Martin Baulig  <martin@ximian.com>
7503
7504         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
7505         all type arguments meet their constraints.
7506
7507 2003-09-19  Martin Baulig  <martin@ximian.com>
7508
7509         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7510         `MemberCache parent' argument.  Normally, an interface doesn't
7511         have a parent type except System.Object, but we use this in gmcs
7512         for generic type parameters.
7513
7514 2003-09-18  Martin Baulig  <martin@ximian.com>
7515
7516         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7517         on `type.IsInterface'; don't check whether the type has a parent
7518         to determine whether it's an interface.
7519
7520 2003-09-17  Martin Baulig  <martin@ximian.com>
7521
7522         * generic.cs (ConstructedType.ToString): Always use `name' as the
7523         type name.
7524
7525 2003-09-15  Martin Baulig  <martin@ximian.com>
7526
7527         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7528
7529         * generic.cs (Constraints.Resolve): New public method; this is
7530         called to resolve the constraint types and to check whether all
7531         the constraints are correct.
7532         (Constraints.Types): New public property.
7533         (TypeParameter.Resolve): New public method; resolves all the
7534         type's constraints.
7535
7536         * class.cs (TypeContainer.DefineType): Call
7537         TypeParameter.Resolve() before actually defining the type.
7538
7539 2003-09-15  Martin Baulig  <martin@ximian.com>
7540
7541         * class.cs (TypeContainer.DefineType): Added an error flag to
7542         avoid reporting duplicate CS0146's ("class definition is
7543         circular.").
7544
7545         * driver.cs (Driver.MainDriver): Abort if
7546         RootContext.ResolveTree() reported any errors.
7547
7548 2003-09-07  Martin Baulig  <martin@ximian.com>
7549
7550         * report.cs (Error, Warning): Added overloaded versions which take
7551         a `params object[] args' and call String.Format().
7552
7553 2003-09-07  Martin Baulig  <martin@ximian.com>
7554
7555         * decl.cs (DeclSpace..ctor): Don't call
7556         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7557         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7558         (DeclSpace.RecordDecl): New method.
7559
7560         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7561
7562 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7563
7564         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7565         value attributes to be applied to ParameterBuilders.
7566
7567         * class.cs (MethodCore.LabelParameters): Make static and more
7568         generic so that it can be used from other places - like interface
7569         methods, for instance.
7570
7571         * interface.cs (Interface.Emit): Call LabelParameters before
7572         emitting attributes on the InterfaceMethod.
7573
7574 2003-09-07  Martin Baulig  <martin@ximian.com>
7575
7576         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7577         if the number of type parameters doesn't match.
7578
7579 2003-09-04  Martin Baulig  <martin@ximian.com>
7580
7581         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7582         for arrays of generic type params (ie. `!0[]').
7583
7584 2003-09-04  Martin Baulig  <martin@ximian.com>
7585
7586         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7587         for the moment.
7588
7589 2003-09-04  Martin Baulig  <martin@ximian.com>
7590
7591         * decl.cs (DeclSpace.LookupGeneric): New method.
7592         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7593         moment.
7594
7595         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7596         argument, not just a string.
7597         (TypeParameter.Define): New public method; this is called to
7598         actually define the generic parameter; after this, you can use the
7599         new `Type' property to get the type.
7600
7601 2003-09-04  Martin Baulig  <martin@ximian.com>
7602
7603         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7604         is now an ArrayList; initialize the result of the `TypeParameters'
7605         property here.
7606         (DeclSpace.GetGenericData): Removed.
7607         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7608         implement this in a different way.
7609         (DeclSpace.GetTypeParameters): Removed; there's now a
7610         `TypeParameters' property.
7611         (DeclSpace.TypeParameters): New public property.
7612
7613         * generic.cs (Constraints): Make this class public.
7614         (TypeParameter): New public class.
7615
7616 2003-09-04  Martin Baulig  <martin@ximian.com>
7617
7618         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7619         generic parameters.
7620
7621         * class.cs (TypeContainer.DefineType): Call
7622         TypeBuilder.DefineGenericParameter () on all generic parameters if
7623         this is a generic type.
7624
7625 2003-08-28  Martin Baulig  <martin@ximian.com>
7626
7627         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7628         sample-stack.il".
7629
7630         * sample-hello.cs: Compile this with gmcs: "gmcs
7631         /r:sample-stack.dll sample-hello.cs".
7632
7633 2003-08-28  Martin Baulig  <martin@ximian.com>
7634
7635         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7636         the parameters to the generic type.
7637
7638 2003-08-28  Martin Baulig  <martin@ximian.com>
7639
7640         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7641
7642 2003-08-28  Martin Baulig  <martin@ximian.com>
7643
7644         * cs-parser.jay (opt_type_argument_list): Use
7645         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7646         (primary_expression): Replace `qualified_identifier' with `type_name'.
7647         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7648
7649         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7650         parser to check whether it is syntactically a type parameter list;
7651         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7652         this case.
7653
7654 2003-08-26  Martin Baulig  <martin@ximian.com>
7655
7656         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7657         resolving aliases; fixes #47927.
7658
7659 2003-08-26  Martin Baulig  <martin@ximian.com>
7660
7661         * statement.cs (Using.DoResolve): This is internally emitting a
7662         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7663         do not always return.  Fixes #47681.
7664
7665 2003-08-26  Martin Baulig  <martin@ximian.com>
7666
7667         * decl.cs (MemberCore): Moved WarningNotHiding(),
7668         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7669         into MemberBase.
7670         (AdditionResult): Make this nested in DeclSpace.
7671         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7672         argument; call NamespaceEntry.Define() unless we're nested in a
7673         class or struct.
7674
7675         * namespace.cs (Namespace.DefineName): New public function.  This
7676         is called from DeclSpace's .ctor to add 
7677         (Namespace.Lookup): Include DeclSpaces in the lookup.
7678
7679         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7680
7681         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7682
7683 2003-08-25  Martin Baulig  <martin@ximian.com>
7684
7685         * convert.cs (Convert.ExplicitReferenceConversion): When
7686         converting from an interface type to a class, unbox if the target
7687         type is a struct type.  Fixes #47822.
7688
7689 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7690
7691         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7692         #47854.
7693
7694 2003-08-22  Martin Baulig  <martin@ximian.com>
7695
7696         * class.cs (TypeManager.DefineType): When defining a nested type,
7697         call DefineType() on our parent; fixes #47801.
7698
7699 2003-08-22  Martin Baulig  <martin@ximian.com>
7700
7701         * class.cs (MethodData.Define): While checking if a method is an
7702         interface implementation, improve the test a bit more to fix #47654.
7703
7704 2003-08-22  Martin Baulig  <martin@ximian.com>
7705
7706         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7707         correctly; fixes #47722.
7708
7709 2003-08-22  Martin Baulig  <martin@ximian.com>
7710
7711         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7712         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7713
7714         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7715
7716 2003-08-22  Martin Baulig  <martin@ximian.com>
7717
7718         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7719         can only be assigned in static constructors.  Fixes #47161.
7720
7721 2003-08-22  Martin Baulig  <martin@ximian.com>
7722
7723         Rewrote and improved the flow analysis code.
7724
7725         * flowbranching.cs (FlowBranching): Make this class abstract.
7726         (FlowBranching.CreateBranching): New static function to create a
7727         new flow branching.
7728         (FlowBranchingBlock, FlowBranchingException): New classes.
7729         (FlowBranching.UsageVector.Type): New public readonly field.
7730         (FlowBranching.UsageVector.Breaks): Removed the setter.
7731         (FlowBranching.UsageVector.Returns): Removed the setter.
7732         (FlowBranching.UsageVector): Added Break(), Return(),
7733         NeverReachable() and Throw() methods to modify the reachability.
7734         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7735         done by FlowBranching.Merge().
7736         (FlowBranching.UsageVector.MergeChild): New method; merges the
7737         merge result into the current vector.
7738         (FlowBranching.Merge): New abstract method to merge a branching.
7739
7740 2003-08-12  Martin Baulig  <martin@ximian.com>
7741
7742         * expression.cs (Indirection.CacheTemporaries): Create the
7743         LocalTemporary with the pointer type, not its element type.
7744
7745 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7746
7747         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7748         token was a keyword or not.
7749
7750         Add `error' options where an IDENTIFIER was expected;  Provide
7751         CheckToken and CheckIdentifierToken convenience error reporting
7752         functions. 
7753
7754         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7755
7756         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7757         NameSpaceEntry NameSpaceEntry.
7758
7759         (LookupInterfaceOrClass): Avoid creating a full qualified name
7760         from namespace and name: avoid doing lookups when we know the
7761         namespace is non-existant.   Use new Tree.LookupByNamespace which
7762         looks up DeclSpaces based on their namespace, name pair.
7763
7764         * driver.cs: Provide a new `parser verbose' to display the
7765         exception thrown during parsing.  This is turned off by default
7766         now, so the output of a failure from mcs is more graceful.
7767
7768         * namespace.cs: Track all the namespaces defined in a hashtable
7769         for quick lookup.
7770
7771         (IsNamespace): New method
7772
7773 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7774
7775         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7776         we know that we need to concatenate (full typename can never be
7777         null). 
7778
7779         * class.cs: ditto.
7780
7781         * statement.cs: Use a bitfield;  Do not initialize to null things
7782         which are done by the constructor by default.
7783
7784         * cs-parser.jay: bug fix, parameter was 4, not 3.
7785
7786         * expression.cs: Just use the property;
7787
7788         * statement.cs: No need for GetVariableInfo method.
7789
7790 2003-08-08  Martin Baulig  <martin@ximian.com>
7791
7792         * flowanalysis.cs (FlowReturns): This is now nested in the
7793         `FlowBranching' class.
7794         (MyBitVector): Moved this here from statement.cs.
7795         (FlowBranching.SiblingType): New enum type.
7796         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7797
7798 2003-08-07  Martin Baulig  <martin@ximian.com>
7799
7800         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7801         `FlowBranching' class and called `BranchingType'.
7802
7803 2003-08-07  Martin Baulig  <martin@ximian.com>
7804
7805         * flowanalysis.cs: Moved all the control flow analysis code into
7806         its own file.
7807
7808 2003-08-07  Martin Baulig  <martin@ximian.com>
7809
7810         * assign.cs (Assign.DoResolve): `target' must either be an
7811         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7812         #37319.
7813
7814 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7815
7816         * expression.cs (BinaryMethod): This kind of expression is created by the
7817         Binary class if it determines that the operator has to be handled
7818         by a method.
7819
7820         (BinaryDelegate): This kind of expression is created if we are
7821         dealing with a + or - operator on delegates.
7822
7823         (Binary): remove method, argumetns, and DelegateOperator: when
7824         dealing with methods, 
7825
7826         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7827
7828         * statement.cs (Block): use bitfields for the three extra booleans
7829         we had in use.   Remove unused topblock parameter.
7830
7831         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7832
7833         * assign.cs: Drop extra unneeded tests.
7834
7835 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7836
7837         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7838
7839         * statement.cs (Foreach): Use VariableStorage instead of
7840         LocalBuilders.   
7841
7842         * codegen.cs (VariableStorage): New class used by clients that
7843         require a variable stored: locals or fields for variables that
7844         need to live across yield.
7845
7846         Maybe provide a convenience api for EmitThis+EmitLoad?
7847
7848         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7849         these bad boys.
7850
7851 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7852
7853         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7854         RemapParameterLValue): New methods that are used to turn a
7855         precomputed FieldInfo into an expression like this:
7856
7857                 instance.FieldInfo
7858
7859         The idea is to use this instead of making LocalVariableReference
7860         have more than one meaning.
7861
7862         * cs-parser.jay: Add error production to BASE.
7863
7864         * ecore.cs: Deal with TypeManager.GetField returning null, which
7865         is now a valid return value.
7866
7867         (FieldExprNoAddress): New expression for Fields whose address can
7868         not be taken.
7869
7870         * expression.cs (LocalVariableReference): During the resolve
7871         phases, create new expressions if we are in a remapping context.
7872         Remove code that dealt with remapping here.
7873
7874         (ParameterReference): same.
7875
7876         (ProxyInstance): New expression, like the `This' expression, but
7877         it is born fully resolved.  We know what we are doing, so remove
7878         the errors that are targeted to user-provided uses of `this'.
7879
7880         * statement.cs (Foreach): our variable is now stored as an
7881         Expression;  During resolution, follow the protocol, dont just
7882         assume it will return this.
7883
7884 2003-08-06  Martin Baulig  <martin@ximian.com>
7885
7886         * support.cs (SeekableStreamReader.cs): New public class.
7887
7888         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7889         SeekableStreamReader instead of the normal StreamReader.
7890
7891 2003-08-04  Martin Baulig  <martin@ximian.com>
7892
7893         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7894         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7895         deambiguate casts and delegate invocations.
7896         (parenthesized_expression): Use the new tokens to ensure this is
7897         not a cast of method invocation.
7898
7899         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7900         when reading a `)' and Deambiguate_CloseParens () was previously
7901         called.
7902
7903         * expression.cs (ParenthesizedExpression): New class.  This is
7904         just used for the CS0075 test.
7905         (Binary.DoResolve): Check for CS0075.   
7906
7907 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7908
7909         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7910         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7911         reference comparison.
7912
7913         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7914         examine the ReturnType for equality - this is necessary in the
7915         cases of implicit and explicit operators whose signature also
7916         includes the return type.
7917
7918 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7919
7920         * namespace.cs: Cache the result of the namespace computation,
7921         instead of computing it every time.
7922
7923 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7924
7925         * decl.cs: Use a global arraylist that we reuse over invocations
7926         to avoid excesive memory consumption.  Reduces memory usage on an
7927         mcs compile by one meg (45 average).
7928
7929         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7930         private, work around that.
7931
7932 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7933
7934         * literal.cs (IntLiteral): Define Zero and One static literals. 
7935
7936         * cs-parser.jay (integer_literal): use static literals to reduce
7937         memory usage for the most used literals (0, 1 and -1).  211kb
7938         reduced in memory usage.
7939
7940         Replace all calls to `new ArrayList' with `new
7941         ArrayList(4)' which is a good average number for most allocations,
7942         and also requires only 16 bytes of memory for its buffer by
7943         default. 
7944
7945         This reduced MCS memory usage in seven megabytes for the RSS after
7946         bootstrapping.
7947
7948 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7949
7950         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7951         handle params methods the correct way by forming only one
7952         applicable set with params and normal methods in them. Earlier we
7953         were looking at params methods only if we found no normal methods
7954         which was not the correct thing to do.
7955
7956         (Invocation.BetterFunction): Take separate arguments indicating
7957         when candidate and the best method are params methods in their
7958         expanded form.
7959
7960         This fixes bugs #43367 and #46199.
7961
7962         * attribute.cs: Documentation updates.
7963
7964         (CheckAttribute): Rename to CheckAttributeTarget.
7965         (GetValidPlaces): Rename to GetValidTargets.
7966
7967         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7968         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7969
7970         Fixes bug #44468.
7971
7972 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
7973
7974         * codegen.cs: Compute IsGeneric correctly.
7975
7976         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
7977         resolution. 
7978
7979         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
7980         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
7981         regressions, and I was chasing more bugs than I required.
7982
7983         * interface.cs: Use expressions for base type names (like classes
7984         and structs have been doing for a while now), and resolve that.
7985         This patch should probably go into head as well.
7986
7987         This makes it one less user of FindType.
7988
7989 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7990
7991         This compiler can not self host currently.  Need to fix that.
7992         
7993         * Makefile: compile to `gmcs.exe'
7994
7995         * driver.cs: Turn on v2 by default on gmcs.
7996
7997         * generic.cs (ConstructedType): Does no longer take a container
7998         type argument;  That will be taken care of later.
7999
8000         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
8001         Use SimpleName to resolve for now, so we can continue the work on
8002         the parser, until we get Type.GetType that understands generics.
8003
8004         (ConstructedType.ToString): Implement
8005
8006         (TypeArguments.Resolve): Resolve the child expressions as types. 
8007         
8008         * cs-parser.jay: Rename interface_constraints to
8009         type_parameter_constraints
8010
8011         (namespace_or_type_name): Only use constructed types for the basic
8012         construction, we will deal with identifier<...> later.
8013
8014         (type/type_name): No longer call DecomposeQI, as
8015         namespace_or_type_name is always decoded now.
8016         
8017 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8018
8019         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8020         closely: we eliminate methods in base types when we have an
8021         applicable method in a top-level type.
8022
8023         Please see section 14.5.5.1 for an exact description of what goes
8024         on. 
8025
8026         This fixes bug #45127 and a host of other related to corlib compilation.
8027
8028         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8029         array is the method corresponding to the top-level type (this is
8030         because of the changes made to icall.c) so we change this
8031         accordingly.
8032
8033         (MethodGroupExpr.Name): This too.
8034
8035         * typemanager.cs (GetElementType): New method which does the right
8036         thing when compiling corlib. 
8037
8038         * everywhere: Make use of the above in the relevant places.
8039
8040 2003-07-22  Martin Baulig  <martin@ximian.com>
8041
8042         * cs-parser.jay (invocation_expression): Moved
8043         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8044         `cast_expression', but create a InvocationOrCast which later
8045         resolves to either an Invocation or a Cast.
8046
8047         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8048         method; call this before EmitStatement() to make sure that this
8049         expression can be used as a statement.
8050
8051         * expression.cs (InvocationOrCast): New class; resolves to either
8052         an Invocation or a Cast.
8053
8054         * statement.cs (StatementExpression): Call ResolveStatement() on
8055         the ExpressionStatement before emitting it.
8056
8057 2003-07-21  Martin Baulig  <martin@ximian.com>
8058
8059         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8060         `ref' and `out' attributes match; fixes #46220.
8061         (MemberAccess.ResolveMemberAccess): You can't reference a type
8062         through an expression; fixes #33180.
8063         (Indexers.GetIndexersForType): Don't return the indexers from
8064         interfaces the class implements; fixes #46502.
8065
8066 2003-07-21  Martin Baulig  <martin@ximian.com>
8067
8068         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8069         CS0661 checks; fixes bug #30442.
8070
8071 2003-07-21  Martin Baulig  <martin@ximian.com>
8072
8073         * decl.cs (AdditionResult): Added `Error'.
8074
8075         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8076
8077         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
8078         cs0031.cs actually work.
8079
8080  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8081  
8082         * cs-parser.jay (namespace_name): do not use
8083         namespace_or_type_name, use qualified_identifier, because
8084         namespace_or_type_name will soon return a composed expression
8085         instead of a string.
8086  
8087         (namespace_or_type_name): Instead of returning a string, now this
8088         production returns an expression.
8089  
8090         * codegen.cs (EmitContext): Setup IsGeneric property based on
8091         whether our DeclSpace is generic, our the method is generic.
8092  
8093         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
8094         the method is generic.
8095  
8096         * cs-parser.jay (type_arguments, opt_type_argument_list,
8097         type_parameters, type_parameter_list, opt_type_parameter_list,
8098         type_parameter,, opt_type_parameter_constraints_clauses,
8099         type_parameter_constraints_clauses,
8100         type_parameter_constraint_clause, type_parameter_constraint,
8101         interface_constraints): Add new production
8102  
8103         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
8104         DeclSpace is generic or not.
8105  
8106         (DeclSpace.SetParameterInfo): New routine, used to set the
8107         parameter info for a type.
8108  
8109         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
8110         returns a GenericTypeExpr
8111  
8112         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
8113         generic, lookup the generic argument.
8114  
8115         * attribute.cs: Do not allow TypeParameterExpressions in
8116         Attributes.
8117  
8118         * class.cs: Do not allow the Main method to be defined in a
8119         Generic container.
8120  
8121         * expression.cs (SizeOf): Do not allow generic types to be used as
8122         arguments to sizeof.
8123  
8124         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
8125         it: whether a type is generic or not.  Only works for types we are
8126         currently building for now.
8127         
8128 2003-07-20  Martin Baulig  <martin@ximian.com>
8129
8130         * namespace.cs: Fixed that bug which caused a crash when compiling
8131         the debugger's GUI.
8132
8133 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8134
8135         * typemanager.cs (LookupTypeReflection): Never expose types which
8136         are NotPublic, NestedPrivate, NestedAssembly, or
8137         NestedFamANDAssem.  We used to return these, and later do a check
8138         that would report a meaningful error, but the problem is that we
8139         would not get the real match, if there was a name override.
8140
8141 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8142
8143         * namespace.cs (Namespace, Name): Do not compute the namespace
8144         name dynamically, compute it in the constructor.  This reduced
8145         memory usage by 1697 KB.
8146
8147         * driver.cs: Use --pause to pause at the end.
8148
8149 2003-07-17  Peter Williams  <peter@newton.cx>
8150
8151         * Makefile: Change the name of the test target so that it doesn't
8152         conflict with the recursive test target.
8153
8154 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8155
8156         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8157         AddressOf): Do not use EmitThis, that was wrong, use the actual
8158         this pointer.
8159
8160 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8161
8162         * class.cs (MethodData.Define): While checking if a method is an
8163         interface implementation, improve the test: If we are not public
8164         (use new test here: use the computed MethodAttributes directly,
8165         instead of the parsed modifier flags) check if the `implementing'
8166         method comes from an interface or not.
8167
8168         * pending.cs (VerifyPendingMethods): Slightly better error
8169         message.
8170
8171         * makefile: add test target that does the mcs bootstrap.
8172
8173 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8174
8175         * interface.cs (Define): Do nothing here since there are no
8176         members to populate etc. Move the attribute emission out of here
8177         since this was just totally the wrong place to put it. Attribute
8178         application happens during the 'Emit' phase, not in the 'Define'
8179         phase.
8180
8181         (Emit): Add this method and move the attribute emission here
8182
8183         * rootcontext.cs (EmitCode): Call the Emit method on interface
8184         types too.
8185
8186 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8187
8188         * expression.cs (OverloadResolve): Report error only if Location
8189         is not 'Null' which means that there was a probe going on.
8190
8191 2003-07-14  Martin Baulig  <martin@ximian.com>
8192
8193         * expression.cs (ConditionalLogicalOperator): New public class to
8194         implement user defined conditional logical operators.
8195         This is section 14.11.2 in the spec and bug #40505.
8196
8197 2003-07-14  Martin Baulig  <martin@ximian.com>
8198
8199         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8200
8201 2003-07-14  Martin Baulig  <martin@ximian.com>
8202
8203         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8204
8205         * ecore.cs (IVariable.VerifyFixed): New interface method.
8206
8207         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8208         operator, check whether the variable is actually fixed.  Fixes bug
8209         #36055.  Set a variable definitely assigned when taking its
8210         address as required by the spec.
8211
8212         * statement.cs (LocalInfo.IsFixed): New field.
8213         (LocalInfo.MakePinned): Set `IsFixed' to true.
8214
8215 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8216
8217         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8218         for .ctors, ensure that we only ask for members declared in the
8219         attribute type (BindingFlags.DeclaredOnly).
8220
8221         Fixes bug #43632.
8222
8223         * expression.cs (Error_WrongNumArguments): Report error 1501
8224         correctly the way CSC does.
8225
8226 2003-07-13  Martin Baulig  <martin@ximian.com>
8227
8228         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8229         lookup on the fully qualified name, to make things like "X.X" work
8230         where "X.X" is a fully qualified type name, but we also have a
8231         namespace "X" in the using list.  Fixes #41975.
8232
8233 2003-07-13  Martin Baulig  <martin@ximian.com>
8234
8235         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8236         function. If we're a CompoundAssign, we need to create an embedded
8237         CompoundAssign, not an embedded Assign.
8238         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8239         Fixes #45854.
8240
8241 2003-07-13  Martin Baulig  <martin@ximian.com>
8242
8243         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8244         work to fix bug #46088.
8245
8246 2003-07-13  Ravi Pratap <ravi@ximian.com>
8247
8248         * class.cs (Operator.Emit): Do not emit attributes here - it is
8249         taken care of by the Method class that we delegate too. This takes
8250         care of bug #45876.
8251
8252 2003-07-10  Martin Baulig  <martin@ximian.com>
8253
8254         * expression.cs (TypeOfVoid): New class.
8255         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8256
8257 2003-07-10  Martin Baulig  <martin@ximian.com>
8258
8259         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8260         bug #35957.
8261
8262 2003-07-10  Martin Baulig  <martin@ximian.com>
8263
8264         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8265         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8266
8267         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8268
8269         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8270
8271 2003-07-10  Martin Baulig  <martin@ximian.com>
8272
8273         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8274         of decimal.  Fixes #42850.
8275
8276         NOTE: I also fixed the created byte blob, but this doesn't work on
8277         the MS runtime and csc never produces any byte blobs for decimal
8278         arrays.
8279
8280 2003-07-10  Martin Baulig  <martin@ximian.com>
8281
8282         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8283         structs; fixes #32068.
8284         (Block.AddChildVariableNames): Fixed #44302.
8285
8286 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8287
8288         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8289
8290 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8291
8292         * attribute.cs: And this test is onger needed.
8293
8294 2003-07-08  Martin Baulig  <martin@ximian.com>
8295
8296         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8297         inaccessible types.  Fixes #36313.
8298
8299         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8300
8301         * namespace.cs (NamespaceEntry): Create implicit entries for all
8302         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8303         implicit entries for N1.N2 and N1.
8304
8305 2003-07-08  Martin Baulig  <martin@ximian.com>
8306
8307         Rewrote the handling of namespaces to fix a lot of the issues
8308         wrt. `using' aliases etc.
8309
8310         * namespace.cs (Namespace): Splitted this class into a
8311         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8312
8313         * typemanager.cs (TypeManager.IsNamespace): Removed.
8314         (TypeManager.ComputeNamespaces): Only compute namespaces from
8315         loaded assemblies here, not the namespaces from the assembly we're
8316         currently compiling.
8317
8318 2003-07-08  Martin Baulig  <martin@ximian.com>
8319
8320         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8321
8322 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8323
8324         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8325         already fixed it.  
8326
8327         I thought about the memory savings here, but LookupTypeReflection
8328         is used under already very constrained scenarios.  Compiling
8329         corlib or mcs only exposes one hit, so it would not really reduce
8330         any memory consumption.
8331
8332 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8333
8334         * typemanager.cs: fixes bug #45889 by only adding public types from
8335         other assemblies to the list of known types.
8336
8337 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8338
8339         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8340         on the type we resolved.
8341
8342 2003-07-05  Martin Baulig  <martin@ximian.com>
8343
8344         * pending.cs (PendingImplementation.ParentImplements): Don't
8345         create the proxy if the parent is abstract.
8346
8347         * class.cs (TypeContainer.DefineIndexers): Process explicit
8348         interface implementations first.  Fixes #37714.
8349
8350 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8351
8352         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8353         defined recursively;  but since we modify the input parameters
8354         (left is set to `this' temporarily), we reset this value if the
8355         left_is_explicit is false, which gives the original semantics to
8356         the code.  
8357
8358         * literal.cs (NullPointer): new class used to represent a null
8359         literal in a pointer context.
8360
8361         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8362         type is a pointer, use a NullPointer object instead of a
8363         NullLiteral.   Closes 43687
8364
8365         (ExplicitConversion): Convert pointer values using
8366         the conv opcode to the proper type.
8367
8368         * ecore.cs (New): change ValueTypeVariable property into a method,
8369         that returns whether the valuetype is suitable for being used.
8370
8371         * expression.cs (Binary.DoNumericPromotions): Only return if we
8372         the int constant was a valid uint, and we can return both left and
8373         right as uints.  If not, we continue processing, to trigger the
8374         type conversion.  This fixes 39018.
8375
8376         * statement.cs (Block.EmitMeta): During constant resolution, set
8377         the CurrentBlock property on the emitcontext, so that we resolve
8378         constants propertly.
8379
8380 2003-07-02  Martin Baulig  <martin@ximian.com>
8381
8382         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8383         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8384
8385         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8386         than emitting it here.
8387
8388         * statement.cs: Fixed some more flow analysis bugs.
8389
8390 2003-07-02  Martin Baulig  <martin@ximian.com>
8391
8392         * class.cs (MethodData.Define): When implementing interface
8393         methods, set Final unless we're Virtual.
8394
8395         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8396         check work for interface methods.
8397
8398 2003-07-01  Martin Baulig  <martin@ximian.com>
8399
8400         * ecore.cs (EmitContext.This): Replaced this property with a
8401         GetThis() method which takes a Location argument.  This ensures
8402         that we get the correct error location for a CS0188.
8403
8404 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8405
8406         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8407         ImplicitStandardConversion.
8408
8409         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8410
8411 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8412
8413         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8414         optimization.
8415
8416 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8417
8418         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8419         constructors.
8420
8421         (MethodData.Define): Turn off initlocals for unsafe methods.
8422
8423 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8424
8425         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8426         complete;  Fixes #37521.
8427
8428         * delegate.cs: Use Modifiers.TypeAttr to compute the
8429         TypeAttributes, instead of rolling our own.  This makes the flags
8430         correct for the delegates.
8431
8432 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8433
8434         * class.cs (Constructor.Define): Set the private flag for static
8435         constructors as well.
8436
8437         * cs-parser.jay (statement_expression): Set the return value to
8438         null, to avoid a crash when we catch an error.
8439
8440 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8441
8442         * cs-parser.jay: Applied patch from Jackson that adds support for
8443         extern and unsafe modifiers to destructor declarations.
8444
8445         * expression.cs: Report error 21 if the user is trying to index a
8446         System.Array.
8447
8448         * driver.cs: Add an error message, suggested by the bug report.
8449
8450         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8451         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8452
8453 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8454
8455         * namespace.cs: Add some information to reduce FAQs.
8456
8457 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8458
8459         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8460         underlying enumeration types.  Fixes #43915.
8461
8462         * expression.cs: Treat ushort/short as legal values to be used in
8463         bitwise operations.
8464
8465 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8466
8467         * delegate.cs: transfer custom attributes for paramenters from
8468         the delegate declaration to Invoke and BeginInvoke.
8469
8470 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8471
8472         * attribute.cs: handle custom marshalers and emit marshal info
8473         for fields, too.
8474
8475 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8476
8477         * makefile.gnu: Added anonymous.cs to the compiler sources.
8478
8479 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8480
8481         * iterators.cs: Change the name of the proxy class to include two
8482         underscores.
8483
8484         * cs-parser.jay: Update grammar to include anonymous methods.
8485
8486         * anonymous.cs: new file.
8487
8488 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8489
8490         * class.cs (Field.Define): Add missing test for pointers and
8491         safety. 
8492
8493 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8494
8495         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8496         we use the stobj opcode.
8497
8498         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8499         since it wasn't the correct fix. 
8500
8501         It still is puzzling that we are required to use stobj for IntPtr
8502         which seems to be a ValueType.
8503
8504 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8505
8506         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8507         during regular simple name resolution.   Now, the trick is that
8508         instead of returning for processing the simplename, we do a
8509         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8510         contextual lookup type).   If a match is found, return that, if
8511         not, return for further composition.
8512
8513         This fixes long-standing 30485.
8514
8515         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8516         using the address to initialize an object, do an Stobj instead of
8517         using the regular Stelem.
8518
8519         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8520         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8521         Because if we are a BaseIndexerAccess that value will be true.
8522         Fixes 43643.
8523
8524         * statement.cs (GotoCase.Resolve): Return after reporting an
8525         error, do not attempt to continue. 
8526
8527         * expression.cs (PointerArithmetic.Emit): If our operand is a
8528         long, convert our constants to match the operand before
8529         multiplying.  Convert to I type before adding.   Fixes 43670.
8530
8531 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8532
8533         * enum.cs (ImplicitConversionExists) : Rename to
8534         ImplicitEnumConversionExists to remove ambiguity. 
8535
8536         * ecore.cs (NullCast): New type of cast expression class which
8537         basically is very similar to EmptyCast with the difference being
8538         it still is a constant since it is used only to cast a null to
8539         something else
8540         (eg. (string) null)
8541
8542         * convert.cs (ImplicitReferenceConversion): When casting a null
8543         literal, we return a NullCast.
8544
8545         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8546         should be around anymore.
8547
8548         The renaming (reported was slightly wrong). Corrections:
8549
8550         ConvertImplicitStandard -> ImplicitConversionStandard
8551         ConvertExplicitStandard -> ExplicitConversionStandard
8552
8553         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8554         before passing them in !
8555
8556         * convert.cs (ImplicitConversionStandard): When comparing for
8557         equal expr and target types, ensure that expr is not a
8558         NullLiteral.
8559
8560         In general, we must not be checking (expr_type ==
8561         target_type) in the top level conversion methods
8562         (ImplicitConversion, ExplicitConversion etc). This checking is
8563         done in the methods that they delegate to.
8564
8565 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8566
8567         * convert.cs: Move Error_CannotConvertType,
8568         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8569         ImplicitNumericConversion, ImplicitConversionExists,
8570         ImplicitUserConversionExists, StandardConversionExists,
8571         FindMostEncompassedType, FindMostSpecificSource,
8572         FindMostSpecificTarget, ImplicitUserConversion,
8573         ExplicitUserConversion, GetConversionOperators,
8574         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8575         TryImplicitIntConversion, Error_CannotConvertImplicit,
8576         ConvertImplicitRequired, ConvertNumericExplicit,
8577         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8578         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8579         its own file.
8580
8581         Perform the following renames:
8582
8583         StandardConversionExists -> ImplicitStandardConversionExists
8584         ConvertImplicit -> ImplicitConversion
8585         ConvertImplicitStandard -> ImplicitStandardConversion
8586         TryImplicitIntConversion -> ImplicitIntConversion
8587         ConvertImplicitRequired -> ImplicitConversionRequired
8588         ConvertNumericExplicit -> ExplicitNumericConversion
8589         ConvertReferenceExplicit -> ExplicitReferenceConversion
8590         ConvertExplicit -> ExplicitConversion
8591         ConvertExplicitStandard -> ExplicitStandardConversion
8592
8593 2003-05-19  Martin Baulig  <martin@ximian.com>
8594
8595         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8596         (TypeInfo): Added support for structs having structs as fields.
8597
8598         * ecore.cs (FieldExpr): Implement IVariable.
8599         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8600         VariableInfo for the field.
8601
8602 2003-05-18  Martin Baulig  <martin@ximian.com>
8603
8604         * expression.cs (This.DoResolve): Report a CS0027 if we're
8605         emitting a field initializer.
8606
8607 2003-05-18  Martin Baulig  <martin@ximian.com>
8608
8609         * expression.cs (This.ResolveBase): New public function.
8610         (This.DoResolve): Check for CS0188.
8611
8612         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8613         This.Resolve().
8614
8615         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8616         `instance_expression' to null if we don't have any non-static
8617         methods.
8618
8619 2003-05-18  Martin Baulig  <martin@ximian.com>
8620
8621         Reworked the way how local variables and parameters are handled by
8622         the flow analysis code.
8623
8624         * statement.cs (TypeInfo, VariableMap): New public classes.
8625         (VariableInfo): New public class.  This is now responsible for
8626         checking whether a variable has been assigned.  It is used for
8627         parameters and local variables.
8628         (Block.EmitMeta): Take the InternalParameters as argument; compute
8629         the layout of the flow vectors here.
8630         (Block.LocalMap, Block.ParameterMap): New public properties.
8631         (FlowBranching): The .ctor doesn't get the InternalParameters
8632         anymore since Block.EmitMeta() now computes the layout of the flow
8633         vector.
8634         (MyStructInfo): This class is now known as `StructInfo' and nested
8635         in `TypeInfo'; we don't access this directly anymore.
8636
8637         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8638         property and removed IsAssigned(), IsFieldAssigned(),
8639         SetAssigned() and SetFieldAssigned(); we now call them on the
8640         VariableInfo so we don't need to duplicate this code everywhere.
8641
8642         * expression.cs (ParameterReference): Added `Block block' argument
8643         to the .ctor.
8644         (LocalVariableReference, ParameterReference, This): The new
8645         VariableInfo class is now responsible for all the definite
8646         assignment stuff.
8647
8648         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8649         IsParameterAssigned, SetParameterAssigned): Removed.
8650
8651 2003-05-18  Martin Baulig  <martin@ximian.com>
8652
8653         * typemanager.cs (InitCoreTypes): Try calling
8654         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8655         the 3-args-version.  Corlib now also needs our `void_type'.
8656         (GetMethod): Added overloaded version which takes an optional
8657         `bool report_errors' to allow lookups of optional methods.
8658
8659 2003-05-12  Martin Baulig  <martin@ximian.com>
8660
8661         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8662         only used for locals and not for parameters.
8663
8664 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8665
8666         * support.cs (InternalParameters.ParameterType): Return the
8667         ExternalType of the parameter.
8668
8669         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8670         they were unused.
8671
8672 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8673
8674         * class.cs (MethodData.Define): Do not set the `newslot' on
8675         interface members, if they are also flagged as "override".
8676
8677         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8678         better code for ++i and i++.  This only works for static fields
8679         and local variables.
8680
8681         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8682         want to pull the DeclSpace out of the builder_to_declspace instead
8683         of the TypeBuilder (like in TypeContainer.FindMembers).
8684
8685         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8686         instead of LookupTypeContainer.  Fixes the crash on .NET for
8687         looking up interface members.
8688
8689         * const.cs: Create our own emit context during the Definition
8690         stage, so that constants are evaluated in the proper context, when
8691         a recursive definition happens.
8692
8693 2003-05-11  Martin Baulig  <martin@ximian.com>
8694
8695         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8696         new block for a switch section.
8697         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8698         the adding/lookup in the switch block.  Fixes #39828.
8699
8700 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8701
8702         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8703         functionality: I needed to convert the data after I had performed
8704         the add/sub operation into the operands type size.
8705
8706         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8707         pass the type for the box operation, otherwise the resulting
8708         object would have been of type object.
8709
8710         (BoxedCast): Add constructor to specify the type to box as.
8711
8712 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8713
8714         * iterators.cs: I was reusing the `count' variable inadvertently,
8715         take steps to not allow this to happen.
8716
8717 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8718
8719         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8720         by creating an array at the point where the params starts and
8721         putting all those arguments there, then adjusting the size of the
8722         array.
8723
8724 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8725
8726         * expression.cs (New.AddressOf): Implement interface
8727         IMemoryLocation.  This is used when the `new' operator is used in
8728         the context of an invocation to a method on a value type.
8729
8730         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8731         example. 
8732
8733         * namespace.cs: Also check the using aliases here.
8734
8735         * driver.cs: Move the test for using validity after the types have
8736         been entered, so we do a single pass that also includes the using
8737         aliases. 
8738
8739         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8740         in the regular case.   CreateSiblingForFinally is doing extra
8741         error checking.
8742
8743         * attribute.cs (GetAttributeArgumentExpression): Store the result
8744         on an out value, and use the return value to indicate failure
8745         instead of using null (which is a valid return for Constant.GetValue).
8746
8747         * statement.cs: Perform the analysis flow for the increment
8748         portion after the statement, because this will be the real flow of
8749         execution.  Fixes #42385
8750
8751         * codegen.cs (EmitContext.EmitArgument,
8752         EmitContext.EmitStoreArgument): New helper functions when the
8753         RemapToProxy flag is set.
8754
8755         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8756         function.
8757
8758         Add support for remapping parameters. 
8759
8760         * iterators.cs: Propagate parameter values;  Store parameter
8761         values in the proxy classes.
8762
8763 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8764
8765         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8766         need a proxy reference;  I do not know what I was thinking
8767
8768         * cs-parser.jay (constructor_initializer): catch another error,
8769         and display nice message.
8770
8771         (field_declaration): catch void field declaration
8772         to flag a better error. 
8773
8774         * class.cs (MemberBase.CheckBase): Report an error instead of a
8775         warning if a new protected member is declared in a struct. 
8776         (Field.Define): catch the error of readonly/volatile.
8777
8778         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8779
8780         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8781         volatile variable is taken
8782
8783 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8784
8785         * statement.cs (Fixed.Resolve): Report an error if we are not in
8786         an unsafe context.
8787
8788 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8789
8790         * typemanager.cs: reuse the code that handles type clashes for
8791         delegates and enumerations.
8792
8793         * class.cs (Report28): Always report.
8794
8795         * expression.cs (EncodeAsAttribute): Allow nulls here.
8796
8797 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8798
8799         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8800         the functionality for testing whether an expression is valid for
8801         an attribute here.  Also handle the case of arrays of elements
8802         being stored. 
8803
8804         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8805         encoding a linear array into an array of objects that are suitable
8806         to be passed to an CustomAttributeBuilder.
8807
8808         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8809
8810         * ecore.cs: (FieldExpr): Handle field remapping here.
8811
8812         * iteratators.cs: Pass the instance variable (if the method is an
8813         instance method) to the constructors, so we can access the field
8814         variables on the class.
8815
8816         TODO: Test this with structs.  I think the THIS variable on
8817         structs might have to be a pointer, and not a refenrece
8818
8819 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8820
8821         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8822         local variables to fields in a proxy class.
8823
8824         * iterators.cs (PopulateProxy): Rename our internal fields to
8825         <XXX>.  
8826         Create a <THIS> field if we are an instance method, so we can
8827         reference our parent container variables.
8828         (MapVariable): Called back from the EmitContext code to enter a
8829         new variable to field mapping into the proxy class (we just create
8830         a FieldBuilder).
8831
8832         * expression.cs
8833         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8834         for using the remapped locals to fields.
8835
8836         I placed the code here, because that gives the same semantics to
8837         local variables, and only changes the Emit code.
8838
8839         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8840         statements inside iterators.
8841         (VariableInfo): Add a FieldBuilder for the cases when we are
8842         remapping local variables to fields in a proxy class
8843
8844         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8845         current_block != null.
8846
8847         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8848         not cope with strings, as it has been moved to the
8849         TableSwitchEmit.  Fixed bug in switch generation.
8850
8851         * expression.cs (New.DoResolve): Provide more context for the user
8852         when reporting an error.
8853
8854         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8855         pointers. 
8856
8857         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8858         check the permissions for it.  Note than in a type-resolution
8859         context the check was already present in DeclSpace.ResolveType,
8860         but was missing from the MemberAccess.
8861
8862         (ArrayCreation.CheckIndices): warn if the user has
8863         more nested levels of expressions, but there are no more
8864         dimensions specified.  Avoids crash on bug 41906.
8865
8866 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8867
8868         * statement.cs (Block): replace Implicit bool, for a generic
8869         flags.   
8870         New flag: `Unchecked'.  This is used during the EmitMeta phase
8871         (which is out-of-line with the regular Resolve/Emit process for a
8872         statement, as this is done ahead of time, but still gets a chance
8873         to call constant resolve).
8874
8875         (Block.Flags): new enum for adding a new flag.
8876
8877         (Block.EmitMeta): track the state of unchecked.
8878
8879         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8880         to enable constant resolution to work there as well.
8881
8882 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8883
8884         * typemanager.cs (ienumerable_type): Also look up
8885         System.Collections.IEnumerable. 
8886
8887 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8888
8889         TODO: Test more than one conditional per method.
8890
8891         * class.cs (Indexer.Define): Report the location where the user is
8892         referencing the unsupported feature.
8893
8894         (MethodData): Overload the use of `conditionals' to
8895         minimize the creation of needless ArrayLists.   This saves roughly
8896         212kb on my machine.
8897
8898         (Method): Implement the new IIteratorContainer interface.
8899         (Method.SetYields): Implement the method by setting the ModFlags
8900         to contain METHOD_YIELDS.
8901
8902         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8903         which just got set to null.
8904
8905         * iterators.cs: New file.
8906
8907         (Yield, YieldBreak): New statements.
8908
8909         * statement.cs (Return.Resolve): Flag an error if we are used in
8910         an iterator method.
8911
8912         * codegen.cs (InIterator): New flag set if the code is being
8913         compiled in an iterator method.
8914
8915         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8916         internal modifier, and we just use it to avoid adding extra
8917         fields, as this is seldom used.  
8918
8919         * cs-parser.jay: Add yield_statement (yield and yield break).
8920
8921         * driver.cs: New flag -v2 to turn on version 2 features. 
8922
8923         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8924         hashtable when v2 is enabled.
8925
8926 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8927
8928         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8929         there is already a namespace defined with this name.
8930
8931         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8932         people upgraded their corlibs.
8933
8934         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8935         always use fully qualified types, no need to use the compiler
8936         front end.
8937
8938         (TypeManager.IsNamespace): Use binarysearch.
8939
8940         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8941         AddDelegate): I did not quite use the new IsValid API properly: I
8942         have to pass the short-name and the fullname.  I was passing only
8943         the basename instead of the fullname sometimes. 
8944
8945         (TypeContainer.DefineType): call NamespaceClash.
8946
8947         * interface.cs (Interface.DefineType): use NamespaceClash before
8948         defining the type.
8949
8950         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8951         defining the type.
8952
8953         * enum.cs: (Enum.DefineType): use NamespaceClash before
8954         defining the type.
8955
8956         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8957         speed increase.  First, use the negative_hits cache when we get a
8958         negative.  Second, add the type with its full original name
8959         instead of the new . and + encoded name (reflection uses + to
8960         separate type from a nested type).  Use LookupTypeReflection
8961         directly which bypasses the type->name hashtable (that we already
8962         know does not contain the type.
8963
8964         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8965         location/container type. 
8966
8967         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8968
8969 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8970
8971         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8972
8973         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8974         method is being referenced in the method group from a static
8975         context, and report error 120 if so.
8976
8977         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8978         Error118. 
8979
8980         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8981         is created, we create the A namespace).
8982
8983         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8984         Fixes #41591
8985
8986 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
8987
8988         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8989         invocation to ModuleBuilder.GetType with the same values will
8990         return a new type instance, so we need to cache its return
8991         values. 
8992
8993         * expression.cs (Binary.ResolveOperator): Only allow the compare
8994         operators on enums if they are of the same type.
8995
8996         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8997         types of ValueType on their own case.  Before we were giving them
8998         the same treatment as objects.
8999
9000         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9001         fullname.  Short name is used to compare against container name.
9002         Fullname is used to check against defined namespace names.
9003
9004         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9005         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9006
9007         (Method.CheckBase): Call parent.
9008         (MemberBase.CheckBase): Check for protected members on sealed
9009         classes.
9010         (PropertyBase.CheckBase): Call parent.
9011         (Field.Define): Call parent.
9012
9013         * report.cs: Negative error codes are now mapped to 8000 - code,
9014         so that the display is render more nicely.
9015
9016         * typemanager.cs: Do not use try/catch, instead report a regular
9017         error. 
9018
9019         (GetPointerType, GetReferenceType): These methods provide
9020         mechanisms to obtain the T* and T& from a T.  We had the code
9021         previously scattered around the code base, and it also used
9022         TypeManager.LookupType that would go through plenty of caches.
9023         This one goes directly to the type source.
9024
9025         In some places we did the Type.GetType followed by
9026         ModuleBuilder.GetType, but not in others, so this unifies the
9027         processing as well.
9028
9029         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9030         statements now that we have namespace information.
9031
9032         * typemanager.cs (IsNamespace): New method, returns whether the
9033         string presented is a namespace or not.
9034
9035         (ComputeNamespaces): New public entry point, computes the list of
9036         available namespaces, using the GetNamespaces API call in Mono, or
9037         the slower version in MS.NET.   
9038
9039         Now before we start the semantic analysis phase, we have a
9040         complete list of namespaces including everything that the user has
9041         provided.
9042
9043         Deleted old code to cache namespaces in .nsc files.
9044
9045 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9046
9047         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9048         class/struct location definition Location for the implicit
9049         constructor location.
9050
9051         (Operator.Define): Use the location of the operator for the
9052         implicit Method definition.
9053
9054         (Constructor.Emit): use the constructor location for the implicit
9055         base initializer constructor.
9056
9057         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9058         and the Expression class now contains two new methods:
9059
9060         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9061         isolate type lookup from the rest of the resolution process.
9062
9063         Since we use Expressions to hold type definitions due to the way
9064         we parse the input we have historically overloaded Resolve to
9065         perform the Type lookups if a special flag is passed.  Now this is
9066         eliminated and two methods take their place. 
9067
9068         The differences in the two methods between xStep and xTerminal is
9069         that xStep is involved in our current lookup system that uses
9070         SimpleNames to compose a name, while xTerminal is used just to
9071         catch the case where the simplename lookup failed.
9072
9073 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9074
9075         * expression.cs (ResolveMemberAccess): Remove redundant code.
9076         TypeExpr expressions are always born fully resolved.
9077
9078         * interface.cs (PopulateMethod): Do not lookup the types twice.
9079         We were doing it once during SemanticAnalysis and once during
9080         PopulateMethod.
9081
9082         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9083         in local variable type definitions, were being returned as a
9084         SimpleName (we decomposed everything into a string), that is
9085         because primary_expression was being used instead of a type in the
9086         grammar (reduce/reduce conflicts).
9087
9088         The part that was wrong is that we converted the expression into a
9089         string (an oversimplification in one hand, compounded with primary
9090         expressions doing string concatenation).
9091
9092         So things like:
9093
9094         A.B.C [] x;
9095
9096         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9097         using clauses from working on this particular context.  And a type
9098         was being matched directly against "A.B.C[]".
9099
9100         We now use the correct approach, and allow for ComposedCast to be
9101         part of the unary expression.  So the "A.B.C []" become a composed
9102         cast of "A.B.C" (as a nested group of MemberAccess with a
9103         SimpleName at the end) plus the rank composition "[]". 
9104
9105         Also fixes 35567
9106
9107 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9108
9109         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9110         for the access level checking.
9111
9112         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9113         `TypeContainer container', because I kept getting confused when I
9114         was debugging this code.
9115
9116         * expression.cs (Indexers): Instead of tracking getters/setters,
9117         we now track them in parallel.  We create one arraylist less, but
9118         most importantly it is possible now for the LValue code to find a
9119         matching get for a set.
9120
9121         (IndexerAccess.DoResolveLValue): Update the code.
9122         GetIndexersForType has been modified already to extract all the
9123         indexers from a type.  The code assumed it did not.
9124
9125         Also make the code set the correct return type for the indexer.
9126         This was fixed a long time ago for properties, but was missing for
9127         indexers.  It used to be void_type.
9128
9129         (Binary.Emit): Test first for doubles instead of
9130         floats, as they are more common.
9131
9132         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9133         when dealing with floats and the <=, >= operators.  This fixes bug
9134         #39314 
9135
9136         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9137         to load the array value by emitting a load on the foreach variable
9138         type.  This was incorrect.  
9139
9140         We now emit the code to load an element using the the array
9141         variable type, and then we emit the conversion operator.
9142
9143         Fixed #40176
9144
9145 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9146
9147         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9148
9149 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9150
9151         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9152         test for protection before we test for signatures. 
9153
9154         (MethodSignature.ToString): implement.
9155
9156         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9157         to the case where we reduced into a LongConstant.
9158
9159         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9160         depend on whether the information is acurrate, because the
9161         Microsoft runtime will always claim that the array type is public,
9162         regardless of the real state.
9163
9164         If the type is a pointer, another problem happens: the type is
9165         reported as non-public in Microsoft.  
9166
9167         In both cases we have to call CheckAccessLevel recursively with
9168         the underlying type as the argument to be tested.
9169
9170 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9171
9172         * assign.cs (Assign.Emit): If we are dealing with a compound
9173         assignment expression, we should use the code path that stores the
9174         intermediate result in a temporary value.  This fixes #40903.
9175
9176         *expression.cs (Indirection.ToString): Provide ToString method for
9177         debugging. 
9178
9179 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9180
9181         * class.cs: Null out fields holding references to Block objects so
9182         they can be garbage collected.
9183
9184         * expression.cs (OverloadResolve): Remove unused local.
9185
9186 2003-04-07  Martin Baulig  <martin@ximian.com>
9187
9188         * codegen.cs (EmitContext.CurrentFile): New public field.
9189         (EmitContext.Mark): Use the CurrentFile to check whether the
9190         location is in the correct file.
9191         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9192
9193 2003-04-07  Martin Baulig  <martin@ximian.com>
9194
9195         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9196
9197         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9198         location.  [FIXME: The location argument which gets passed to this
9199         method is sometimes wrong!]
9200
9201 2003-04-07  Nick Drochak <ndrochak@gol.com>
9202
9203         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9204
9205 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9206
9207         * expression.cs (Indirection.EmitAssign): We were using the
9208         temporary, but returning immediately instead of continuing the
9209         EmitAssing flow.
9210
9211 2003-04-06  Martin Baulig  <martin@ximian.com>
9212
9213         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9214         if it's a nested child, but also deriving from the outer class.
9215         See test 190.cs.
9216
9217         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9218         nested child, but also deriving from the outer class.  See
9219         test-190.cs.
9220         (FilterWithClosure): We may access private members of the outer
9221         class if we're a nested child and deriving from the outer class.
9222         (RealMemberLookup): Only set `closure_private_ok' if the
9223         `original_bf' contained BindingFlags.NonPublic.
9224
9225 2003-04-05  Martin Baulig  <martin@ximian.com>
9226
9227         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
9228         probe if its a type parameter, and if so, flag an error.
9229
9230         * decl.cs: Move here the SetParameterInfo code from class.cs.
9231         Handle IsGeneric here.
9232
9233         Handle a variety of errors in the parameter info definition.
9234
9235         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
9236         type parameters here.
9237
9238         * cs-parser.jay (class_declaration): report errors for parameters
9239         here as well.
9240
9241 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
9242
9243         * generic.cs: New file, contains support code for generics.
9244
9245         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
9246         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
9247
9248         Update parser for the above removals.
9249
9250         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
9251         now taken care of in the parser.
9252
9253 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9254
9255         * class.cs (Event.Define): Do not allow abstract events to have
9256         initializers. 
9257
9258 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9259
9260         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9261         block in event declarations.
9262
9263         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9264         value type, get its address.
9265
9266         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9267         leaving a class on the stack instead of a boolean value (int
9268         0/1).  Change the code so we compare against null, and then the
9269         result against zero.
9270
9271         * class.cs (TypeContainer.GetClassBases): We were checking for the
9272         parent class being sealed too late.
9273
9274         * expression.cs (Binary.Emit): For <= and >= when dealing with
9275         floating point values, use cgt.un and clt.un instead of cgt and
9276         clt alone.
9277
9278 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9279
9280         * statement.cs: Apply the same optimization as MS: skip the 
9281         GetEnumerator returning an IEnumerator, and use the one returning a 
9282         CharEnumerator instead. This allows us to avoid the try-finally block 
9283         and the boxing.
9284
9285 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9286
9287         * cs-parser.jay: Attributes cannot be applied to
9288                          namespaces. Fixes #40473
9289
9290 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9291
9292         * class.cs:
9293         (Add*): check if the name is valid using the full name for constants,
9294         fields, properties and events.
9295
9296 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9297
9298         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9299         char constants to be part of the enumeration.
9300
9301         * expression.cs (Conditional.DoResolve): Add support for operator
9302         true. Implements the missing functionality from 14.12
9303
9304         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9305         operator true/false as required by the spec.
9306
9307         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9308         implicit conversion to boolean.
9309
9310         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9311         also one where the type implements `operator true'. 
9312
9313         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9314         get an expression that will invoke operator true based on an
9315         expression.  
9316
9317         (GetConversionOperators): Removed the hack that called op_True
9318         here.  
9319
9320         (Expression.ResolveBoolean): Move this from Statement.
9321
9322 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9323
9324         * ecore.cs (FieldExpr): do not allow initialization of initonly
9325         fields on derived classes
9326
9327 2003-03-13  Martin Baulig  <martin@ximian.com>
9328
9329         * statement.cs (Block.Emit): Call ig.BeginScope() and
9330         ig.EndScope() when compiling with debugging info; call
9331         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9332
9333 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9334
9335         * expression.cs (Indexers): Do not construct immediately, allow
9336         for new members to be appended as we go.  Fixes 38143
9337
9338 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9339
9340         * expression.cs: save/restore context when resolving an unchecked
9341         expression.
9342
9343 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9344
9345         * cfold.cs: Catch division by zero in modulus operator during
9346         constant folding.
9347
9348 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9349
9350         * interface.cs (Interface.DefineMembers): Avoid defining members
9351         twice. 
9352
9353 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9354
9355         * driver.cs: handle the +/- options for -noconfig
9356
9357         * statement.cs (Unckeched.Resolve): Also track the state of
9358         unchecked in the Resolve phase.
9359
9360 2003-02-27  Martin Baulig  <martin@ximian.com>
9361
9362         * ecore.cs (Expression.MemberLookup): Don't create a
9363         MethodGroupExpr for something which is not a method.  Fixes #38291.
9364
9365 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9366
9367         * class.cs (MemberBase.CheckParameters): Also check that the type
9368         is unmanaged if it is a pointer.
9369
9370         * expression.cs (SizeOf.Resolve): Add location information.
9371
9372         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9373         a managed type is declared.
9374
9375         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9376         parameter modifiers as well.  Fixes bug 38606
9377
9378         * class.cs: Very sad.  Am backing out the speed up changes
9379         introduced by the ArrayList -> Array in the TypeContainer, as they
9380         were not actually that much faster, and introduced a bug (no error
9381         reports on duplicated methods).
9382
9383         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9384         source first, this will guarantee that we have a valid expression
9385         before calling in lower levels functions that will require a
9386         resolved object.  Then use this original_source in the
9387         target.ResolveLValue instead of the original source that was
9388         passed to us.
9389
9390         Another change.  Use target.Resolve instead of LValueResolve.
9391         Although we are resolving for LValues, we will let the Assign code
9392         take care of that (it will be called again from Resolve).  This
9393         basically allows code like this:
9394
9395         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9396         class Y { void A (X x) { x [0] += o; }
9397
9398         The problem was that the indexer was trying to resolve for
9399         set_Item (idx, object o) and never finding one.  The real set_Item
9400         was set_Item (idx, X).  By delaying the process we get the right
9401         semantics. 
9402
9403         Fixes bug 36505
9404
9405 2003-02-23  Martin Baulig  <martin@ximian.com>
9406
9407         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9408         while calling DoEmit ().
9409
9410         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9411         source files; if you use the #line directive inside a method, the
9412         compiler stops emitting line numbers for the debugger until it
9413         reaches the end of the method or another #line directive which
9414         restores the original file.
9415
9416 2003-02-23  Martin Baulig  <martin@ximian.com>
9417
9418         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9419
9420 2003-02-23  Martin Baulig  <martin@ximian.com>
9421
9422         * statement.cs (Block.AddChildVariableNames): We need to call this
9423         recursively, not just for our immediate children.
9424
9425 2003-02-23  Martin Baulig  <martin@ximian.com>
9426
9427         * class.cs (Event.Define): Always make the field private, like csc does.
9428
9429         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9430         actually work, fixes bug #37521.
9431
9432 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9433
9434         * delegate.cs: When creating the various temporary "Parameters"
9435         classes, make sure that we call the ComputeAndDefineParameterTypes
9436         on those new parameters (just like we do with the formal ones), to
9437         allow them to be resolved in the context of the DeclSpace.
9438
9439         This fixes the bug that Dick observed in Bugzilla #38530.
9440
9441 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9442
9443         * expression.cs (ResolveMemberAccess): When resolving a constant,
9444         do not attempt to pull a constant if the value was not able to
9445         generate a valid constant.
9446
9447         * const.cs (LookupConstantValue): Do not report more errors than required.
9448
9449 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9450
9451         * expression.cs: fixes bug #38328.
9452
9453 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9454
9455         * class.cs: Changed all the various members that can be part of a
9456         class from being an ArrayList to be an Array of the right type.
9457         During the DefineType type_list, interface_list, delegate_list and
9458         enum_list are turned into types, interfaces, delegates and enums
9459         arrays.  
9460
9461         And during the member population, indexer_list, event_list,
9462         constant_list, field_list, instance_constructor_list, method_list,
9463         operator_list and property_list are turned into their real arrays.
9464
9465         Although we could probably perform this operation earlier, for
9466         good error reporting we need to keep the lists and remove the
9467         lists for longer than required.
9468
9469         This optimization was triggered by Paolo profiling the compiler
9470         speed on the output of `gen-sample-program.pl' perl script. 
9471
9472         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9473         not crash in methods like MemberLookupFailed that use this field.  
9474
9475         This problem arises when the compiler fails to resolve a type
9476         during interface type definition for example.
9477
9478 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9479
9480         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9481         inherit from System.Object, so we have to stop at null, not only
9482         when reaching System.Object.
9483
9484 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9485
9486         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9487         DeclaredOnly because the parent indexer might have had a different
9488         name, but did not loop until the top of the hierarchy was reached.
9489
9490         The problem this one fixes is 35492: when a class implemented an
9491         indexer from an interface, we were getting the interface method
9492         (which was abstract) and we were flagging an error (can not invoke
9493         abstract method).
9494
9495         This also keeps bug 33089 functioning, and test-148 functioning.
9496
9497         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9498         out if a method is special is to see if it is declared in a
9499         property or event, or whether it is one of the predefined operator
9500         names.   This should fix correctly #36804.
9501
9502 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9503
9504         The goal here is to remove the dependency on EmptyCast.Peel ().
9505         Killing it completely.
9506
9507         The problem is that currently in a number of places where
9508         constants are expected, we have to "probe" for an EmptyCast, and
9509         Peel, which is not the correct thing to do, as this will be
9510         repetitive and will likely lead to errors. 
9511
9512         The idea is to remove any EmptyCasts that are used in casts that
9513         can be reduced to constants, so we only have to cope with
9514         constants. 
9515
9516         This bug hunt was triggered by Bug 37363 and the desire to remove
9517         the duplicate pattern where we were "peeling" emptycasts to check
9518         whether they were constants.  Now constants will always be
9519         constants.
9520
9521         * ecore.cs: Use an enumconstant here instead of wrapping with
9522         EmptyCast.  
9523
9524         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9525         throwing me off.  By handling this we can get rid of a few hacks.
9526
9527         * statement.cs (Switch): Removed Peel() code.
9528
9529 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9530
9531         * class.cs: Location information for error 508
9532
9533         * expression.cs (New.DoResolve): Add a guard against double
9534         resolution of an expression.  
9535
9536         The New DoResolve might be called twice when initializing field
9537         expressions (see EmitFieldInitializers, the call to
9538         GetInitializerExpression will perform a resolve on the expression,
9539         and later the assign will trigger another resolution
9540
9541         This leads to bugs (#37014)
9542
9543         * delegate.cs: The signature for EndInvoke should contain any ref
9544         or out parameters as well.  We were not doing this in the past. 
9545
9546         * class.cs (Field.Define): Do not overwrite the type definition
9547         inside the `volatile' group.  Turns out that volatile enumerations
9548         were changing the type here to perform a validity test, which
9549         broke conversions. 
9550
9551 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9552
9553         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9554         and structs, we do not want to load the instance variable
9555
9556         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9557         enum_type has to be handled like an object reference (implicit
9558         conversions exists from this to object), but the regular IsClass
9559         and IsValueType tests will never return true for this one.
9560
9561         Also we use TypeManager.IsValueType instead of type.IsValueType,
9562         just for consistency with the rest of the code (this is only
9563         needed if we ever use the construct exposed by test-180.cs inside
9564         corlib, which we dont today).
9565
9566 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9567
9568         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9569         just InternalCall.
9570
9571 2003-02-09  Martin Baulig  <martin@ximian.com>
9572
9573         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9574         (Namespace.DefineNamespaces): New static public method; this is
9575         called when we're compiling with debugging to add all namespaces
9576         to the symbol file.
9577
9578         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9579         pass it to the Namespace's .ctor.
9580
9581         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9582         and MethodBase arguments; pass the namespace ID to the symwriter;
9583         pass the MethodBase instead of the token to the symwriter.
9584         (SymbolWriter.DefineNamespace): New method to add a namespace to
9585         the symbol file.
9586
9587 2003-02-09  Martin Baulig  <martin@ximian.com>
9588
9589         * symbolwriter.cs: New file.  This is a wrapper around
9590         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9591         methods here in near future.
9592
9593 2003-02-09  Martin Baulig  <martin@ximian.com>
9594
9595         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9596         ILGenerator.MarkSequencePoint() which are actually used by the
9597         symbol writer.
9598
9599 2003-02-09  Martin Baulig  <martin@ximian.com>
9600
9601         * location.cs (SourceFile): New public sealed class.  This
9602         contains the name and an index which is used in the location's token.
9603         (Location): Reserve an appropriate number of bits in the token for
9604         the source file instead of walking over that list, this gives us a
9605         really huge performance improvement when compiling with debugging.
9606
9607         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9608         `SourceFile' argument instead of a string.
9609         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9610         but don't parse/tokenize here, we need to generate the list of all
9611         source files before we do that.
9612         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9613         the files.
9614
9615         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9616         instead of a string.
9617
9618         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9619         of a string.
9620
9621 2003-02-09  Martin Baulig  <martin@ximian.com>
9622
9623         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9624         filename on `#line default'.
9625
9626 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9627
9628         * statement.cs: don't clear the pinned var when the fixed statement
9629         returns from the method (fixes bug#37752).
9630
9631 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9632
9633         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9634         to IsValueType.
9635
9636 2003-02-07  Martin Baulig  <martin@ximian.com>
9637
9638         * driver.cs: Removed the `--debug-args' command line argument.
9639
9640         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9641         automatically by the AsssemblyBuilder.
9642         (CodeGen.InitializeSymbolWriter): We don't need to call any
9643         initialization function on the symbol writer anymore.  This method
9644         doesn't take any arguments.
9645
9646 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9647
9648         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9649         from referenced assemblies as well.
9650
9651 2003-02-02  Martin Baulig  <martin@ximian.com>
9652
9653         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9654
9655 2003-02-02  Martin Baulig  <martin@ximian.com>
9656
9657         * class.cs (Constructor.Emit): Open the symbol writer before
9658         emitting the constructor initializer.
9659         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9660         single-stepping through constructor initializers.
9661
9662 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9663
9664         * class.cs: Handle error 549: do not allow virtual methods in
9665         sealed classes. 
9666
9667 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9668
9669         * decl.cs: Check access levels when resolving types
9670
9671 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9672
9673         * statement.cs: Add parameters and locals set in catch blocks that might 
9674         return to set vector
9675
9676 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9677
9678         * class.cs (Operator): Set the SpecialName flags for operators.
9679
9680         * expression.cs (Invocation.DoResolve): Only block calls to
9681         accessors and operators on SpecialName methods.
9682
9683         (Cast.TryReduce): Handle conversions from char constants.
9684
9685
9686 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9687
9688         * statement.cs: small memory and time optimization in FlowBranching.
9689
9690 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9691
9692         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9693         problem that the last fix but in the other sid (Set).
9694
9695         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9696         access when there is no indexer in the hierarchy.
9697
9698 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9699
9700         * class.cs: Combine some if statements.
9701
9702 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9703
9704         * driver.cs: fixed bug #37187.
9705
9706 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9707
9708         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9709         any indexer, it's needed to build a list with all the indexers in the
9710         hierarchy (AllGetters), else we have problems. Fixes #35653.
9711
9712 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9713
9714         * class.cs (MethodData.Define): It is wrong for an interface
9715         implementation to be static in both cases: explicit and implicit.
9716         We were only handling this in one case.
9717
9718         Improve the if situation there to not have negations.
9719
9720         * class.cs (Field.Define): Turns out that we do not need to check
9721         the unsafe bit on field definition, only on usage.  Remove the test.
9722
9723 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9724
9725         * driver.cs: use assembly.Location instead of Codebase (the latest
9726         patch made mcs fail when using MS assemblies).
9727
9728 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9729
9730         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9731         get the path to *corlib.dll.
9732
9733 2003-01-21  Nick Drochak <ndrochak@gol.com>
9734
9735         * cs-tokenizer.cs:
9736         * pending.cs:
9737         * typemanager.cs: Remove compiler warnings
9738
9739 2003-01-20  Duncan Mak  <duncan@ximian.com>
9740
9741         * AssemblyInfo.cs: Bump the version number to 0.19.
9742
9743 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9744
9745         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9746
9747 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9748
9749         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9750
9751 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9752
9753         * cs-parser.jay: Small fix: we were not comparing the constructor
9754         name correctly.   Thanks to Zoltan for the initial pointer.
9755
9756 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9757
9758         * cs-tokenizer.cs: Set file name when specified with #line
9759
9760 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9761
9762         * cs-parser.jay: Only perform the constructor checks here if we
9763         are named like the class;  This will help provider a better
9764         error.  The constructor path is taken when a type definition is
9765         not found, but most likely the user forgot to add the type, so
9766         report that rather than the constructor error.
9767
9768 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9769
9770         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9771         allocations.
9772
9773 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9774
9775         * cs-parser.jay: Add cleanup call.
9776
9777 2003-01-13  Duncan Mak  <duncan@ximian.com>
9778
9779         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9780         consistent with other methods.
9781
9782 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9783
9784         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9785
9786 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9787
9788         * attribute.cs: only set GuidAttr to true when we have a
9789         GuidAttribute.
9790
9791 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9792
9793         * ecore.cs:
9794         * expression.cs:
9795         * typemanager.cs: fixes to allow mcs compile corlib with the new
9796         Type.IsSubclassOf fix.
9797
9798 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9799
9800         * expression.cs (LocalVariableReference.DoResolve): Classify a
9801         constant as a value, not as a variable.   Also, set the type for
9802         the variable.
9803
9804         * cs-parser.jay (fixed_statement): take a type instead of a
9805         pointer_type, so we can produce a better error message later.
9806
9807         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9808         as an error.  
9809
9810         (For.DoEmit): Make inifinite loops have a
9811         non-conditional branch back.
9812
9813         (Fixed.DoEmit): First populate the pinned variables, then emit the
9814         statement, then clear the variables.  Before I was emitting the
9815         code once for each fixed piece.
9816
9817
9818 2003-01-08  Martin Baulig  <martin@ximian.com>
9819
9820         * statement.cs (FlowBranching.MergeChild): A break in a
9821         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9822
9823 2003-01-08  Martin Baulig  <martin@ximian.com>
9824
9825         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9826         lives in the same number space than `param_map'.  Fixes #36154.
9827
9828 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9829
9830         * cs-parser.jay (constructor_declaration): Set the
9831         Constructor.ModFlags before probing for it.  This makes the
9832         compiler report 514, 515 and 132 (the code was there, but got
9833         broken). 
9834
9835         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9836         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9837         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9838
9839 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9840
9841         * enum.cs: create the enum static fields using the enum type.
9842
9843 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9844
9845         * class.cs: don't try to create the ParamBuilder for the return
9846         type if it's not needed (and handle it breaking for the ms runtime
9847         anyway).
9848
9849 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9850
9851         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9852
9853 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9854
9855         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9856         the command.   This showed up while compiling the JANET source
9857         code, which used \r as its only newline separator.
9858
9859 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9860
9861         * class.cs (Method.Define): If we are an operator (because it
9862         reuses our code), then set the SpecialName and HideBySig.  #36128
9863
9864 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9865
9866         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9867         exception, report error 120 `object reference required'.
9868
9869         * driver.cs: Add --pause option, used during to measure the size
9870         of the process as it goes with --timestamp.
9871
9872         * expression.cs (Invocation.DoResolve): Do not allow methods with
9873         SpecialName to be invoked.
9874
9875 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9876
9877         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9878         number before adding it.
9879
9880 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9881
9882         * ecore.cs (StandardImplicitConversion): When in an unsafe
9883         context, we allow conversion between void * to any other pointer
9884         type. This fixes bug #35973.
9885
9886 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9887
9888         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9889         is not thrown when extensionless outputs are used 
9890
9891 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9892
9893         * rootcontext.cs: fixed compilation of corlib.
9894
9895 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9896
9897         * attribute.cs (Attributes.Contains): Add new method.
9898
9899         * class.cs (MethodCore.LabelParameters): if the parameter is an
9900         `out' parameter, check that no attribute `[In]' has been passed.
9901
9902         * enum.cs: Handle the `value__' name in an enumeration.
9903
9904 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9905
9906         * decl.cs: Added special case to allow overrides on "protected
9907         internal" methods
9908
9909 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9910
9911         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9912         since it makes much more sense.
9913
9914         (Attributes.ctor): Don't require a Location parameter.
9915
9916         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9917
9918         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9919         since we already have that information per attribute.
9920
9921         * everywhere : make appropriate changes.
9922
9923         * class.cs (LabelParameters): Write the code which actually
9924         applies attributes to the return type. We can't do this on the MS
9925         .NET runtime so we flag a warning in the case an exception is
9926         thrown.
9927
9928 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9929
9930         * const.cs: Handle implicit null conversions here too.
9931
9932 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9933
9934         * class.cs (MethodCore.LabelParameters): Remove the extra
9935         Type [] parameter since it is completely unnecessary. Instead
9936         pass in the method's attributes so that we can extract
9937         the "return" attribute.
9938
9939 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9940
9941         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9942         of ignoring it and letting the compile continue.
9943
9944         * typemanager.cs (ChangeType): use an extra argument to return an
9945         error condition instead of throwing an exception.
9946
9947 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9948
9949         * expression.cs (Unary.TryReduce): mimic the code for the regular
9950         code path.  Perform an implicit cast in the cases where we can
9951         implicitly convert to one of the integral types, and then reduce
9952         based on that constant.   This fixes bug #35483.
9953
9954 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9955
9956         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9957
9958 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9959
9960         * namespace.cs: fixed bug #35489.
9961
9962 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9963
9964         * class.cs: Remove some dead code.
9965
9966         * cs-parser.jay: Estimate the number of methods needed
9967         (RootContext.MethodCount);
9968
9969         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9970         numbers instead of StringBuilders.
9971
9972         * support.cs (PtrHashtable): Add constructor with initial size;
9973         We can now reduce reallocations of the method table.
9974
9975 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9976
9977         * attribute.cs (ApplyAttributes): Keep track of the emitted
9978         attributes on a per-target basis. This fixes bug #35413.
9979
9980 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9981
9982         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9983         default to the Windows 1252 encoding.
9984
9985         (UnixParseOption): Support version, thanks to Alp for the missing
9986         pointer. 
9987
9988         * AssemblyInfo.cs: Add nice assembly information.
9989
9990         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9991         (bug 35169).
9992
9993         * cs-parser.jay: Allow a trailing comma before the close bracked
9994         in the attribute_section production.
9995
9996         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9997         address of the instance was being taken, I will take this out,
9998         because we take the address of the object immediately here.
9999
10000 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10001
10002         * typemanager.cs (AreMultipleAllowed): Take care of the most
10003         obvious case where attribute type is not in the current assembly -
10004         stupid me ;-)
10005
10006 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10007
10008         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10009         definitions, instead of doing that afterwards.  
10010
10011         Also we use a nice little hack, depending on the constructor, we
10012         know if we are a "composed" name or a simple name.  Hence, we
10013         avoid the IndexOf test, and we avoid 
10014
10015         * codegen.cs: Add code to assist in a bug reporter to track down
10016         the source of a compiler crash. 
10017
10018 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10019
10020         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10021         types have been emitted for a given element and flag an error
10022         if something which does not have AllowMultiple set is used more
10023         than once.
10024
10025         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10026         attribute types and their corresponding AllowMultiple properties
10027
10028         (AreMultipleAllowed): Check the property for a given type.
10029
10030         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10031         property in the case we have a TypeContainer.
10032
10033         (Attributes.AddAttribute): Detect duplicates and just skip on
10034         adding them. This trivial fix catches a pretty gross error in our
10035         attribute emission - global attributes were being emitted twice!
10036
10037         Bugzilla bug #33187 is now fixed.
10038
10039 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10040
10041         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10042         instead of pp_and).
10043
10044         * expression.cs (Binary.ResolveOperator): I can only use the
10045         Concat (string, string, string) and Concat (string, string,
10046         string, string) if the child is actually a concatenation of
10047         strings. 
10048
10049 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10050
10051         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10052         context where we need a 2-character lookahead.
10053
10054         * pending.cs (PendingImplementation): Rework so we can keep track
10055         of interface types all the time, and flag those which were
10056         implemented by parents as optional.
10057
10058 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10059
10060         * expression.cs (Binary.ResolveOperator): Use
10061         String.Concat(string,string,string) or
10062         String.Concat(string,string,string,string) when possible. 
10063
10064         * typemanager: More helper methods.
10065
10066
10067 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10068
10069         * pending.cs: remove the bogus return from GetMissingInterfaces()
10070         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10071
10072 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10073
10074         * namespace.cs: avoid duplicated 'using xxx' being added to
10075         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10076         when we get more than one 'using' statement for the same namespace.
10077         Report a CS0105 warning for it.
10078
10079 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10080
10081         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10082         of calling getChar/putback, uses internal knowledge of it.    
10083
10084         (xtoken): Reorder tokenizer so most common patterns are checked
10085         first.  This reduces the compilation time in another 5% (from 8.11s
10086         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10087
10088         The parsing time is 22% of the compilation in mcs, and from that
10089         64% is spent on the tokenization process.  
10090
10091         I tried using a binary search for keywords, but this is slower
10092         than the hashtable.  Another option would be to do a couple of
10093         things:
10094
10095                 * Not use a StringBuilder, instead use an array of chars,
10096                   with a set value.  Notice that this way we could catch
10097                   the 645 error without having to do it *afterwards*.
10098
10099                 * We could write a hand-parser to avoid the hashtable
10100                   compares altogether.
10101
10102         The identifier consumption process takes 37% of the tokenization
10103         time.  Another 15% is spent on is_number.  56% of the time spent
10104         on is_number is spent on Int64.Parse:
10105
10106                 * We could probably choose based on the string length to
10107                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10108                   computations. 
10109
10110         Another 3% is spend on wrapping `xtoken' in the `token' function.
10111
10112         Handle 0xa0 as whitespace (#34752)
10113
10114 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10115
10116         * typemanager.cs (IsCLRType): New routine to tell whether a type
10117         is one of the builtin types.  
10118
10119         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10120         typecode in more places instead of doing pointer comparissions.
10121         We could leverage some knowledge about the way the typecodes are
10122         laid out.
10123
10124         New code to cache namespaces in assemblies, it is currently not
10125         invoked, to be used soon.
10126
10127         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10128
10129         * expression.cs (Binary.ResolveOperator): specially handle
10130         strings, and do not perform user-defined operator overloading for
10131         built-in types.
10132
10133 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10134
10135         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10136         internalcall as it is a pretty simple operation;  Avoid whenever
10137         possible to call Char.IsLetter.
10138
10139         (consume_identifier): Cut by half the number of
10140         hashtable calls by merging the is_keyword and GetKeyword behavior.
10141
10142         Do not short-circuit, because if we do, we
10143         report errors (ie, #if false && true would produce an invalid
10144         directive error);
10145
10146
10147 2002-11-24  Martin Baulig  <martin@ximian.com>
10148
10149         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10150         check constant ranges and report a CS0221.  Fixes #33186.
10151
10152 2002-11-24  Martin Baulig  <martin@ximian.com>
10153
10154         * cs-parser.jay: Make this work for uninitialized variable
10155         declarations in the `for' initializer.  Fixes #32416.
10156
10157 2002-11-24  Martin Baulig  <martin@ximian.com>
10158
10159         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10160         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10161
10162 2002-11-24  Martin Baulig  <martin@ximian.com>
10163
10164         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10165         argument; if true, we also check for user-defined conversions.
10166         This is only needed if both arguments are of a user-defined type.
10167         Fixes #30443, added test-175.cs.
10168         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10169
10170         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10171
10172 2002-11-24  Martin Baulig  <martin@ximian.com>
10173
10174         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10175         function to get the store opcode.
10176         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10177         only emit the Ldelema if the store opcode is Stobj.  You must run
10178         both test-34 and test-167 to test this.  Fixes #34529.
10179
10180 2002-11-23  Martin Baulig  <martin@ximian.com>
10181
10182         * ecore.cs (Expression.MemberLookup): Added additional
10183         `qualifier_type' argument which is used when we're being called
10184         from MemberAccess.DoResolve() and null if we're called from a
10185         SimpleName lookup.
10186         (Expression.MemberLookupFailed): New method to report errors; this
10187         does the CS1540 check and reports the correct error message.
10188
10189         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10190         argument for the CS1540 check and redone the way how we're dealing
10191         with private members.  See the comment in the source code for details.
10192         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10193         `closure_start_type' to `closure_qualifier_type' and check whether
10194         it's not null.  It was not this filter being broken, it was just
10195         being called with the wrong arguments.
10196
10197         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10198         and pass it the correct `qualifier_type'; this also does the error
10199         handling for us.
10200
10201 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10202
10203         * expression.cs (Invocation.EmitParams): If the we are dealing
10204         with a non-built-in value type, load its address as well.
10205
10206         (ArrayCreation): Use a a pretty constant instead
10207         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10208         static initializers.  
10209
10210         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10211         because they are not really value types, just glorified integers. 
10212
10213         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10214
10215         * ecore.cs: Remove redundant code for enumerations, make them use
10216         the same code path as everything else, fixes the casting issue
10217         with enumerations in Windows.Forms.
10218
10219         * attribute.cs: Do only cast to string if it is a string, the
10220         validation happens later.
10221
10222         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10223         people upgrade their corlibs.
10224
10225         * ecore.cs: Oops, enumerations were not following the entire code path
10226
10227 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10228
10229         * typemanager.cs (FilterWithClosure): Commented out the test for
10230         1540 in typemanager.cs, as it has problems when accessing
10231         protected methods from a parent class (see test-174.cs). 
10232
10233         * attribute.cs (Attribute.ValidateGuid): new method.
10234         (Attribute.Resolve): Use above.
10235
10236 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10237
10238         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10239
10240         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10241         handling for enumerations, as we only needed the TypeContainer
10242         functionality to begin with (this is required for the fix below to
10243         work for enums that reference constants in a container class for
10244         example). 
10245
10246         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10247
10248         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10249         a valid TypeBuilder to perform lookups on.o
10250
10251         * class.cs (InheritableMemberSignatureCompare): Use true in the
10252         call to GetGetMethod and GetSetMethod, because we are comparing
10253         the signature, and we need to get the methods *even* if they are
10254         private. 
10255
10256         (PropertyBase.CheckBase): ditto.
10257
10258         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10259         GotoCase.Resolve): Use Peel on EmpytCasts.
10260
10261         * ecore.cs (EmptyCast): drop child, add Peel method.
10262
10263 2002-11-17  Martin Baulig  <martin@ximian.com>
10264
10265         * ecore.cs (EmptyCast.Child): New public property.
10266
10267         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10268         label resolved to an EmptyCast.  Fixes #34162.
10269         (GotoCase.Resolve): Likewise.
10270         (Block.EmitMeta): Likewise.
10271
10272 2002-11-17  Martin Baulig  <martin@ximian.com>
10273
10274         * expression.cs (Invocation.BetterConversion): Prefer int over
10275         uint; short over ushort; long over ulong for integer literals.
10276         Use ImplicitConversionExists instead of StandardConversionExists
10277         since we also need to check for user-defined implicit conversions.
10278         Fixes #34165.  Added test-173.cs.
10279
10280 2002-11-16  Martin Baulig  <martin@ximian.com>
10281
10282         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10283         with the `true' and `false' literals.  Fixes #33151.
10284
10285 2002-11-16  Martin Baulig  <martin@ximian.com>
10286
10287         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10288         October 22nd; don't do the cs1540 check for static members.
10289
10290         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10291         now using our own filter here and doing the cs1540 check again.
10292
10293 2002-11-16  Martin Baulig  <martin@ximian.com>
10294
10295         * support.cs (InternalParameters): Don't crash if we don't have
10296         any fixed parameters.  Fixes #33532.
10297
10298 2002-11-16  Martin Baulig  <martin@ximian.com>
10299
10300         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10301         when looking up static methods to make this work on Windows.
10302         Fixes #33773.
10303
10304 2002-11-16  Martin Baulig  <martin@ximian.com>
10305
10306         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10307         a setter rather than using PropertyInfo.CanWrite.
10308
10309 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10310
10311         * class.cs: Allow acces to block member by subclasses. Fixes build
10312         breaker.
10313
10314 2002-11-14  Martin Baulig  <martin@ximian.com>
10315
10316         * class.cs (Constructor.Emit): Added the extern/block check.
10317         Fixes bug #33678.
10318
10319 2002-11-14  Martin Baulig  <martin@ximian.com>
10320
10321         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10322         iteration while looking for indexers, this is needed because the
10323         indexer may have a different name in our base classes.  Fixed the
10324         error reporting (no indexers at all, not get accessor, no
10325         overloaded match).  Fixes bug #33089.
10326         (IndexerAccess.DoResolveLValue): Likewise.
10327
10328 2002-11-14  Martin Baulig  <martin@ximian.com>
10329
10330         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10331         indexers.  Fixes the first part of bug #33089.
10332         (MethodSignature.InheritableMemberSignatureCompare): Added support
10333         for properties.
10334
10335 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10336
10337         * attribute.cs (Attribute.Resolve): Catch the
10338         NullReferenceException and report it since it isn't supposed to
10339         happen. 
10340
10341 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10342
10343         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10344         LogicalOr and LogicalAnd that can benefit from recursively
10345         handling EmitBranchable.  The code now should be nice for Paolo.
10346
10347 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10348
10349         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10350         the Type lookups, as we perform quite a number of lookups on
10351         non-Types.  This can be removed once we can deterministically tell
10352         whether we have a type or a namespace in advance.
10353
10354         But this might require special hacks from our corlib.
10355
10356         * TODO: updated.
10357
10358         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10359         and double which avoids a conversion from an integer to a double.
10360
10361         * expression.cs: tiny optimization, avoid calling IsConstant,
10362         because it effectively performs the lookup twice.
10363
10364 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10365
10366         But a bogus return here to keep the semantics of the old code
10367         until the Mono runtime is fixed.
10368
10369         * pending.cs (GetMissingInterfaces): New method used to remove all
10370         the interfaces that are already implemented by our parent
10371         classes from the list of pending methods. 
10372
10373         * interface.cs: Add checks for calls after ResolveTypeExpr.
10374
10375 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10376
10377         * class.cs (Class.Emit): Report warning 67: event not used if the
10378         warning level is beyond 3.
10379
10380         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10381         being a NullLiteral.
10382
10383         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10384         specifiers. 
10385
10386         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10387         path that might fail if a type can not be resolved.
10388
10389         * expression.cs (Binary.Emit): Emit unsigned versions of the
10390         operators. 
10391
10392         * driver.cs: use error 5.
10393
10394 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10395
10396         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10397
10398 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10399
10400         * cs-parser.jay (switch_section): A beautiful patch from Martin
10401         Baulig that fixed 33094.
10402
10403 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10404
10405         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10406         Check whether the base is abstract and report an error if so.
10407
10408         * expression.cs (IndexerAccess.DoResolveLValue,
10409         IndexerAccess.DoResolve): ditto. 
10410
10411         (Invocation.DoResolve): ditto.
10412
10413         (Invocation.FullMethodDesc): Improve the report string.
10414
10415         * statement.cs (Block): Eliminate IsVariableDefined as it is
10416         basically just a wrapper for GetVariableInfo.
10417
10418         * ecore.cs (SimpleName): Use new 
10419
10420         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10421         type, as we return the actual parameter ref/unref state on a
10422         different call.
10423
10424 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10425
10426         * support.cs: Return proper flags REF/OUT fixing the previous
10427         commit.  
10428
10429         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10430         not used to mean `ref' but `ref or out' in ParameterReference
10431
10432         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10433         full type signature instead of calling TypeManger.CSharpName
10434         ourselves. 
10435
10436         * support.cs (InternalParameters.ParameterDesc): Do not compare
10437         directly to the modflags, because REF/OUT will actually be bitsets
10438         if set. 
10439
10440         * delegate.cs (VerifyMethod): Check also the modifiers.
10441
10442         * cs-tokenizer.cs: Fix bug where floating point values with an
10443         exponent where a sign was missing was ignored.
10444
10445         * driver.cs: Allow multiple assemblies to be specified in a single
10446         /r: argument
10447
10448 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10449
10450         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10451         because identifiers after a parenthesis would end up in this kind
10452         of production, and we needed to desamiguate it for having casts
10453         like:
10454
10455                 (UserDefinedType *) xxx
10456
10457 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10458
10459         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10460         we should set on the Bindingflags.NonPublic, but not turn on
10461         private_ok.  private_ok controls whether a Private member is
10462         returned (this is chekced on the filter routine), while the
10463         BindingFlags.NonPublic just controls whether private/protected
10464         will be allowed.   This fixes the problem part of the problem of
10465         private properties being allowed to be used in derived classes.
10466
10467         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10468         so we can call the children DoResolveLValue method (this will
10469         properly signal errors on lvalue assignments to base properties)
10470
10471         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10472         getter are null, and we have a property info, we know that this
10473         happened because the lookup failed, so we report an error 122 for
10474         protection level violation.
10475
10476         We also silently return if setter and getter are null in the
10477         resolve functions, this condition only happens if we have flagged
10478         the error before.  This is the other half of the problem. 
10479
10480         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10481         not have accessibility information, that is why we were returning
10482         true in the filter function in typemanager.cs.
10483
10484         To properly report 122 (property is inaccessible because of its
10485         protection level) correctly, we report this error in ResolveAccess
10486         by failing if both the setter and the getter are lacking (ie, the
10487         lookup failed). 
10488
10489         DoResolve and DoLResolve have been modified to check for both
10490         setter/getter being null and returning silently, the reason being
10491         that I did not want to put the knowledge about this error in upper
10492         layers, like:
10493
10494         int old = Report.Errors;
10495         x = new PropertyExpr (...);
10496         if (old != Report.Errors)
10497                 return null;
10498         else
10499                 return x;
10500
10501         So the property expr is returned, but it is invalid, so the error
10502         will be flagged during the resolve process. 
10503
10504         * class.cs: Remove InheritablePropertySignatureCompare from the
10505         class, as we no longer depend on the property signature to compute
10506         whether it is possible to implement a method or not.
10507
10508         The reason is that calling PropertyInfo.GetGetMethod will return
10509         null (in .NET, in Mono it works, and we should change this), in
10510         cases where the Get Method does not exist in that particular
10511         class.
10512
10513         So this code:
10514
10515         class X { public virtual int A { get { return 1; } } }
10516         class Y : X { }
10517         class Z : Y { public override int A { get { return 2; } } }
10518
10519         Would fail in Z because the parent (Y) would not have the property
10520         defined.  So we avoid this completely now (because the alternative
10521         fix was ugly and slow), and we now depend exclusively on the
10522         method names.
10523
10524         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10525         reference method, instead of using the property.
10526
10527         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10528         routines are gone now.
10529
10530         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10531         names, they were incorrectly named.
10532
10533         * cs-tokenizer.cs: Return are more gentle token on failure. 
10534
10535         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10536         had an out-of-sync index variable, which caused it to remove from
10537         the list of pending methods the wrong method sometimes.
10538
10539 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10540
10541         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10542         CanWrite, because those refer to this particular instance of the
10543         property, and do not take into account the fact that we can
10544         override single members of a property.
10545
10546         Constructor requires an EmitContext.  The resolution process does
10547         not happen here, but we need to compute the accessors before,
10548         because the resolution does not always happen for properties.
10549
10550         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10551         subclass, before we did not update this flag, but we did update
10552         bindingflags. 
10553
10554         (GetAccessors): Drop this routine, as it did not work in the
10555         presence of partially overwritten set/get methods. 
10556
10557         Notice that this broke the cs1540 detection, but that will require
10558         more thinking. 
10559
10560 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10561
10562         * class.cs:
10563         * codegen.cs:
10564         * driver.cs: issue a warning instead of an error if we don't support
10565         debugging for the platform. Also ignore a couple of errors that may
10566         arise when trying to write the symbols. Undo my previous patch.
10567
10568 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10569
10570         * driver.cs: ignore /debug switch except for Unix platforms.
10571
10572 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10573
10574         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10575
10576 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10577
10578         * driver.cs: Do not make mcs-debug conditional, so we do not break
10579         builds that use it.
10580
10581         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10582         review this patch.  But basically after all the children variables
10583         have been merged, the value of "Breaks" was not being set to
10584         new_breaks for Switch blocks.  I think that it should be set after
10585         it has executed.  Currently I set this to the value of new_breaks,
10586         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10587         conservative, but I do not understand this code very well.
10588
10589         I did not break anything in the build, so that is good ;-)
10590
10591         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10592
10593 2002-10-20  Mark Crichton  <crichton@gimp.org>
10594
10595         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10596
10597 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10598
10599         * cfold.cs: Fixed compile blocker.
10600
10601 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10602
10603         * driver.cs: I was chekcing the key, not the file.
10604
10605 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10606
10607         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10608         message that we were generating - we just need to silently return
10609         a null.
10610
10611 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10612
10613         * class.cs (Event.Define): Change my previous commit, as this
10614         breaks the debugger.  This is a temporary hack, as it seems like
10615         the compiler is generating events incorrectly to begin with.
10616
10617         * expression.cs (Binary.ResolveOperator): Added support for 
10618         "U operator - (E x, E y)"
10619
10620         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10621         y)".
10622
10623         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10624         init-only variables, but this path did not take into account that
10625         there might be also instance readonly variables.  Correct this
10626         problem. 
10627
10628         This fixes bug 32253
10629
10630         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10631         delegates as well.
10632
10633         * driver.cs: Change the extension for modules to `netmodule'
10634
10635         * cs-parser.jay: Improved slightly the location tracking for
10636         the debugger symbols.
10637
10638         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10639         modifiers that were specified instead of the hardcoded value
10640         (FamAndAssem).  This was basically ignoring the static modifier,
10641         and others.  Fixes 32429.
10642
10643         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10644         fixed a bug in the process (32476)
10645
10646         * expression.cs (ArrayAccess.EmitAssign): Patch from
10647         hwang_rob@yahoo.ca that fixes bug 31834.3
10648
10649 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10650
10651         * driver.cs: Make the module extension .netmodule.
10652
10653 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10654
10655         * driver.cs: Report an error if the resource file is not found
10656         instead of crashing.
10657
10658         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10659         false, like Emit does.
10660
10661 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10662
10663         * typemanager.cs: Remove unused private member.  Also reported mcs
10664         bug to report this as a warning like csc.
10665
10666 2002-10-15  Martin Baulig  <martin@gnome.org>
10667
10668         * statement.cs (Statement.Emit): Made this a virtual method; emits
10669         the line number info and calls DoEmit().
10670         (Statement.DoEmit): New protected abstract method, formerly knows
10671         as Statement.Emit().
10672
10673         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10674
10675 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10676
10677         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10678         have fixed a remaining problem: not every AddXXXX was adding a
10679         fully qualified name.  
10680
10681         Now everyone registers a fully qualified name in the DeclSpace as
10682         being defined instead of the partial name.  
10683
10684         Downsides: we are slower than we need to be due to the excess
10685         copies and the names being registered this way.  
10686
10687         The reason for this is that we currently depend (on the corlib
10688         bootstrap for instance) that types are fully qualified, because
10689         we dump all the types in the namespace, and we should really have
10690         types inserted into the proper namespace, so we can only store the
10691         basenames in the defined_names array.
10692
10693 2002-10-10  Martin Baulig  <martin@gnome.org>
10694
10695         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10696         from bug #31834, see the bug report for a testcase which is
10697         miscompiled.
10698
10699 2002-10-10  Martin Baulig  <martin@gnome.org>
10700
10701         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10702         flow analysis code for this.
10703
10704         * statement.cs (Do, While, For): Tell the flow analysis code about
10705         infinite loops.
10706         (FlowBranching.UsageVector): Added support for infinite loops.
10707         (Block.Resolve): Moved the dead code elimination here and use flow
10708         analysis to do it.
10709
10710 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10711
10712         * class.cs (Field.Define): Catch cycles on struct type
10713         definitions. 
10714
10715         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10716         fields if the fields are static.  We only need to check instance
10717         fields. 
10718
10719         * expression.cs (As.DoResolve): Test for reference type.
10720
10721         * statement.cs (Using.ResolveExpression): Use
10722         ConvertImplicitRequired, not ConvertImplicit which reports an
10723         error on failture
10724         (Using.ResolveLocalVariableDecls): ditto.
10725
10726         * expression.cs (Binary.ResolveOperator): Report errors in a few
10727         places where we had to.
10728
10729         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10730
10731 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10732
10733         * expression.cs: Use StoreFromPtr instead of extracting the type
10734         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10735
10736         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10737         an enumeration value to a System.Enum, but System.Enum is not a
10738         value type, but an class type, so we need to box.
10739
10740         (Expression.ConvertExplicit): One codepath could return
10741         errors but not flag them.  Fix this.  Fixes #31853
10742
10743         * parameter.cs (Resolve): Do not allow void as a parameter type.
10744
10745 2002-10-06  Martin Baulig  <martin@gnome.org>
10746
10747         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10748         if it's a class type and not a struct.  Fixes #31815.
10749
10750 2002-10-06  Martin Baulig  <martin@gnome.org>
10751
10752         * statement.cs: Reworked the flow analysis code a bit to make it
10753         usable for dead code elimination.
10754
10755 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10756
10757         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10758
10759 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10760
10761         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10762         to fix the test 165, will investigate deeper.
10763
10764 2002-10-04  Martin Baulig  <martin@gnome.org>
10765
10766         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10767         finally blocks actually work.
10768         (Try.Resolve): We don't need to create a sibling for `finally' if
10769         there is no finally block.
10770
10771 2002-10-04  Martin Baulig  <martin@gnome.org>
10772
10773         * class.cs (Constructor.Define): The default accessibility for a
10774         non-default constructor is private, not public.
10775
10776 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10777
10778         * class.cs (Constructor): Make AllowedModifiers public, add
10779         EXTERN.
10780
10781         * cs-parser.jay: Perform the modifiers test here, as the
10782         constructor for the Constructor class usually receives a zero
10783         because of the way we create it (first we create, later we
10784         customize, and we were never checking the modifiers).
10785
10786         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10787         is a version of LookupTypeReflection that includes the type-name
10788         cache.  This can be used as a fast path for functions that know
10789         the fully qualified name and are only calling into *.GetType() to
10790         obtain a composed type.
10791
10792         This is also used by TypeManager.LookupType during its type
10793         composition.
10794
10795         (LookupType): We now also track the real type name, as sometimes
10796         we can get a quey for the real type name from things like
10797         ComposedCast.  This fixes bug 31422.
10798
10799         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10800         complete type fullname, it does not have to go through the type
10801         resolution system to obtain the composed version of the type (for
10802         obtaining arrays or pointers).
10803
10804         (Conditional.Emit): Use the EmitBoolExpression to
10805         generate nicer code, as requested by Paolo.
10806
10807         (ArrayCreation.CheckIndices): Use the patch from
10808         hwang_rob@yahoo.ca to validate the array initializers. 
10809
10810 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10811
10812         * class.cs (ConstructorInitializer.Emit): simplify code by using
10813         Invocation.EmitCall, and at the same time, fix the bugs in calling
10814         parent constructors that took variable arguments. 
10815
10816         * ecore.cs (Expression.ConvertNumericExplicit,
10817         Expression.ImplicitNumericConversion): Remove the code that
10818         manually wrapped decimal (InternalTypeConstructor call is now gone
10819         as well).
10820
10821         * expression.cs (Cast.TryReduce): Also handle decimal types when
10822         trying to perform a constant fold on the type.
10823
10824         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10825
10826         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10827         that only turned off an error report, and did nothing else. 
10828
10829 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10830
10831         * driver.cs: Handle and ignore /fullpaths
10832
10833 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10834
10835         * expression.cs (Binary.ResolveOperator): Catch the case where
10836         DoNumericPromotions returns true, 
10837
10838         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10839
10840 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10841
10842         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10843         report error 70.
10844
10845 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10846
10847         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10848         conversion exists, but it is also required that the conversion be
10849         performed.  This manifested in "(Type64Enum) 2".  
10850
10851         * class.cs (TypeManager.AddMethod): The fix is not to change
10852         AddEnum, because that one was using a fully qualified name (every
10853         DeclSpace derivative does), but to change the AddMethod routine
10854         that was using an un-namespaced name.  This now correctly reports
10855         the duplicated name.
10856
10857         Revert patch until I can properly fix it.  The issue
10858         is that we have a shared Type space across all namespaces
10859         currently, which is wrong.
10860
10861         Options include making the Namespace a DeclSpace, and merge
10862         current_namespace/current_container in the parser.
10863
10864 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10865
10866         * cs-parser.jay: Improve error reporting when we get a different
10867         kind of expression in local_variable_type and
10868         local_variable_pointer_type. 
10869
10870         Propagate this to avoid missleading errors being reported.
10871
10872         * ecore.cs (ImplicitReferenceConversion): treat
10873         TypeManager.value_type as a target just like object_type.   As
10874         code like this:
10875
10876         ValueType v = 1;
10877
10878         Is valid, and needs to result in the int 1 being boxed before it
10879         is assigned to the value type v.
10880
10881         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10882         to validate the enumeration name.
10883
10884         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10885         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10886         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10887
10888         * ecore.cs (TryImplicitIntConversion): When doing an
10889         implicit-enumeration-conversion, check if the type is 64-bits and
10890         perform a conversion before passing to EnumConstant.
10891
10892 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10893
10894         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10895         report ambiguous type references.  Unlike the MS version, we
10896         report what the ambiguity is.   Innovation at work ;-)
10897
10898         (DeclSpace.FindType): Require a location argument to
10899         display when we display an ambiguous error.
10900
10901         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10902
10903         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10904
10905         * expression.cs (EmitDynamicInitializers): Apply patch from
10906         hwang_rob@yahoo.ca that fixes the order in which we emit our
10907         initializers. 
10908
10909 2002-09-21  Martin Baulig  <martin@gnome.org>
10910
10911         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10912         delegate takes no arguments.
10913
10914 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10915
10916         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10917         from integers.
10918
10919         * expression.cs: Extract the underlying type.
10920
10921         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10922
10923         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10924
10925 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10926
10927         * class.cs (TypeContainer.DefineType): We can not use the nice
10928         PackingSize with the size set to 1 DefineType method, because it
10929         will not allow us to define the interfaces that the struct
10930         implements.
10931
10932         This completes the fixing of bug 27287
10933
10934         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10935         means also structs.  This fixes part of the problem. 
10936         (Expresion.ImplicitReferenceConversionExists): ditto.
10937
10938         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10939         error if there were no errors reported during the type lookup
10940         process, to avoid duplicates or redundant errors.  Without this
10941         you would get an ambiguous errors plus a type not found.  We have
10942         beaten the user enough with the first error.  
10943
10944         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10945         reference. 
10946
10947         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10948         during the resolution process, stop the lookup, this avoids
10949         repeated error reports (same error twice).
10950
10951         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10952
10953         * typemanager.cs (LookupType): Redo the type lookup code to match
10954         the needs of System.Reflection.  
10955
10956         The issue is that System.Reflection requires references to nested
10957         types to begin with a "+" sign instead of a dot.  So toplevel
10958         types look like: "NameSpace.TopLevelClass", and nested ones look
10959         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10960         levels. 
10961
10962 2002-09-19  Martin Baulig  <martin@gnome.org>
10963
10964         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10965         says that a method always returns or always throws an exception,
10966         don't report the CS0161.
10967
10968         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10969         set `Returns = new_returns'.
10970
10971 2002-09-19  Martin Baulig  <martin@gnome.org>
10972
10973         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10974         to an enum constant, check for a CS0176.
10975
10976 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10977
10978         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10979         for operators that must be in pairs and report errors.
10980
10981         * ecore.cs (SimpleName.DoResolveType): During the initial type
10982         resolution process, when we define types recursively, we must
10983         check first for types in our current scope before we perform
10984         lookups in the enclosing scopes.
10985
10986         * expression.cs (MakeByteBlob): Handle Decimal blobs.
10987
10988         (Invocation.VerifyArgumentsCompat): Call
10989         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10990         I thought we were supposed to always call this, but there are a
10991         few places in the code where we dont do it.
10992
10993 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
10994
10995         * driver.cs: Add support in -linkres and -resource to specify the
10996         name of the identifier.
10997
10998 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10999
11000         * ecore.cs (StandardConversionExists): Sync with the conversion
11001         code: allow anything-* to void* conversions.
11002
11003         (FindMostSpecificSource): Use an Expression argument
11004         instead of a Type, because we might be handed over a Literal which
11005         gets a few more implicit conversions that plain types do not.  So
11006         this information was being lost.
11007
11008         Also, we drop the temporary type-holder expression when not
11009         required.
11010
11011 2002-09-17  Martin Baulig  <martin@gnome.org>
11012
11013         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11014         this is an explicit interface implementation.
11015
11016 2002-09-17  Martin Baulig  <martin@gnome.org>
11017
11018         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11019         different `IndexerName' attributes.
11020
11021         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11022         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11023         virtual CommonResolve().
11024
11025 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11026
11027         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11028         and convert that to the UnderlyingType.
11029
11030         * statement.cs (Foreach.Resolve): Indexers are just like variables
11031         or PropertyAccesses.
11032
11033         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11034         inside quoted strings, we were not doing this before.
11035
11036 2002-09-16  Martin Baulig  <martin@gnome.org>
11037
11038         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11039         resolve it.  This is needed for the definite assignment check of the
11040         instance expression, fixes bug #29846.
11041         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11042
11043 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11044
11045         * parameter.cs: Fix compile error.  Cannot reference static member
11046         from an instance object.  Is this an mcs bug?
11047
11048 2002-09-14  Martin Baulig  <martin@gnome.org>
11049
11050         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11051         multiple times.  Fixes bug #30295, added test-166.cs.
11052
11053 2002-09-14  Martin Baulig  <martin@gnome.org>
11054
11055         * statement.cs (Block.Emit): Don't emit unreachable code.
11056         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11057         `break' statements.
11058         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11059
11060 2002-09-14  Martin Baulig  <martin@gnome.org>
11061
11062         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11063         is set.
11064
11065 2002-09-14  Martin Baulig  <martin@gnome.org>
11066
11067         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11068         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11069         be false on the ms runtime.
11070
11071 2002-09-13  Martin Baulig  <martin@gnome.org>
11072
11073         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11074         the CS0038 error message.
11075
11076 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11077
11078         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11079         constant inside, return it.
11080
11081 2002-09-12  Martin Baulig  <martin@gnome.org>
11082
11083         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11084         implicit conversion can be done between enum types.
11085
11086         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11087         check whether an implicit conversion to the current enum's UnderlyingType
11088         exists and report an error if not.
11089
11090         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11091         without debugging support.
11092
11093         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11094         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11095
11096 2002-09-12  Martin Baulig  <martin@gnome.org>
11097
11098         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11099
11100         * ecore.cs (IMemberExpr.DeclaringType): New property.
11101         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11102         nonstatic member of an outer type (CS0038).
11103
11104 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11105
11106         * driver.cs: Activate the using-error detector at warning level
11107         4 (at least for MS-compatible APIs).
11108
11109         * namespace.cs (VerifyUsing): Small buglett fix.
11110
11111         * pending.cs (PendingImplementation): pass the container pointer. 
11112
11113         * interface.cs (GetMethods): Allow for recursive definition.  Long
11114         term, I would like to move every type to support recursive
11115         definitions, not the current ordering mechanism that we have right
11116         now.
11117
11118         The situation is this: Attributes are handled before interfaces,
11119         so we can apply attributes to interfaces.  But some attributes
11120         implement interfaces, we will now handle the simple cases
11121         (recursive definitions will just get an error).  
11122
11123         * parameter.cs: Only invalidate types at the end if we fail to
11124         lookup all types.  
11125
11126 2002-09-09  Martin Baulig  <martin@gnome.org>
11127
11128         * ecore.cs (PropertyExpr.Emit): Also check for
11129         TypeManager.system_int_array_get_length so this'll also work when
11130         compiling corlib.  Fixes #30003.
11131
11132 2002-09-09  Martin Baulig  <martin@gnome.org>
11133
11134         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11135         and throw an exception if we can't get the type's size.  Fixed #30040,
11136         added test-165.cs.
11137
11138 2002-09-09  Martin Baulig  <martin@gnome.org>
11139
11140         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11141
11142         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11143         context.  Fixes bug #30027.
11144
11145         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11146         virtual functions.  Fixes bug #30043, added test-164.cs.
11147
11148 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11149
11150         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11151
11152 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11153
11154         * driver.cs: Use an object to get the windows codepage since it's not a
11155         static property.
11156
11157 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11158
11159         * statement.cs (For.Emit): for infinite loops (test == null)
11160         return whether there is a break inside, not always "true".
11161
11162         * namespace.cs (UsingEntry): New struct to hold the name of the
11163         using definition, the location where it is defined, and whether it
11164         has been used in a successful type lookup.
11165
11166         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11167         strings.
11168
11169         * decl.cs: ditto.
11170
11171 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11172
11173         * attribute.cs : Fix incorrect code which relied on catching
11174         a NullReferenceException to detect a null being passed in
11175         where an object was expected.
11176
11177 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11178
11179         * statement.cs (Try): flag the catch variable as assigned
11180
11181         * expression.cs (Cast): Simplified by using ResolveType instead of
11182         manually resolving.
11183
11184         * statement.cs (Catch): Fix bug by using ResolveType.
11185
11186 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11187
11188         * expression.cs (BetterConversion): Special case for when we have
11189         a NullLiteral as the argument and we have to choose between string
11190         and object types - we choose string the way csc does.
11191
11192         * attribute.cs (Attribute.Resolve): Catch the
11193         NullReferenceException and report error #182 since the Mono
11194         runtime no more has the bug and having this exception raised means
11195         we tried to select a constructor which takes an object and is
11196         passed a null.
11197
11198 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11199
11200         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11201         message (1502, 1503) when we can't locate a method after overload
11202         resolution. This is much more informative and closes the bug
11203         Miguel reported.
11204
11205         * interface.cs (PopulateMethod): Return if there are no argument
11206         types. Fixes a NullReferenceException bug.
11207
11208         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11209         expressions too. Previously we were checking only in one place for
11210         positional arguments leaving out named arguments.
11211
11212         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11213         type to the enum type is not allowed. Remove code corresponding to
11214         that.
11215
11216         (ConvertNumericExplicit): Allow explicit conversions from
11217         the underlying type to enum type. This precisely follows the spec
11218         and closes a bug filed by Gonzalo.
11219
11220 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11221
11222         * compiler.csproj:
11223         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11224
11225 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11226
11227         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11228         it was important that we stored the right value after the
11229         reduction in `converted'.
11230
11231 2002-09-04  Martin Baulig  <martin@gnome.org>
11232
11233         * location.cs (Location.SymbolDocument): Use full pathnames for the
11234         source files.
11235
11236 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11237
11238         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11239         of the expression resolve mechanism, because that will catch the
11240         SimpleName error failures.
11241
11242         (Conditional): If we can not resolve the
11243         expression, return, do not crash.
11244
11245 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11246
11247         * cs-tokenizer.cs:
11248         (location): display token name instead of its number.
11249
11250 2002-08-28  Martin Baulig  <martin@gnome.org>
11251
11252         * expression.cs (Binary.ResolveOperator): Don't silently return
11253         but return an error if an operator cannot be applied between two
11254         enum types.
11255
11256 2002-08-28  Martin Baulig  <martin@gnome.org>
11257
11258         * class.cs (Constructor.Define): Set the permission attributes
11259         correctly instead of making all constructors public.
11260
11261 2002-08-28  Martin Baulig  <martin@gnome.org>
11262
11263         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11264         for private members before reporting a CS0103; if we find anything,
11265         it's a CS0122.
11266
11267 2002-08-28  Martin Baulig  <martin@gnome.org>
11268
11269         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11270         to check whether `closure_start_type == closure_invocation_type',
11271         we also need to check whether `m.DeclaringType == closure_invocation_type'
11272         before bypassing the permission checks.  We might be accessing
11273         protected/private members from the base class.
11274         (TypeManager.RealMemberLookup): Only set private_ok if private
11275         members were requested via BindingFlags.NonPublic.
11276
11277         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11278
11279         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11280         MethodGroupExpr.IsExplicitImpl if appropriate.
11281         (Invocation.DoResolve): Don't report the CS0120 for explicit
11282         interface implementations.
11283
11284 2002-08-27  Martin Baulig  <martin@gnome.org>
11285
11286         * expression.cs (Invocation.DoResolve): If this is a static
11287         method and we don't have an InstanceExpression, we must report
11288         a CS0120.
11289
11290 2002-08-25  Martin Baulig  <martin@gnome.org>
11291
11292         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11293         `==' between a valuetype and an object.
11294
11295 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11296
11297         * ecore.cs (TypeExpr): Provide a ToString method.
11298
11299 2002-08-24  Martin Baulig  <martin@gnome.org>
11300
11301         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11302         now called proggie.dbg and it's a binary file.
11303
11304 2002-08-23  Martin Baulig  <martin@gnome.org>
11305
11306         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11307
11308 2002-08-23  Martin Baulig  <martin@gnome.org>
11309
11310         * struct.cs (MyStructInfo.ctor): Make this work with empty
11311         structs; it's not allowed to use foreach() on null.
11312
11313 2002-08-23  Martin Baulig  <martin@gnome.org>
11314
11315         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11316         writer the full pathname of the generated assembly.
11317
11318 2002-08-23  Martin Baulig  <martin@gnome.org>
11319
11320         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11321         A `finally' block never returns or breaks; improved handling of
11322         unreachable code.
11323
11324 2002-08-23  Martin Baulig  <martin@gnome.org>
11325
11326         * statement.cs (Throw.Resolve): Allow `throw null'.
11327
11328 2002-08-23  Martin Baulig  <martin@gnome.org>
11329
11330         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11331         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11332         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11333         MemberLookup would return a wrong event if this is an explicit
11334         interface implementation and the class has an event with the same
11335         name.
11336
11337 2002-08-23  Martin Baulig  <martin@gnome.org>
11338
11339         * statement.cs (Block.AddChildVariableNames): New public method.
11340         (Block.AddChildVariableName): Likewise.
11341         (Block.IsVariableNameUsedInChildBlock): Likewise.
11342         (Block.AddVariable): Check whether a variable name has already
11343         been used in a child block.
11344
11345         * cs-parser.jay (declare_local_variables): Mark all variable names
11346         from the current block as being used in a child block in the
11347         implicit block.
11348
11349 2002-08-23  Martin Baulig  <martin@gnome.org>
11350
11351         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11352         find the symbol writer.
11353
11354         * driver.cs: csc also allows the arguments to /define being
11355         separated by commas, not only by semicolons.
11356
11357 2002-08-23  Martin Baulig  <martin@gnome.org>
11358
11359         * interface.cs (Interface.GetMembers): Added static check for events.
11360
11361 2002-08-15  Martin Baulig  <martin@gnome.org>
11362
11363         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11364         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11365
11366         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11367         why the MethodData.EmitDestructor() change was necessary.
11368
11369 2002-08-20  Martin Baulig  <martin@gnome.org>
11370
11371         * class.cs (TypeContainer.FindMembers): Added static check for events.
11372
11373         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11374
11375         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11376         use Type.GetEvents(), not Type.FindMembers().
11377
11378 2002-08-20  Martin Baulig  <martin@gnome.org>
11379
11380         * decl.cs (MemberCache): Added a special method cache which will
11381         be used for method-only searched.  This ensures that a method
11382         search will return a MethodInfo with the correct ReflectedType for
11383         inherited methods.      
11384
11385 2002-08-20  Martin Baulig  <martin@gnome.org>
11386
11387         * decl.cs (DeclSpace.FindMembers): Made this public.
11388
11389 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11390
11391         * delegate.cs: fixed build on windows.
11392         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11393
11394 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11395
11396         * ecore.cs (StandardConversionExists): Return a false
11397         if we are trying to convert the void type to anything else
11398         since that is not allowed.
11399
11400         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11401         we flag error 70 in the event an event is trying to be accessed
11402         directly from outside the declaring type.
11403
11404 2002-08-20  Martin Baulig  <martin@gnome.org>
11405
11406         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11407         MemberCache from typemanager.cs to decl.cs.
11408
11409 2002-08-19  Martin Baulig  <martin@gnome.org>
11410
11411         * class.cs (TypeContainer): Implement IMemberContainer.
11412         (TypeContainer.DefineMembers): Create the MemberCache.
11413         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11414         return public members if BindingFlags.Public was given, check
11415         whether members are static.
11416
11417 2002-08-16  Martin Baulig  <martin@gnome.org>
11418
11419         * decl.cs (DeclSpace.Define): Splitted this in Define and
11420         DefineMembers.  DefineMembers is called first and initializes the
11421         MemberCache.
11422
11423         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11424         DefineMembers() on all our DeclSpaces.
11425
11426         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11427         but call DefineMembers() on all nested interfaces.  We call their
11428         Define() in our new Define() function.
11429
11430         * interface.cs (Interface): Implement IMemberContainer.
11431         (Interface.Define): Moved all code except the attribute stuf to
11432         DefineMembers().
11433         (Interface.DefineMembers): Initialize the member cache.
11434
11435         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11436         need this anymore since we can use MemberCache.FindMembers directly.
11437
11438 2002-08-19  Martin Baulig  <martin@gnome.org>
11439
11440         * typemanager.cs (MemberCache): When creating the cache for an
11441         interface type, add all inherited members.
11442         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11443         to `out bool used_cache' and documented it.
11444         (TypeManager.MemberLookup): If we already used the cache in the first
11445         iteration, we don't need to do the interfaces check.
11446
11447 2002-08-19  Martin Baulig  <martin@gnome.org>
11448
11449         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11450         here from IMemberFinder and don't implement this interface anymore.
11451         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11452
11453         * typemanager.cs (IMemberFinder): This interface is now only used by
11454         classes which actually support the member cache.
11455         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11456         since we only put DeclSpaces into this Hashtable.
11457         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11458         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11459
11460 2002-08-16  Martin Baulig  <martin@gnome.org>
11461
11462         * typemanager.cs (ICachingMemberFinder): Removed.
11463         (IMemberFinder.MemberCache): New property.
11464         (TypeManager.FindMembers): Merged this with RealFindMembers().
11465         This function will never be called from TypeManager.MemberLookup()
11466         so we can't use the cache here, just the IMemberFinder.
11467         (TypeManager.MemberLookup_FindMembers): Check whether the
11468         IMemberFinder has a MemberCache and call the cache's FindMembers
11469         function.
11470         (MemberCache): Rewrote larger parts of this yet another time and
11471         cleaned it up a bit.
11472
11473 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11474
11475         * driver.cs (LoadArgs): Support quoting.
11476
11477         (Usage): Show the CSC-like command line arguments.
11478
11479         Improved a few error messages.
11480
11481 2002-08-15  Martin Baulig  <martin@gnome.org>
11482
11483         * typemanager.cs (IMemberContainer.Type): New property.
11484         (IMemberContainer.IsInterface): New property.
11485
11486         The following changes are conditional to BROKEN_RUNTIME, which is
11487         defined at the top of the file.
11488
11489         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11490         class'es members, but add all members from TypeHandle.ObjectType
11491         if we're an interface.
11492         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11493         is the current type.
11494         (MemberCache.CacheEntry.Container): Removed this field.
11495         (TypeHandle.GetMembers): Include inherited members.
11496
11497 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11498
11499         * typemanager.cs: fixed compilation and added a comment on a field that
11500         is never used.
11501
11502 2002-08-15  Martin Baulig  <martin@gnome.org>
11503
11504         * class.cs (ConstructorInitializer.Resolve): In the
11505         Expression.MemberLookup call, use the queried_type as
11506         invocation_type.
11507
11508         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11509         declared' attribute, it's always true.
11510         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11511         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11512         temporary wrapper for FindMembers which tells MemberLookup whether
11513         members from the base classes are included in the return value.
11514         This will go away soon.
11515         (TypeManager.MemberLookup): Use this temporary hack here; once the
11516         new MemberCache is completed, we don't need to do the DeclaredOnly
11517         looping here anymore since the MemberCache will take care of this.
11518         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11519         (MemberCache): When creating the MemberCache for a class, get
11520         members from the current class and all its base classes.
11521         (MemberCache.CacheEntry.Container): New field.  This is a
11522         temporary hack until the Mono runtime is fixed to distinguish
11523         between ReflectedType and DeclaringType.  It allows us to use MCS
11524         with both the MS runtime and the unfixed Mono runtime without
11525         problems and without accecting performance.
11526         (MemberCache.SearchMembers): The DeclaredOnly looping from
11527         TypeManager.MemberLookup is now done here.      
11528
11529 2002-08-14  Martin Baulig  <martin@gnome.org>
11530
11531         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11532         Type.GetFields on dynamic types but get the fields from the
11533         corresponding TypeContainer.
11534         (MyStructInfo.GetStructInfo): Added check for enum types.
11535
11536         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11537         (MemberList.SyncRoot): Implemented.
11538         (TypeManager.FilterWithClosure): No need to check permissions if
11539         closure_start_type == closure_invocation_type, don't crash if
11540         closure_invocation_type is null.
11541
11542 2002-08-13  Martin Baulig  <martin@gnome.org>
11543
11544         Rewrote TypeContainer.FindMembers to use a member cache.  This
11545         gives us a speed increase of about 35% for the self-hosting MCS
11546         build and of about 15-20% for the class libs (both on GNU/Linux).
11547
11548         * report.cs (Timer): New class to get enhanced profiling.  This
11549         whole class is "TIMER" conditional since it remarkably slows down
11550         compilation speed.
11551
11552         * class.cs (MemberList): New class.  This is an IList wrapper
11553         which we're now using instead of passing MemberInfo[]'s around to
11554         avoid copying this array unnecessarily.
11555         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11556         (ICachingMemberFinder, IMemberContainer): New interface.
11557         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11558         has already been checked, otherwise use it for the name comparision.
11559         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11560         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11561         if possible.  Returns a MemberList, not a MemberInfo [].
11562         (TypeHandle): New class, implements IMemberContainer.  We create
11563         one instance of this class per type, it contains a MemberCache
11564         which is used to do the member lookups.
11565         (MemberCache): New class.  Each instance of this class contains
11566         all members of a type and a name-based hash table.
11567         (MemberCache.FindMembers): This is our new member lookup
11568         function.  First, it looks up all members of the requested name in
11569         the hash table.  Then, it walks this list and sorts out all
11570         applicable members and returns them.
11571
11572 2002-08-13  Martin Baulig  <martin@gnome.org>
11573
11574         In addition to a nice code cleanup, this gives us a performance
11575         increase of about 1.4% on GNU/Linux - not much, but it's already
11576         half a second for the self-hosting MCS compilation.
11577
11578         * typemanager.cs (IMemberFinder): New interface.  It is used by
11579         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11580         Enum, Delegate or Interface.
11581         (TypeManager.finder_to_member_finder): New PtrHashtable.
11582         (TypeManager.finder_to_container): Removed.
11583         (TypeManager.finder_to_delegate): Removed.
11584         (TypeManager.finder_to_interface): Removed.
11585         (TypeManager.finder_to_enum): Removed.
11586
11587         * interface.cs (Interface): Implement IMemberFinder.
11588
11589         * delegate.cs (Delegate): Implement IMemberFinder.
11590
11591         * enum.cs (Enum): Implement IMemberFinder.
11592
11593         * class.cs (TypeContainer): Implement IMemberFinder.
11594
11595 2002-08-12  Martin Baulig  <martin@gnome.org>
11596
11597         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11598
11599 2002-08-12  Martin Baulig  <martin@gnome.org>
11600
11601         * ecore.cs (ITypeExpression): New interface for expressions which
11602         resolve to a type.
11603         (TypeExpression): Renamed to TypeLookupExpression.
11604         (Expression.DoResolve): If we're doing a types-only lookup, the
11605         expression must implement the ITypeExpression interface and we
11606         call DoResolveType() on it.
11607         (SimpleName): Implement the new ITypeExpression interface.
11608         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11609         hack, the situation that we're only looking up types can't happen
11610         anymore when this method is called.  Moved the type lookup code to
11611         DoResolveType() and call it.
11612         (SimpleName.DoResolveType): This ITypeExpression interface method
11613         is now doing the types-only lookup.
11614         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11615         (ResolveFlags): Added MaskExprClass.
11616
11617         * expression.cs (MemberAccess): Implement the ITypeExpression
11618         interface.
11619         (MemberAccess.DoResolve): Added support for a types-only lookup
11620         when we're called via ITypeExpression.DoResolveType().
11621         (ComposedCast): Implement the ITypeExpression interface.
11622
11623         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11624         Expression.Resolve() with ResolveFlags.Type instead.
11625
11626 2002-08-12  Martin Baulig  <martin@gnome.org>
11627
11628         * interface.cs (Interface.Define): Apply attributes.
11629
11630         * attribute.cs (Attribute.ApplyAttributes): Added support for
11631         interface attributes.
11632
11633 2002-08-11  Martin Baulig  <martin@gnome.org>
11634
11635         * statement.cs (Block.Emit): Only check the "this" variable if we
11636         do not always throw an exception.
11637
11638         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11639         whether the property has a set accessor.
11640
11641 2002-08-11  Martin Baulig  <martin@gnome.org>
11642
11643         Added control flow analysis support for structs.
11644
11645         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11646         with control flow analysis turned off.
11647         (IVariable): New interface.
11648         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11649         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11650         (FieldExpr.DoResolve): Resolve the instance expression with flow
11651         analysis turned off and do the definite assignment check after the
11652         resolving when we know what the expression will resolve to.
11653
11654         * expression.cs (LocalVariableReference, ParameterReference):
11655         Implement the new IVariable interface, only call the flow analysis
11656         code if ec.DoFlowAnalysis is true.
11657         (This): Added constructor which takes a Block argument.  Implement
11658         the new IVariable interface.
11659         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11660         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11661         This does the definite assignment checks for struct members.
11662
11663         * class.cs (Constructor.Emit): If this is a non-static `struct'
11664         constructor which doesn't have any initializer, call
11665         Block.AddThisVariable() to tell the flow analysis code that all
11666         struct elements must be initialized before control returns from
11667         the constructor.
11668
11669         * statement.cs (MyStructInfo): New public class.
11670         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11671         argument to this indexer.  If non-zero, check an individual struct
11672         member, not the whole struct.
11673         (FlowBranching.CheckOutParameters): Check struct members.
11674         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11675         overloaded versions of these methods which take an additional
11676         `int field_idx' argument to check struct members.
11677         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11678         overloaded versions of these methods which take an additional
11679         `string field_name' argument to check struct member.s
11680         (VariableInfo): Implement the IVariable interface.
11681         (VariableInfo.StructInfo): New public property.  Returns the
11682         MyStructInfo instance of the variable if it's a struct or null.
11683         (Block.AddThisVariable): New public method.  This is called from
11684         Constructor.Emit() for non-static `struct' constructor which do
11685         not have any initializer.  It creates a special variable for the
11686         "this" instance variable which will be checked by the flow
11687         analysis code to ensure that all of the struct's fields are
11688         initialized before control returns from the constructor.
11689         (UsageVector): Added support for struct members.  If a
11690         variable/parameter is a struct with N members, we reserve a slot
11691         in the usage vector for each member.  A struct is considered fully
11692         initialized if either the struct itself (slot 0) or all its
11693         members are initialized.
11694
11695 2002-08-08  Martin Baulig  <martin@gnome.org>
11696
11697         * driver.cs (Driver.MainDriver): Only report an error CS5001
11698         if there were no compilation errors.
11699
11700         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11701         `UnsafeContext' property to determine whether the parent is in
11702         unsafe context rather than checking the parent's ModFlags:
11703         classes nested in an unsafe class are unsafe as well.
11704
11705 2002-08-08  Martin Baulig  <martin@gnome.org>
11706
11707         * statement.cs (UsageVector.MergeChildren): Distinguish between
11708         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11709         we return.  Added test17() and test18() to test-154.cs.
11710
11711 2002-08-08  Martin Baulig  <martin@gnome.org>
11712
11713         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11714         Family access, make sure the invoking type isn't a subclass of the
11715         queried type (that'd be a CS1540).
11716
11717         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11718         this method which takes an additional `Type invocation_type'.
11719
11720         * expression.cs (BaseAccess.DoResolve): Use the base type as
11721         invocation and query type.
11722         (MemberAccess.DoResolve): If the lookup failed and we're about to
11723         report a CS0122, try a lookup with the ec.ContainerType - if this
11724         succeeds, we must report a CS1540.
11725
11726 2002-08-08  Martin Baulig  <martin@gnome.org>
11727
11728         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11729         (MethodGroupExpr): Implement the IMemberExpr interface.
11730
11731         * expression (MemberAccess.ResolveMemberAccess): No need to have
11732         any special code for MethodGroupExprs anymore, they're now
11733         IMemberExprs.   
11734
11735 2002-08-08  Martin Baulig  <martin@gnome.org>
11736
11737         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11738         Family, FamANDAssem and FamORAssem permissions.
11739         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11740
11741 2002-08-08  Martin Baulig  <martin@gnome.org>
11742
11743         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11744         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11745         or loop block.
11746
11747 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11748
11749         * driver.cs: implemented /resource option to embed managed resources.
11750
11751 2002-08-07  Martin Baulig  <martin@gnome.org>
11752
11753         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11754         (FieldBase.HasFieldInitializer): New public property.
11755         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11756         returns the field initializer and makes sure it is only resolved once.
11757         (TypeContainer.EmitFieldInitializers): Call
11758         FieldBase.GetInitializerExpression to get the initializer, this ensures
11759         that it isn't resolved multiple times.
11760
11761         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11762         the resolving process (SimpleName/MemberLookup) that we're currently
11763         emitting a field initializer (which must not access any instance members,
11764         this is an error CS0236).
11765
11766         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11767         argument, if the `IsFieldInitializer' flag is set, we must report and
11768         error CS0236 and not an error CS0120.   
11769
11770 2002-08-07  Martin Baulig  <martin@gnome.org>
11771
11772         * ecore.cs (IMemberExpr): New public interface.
11773         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11774         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11775         if the expression is an IMemberExpr.
11776
11777         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11778         to be null, implicitly default to `this' if we're non-static in
11779         this case.  Simplified the code a lot by using the new IMemberExpr
11780         interface.  Also fixed bug #28176 here.
11781
11782 2002-08-06  Martin Baulig  <martin@gnome.org>
11783
11784         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11785         ParameterReferences during semantic analysis so that we can do a
11786         type-only search when resolving Cast, TypeOf and SizeOf.
11787         (block): Pass the `current_local_parameters' to the Block's
11788         constructor.
11789
11790         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11791         argument to the constructor.
11792         (ConstructorInitializer.Resolve): Create a temporary implicit
11793         block with the parameters.
11794
11795         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11796         references here if we aren't doing a type-only search.
11797
11798         * statement.cs (Block): Added constructor which takes a
11799         `Parameters parameters' argument.
11800         (Block.Parameters): New public property.
11801
11802         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11803         to `Parameters' and made it public readonly.
11804
11805 2002-08-06  Martin Baulig  <martin@gnome.org>
11806
11807         * ecore.cs (Expression.Warning): Made this public as well.
11808
11809         * report.cs (Report.Debug): Print the contents of collections.
11810
11811 2002-08-06  Martin Baulig  <martin@gnome.org>
11812
11813         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11814         used to tell Resolve() which kinds of expressions it may return.
11815         (Expression.Resolve): Added overloaded version of this method which
11816         takes a `ResolveFlags flags' argument.  This can be used to tell
11817         Resolve() which kinds of expressions it may return.  Reports a
11818         CS0118 on error.
11819         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11820         ResolveFlags.SimpleName.
11821         (Expression.Error118): Added overloaded version of this method which
11822         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11823         which kinds of expressions are allowed.
11824
11825         * expression.cs (Argument.ResolveMethodGroup): New public method.
11826         Resolves an argument, but allows a MethodGroup to be returned.
11827         This is used when invoking a delegate.
11828
11829         * TODO: Updated a bit.
11830
11831 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11832
11833         Fixed compilation with csc.
11834
11835         * ecore.cs: Expression.Error made public. Is this correct? Should
11836         Warning be made public too?
11837
11838         * expression.cs: use ea.Location instead of ea.loc.
11839         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11840
11841 2002-08-06  Martin Baulig  <martin@gnome.org>
11842
11843         * ecore.cs (Expression.loc): Moved the location here instead of
11844         duplicating it in all derived classes.
11845         (Expression.Location): New public property.
11846         (Expression.Error, Expression.Warning): Made them non-static and
11847         removed the location argument.
11848         (Expression.Warning): Added overloaded version which takes an
11849         `int level' argument.
11850         (Expression.Error118): Make this non-static and removed the
11851         expression and location arguments.
11852         (TypeExpr): Added location argument to the constructor.
11853
11854         * expression.cs (StaticCallExpr): Added location argument to
11855         the constructor.
11856         (Indirection, PointerArithmetic): Likewise.
11857         (CheckedExpr, UnCheckedExpr): Likewise.
11858         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11859         (StringPtr): Likewise.
11860
11861
11862 2002-08-05  Martin Baulig  <martin@gnome.org>
11863
11864         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11865
11866         * assign.cs (Assign.DoResolve): Check whether the source
11867         expression is a value or variable.
11868
11869         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11870         while resolving the corresponding blocks.
11871
11872         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11873         an error, don't silently return null.
11874
11875         * statement.cs (Block.AddVariable): Do the error reporting here
11876         and distinguish between CS0128 and CS0136.
11877         (Block.DoResolve): Report all unused labels (warning CS0164).
11878         (LabeledStatement): Pass the location to the constructor.
11879         (LabeledStatement.HasBeenReferenced): New property.
11880         (LabeledStatement.Resolve): Set it to true here.
11881
11882         * statement.cs (Return.Emit): Return success even after reporting
11883         a type mismatch error (CS0126 or CS0127), this is what csc does and
11884         it avoids confusing the users with any consecutive errors.
11885
11886 2002-08-05  Martin Baulig  <martin@gnome.org>
11887
11888         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11889
11890         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11891
11892         * expression.cs (MemberAccess.DoResolve): Silently return if an
11893         error has already been reported.
11894
11895         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11896         error has already been reported.
11897
11898 2002-08-05  Martin Baulig  <martin@gnome.org>
11899
11900         * statement.cs (UsageVector): Only initialize the `parameters'
11901         vector if we actually have any "out" parameters.
11902
11903 2002-08-05  Martin Baulig  <martin@gnome.org>
11904
11905         * expression.cs (Binary.ResolveOperator): When combining delegates,
11906         they must have the same type.
11907
11908 2002-08-05  Martin Baulig  <martin@gnome.org>
11909
11910         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11911         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11912         work with the ms runtime and we also don't need it: if we're a
11913         PropertyBuilder and not in the `indexer_arguments' hash, then we
11914         are a property and not an indexer.
11915
11916         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11917         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11918         since the latter one doesn't work with the ms runtime.
11919
11920 2002-08-03  Martin Baulig  <martin@gnome.org>
11921
11922         Fixed bugs #27998 and #22735.
11923
11924         * class.cs (Method.IsOperator): New public field.
11925         (Method.CheckBase): Report CS0111 if there's already a method
11926         with the same parameters in the current class.  Report CS0508 when
11927         attempting to change the return type of an inherited method.
11928         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11929         and it's not marked abstract or extern.
11930         (PropertyBase): New abstract base class for Property and Indexer.
11931         (PropertyBase.CheckBase): Moved here from Property and made it work
11932         for indexers.
11933         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11934         the same so we can reuse it there.
11935         (Property, Indexer): Derive from PropertyBase.
11936         (MethodSignature.inheritable_property_signature_filter): New delegate
11937         to find properties and indexers.
11938
11939         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11940         argument and improved error reporting.
11941
11942         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11943         EmptyReadOnlyParameters and made it a property.
11944
11945         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11946         version of this method which takes a `PropertyInfo indexer'.
11947         (TypeManager.RegisterIndexer): New method.
11948
11949         * class.cs: Added myself as author of this file :-)
11950
11951 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11952
11953         * class.cs: fixed compilation on windoze.
11954
11955 2002-08-03  Martin Baulig  <martin@gnome.org>
11956
11957         * interface.cs (Interface.GetInterfaceBases): Check whether all
11958         base interfaces are at least as accessible than the current one.
11959
11960         * class.cs (TypeContainer.GetClassBases): Check whether base types
11961         are at least as accessible than the current type.
11962         (TypeContainer.AsAccessible): Implemented and made non-static.
11963         (MemberBase.CheckParameters): Report errors if the accessibility
11964         checks fail.
11965
11966         * delegate.cs (Delegate.Delegate): The default visibility is
11967         internal for top-level types and private for nested types.
11968         (Delegate.Define): Report errors if the accessibility checks fail.
11969
11970         * enum.cs (Enum.Enum): The default visibility is internal for
11971         top-level types and private for nested types.
11972         (Enum.DefineType): Compute the correct visibility.
11973
11974         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11975         function which takes a `bool is_toplevel' instead of a TypeContainer.
11976
11977         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11978         builtin type.
11979
11980 2002-08-02  Martin Baulig  <martin@gnome.org>
11981
11982         * expression.cs (LocalVariableReferenc): Added constructor which
11983         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11984         (LocalVariableReference.IsReadOnly): New property.
11985         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11986         variable is readonly, use our own readonly flag to do this; you can
11987         use the new constructor to get a writable reference to a read-only
11988         variable.
11989
11990         * cs-parser.jay (foreach_statement, using_statement): Get a writable
11991         reference to the local variable.
11992
11993 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
11994
11995         * rootcontext.cs (ResolveCore): Also include System.Exception
11996
11997         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11998         we reach an EmptyStatement.
11999
12000         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12001         is also fine.
12002
12003         * expression.cs (Binary.ResolveOperator): Check error result in
12004         two places.
12005
12006         use brtrue/brfalse directly and avoid compares to null.
12007
12008 2002-08-02  Martin Baulig  <martin@gnome.org>
12009
12010         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12011         Fixes bug #28407, added test-155.cs.
12012
12013 2002-08-01  Martin Baulig  <martin@gnome.org>
12014
12015         * class.cs (Event.EmitDefaultMethod): Make this work with static
12016         events.  Fixes #28311, added verify-3.cs.
12017
12018 2002-08-01  Martin Baulig  <martin@gnome.org>
12019
12020         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12021         `is_disposable' fields.
12022         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12023         `hm.is_disposable' if we're using the collection pattern.
12024         (Foreach.EmitCollectionForeach): Use the correct type for the
12025         enumerator's local variable, only emit the try/finally block if
12026         necessary (fixes #27713).
12027
12028 2002-08-01  Martin Baulig  <martin@gnome.org>
12029
12030         * ecore.cs (Expression.report118): Renamed to Error118 and made
12031         it public static.
12032
12033         * statement.cs (Throw.Resolve): Check whether the expression is of
12034         the correct type (CS0118) and whether the type derives from
12035         System.Exception (CS0155).
12036         (Catch.Resolve): New method.  Do the type lookup here and check
12037         whether it derives from System.Exception (CS0155).
12038         (Catch.CatchType, Catch.IsGeneral): New public properties.
12039
12040         * typemanager.cs (TypeManager.exception_type): Added.
12041
12042 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12043
12044         * driver.cs: Updated About function.
12045
12046 2002-07-31  Martin Baulig  <martin@gnome.org>
12047
12048         Implemented Control Flow Analysis.
12049
12050         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12051         (EmitContext.CurrentBranching): Added.
12052         (EmitContext.StartFlowBranching): Added.
12053         (EmitContext.EndFlowBranching): Added.
12054         (EmitContext.KillFlowBranching): Added.
12055         (EmitContext.IsVariableAssigned): Added.
12056         (EmitContext.SetVariableAssigned): Added.
12057         (EmitContext.IsParameterAssigned): Added.
12058         (EmitContext.SetParameterAssigned): Added.
12059         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12060         Added control flow analysis stuff here.
12061
12062         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12063         resolve the expression as lvalue.
12064         (LocalVariableReference.DoResolve): Check whether the variable has
12065         already been assigned.
12066         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12067         the parameter as assigned here.
12068         (ParameterReference.DoResolve): Check whether the parameter has already
12069         been assigned.
12070         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12071         expression as lvalue.
12072
12073         * statement.cs (FlowBranching): New class for the flow analysis code.
12074         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12075         (LabeledStatement.IsDefined): New public property.
12076         (LabeledStatement.AddUsageVector): New public method to tell flow
12077         analyis that the label may be reached via a forward jump.
12078         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12079         flow analysis.
12080         (VariableInfo.Number): New public field.  This is used by flow analysis
12081         to number all locals of a block.
12082         (Block.CountVariables): New public property.  This is the number of
12083         local variables in this block (including the locals from all parent
12084         blocks).
12085         (Block.EmitMeta): Number all the variables.
12086
12087         * statement.cs: Added flow analysis support to all classes.
12088
12089 2002-07-31  Martin Baulig  <martin@gnome.org>
12090
12091         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12092         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12093         then use this argument.
12094
12095         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12096
12097         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12098         use this to specify /define options.
12099
12100 2002-07-29  Martin Baulig  <martin@gnome.org>
12101
12102         * statement.cs (Fixed): Moved all code that does variable lookups
12103         and resolvings from Emit to Resolve.
12104
12105         * statement.cs (For): Moved all code that does variable lookups
12106         and resolvings from Emit to Resolve.
12107
12108         * statement.cs (Using): Moved all code that does variable lookups
12109         and resolvings from Emit to Resolve.
12110
12111 2002-07-29  Martin Baulig  <martin@gnome.org>
12112
12113         * attribute.cs (Attribute.Resolve): Explicitly catch a
12114         System.NullReferenceException when creating the
12115         CustromAttributeBuilder and report a different warning message.
12116
12117 2002-07-29  Martin Baulig  <martin@gnome.org>
12118
12119         * support.cs (ParameterData.ParameterName): Added method to
12120         get the name of a parameter.
12121
12122         * typemanager.cs (TypeManager.IsValueType): New public method.
12123
12124 2002-07-29  Martin Baulig  <martin@gnome.org>
12125
12126         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12127         is a flag which specifies that it's either ref or out.
12128         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12129         the out parameter to `out Parameter.Modifier mod', also set the
12130         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12131
12132         * support.cs (InternalParameters.ParameterModifier): Distinguish
12133         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12134         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12135
12136         * expression.cs (Argument.GetParameterModifier): Distinguish
12137         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12138         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12139
12140 2002-07-29  Martin Baulig  <martin@gnome.org>
12141
12142         * expression.cs (ParameterReference.ParameterReference): Added
12143         `Location loc' argument to the constructor.
12144
12145         * cs-parser.jay: Pass location to ParameterReference.
12146
12147 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12148
12149         * statement.cs (Try): Initialize the location.
12150
12151         * cs-parser.jay: pass location to Try.
12152
12153         * expression.cs (Unary.Reduce): Change the prototype to return
12154         whether a constant fold could be performed or not.  The result is
12155         returned in an out parameters.  In the case of Indirection and
12156         AddressOf, we want to perform the full tests.
12157
12158 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12159
12160         * statement.cs (Statement.Emit): Flag dead code.
12161
12162 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12163
12164         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12165
12166 2002-07-27  Martin Baulig  <martin@gnome.org>
12167
12168         * class.cs (MethodData.Define): Put back call to
12169         TypeManager.AddMethod(), accidentally commented this out.
12170
12171         * report.cs (Debug): New public method to print debugging information,
12172         this is `[Conditional ("DEBUG")]'.
12173
12174 2002-07-26  Martin Baulig  <martin@gnome.org>
12175
12176         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12177         (switch_statement): Push the current_block to the switch_stack and
12178         pop it again when we're done with the switch.
12179         (switch_section): The new block is a child of the current_block.
12180         Fixes bug #24007, added test-152.cs.
12181
12182 2002-07-27  Martin Baulig  <martin@gnome.org>
12183
12184         * expression.cs (Invocation.EmitArguments): When calling a varargs
12185         function with only its fixed arguments, we need to pass an empty
12186         array.
12187
12188 2002-07-27  Martin Baulig  <martin@gnome.org>
12189
12190         Mono 0.13 has been released.
12191
12192 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12193
12194         * driver.cs: Rename --resource to --linkres, because that is what
12195         we do currently, we dont support --resource yet.
12196
12197         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12198
12199 2002-07-25  Martin Baulig  <martin@gnome.org>
12200
12201         * class.cs (MethodData): New public class.  This is a `method builder'
12202         class for a method or one accessor of a Property/Indexer/Event.
12203         (MethodData.GetMethodFlags): Moved here from MemberBase.
12204         (MethodData.ApplyAttributes): Likewise.
12205         (MethodData.ApplyObsoleteAttribute): Likewise.
12206         (MethodData.ApplyConditionalAttribute): Likewise.
12207         (MethodData.ApplyDllImportAttribute): Likewise.
12208         (MethodData.CheckAbstractAndExternal): Likewise.
12209         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12210         (MethodData.Emit): Formerly known as Method.Emit().
12211         (MemberBase): Moved everything which was specific to a single
12212         accessor/method to MethodData.
12213         (Method): Create a new MethodData and call Define() and Emit() on it.
12214         (Property, Indexer, Event): Create a new MethodData objects for each
12215         accessor and call Define() and Emit() on them.
12216
12217 2002-07-25  Martin Baulig  <martin@gnome.org>
12218
12219         Made MethodCore derive from MemberBase to reuse the code from there.
12220         MemberBase now also checks for attributes.
12221
12222         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12223         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12224         as virtual.
12225         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12226         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12227         (MemberBase.ApplyAttributes): New virtual method; applies the
12228         attributes to a method or accessor.
12229         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12230         (MemberBase.ApplyConditionalAttribute): Likewise.
12231         (MemberBase.ApplyDllImportAttribute): Likewise.
12232         (MemberBase.CheckAbstractAndExternal): Likewise.
12233         (MethodCore.ParameterTypes): This is now a property instead of a
12234         method, it's initialized from DoDefineParameters().
12235         (MethodCore.ParameterInfo): Removed the set accessor.
12236         (MethodCore.DoDefineParameters): New protected virtual method to
12237         initialize ParameterTypes and ParameterInfo.
12238         (Method.GetReturnType): We can now simply return the MemberType.
12239         (Method.GetMethodFlags): Override the MemberBase version and add
12240         the conditional flags.
12241         (Method.CheckBase): Moved some code from Define() here, call
12242         DoDefineParameters() here.
12243         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12244         here to avoid some larger code duplication.
12245         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12246         ensure that abstract and external accessors don't declare a body.
12247
12248         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12249         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12250         lookup in the attribute's parent classes, so we need to abort as soon
12251         as we found the first match.
12252         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12253         the attribute has no arguments.
12254
12255         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12256         of a Method.
12257
12258 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12259
12260         * cs-parser.jay: reverted previous patch.
12261
12262 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12263
12264         * cs-parser.jay: fixed bug #22119.
12265
12266 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12267
12268         * attribute.cs: fixed compilation. The error was:
12269         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12270         be assigned to before control leaves the current method."
12271         [FIXME:  Filed as bug #28186: MCS must report this error.]
12272
12273 2002-07-25  Martin Baulig  <martin@gnome.org>
12274
12275         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12276         method to pull the condition name ouf of a Conditional attribute.
12277         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12278         the obsolete message and error flag out of an Obsolete attribute.
12279
12280         * class.cs (Method.GetMethodFlags): New public method to get the
12281         TypeManager.MethodFlags for this method.
12282         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12283         private methods.
12284         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12285         if we're overriding a virtual function, set the new private variable
12286         `parent_method'; call the new TypeManager.AddMethod().
12287
12288         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12289         the MethodBuilder and the Method in a PtrHashtable.
12290         (TypeManager.builder_to_method): Added for this purpose.
12291         (TypeManager.MethodFlags): Added IsObsoleteError.
12292         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12293         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12294         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12295         the message from the attribute.
12296
12297 2002-07-24  Martin Baulig  <martin@gnome.org>
12298
12299         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12300         preprocessor directives, ensure that the argument to #define/#undef is
12301         exactly one identifier and that it's actually an identifier.
12302
12303         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12304         did not work ....
12305
12306 2002-07-24  Martin Baulig  <martin@gnome.org>
12307
12308         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12309         initialize it to TypeManager.object_type in the constructor.
12310         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12311         of the `hm.get_current' method if we're using the collection pattern.
12312         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12313         for the explicit conversion to make it work when we're using the collection
12314         pattern and the `Current' property has a different return type than `object'.
12315         Fixes #27713.
12316
12317 2002-07-24  Martin Baulig  <martin@gnome.org>
12318
12319         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12320         does not match, but don't report any errors.  This method is called in
12321         order for all methods in a MethodGroupExpr until a matching method is
12322         found, so we don't want to bail out if the first method doesn't match.
12323         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12324         matches, report the 123.  Fixes #28070.
12325
12326 2002-07-24  Martin Baulig  <martin@gnome.org>
12327
12328         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12329         TypeManager.TypeToCoreType() to the top of the method so the
12330         following equality checks will work.  Fixes #28107.
12331
12332 2002-07-24  Martin Baulig  <martin@gnome.org>
12333
12334         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12335         operand is of type uint, and the other operand is of type sbyte,
12336         short or int, the operands are converted to type long." -
12337         Actually do what this comment already told us.  Fixes bug #28106,
12338         added test-150.cs.
12339
12340 2002-07-24  Martin Baulig  <martin@gnome.org>
12341
12342         * class.cs (MethodBase): New abstract class.  This is now a base
12343         class for Property, Indexer and Event to avoid some code duplication
12344         in their Define() and DefineMethods() methods.
12345         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12346         generic methods for Define() and DefineMethods().
12347         (FieldBase): Derive from MemberBase, not MemberCore.
12348         (Property): Derive from MemberBase, not MemberCore.
12349         (Property.DefineMethod): Moved all the code from this method to the
12350         new MethodBase.DefineAccessor(), just call it with appropriate
12351         argumetnts.
12352         (Property.Define): Call the new Property.DoDefine(), this does some
12353         sanity checks and we don't need to duplicate the code everywhere.
12354         (Event): Derive from MemberBase, not MemberCore.
12355         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12356         accessors, this will also make them work with interface events.
12357         (Indexer): Derive from MemberBase, not MemberCore.
12358         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12359         (Indexer.Define): Use the new MethodBase functions.
12360
12361         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12362         argument to the constructor.
12363         (Interface.FindMembers): Added support for interface events.
12364         (Interface.PopluateEvent): Implemented.
12365
12366         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12367
12368 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12369
12370         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12371         but this is required to check for a method name being the same as
12372         the containing class.  
12373
12374         Handle this now.
12375
12376 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12377
12378         * interface.cs: initialize variable.
12379
12380 2002-07-23  Martin Baulig  <martin@gnome.org>
12381
12382         Implemented the IndexerName attribute in interfaces.
12383
12384         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12385         name if this is an explicit interface implementation.
12386         (Indexer.InterfaceIndexerName): New public variable.  If we're
12387         implementing an interface indexer, this is the IndexerName in that
12388         interface.  Otherwise, it's the IndexerName.
12389         (Indexer.DefineMethod): If we're implementing interface indexer,
12390         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12391         and Pending.ImplementIndexer methods.
12392         (Indexer.Define): Also define the PropertyBuilder if we're
12393         implementing an interface indexer and this is neither an explicit
12394         interface implementation nor do the IndexerName match the one in
12395         the interface.
12396
12397         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12398         If a method is defined here, then we always need to create a proxy
12399         for it.  This is used when implementing interface indexers.
12400         (Pending.IsInterfaceIndexer): New public method.
12401         (Pending.ImplementIndexer): New public method.
12402         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12403         This is used when implementing interface indexers to define a proxy
12404         if necessary.
12405         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12406         define a proxy if necessary.
12407
12408         * interface.cs (Interface.IndexerName): New public variable.
12409         (Interface.PopulateIndexer): Set the IndexerName.
12410         (Interface.DefineIndexers): New private method.  Populate all the
12411         indexers and make sure their IndexerNames match.
12412
12413         * typemanager.cs (IndexerPropertyName): Added support for interface
12414         indexers.
12415
12416 2002-07-22  Martin Baulig  <martin@gnome.org>
12417
12418         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12419         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12420         ret if HasReturnLabel.
12421         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12422         variables.
12423
12424         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12425         and set the ec.LoopBeginTryCatchLevel.
12426         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12427         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12428         the current ec.TryCatchLevel, the branch goes out of an exception
12429         block.  In this case, we need to use Leave and not Br.
12430
12431 2002-07-22  Martin Baulig  <martin@gnome.org>
12432
12433         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12434         block unless the block does not always return or it is contained in
12435         another try { ... } catch { ... } block.  Fixes bug #26506.
12436         Added verify-1.cs to the test suite.
12437
12438 2002-07-22  Martin Baulig  <martin@gnome.org>
12439
12440         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12441         then we do not always return.  Fixes bug #24985.
12442
12443 2002-07-22  Martin Baulig  <martin@gnome.org>
12444
12445         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12446         lookup on a per-class level; ie. walk up the class hierarchy until we
12447         found at least one applicable method, then choose the best among them.
12448         Fixes bug #24463 and test-29.cs.
12449
12450 2002-07-22  Martin Baulig  <martin@gnome.org>
12451
12452         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12453         return types of the methods.  The return type is not part of the
12454         signature and we must not check it to make the `new' modifier work.
12455         Fixes bug #27999, also added test-147.cs.
12456         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12457
12458         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12459         on the method's return type.
12460
12461 2002-07-21  Martin Baulig  <martin@gnome.org>
12462
12463         * assign.cs: Make this work if the rightmost source is a constant and
12464         we need to do an implicit type conversion.  Also adding a few more tests
12465         to test-38.cs which should have caught this.
12466
12467         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12468         target in the makefile for this.  The makefile.gnu is primarily intended
12469         for end-users who don't want to debug the compiler.
12470
12471 2002-07-21  Martin Baulig  <martin@gnome.org>
12472
12473         * assign.cs: Improved the Assign class so it can now handle embedded
12474         assignments (X = Y = Z = something).  As a side-effect this'll now also
12475         consume less local variables.  test-38.cs now passes with MCS, added
12476         a few new test cases to that test.
12477
12478 2002-07-20  Martin Baulig  <martin@gnome.org>
12479
12480         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12481         instructions.  Fixes bug #27977, also added test-146.cs.
12482
12483 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12484
12485         * cs-tokenizer.cs: fixed getHex ().
12486
12487 2002-07-19  Martin Baulig  <martin@gnome.org>
12488
12489         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12490         not Type.GetType() to lookup the array type.  This is needed when
12491         we're constructing an array of a user-defined type.
12492         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12493         single-dimensional arrays, but also for single-dimensial arrays of
12494         type decimal.
12495
12496 2002-07-19  Martin Baulig  <martin@gnome.org>
12497
12498         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12499         this function is called, it's not allowed to share LocalBuilders
12500         among ILGenerators.
12501
12502 2002-07-19  Martin Baulig  <martin@gnome.org>
12503
12504         * expression.cs (Argument.Resolve): Report an error 118 when trying
12505         to pass a type as argument.
12506
12507 2002-07-18  Martin Baulig  <martin@gnome.org>
12508
12509         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12510         Conv_R_Un for the signed `long' type.
12511
12512 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12513
12514         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12515         `expr' for the temporary result, as that will fail if we do
12516         multiple resolves on the same expression.
12517
12518 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12519
12520         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12521         ec.TypeContainer for looking up aliases. 
12522
12523         * class.cs (TypeContainer): Remove LookupAlias from here.
12524
12525         * decl.cs (DeclSpace); Move here.
12526
12527 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12528
12529         * class.cs (FindMembers): Only call filter if the constructor
12530         bulider is not null.
12531
12532         Also handle delegates in `NestedTypes' now.  Now we will perform
12533         type lookups using the standard resolution process.  This also
12534         fixes a bug.
12535
12536         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12537         This uses Expressions (the limited kind that can be parsed by the
12538         tree) instead of strings.
12539
12540         * expression.cs (ComposedCast.ToString): Implement, used to flag
12541         errors since now we have to render expressions.
12542
12543         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12544         FormArrayType. 
12545
12546         * ecore.cs (SimpleName.ToString): ditto.
12547
12548         * cs-parser.jay: Instead of using strings to assemble types, use
12549         Expressions to assemble the type (using SimpleName, ComposedCast,
12550         MemberAccess).  This should fix the type lookups in declarations,
12551         because we were using a different code path for this.
12552
12553         * statement.cs (Block.Resolve): Continue processing statements
12554         even when there is an error.
12555
12556 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12557
12558         * class.cs (Event.Define): Also remove the `remove' method from
12559         the list of pending items.
12560
12561         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12562         generate more compact code. 
12563
12564 2002-07-17  Martin Baulig  <martin@gnome.org>
12565
12566         * const.cs (Const.LookupConstantValue): Add support for constant
12567         `unchecked' and `checked' expressions.
12568         Also adding test case test-140.cs for this.
12569
12570 2002-07-17  Martin Baulig  <martin@gnome.org>
12571
12572         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12573         check whether mi.ReturnType implements the IEnumerator interface; the
12574         `==' and the IsAssignableFrom() will fail in this situation.
12575
12576 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12577
12578         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12579         here too.
12580
12581 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12582
12583         * expression.cs: fixed bug #27811.
12584
12585 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12586
12587         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12588         Molaro: when we are a ref, the value already contains a pointer
12589         value, do not take the address of it.
12590
12591 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12592         * removed mb-parser.jay and mb-tokenizer.cs
12593
12594 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12595
12596         * expression.cs: check against the building corlib void type.
12597
12598 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12599
12600         * ecore.cs: fix for valuetype static readonly fields: when 
12601         initializing them, we need their address, not the address of a copy.
12602
12603 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12604
12605         * typemanager.cs: register also enum_type in corlib.
12606
12607 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12608
12609         * class.cs: allow calling this (but not base) initializers in structs.
12610
12611 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12612
12613         * ecore.cs: make sure we compare against the building base types
12614         in GetTypeSize ().
12615
12616 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12617
12618         * typemanager.cs: fix TypeToCoreType() to handle void and object
12619         (corlib gets no more typerefs after this change).
12620
12621 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12622
12623         * expression.cs (ArrayCreation.EmitArrayArguments): use
12624         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12625
12626         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12627         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12628         array indexes, the runtime actually forbids them.
12629
12630         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12631         for array arguments here.
12632
12633         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12634         instead of the default for ValueTypes.
12635
12636         (New.DoEmit): Use IsValueType instead of
12637         IsSubclassOf (value_type)
12638         (New.DoResolve): ditto.
12639         (Invocation.EmitCall): ditto.
12640
12641         * assign.cs (Assign): ditto.
12642
12643         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12644         Statements *are* currently doing part of their resolution during
12645         Emit.  
12646
12647         Expressions do always resolve during resolve, but statements are
12648         only required to propagate resolution to their children.
12649
12650 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12651
12652         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12653
12654         (LoadAssembly): Do not add the dll if it is already specified
12655
12656         (MainDriver): Add the System directory to the link path at the end,
12657         after all the other -L arguments. 
12658
12659         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12660         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12661         ldelem.u1) and using the opposite for sbytes.
12662
12663         This fixes Digger, and we can finally run it.
12664
12665         * driver.cs (UnixParseOption): Move the option parsing here.  
12666         (CSCParseOption): Implement CSC-like parsing of options.
12667
12668         We now support both modes of operation, the old Unix way, and the
12669         new CSC-like way.  This should help those who wanted to make cross
12670         platform makefiles.
12671
12672         The only thing broken is that /r:, /reference: and /lib: are not
12673         implemented, because I want to make those have the same semantics
12674         as the CSC compiler has, and kill once and for all the confussion
12675         around this.   Will be doing this tomorrow.
12676
12677         * statement.cs (Unsafe.Resolve): The state is checked during
12678         resolve, not emit, so we have to set the flags for IsUnsfe here.
12679
12680 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12681
12682         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12683         not catch the Error_ObjectRefRequired in SimpleName (as it is
12684         possible to have a class/instance variable name that later gets
12685         deambiguated), we have to check this here.      
12686
12687 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12688
12689         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12690         make static and put into Expression.
12691
12692         (Event.Define): Register the private field of the event with the 
12693         TypeManager so that GetFieldFromEvent can get at it.
12694
12695         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12696         keep track of the private field associated with an event which
12697         has no accessors.
12698
12699         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12700         private field.
12701
12702         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12703
12704 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12705
12706         * expression.cs (Binary.EmitBranchable): this routine emits the
12707         Binary expression in a branchable context.  This basically means:
12708         we need to branch somewhere, not just get the value on the stack.
12709
12710         This works together with Statement.EmitBoolExpression.
12711
12712         * statement.cs (Statement.EmitBoolExpression): Use
12713         EmitBranchable. 
12714
12715 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12716
12717         * statement.cs (For): Reduce the number of jumps in loops.
12718
12719         (For): Implement loop inversion for the For statement.
12720
12721         (Break): We can be breaking out of a Try/Catch controlled section
12722         (foreach might have an implicit try/catch clause), so we need to
12723         use Leave instead of Br.
12724
12725         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12726         now).  If the instace expression supports IMemoryLocation, we use
12727         the AddressOf method from the IMemoryLocation to extract the
12728         address instead of emitting the instance.
12729
12730         This showed up with `This', as we were emitting the instance
12731         always (Emit) instead of the Address of This.  Particularly
12732         interesting when This is a value type, as we dont want the Emit
12733         effect (which was to load the object).
12734
12735 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12736
12737         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12738
12739         * statement.cs (Checked): Set the CheckedState during the resolve
12740         process too, as the ConvCast operations track the checked state on
12741         the resolve process, and not emit.
12742
12743         * cs-parser.jay (namespace_member_declaration): Flag that we have
12744         found a declaration when we do.  This is used to flag error 1529
12745
12746         * driver.cs: Report ok when we display the help only.
12747
12748 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12749
12750         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12751
12752 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12753
12754         * cs-tokenizer.cs (define): We also have to track locally the
12755         defines.  AllDefines is just used for the Conditional Attribute,
12756         but we also need the local defines for the current source code. 
12757
12758 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12759
12760         * statement.cs (While, For, Do): These loops can exit through a
12761         Break statement, use this information to tell whether the
12762         statement is the last piece of code.
12763
12764         (Break): Flag that we break.
12765
12766         * codegen.cs (EmitContexts): New `Breaks' state variable.
12767
12768 2002-07-03  Martin Baulig  <martin@gnome.org>
12769
12770         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12771         modifiers in method declarations in structs.  Otherwise, you won't
12772         be able to override things like Object.Equals().
12773
12774 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12775
12776         * class.cs (Method, Property, Indexer): Do not allow the public
12777         modifier to be used in explicit interface implementations.
12778
12779         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12780         override modifiers in method declarations in structs
12781
12782 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12783
12784         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12785         integer or real overflow, report an error
12786
12787 2002-07-02  Martin Baulig  <martin@gnome.org>
12788
12789         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12790         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12791         to tell the runtime about our newly created System.Object and
12792         System.ValueType types.
12793
12794 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12795
12796         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12797         struct instead of Ldarg/Starg.
12798
12799 2002-07-02  Martin Baulig  <martin@gnome.org>
12800
12801         * expression.cs (Indirection.Indirection): Call
12802         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12803
12804 2002-07-02  Martin Baulig  <martin@gnome.org>
12805
12806         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12807         ValueType, call TypeManager.TypeToCoreType() on it.
12808         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12809         the OpCodes.Newarr argument.
12810
12811 2002-07-02  Martin Baulig  <martin@gnome.org>
12812
12813         * expression.cs (Invocation.EmitCall): When compiling corlib,
12814         replace all calls to the system's System.Array type to calls to
12815         the newly created one.
12816
12817         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12818         System.Array methods.
12819         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12820         from the system's System.Array type which must be replaced.
12821
12822 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12823
12824         * typemanager.cs: load unverifiable_code_ctor so we can build
12825         corlib using the correct type. Avoid using GetTypeCode() with
12826         TypeBuilders.
12827         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12828         TypeManager.object_type to allow building corlib.
12829
12830 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12831
12832         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12833
12834 2002-07-01  Martin Baulig  <martin@gnome.org>
12835
12836         * class.cs: Make the last change actually work, we need to check
12837         whether `ifaces != null' to avoid a crash.
12838
12839 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12840
12841         * class.cs: when we build structs without fields that implement
12842         interfaces, we need to add the interfaces separately, since there is
12843         no API to both set the size and add the interfaces at type creation
12844         time.
12845
12846 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12847
12848         * expression.cs: the dimension arguments to the array constructors
12849         need to be converted if they are a long.
12850
12851 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12852
12853         * class.cs: don't emit ldarg.0 if there is no parent constructor
12854         (fixes showstopper for corlib).
12855
12856 2002-06-29  Martin Baulig  <martin@gnome.org>
12857
12858         MCS now compiles corlib on GNU/Linux :-)
12859
12860         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12861         ie. check for MethodImplOptions.InternalCall.
12862
12863         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12864         and TypeManager.attribute_type are null, so we must explicitly check
12865         whether parent is not null to find out whether it's an attribute type.
12866         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12867         and SetBuilder, not only if the property is neither abstract nor external.
12868         This is necessary to set the MethodImplOptions on the accessor methods.
12869         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12870         SetBuilder, see Property.Emit().
12871
12872         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12873         populate "System.Object", "System.ValueType" and "System.Attribute" since
12874         they've already been populated from BootCorlib_PopulateCoreTypes().
12875
12876 2002-06-29  Martin Baulig  <martin@gnome.org>
12877
12878         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12879         is the NullLiteral, we also need to make sure that target_type is not
12880         an enum type.   
12881
12882 2002-06-29  Martin Baulig  <martin@gnome.org>
12883
12884         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12885         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12886         before calling BootstrapCorlib_ResolveDelegate ().
12887
12888 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12889
12890         * statement.cs: fixed build-breaker. All tests passed ok.
12891
12892 2002-06-27  Martin Baulig  <martin@gnome.org>
12893
12894         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12895         for System.Decimal when compiling corlib.
12896
12897 2002-06-27  Martin Baulig  <martin@gnome.org>
12898
12899         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12900         switch blocks which contain nothing but a default clause.
12901
12902 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12903
12904        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12905
12906 2002-06-27  Martin Baulig  <martin@gnome.org>
12907
12908         * ecore.cs (PropertyExpr.PropertyExpr): Call
12909         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12910
12911         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12912         is already a TypeBuilder.
12913
12914 2002-06-27  Martin Baulig  <martin@gnome.org>
12915
12916         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12917         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12918         the "from an array-type to System.Array" case.  This makes it work
12919         when compiling corlib.
12920
12921 2002-06-27  Martin Baulig  <martin@gnome.org>
12922
12923         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12924         non-static PropertyExpr, set its InstanceExpression.  This makes
12925         the `ICollection.Count' property work in System/Array.cs.
12926
12927 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12928
12929         * driver.cs: Made error handling more consistent.  Errors now
12930         tracked by Report class, so many methods which used to return int
12931         now return void.  Main() now prints success/failure and 
12932         errors/warnings message.
12933
12934         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12935         the magic number return values (123 and 124).  Now, if the
12936         expected error occurs, the compiler exits with success (exit value
12937         0).  If the compilation completes without seeing that particular
12938         error, the compiler exits with failure (exit value 1).  The
12939         makefile in mcs/errors has been changed to handle the new behaviour.
12940
12941         * report.cs: Made 'expected error' number a property and renamed
12942         it from 'Probe' to 'ExpectedError'.
12943
12944         * genericparser.cs: Removed error handling support, since it is
12945         now all done by Report class.
12946
12947         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12948         class, so parse() no longer returns an int.
12949
12950         * namespace.cs: Use Report.Error instead of GenericParser.error
12951
12952 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12953
12954         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12955         TypeContainer.AddOperator): At the front of the list put the
12956         explicit implementations, so they get resolved/defined first. 
12957
12958 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
12959
12960         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12961         interface type is implemented by this TypeContainer.  Used during
12962         explicit interface implementation.
12963
12964         (Property.Define, Indexer.Define, Method.Define): Validate that
12965         the given interface in the explicit implementation is one of the
12966         base classes for the containing type.
12967
12968         Also if we are explicitly implementing an interface, but there is
12969         no match in the pending implementation table, report an error.
12970
12971         (Property.Define): Only define the property if we are
12972         not explicitly implementing a property from an interface.  Use the
12973         correct name also for those properties (the same CSC uses,
12974         although that is really not needed).
12975
12976         (Property.Emit): Do not emit attributes for explicitly implemented
12977         properties, as there is no TypeBuilder.
12978
12979         (Indexer.Emit): ditto.
12980
12981         Hiding then means that we do not really *implement* a pending
12982         implementation, which makes code fail.
12983
12984 2002-06-22  Martin Baulig  <martin@gnome.org>
12985
12986         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12987         the return value of Object.GetType().  [FIXME: we need to do this whenever
12988         we get a type back from the reflection library].
12989
12990 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12991
12992         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12993
12994 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
12995
12996         * attribute.cs: Return null if we can not look up the type.
12997
12998         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12999         the interface types found.
13000
13001         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13002         interface types found.
13003
13004         * typemanager.cs (GetInterfaces): Make this routine returns alll
13005         the interfaces and work around the lame differences between
13006         System.Type and System.Reflection.Emit.TypeBuilder in the results
13007         result for GetInterfaces.
13008
13009         (ExpandInterfaces): Given an array of interface types, expand and
13010         eliminate repeated ocurrences of an interface.  This expands in
13011         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13012         be IA, IB, IC.
13013
13014 2002-06-21  Martin Baulig  <martin@gnome.org>
13015
13016         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13017         on System.Enum.
13018
13019 2002-06-21  Martin Baulig  <martin@gnome.org>
13020
13021         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13022         and called with one of the core types, return the corresponding typebuilder for
13023         that type.
13024
13025         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13026         element type.
13027
13028 2002-06-21  Martin Baulig  <martin@gnome.org>
13029
13030         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13031         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13032         (Expression.ConvertReferenceExplicit): Likewise.
13033
13034         * expression.cs (ElementAccess.DoResolve): Likewise.
13035         (ElementAccess.DoResolveLValue): Likewise.
13036
13037 2002-06-10  Martin Baulig  <martin@gnome.org>
13038
13039         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13040         add the "value" parameter to the parameter list.
13041
13042         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13043         to our caller.
13044
13045 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13046
13047         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13048         the argument to an int, uint, long or ulong, per the spec.  Also
13049         catch negative constants in array creation.
13050
13051 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13052
13053         * class.cs: do not allow the same interface to appear twice in
13054         the definition list.
13055
13056 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13057
13058         * ecore.cs: don't use ldlen with System.Array.
13059
13060 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13061
13062         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13063
13064 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13065
13066         * modifiers.cs: produce correct field attributes for protected
13067         internal. Easy fix so miguel can work on ther harder stuff:-)
13068
13069 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13070
13071         * pending.cs: New file.  Move the code from class.cs here.
13072         Support clearning the pending flag for all methods (when not doing
13073         explicit interface implementation).
13074
13075 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13076
13077         * rootcontext.cs: added a couple more types needed to bootstrap.
13078
13079 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13080
13081         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13082         constructor in the type, instead of any constructor in the type
13083         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13084         a bug in the Mono runtime when applying the params attribute). 
13085
13086 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13087         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13088
13089 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13090
13091         * expression.cs (Unary.ResolveOperator): Use TypeManager
13092         to resolve the type.
13093
13094 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13095
13096         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13097         attached.
13098
13099         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13100         with each member too.
13101
13102         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13103         field builders too - this takes care of the enum member case.
13104
13105 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13106
13107         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13108         address-of operator on both value types and pointers.
13109
13110 2002-06-10  Martin Baulig  <martin@gnome.org>
13111
13112         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13113         PropertyBuilder to the `property_builders' list.
13114
13115         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13116         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13117         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13118         find any indexers which are inherited from an interface.
13119
13120 2002-06-09  Martin Baulig  <martin@gnome.org>
13121
13122         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13123         the same type as the constant if necessary.  There's also a test-130.cs
13124         for this.
13125
13126         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13127
13128         * typemanager.cs (TypeManager.ChangeType): Previously known as
13129         Enum.ChangeEnumType().
13130
13131 2002-06-09  Martin Baulig  <martin@gnome.org>
13132
13133         * expression.cs (Cast.TryReduce): Added support for consts.
13134
13135 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13136
13137         * class.cs (Accessor): Hold attributes information so we can pass
13138         it along.
13139
13140         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13141         Modify to pass in attributes attached to the methods.
13142
13143         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13144
13145         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13146         to handle the Accessor kind :-)
13147
13148         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13149
13150 2002-06-08  Martin Baulig  <martin@gnome.org>
13151
13152         * expression.cs (Unary.TryReduceNegative): Added support for
13153         ULongConstants.
13154
13155 2002-06-08  Martin Baulig  <martin@gnome.org>
13156
13157         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13158         name can't be found in the `defined_names' - the caller will do a
13159         MemberLookup in this case and thus find methods in System.Enum
13160         such as Enum.IsDefined().
13161
13162 2002-06-08  Martin Baulig  <martin@gnome.org>
13163
13164         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13165         Convert.ChangeType() which works with TypeBuilder created types.
13166         (Enum.LookupEnumValue, Enum.Define): Use it here.
13167
13168         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13169         `TypeBuilder.BaseType != null' check.
13170         (TypeContainer.FindMembers): Only lookup parent members if we
13171         actually have a parent.
13172         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13173         (ConstructorInitializer.Resolve): Likewise.
13174
13175         * interface.cs (Interface.FindMembers): Added
13176         `TypeBuilder.BaseType != null' check.
13177
13178         * rootcontext.cs (RootContext.ResolveCore): Added
13179         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13180         classes_second_stage.
13181
13182         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13183         debug_type and trace_type when compiling with --nostdlib.       
13184
13185 2002-06-07  Martin Baulig  <martin@gnome.org>
13186
13187         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13188         (AddField): Set it to true when adding a non-static field.
13189         (DefineType): Use `have_nonstatic_fields' to find out whether we
13190         have non-static fields, not `Fields != null'.
13191
13192 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13193
13194         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13195         dereferencing a null on the static-field code path)
13196
13197 2002-05-30  Martin Baulig  <martin@gnome.org>
13198
13199         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13200         to take command line arguments.  Use reflection to call the new
13201         custom `Initialize' function on the symbol writer and pass it the
13202         command line arguments.
13203
13204         * driver.cs (--debug-args): New command line argument to pass command
13205         line arguments to the symbol writer.
13206
13207 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13208
13209         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13210         the target type for indexers and properties.  Thanks to Joe for
13211         catching this.
13212
13213 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13214
13215         * typemanager.cs (MethodFlags): returns the method flags
13216         (Obsolete/ShouldIgnore) that control warning emission and whether
13217         the invocation should be made, or ignored. 
13218
13219         * expression.cs (Invocation.Emit): Remove previous hack, we should
13220         not do this on matching a base type, we should do this based on an attribute
13221
13222         Only emit calls to System.Diagnostics.Debug and
13223         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13224         on the command line.
13225
13226         * rootcontext.cs: Global settings for tracing and debugging.
13227
13228         * cs-tokenizer.cs (define): New utility function to track
13229         defines.   Set the global settings for TRACE and DEBUG if found.
13230
13231 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13232
13233         * interface.cs (Populate*): Pass in the TypeContainer as well as
13234         the DeclSpace as parameters so that we can create EmitContexts and
13235         then use that to apply attributes etc.
13236
13237         (PopulateMethod, PopulateEvent, PopulateProperty)
13238         (PopulateIndexer): Apply attributes everywhere.
13239
13240         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13241         etc.
13242
13243         (ApplyAttributes): Update accordingly.
13244
13245         We now apply interface attributes for all members too.
13246
13247 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13248
13249         * class.cs (Indexer.Define); Correctly check if we are explicit
13250         implementation (instead of checking the Name for a ".", we
13251         directly look up if the InterfaceType was specified).
13252
13253         Delay the creation of the PropertyBuilder.
13254
13255         Only create the PropertyBuilder if we are not an explicit
13256         interface implementation.   This means that explicit interface
13257         implementation members do not participate in regular function
13258         lookups, and hence fixes another major ambiguity problem in
13259         overload resolution (that was the visible effect).
13260
13261         (DefineMethod): Return whether we are doing an interface
13262         implementation. 
13263
13264         * typemanager.cs: Temporary hack until we get attributes in
13265         interfaces (Ravi is working on that) and we get IndexerName
13266         support in interfaces.
13267
13268         * interface.cs: Register the indexers as properties.
13269
13270         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13271         warning, I have verified that this is a bug in the .NET runtime
13272         (JavaScript suffers of the same problem).
13273
13274         * typemanager.cs (MemberLookup): When looking up members for
13275         interfaces, the parent of an interface is the implicit
13276         System.Object (so we succeed in searches of Object methods in an
13277         interface method invocation.  Example:  IEnumerable x;  x.ToString
13278         ()) 
13279
13280 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13281
13282         * class.cs (Event): Events should also register if they do
13283         implement the methods that an interface requires.
13284
13285         * typemanager.cs (MemberLookup); use the new GetInterfaces
13286         method. 
13287
13288         (GetInterfaces): The code used to lookup interfaces for a type is
13289         used in more than one place, factor it here. 
13290
13291         * driver.cs: Track the errors at the bottom of the file, we kept
13292         on going.
13293
13294         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13295         instance if the method we are calling is static!
13296
13297 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13298
13299         * attribute.cs (ApplyAttributes): Make this function filter out
13300         the IndexerName attribute (as that attribute in reality is never
13301         applied) and return the string constant for the IndexerName
13302         attribute. 
13303
13304         * class.cs (TypeContainer.Emit): Validate that all the indexers
13305         have the same IndexerName attribute, and if so, set the
13306         DefaultName attribute on the class. 
13307
13308         * typemanager.cs: The return value might contain other stuff (not
13309         only methods).  For instance, consider a method with an "Item"
13310         property and an Item method.
13311
13312         * class.cs: If there is a problem with the parameter types,
13313         return. 
13314
13315 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13316
13317         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13318         looks at user defined conversion after making a call to 
13319         StandardConversionExists - we need this for overload resolution.
13320
13321         * expression.cs : Update accordingly the various method calls.
13322
13323         This fixes 2 bugs filed against implicit user defined conversions 
13324
13325 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13326
13327         * statement.cs: Track the result of the assignment.
13328
13329 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13330
13331         * expression.cs (MemberAccess): Improved error reporting for
13332         inaccessible members.
13333
13334 2002-05-22  Martin Baulig  <martin@gnome.org>
13335
13336         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13337         itself with debugging support.
13338
13339 2002-05-22  Martin Baulig  <martin@gnome.org>
13340
13341         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13342         Removed, this isn't needed anymore.
13343
13344 2002-05-20  Martin Baulig  <martin@gnome.org>
13345
13346         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13347         be underlying type for an enum.
13348
13349 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13350
13351         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13352         that splits out the loading of just the core types.
13353
13354         * rootcontext.cs (ResolveCore): Split the struct resolution in
13355         two, so we can load the enumeration underlying types before any
13356         enums are used.
13357
13358         * expression.cs (Is): Bandaid until we fix properly Switch (see
13359         bug #24985 for details).
13360
13361         * typemanager.cs (ImplementsInterface): The hashtable will contain
13362         a null if there are no interfaces implemented.
13363
13364 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13365
13366         * cs-parser.jay (indexer_declarator): It is fine to have array
13367         parameters
13368
13369 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13370
13371         * typemanager.cs: (RegisterBuilder): New function used to register
13372         TypeBuilders that implement interfaces.  Since
13373         TypeBuilder.GetInterfaces (as usual) does not work with lame
13374         Reflection.Emit. 
13375         (AddUserType): register interfaces.
13376
13377         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13378         dealing with TypeBuilder.  Also, arrays are showing up as
13379         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13380         methods can not be invoked on them!
13381
13382         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13383         (ImplicitReferenceConversionExists): Split out from
13384         StandardConversionExists. 
13385
13386         * expression.cs (As): We were only implementing one of the three
13387         cases for the as operator.  We now implement them all.
13388         (Is): Implement the various other cases for Is as well.
13389
13390         * typemanager.cs (CACHE): New define used to control if we want or
13391         not the FindMembers cache.  Seems to have a negative impact on
13392         performance currently
13393
13394         (MemberLookup): Nested types have full acess to
13395         enclosing type members
13396
13397         Remove code that coped with instance/static returns for events, we
13398         now catch this in RealFindMembers.
13399
13400         (RealFindMembers): only perform static lookup if the instance
13401         lookup did not return a type or an event.  
13402
13403 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13404
13405         * assign.cs (CompoundAssign): We pass more semantic information
13406         now to Compound Assignments than we did before: now we have all
13407         the information at hand, and now we resolve the target *before* we
13408         do the expression expansion, which allows the "CacheValue" method
13409         to have the effect we intended (before, a [x] += 1 would generate
13410         two differen ArrayAccess expressions from the ElementAccess,
13411         during the resolution process).
13412
13413         (CompoundAssign.DoResolve): Resolve target and original_source here.
13414
13415 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13416
13417         * expression.cs (ArrayAccess): dropped debugging information. 
13418
13419         * typemanager.cs: Small bug fix: I was always returning i_members,
13420         instead of one of i_members or s_members (depending on which had
13421         the content).
13422
13423         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13424         method is invoked before any code generation takes place, and it
13425         is a mechanism to inform that the expression will be invoked more
13426         than once, and that the method should use temporary values to
13427         avoid having side effects
13428
13429         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13430
13431         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13432         implementation.
13433
13434         * expression.cs (Indirection, ArrayAccess): Add support for
13435         CacheTemporaries in these two bad boys. 
13436
13437         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13438         ldobj or ldind_ref.  
13439         (StoreFromPtr): Handle stobj as well.
13440
13441         * expression.cs (UnaryMutator): Share more code.
13442
13443         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13444         down: I was not tracking the Filter function as well, which
13445         was affecting the results of the cache.
13446
13447 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13448
13449         * attribute.cs: Remove the hack to handle the CharSet property on
13450         StructLayouts. 
13451
13452 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13453
13454         * attribute.cs (DoResolve): More uglyness, we now only try to
13455         resolve the attribute partially, to extract the CharSet
13456         information (only if we are a StructLayout attribute).  Otherwise 
13457
13458         (GetExtraTypeInfo): Add some code to conditionally kill in the
13459         future this.   I am more and more convinced that the .NET
13460         framework has special code to handle the attribute setting on
13461         certain elements.
13462
13463         * expression.cs (IsParamsMethodApplicable): Revert my previous
13464         foreach change here, it was wrong.
13465
13466 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13467
13468         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13469         (pp_expr): do not abort on unknown input, just return.
13470         (eval): abort if there are pending chars.
13471
13472         * attribute.cs (Attribute.Resolve): Positional parameters are
13473         optional.  Deal with that case.
13474
13475         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13476         the Ansi/Unicode/Auto information for the type.
13477
13478         (TypeContainer.DefineType): instantiate the EmitContext here, as
13479         we will be using it during the type definition (to resolve
13480         attributes) and during the emit phase.
13481
13482         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13483         to pull type information out of the attributes
13484
13485         (Attribute.Resolve): track the constructor builder, and allow for
13486         multiple invocations (structs and classes will use this).
13487
13488         * ecore.cs (MemberLookupFinal): new version with all the
13489         parameters customizable.
13490
13491         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13492         constructors.  Return if the result value is null (as the error
13493         would have been flagged already by MemberLookupFinal)
13494
13495         Do not allow instances of abstract classes or interfaces to be
13496         created.
13497
13498         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13499         We have to compare the assembly property here when dealing with
13500         FamANDAssem and Assembly access modifiers, because we might be
13501         creating an assembly from *modules* (that means that we are not
13502         getting TypeBuilders for types defined in other modules that are
13503         part of this assembly).
13504
13505         (Method.Emit): If the method is marked abstract and has a body,
13506         emit an error. 
13507
13508         (TypeContainer.DefineMembers): If both the defined member and the
13509         parent name match are methods, then do not emit any warnings: let
13510         the Method.Define routine take care of flagging warnings.  But if
13511         there is a mismatch (method overrides something else, or method is
13512         overriwritten by something, then emit warning).
13513
13514         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13515         set to null, this means `do not check for the return type on the
13516         signature'. 
13517
13518         (Method.Define): set the return type for the method signature to
13519         null, so that we get methods with the same name and parameters and
13520         different return types.  This is used to flag warning 114 (you are
13521         hiding a method, and you probably want to use the new/override
13522         keywords instead).
13523
13524         * typemanager.cs (MemberLookup): Implemented proper access
13525         control, closing a long standing set of bug reports.  The problem
13526         was that the Framework only has two bits: Public and NonPublic,
13527         and NonPublic includes private and protected methods, but we need
13528         to enforce the FamANDAssem, FamOrAssem and Family. 
13529
13530 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13531
13532         * statement.cs (GotoCase): Return true: Ammounts to giving up
13533         knowledge on whether we return or not, and letting the other case
13534         be responsible for it.
13535
13536 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13537
13538         * driver.cs: Do not load directories for each file processed, only
13539         do it if there is a pattern.
13540
13541         * ecore.cs: Report readonly assigns here as well, as we might have
13542         been resolved only by MemberAccess.
13543
13544         (SimpleName.SimpleNameResolve): Also be useful for LValue
13545         resolution.   We need this to propagate assign to local readonly variables
13546
13547         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13548         do not want to reuse potential criteria memory.
13549
13550         * class.cs (MyEventBuilder): Set reflected_type;
13551
13552         * ecore.cs (Constantify): Added support for constifying bools.
13553
13554         (RootContext.LookupType): Added a cache for values looked up in
13555         the declaration space.
13556
13557         * typemanager.cs (FindMembers): Now is a front-end to
13558         RealFindMembers, and provides a two-level hashtable-based cache to
13559         the request.  
13560
13561         15% performance improvement: from 22.5 to 19.2 seconds.
13562
13563         * expression.cs (IsParamsMethodApplicable): use foreach.
13564         (Invocation.DoResolve): ditto.
13565         (New.DoResolve): ditto.
13566         (ArrayCreation.DoResolve): ditto.
13567
13568         * ecore.cs (FindMostEncompassingType): use foreach.
13569
13570         * delegate.cs (NewDelegate.DoResolve): Use foreach
13571
13572         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13573         (RemoveMethods): use foreach.
13574
13575         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13576         nested foreach statements instead of for, and also break out of
13577         the inner loop once a match is found.
13578
13579         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13580
13581 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13582
13583         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13584         we actually unwrap the expression to allow for extra information
13585         to be extracted. 
13586
13587         * expression.cs: Use Shr_Un on unsigned operations. 
13588
13589 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13590
13591         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13592         applicable operators was not being considered correctly. This closes
13593         the bug Miguel reported.
13594
13595 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13596
13597         * attribute.cs: check that the type derives from System.Attribute
13598         and report the correct error in that case (moved the duplicate code to
13599         its own method, too).
13600
13601 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13602
13603         * attribute.cs: lookup attribute type name as the spec says: first the
13604         bare attribute name and then name + "Attribute" (nant compiles with
13605         mcs after this fix).
13606
13607 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13608
13609         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13610         Because of the way we parse things, we should try to see if a
13611         UIntConstant can fit in an integer.
13612
13613 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13614
13615         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13616         when we are in an explicit context.
13617
13618         (ConvertReferenceExplicit): When converting from Iface type S to Class
13619         T make sure the rules are implemented as an OR.
13620
13621         * parameter.cs (ParameterType): Make it a property for now although the
13622         purpose really isn't anything immediate.
13623
13624         * expression.cs (Is*Applicable): Do better checking on the parameter type
13625         of a ref/out parameter. The ones from the system assemblies are already 
13626         marked with the correct type so we don't need to do any correction.
13627
13628         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13629         the object type is standard too so include that.
13630
13631 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13632
13633         * ecore.cs (StandardConversionExists): Augment with missing code:
13634         deal with IntConstant, LongConstants and Enumerations.
13635
13636         * assign.cs: Report the error, instead of failing silently
13637
13638         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13639         typecontainer that they are declared, because the
13640         typecontainer/namespace will have the list of using clauses that
13641         need to be applied.
13642
13643         Assembly Attributes were escaping the normal registration
13644         mechanism. 
13645
13646         (EmitCode): Apply attributes within an EmitContext that represents
13647         the container they were declared on.
13648
13649         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13650
13651 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13652
13653         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13654         Revamp completely - make much cleaner as we now operate only
13655         on a set of Types.
13656
13657         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13658         to implement the logic detailed in the spec more correctly.
13659
13660         (UserDefinedConversion): Update accordingly.
13661
13662 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13663
13664         * statement.cs: Return flow analysis information up.
13665
13666         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13667         and the default.
13668
13669         (token): Do not consume an extra character before calling
13670         decimal_digits.
13671
13672 2002-05-06  Piers Haken <piersh@friskit.com>
13673
13674         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13675
13676 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13677
13678         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13679         EmitContext during the instance constructor initializer
13680         resolution, to stop access to instance variables.
13681
13682         This is mandated by the spec, last paragraph of the `constructor
13683         initializers' section. 
13684
13685 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13686
13687         * cs-parser.jay, class.cs (Accessor): new class used to represent
13688         an accessor (get or set).  In the past we used `null' to represent
13689         a missing accessor.  But this is ambiguous because there was no
13690         way to tell in abstract indexers/properties if one of them was
13691         specified.
13692
13693         Now there is a way of addressing that.
13694
13695         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13696         instead of FindMembers.
13697
13698         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13699         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13700
13701         * attribute.cs: Treat indexers and properties as the same in terms
13702         of applying attributes
13703
13704         * ecore.cs (FindMostEncompassedType): Use statically initialized
13705         EmptyExpressions()s like we do elsewhere to avoid creating useless
13706         objects (and we take this out of the tight loop).
13707
13708         (GetConversionOperators): Move the code to extract the actual
13709         operators to a separate routine to clean things up.
13710
13711 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13712
13713         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13714         events are always registered FieldBuilders.
13715
13716         * class.cs (FieldBase): New class shared by Fields 
13717
13718         * delegate.cs: If we are a toplevel delegate, use our full name.
13719         If we are a nested delegate, then only use our tail name.
13720
13721 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13722
13723         * expression.cs (IsApplicable): Ensure that we add the "&" to
13724         ref/out types before comparing it with the type of the argument.
13725
13726         (IsParamsMethodApplicable): Ditto.
13727
13728         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13729         silly me ;-)
13730
13731         * delegate.cs : Handle the case when we have more than one applicable
13732         method. Flag an error only when we finish checking all.
13733
13734 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13735
13736         * expression.cs: Add support for boolean static initializers.
13737
13738 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13739
13740         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13741
13742         * parameter.cs (ComputeParameterTypes,
13743         ComputeAndDefineParameterTypes): Better error handling: now we
13744         clear the `types' cache if we fail during any of the type lookups.
13745         We also return the status code correctly to our caller
13746
13747         * delegate.cs: If we fail to define a delegate, abort the extra
13748         steps. 
13749
13750         * expression.cs (Binary.ResolveOperator): for
13751         operator==(object,object) and operator !=(object, object) we also
13752         have to verify that there is an implicit conversion from one to
13753         the other.
13754
13755         (ArrayAccess.DoResolve): Array Access can operate on
13756         non-variables. 
13757
13758 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13759
13760         * assign.cs (CompoundAssign): A new class used as a "flag" that
13761         the assignment actually is happening as part of a compound
13762         assignment operator.
13763
13764         During compound assignment, a few new rules exist to enable things
13765         like:
13766
13767         byte b |= 1 + 2
13768
13769         From the spec:
13770
13771         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13772         to the type of x) if y is implicitly convertible to the type of x,
13773         and the operator is a builtin operator and the return type of the
13774         operator is explicitly convertible to the type of x. 
13775
13776         * rootcontext.cs: Reset warning level to 2.  4 catches various
13777         "interesting" features in mcs, we must clean this up at some
13778         point, but currently am trying to kill other bugs ;-)
13779
13780         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13781         in container classes as well.  
13782
13783         * expression.cs (Binary.ResolveOperator): Handle string case
13784         before anything else (as operator overloading does emit an error
13785         before doing anything else).
13786
13787         This code could go away when we move to a table driven model, but
13788         i could not come up with a good plan last night.
13789
13790 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13791
13792         * typemanager.cs (CSharpName): reimplementation using regex.
13793         * class.cs: added null check for fields in Emit
13794         * rootcontext.cs: set warninglevel to 4
13795
13796 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13797
13798         * typemanager.cs (CSharpName): reimplemented with Lupus
13799         suggestion.
13800
13801 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13802
13803         * statement.cs (If): correclty implement Resolve, because we were
13804         not catching sem errors in there.  The same process is needed
13805         everywhere else. 
13806         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13807
13808
13809         (Statement.Warning_DeadCodeFound): Factorize code.
13810         (While): Report dead code here too.
13811
13812         (Statement): Added Resolve virtual method to allow
13813         for resolution split from the emit code.
13814
13815 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13816
13817         * statement.cs (EmitBoolExpression): No longer try to resolve the
13818         expression here.    
13819         (MakeBoolean): New utility function that resolve, implicitly
13820         converts to boolean and tags the expression. 
13821
13822
13823         (If, Do): Implement dead code elimination.
13824         (While): Implement loop inversion
13825
13826         (Do, While, For, If): Resolve the expression prior to calling our
13827         code generation.
13828
13829 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13830
13831         * class.cs:
13832           - added method Report28 (warning: program has more than one entry point)
13833           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13834           - modified method Method.Define, the part at the end of the method
13835
13836         * rootcontext.cs: added static public Location EntryPointLocation;
13837           
13838         * ../errors/cs0028.cs : Add test case for the above warning.              
13839
13840         * typemanager.cs:
13841           - modified method CSharpName to allow arrays of primitive type to
13842             be printed nicely (e.g. instead of System.Int32[][] it now prints
13843             int[][])
13844           - added method CSharpSignature: returns the signature of a method
13845             in string format to be used in reporting errors, warnings, etc.
13846
13847         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13848         with String.Empty.
13849
13850 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13851
13852         * delegate.cs (Define): Fix extremely silly bug where I was
13853         setting the type of the 'object' parameter of the BeginInvoke
13854         method to System.IAsyncResult instead of System.Object ;-)
13855
13856 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13857
13858         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13859         here. 
13860
13861         (Constructor.Emit): return if we fail to initialize the
13862         constructor.  Another door closed!  
13863
13864         * expression.cs (New.DoResolve): Improve error message (from -6 to
13865         1501).  Use DeclaredOnly lookup to find the exact constructor.
13866
13867         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13868         loop.  This is useful.
13869
13870         * cs-parser.jay: Adjust the default parameters so that destructors
13871         have the proper signature.
13872
13873 2002-04-26  Martin Baulig  <martin@gnome.org>
13874
13875         * driver.cs (LoadAssembly): If `assembly' contains any characters
13876         which are only valid in path names and not in assembly names
13877         (currently slash, backslash and point), use Assembly.LoadFrom ()
13878         instead of Assembly.Load () on the `assembly' (before iteration
13879         over the link_paths).
13880
13881 2002-04-26  Martin Baulig  <martin@gnome.org>
13882
13883         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13884
13885 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13886
13887         * class.cs (Property): use the new typemanager.MemberLookup
13888
13889         (TypeContainer.MemberLookup): Implement using the
13890         TypeManager.MemberLookup now. 
13891
13892         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13893         and return MemberInfos, so that these can be used without an
13894         EmitContext (what we had before).
13895
13896 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13897
13898         * expression.cs: Fix the case where the argument to params if the
13899         type of the params.  I omitted handling this before.   Fixed
13900
13901 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13902
13903         * driver.cs: Call BootCorlib_PopulateCoreType
13904
13905         * class.cs (Property.CheckBase): Check for properties only, not
13906         for all members. 
13907
13908         * interface.cs: Temporary hack: try/catch around the
13909         CustomAttributeBuilder, because I am getting an exception that I
13910         do not understand.
13911
13912         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13913         types whose definitions are required to be there (attributes are
13914         defined before standard types).
13915
13916         Compute definitions as we boot the various types, as they are used
13917         immediately (value_type class will need object_type, but if we do
13918         not initialize object_type, we will pass a null, which will let
13919         the runtime pick the System.Object from the existing corlib, which
13920         is not what we want).
13921
13922 2002-04-22  Patrik Torstensson <totte@labs2.com>
13923
13924         * cs-tokenizer.cs: fixed a number of trim() issues.
13925
13926 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13927
13928         * expression.cs (Argument.Type): Ensure that we return the correct
13929         type when we have out or ref parameters [in which case we 
13930         append a "&"].
13931
13932 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13933
13934         * class.cs (Property, Indexer): Allow extern modifier in there. 
13935
13936         * typemanager.cs (InitBaseTypes): Initializes object_type and
13937         value_type, since those will be used early on during the bootstrap
13938         process to compile corlib.
13939
13940         (InitCoreTypes): Move code from here to InitBaseTypes.
13941
13942 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13943
13944         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13945         single-dimension arrays as using the ldlen opcode.  
13946
13947         Daniel Lewis discovered this optimization.  
13948
13949         * typemanager.cs: Add signature for System.Array::get_Length
13950
13951 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13952
13953         * statement.cs: report the error when the foreach does not apply to an
13954         array nor a collection.
13955
13956 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
13957
13958         * expression.cs: Add implicit conversions to the operator ~.
13959
13960         * constant.cs (DecimalConstant.Emit): Emit decimal value.
13961
13962         * typemanager.cs: Locate the decimal constructor.
13963
13964 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13965
13966         * attribute.cs: use the new property of TypeOf.
13967         * expression.cs: added 'get' property around typearg.
13968
13969         These changes fix a build breaker reported by NickD. Is this the
13970         correct way to fix?  If not, please, revert my changes and make it
13971         work :-).
13972
13973 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13974
13975         * attribute.cs: Add support for typeof in attribute invocations.
13976         I am not sure that this is right though.
13977
13978 2002-04-14  Duncan Mak  <duncan@ximian.com>
13979
13980         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13981         Binary.Operator.Division case.
13982
13983 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13984
13985         * class.cs (DefineType): Ensure that we do a proper check on
13986         attribute types and also register it with the TypeManager.
13987
13988         (TypeContainer.Targets): The default for attribute types is
13989         AttributeTargets.All.
13990
13991         * attribute.cs (ApplyAttributes): Registering the attribute type
13992         is done elsewhere, not when we discover we have a Usage attribute.
13993
13994 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13995
13996         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13997         and get rid of is_delegate parameter.
13998
13999         * everywhere : update.
14000
14001 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14002
14003         * cs-parser.jay (compilation_unit): Revamp completely to use
14004         some new ideas that I got from Rhys' grammar to solve the problems
14005         with assembly level attributes.
14006
14007         (outer_declaration): New grammar production.
14008
14009         (attribute_sections): Add.
14010
14011         (opt_attributes): Base on attribute_sections
14012
14013         (namespace_declaration): Allow opt_attributes to tackle the case
14014         when we have assembly level attributes - we are clever in this
14015         regard now ;-)
14016
14017         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14018         attributes in the non-global context.
14019
14020         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14021         instead of SetGlobalAttributes.
14022
14023         * class.cs, rootcontext.cs : Ensure we define and generate 
14024         attribute types before anything else.
14025
14026         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14027         and flag the new error -20 for the case when the attribute type
14028         does not have valid targets specified. csc does not catch this.
14029
14030         * ../errors/errors.txt : update for error # -20
14031
14032 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14033
14034         * support.cs (InternalParameters.ParameterModifier): Do some null
14035         checking and return sane values.
14036
14037         * class.cs (Method.Define): If we are a PInvoke method, ensure
14038         that we are static and extern. Report error # 601
14039
14040         * ../errors/cs0601.cs : Add test case for the above error.
14041
14042 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14043
14044         * rootcontext.cs (attribute_types): We need to keep type of
14045         all attribute types separately and emit code for them first.
14046
14047         (RegisterAttribute) : Implement.
14048
14049         * class.cs (DefineType): Check if the current Type is a custom
14050         attribute type and register it accordingly.
14051
14052         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14053         adding the first attribute twice and rename to
14054
14055         (SetGlobalAttributes): this.
14056
14057         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14058         lookups.
14059
14060         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14061         if we are processing global arguments. Hmm, I am unsure of this.
14062
14063 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14064
14065         * expression.cs: added static array of strings to avoid calling
14066         Enum.ToString () for Operator in Binary. Significant recover of
14067         performance.
14068
14069 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14070
14071         * class.cs (FindMembers): Allow the Builders of the various
14072         members to be null.  If they are skip them.  This only happens
14073         during the PInvoke declaration.
14074
14075 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14076
14077         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14078         failure, so we do not keep going afterwards.
14079
14080         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14081         wanted to pass `false' as the `is_delegate' argument.  If this is
14082         the case, why not use delegate_type == null to mean `is_delegate =
14083         false' and anything else as is_delegate = true.
14084
14085 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14086
14087         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14088         code for the section, not the beginning of the tests.
14089
14090 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14091
14092         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14093
14094         * expression.cs (Binary): same.  Warn about errors where we have
14095         Enum/Enum in operator + as well.
14096
14097 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14098
14099         * statement.cs:
14100                 - added support for switch(bool)
14101                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14102                 - add TableSwitchEmit() to handle table-based switch statements
14103
14104 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14105
14106         * expression.cs (Invocation.OverloadResolve): Factor out code which
14107         does parameter compatibility checking with arguments so that we can 
14108         re-use the code even from Delegate.VerifyApplicability
14109
14110         (VerifyArgumentsCompat): Move above code here.
14111
14112         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14113         and instead make a call to the above method.
14114
14115 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14116
14117         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14118         We use it to keep track of classes which are attribute types.
14119
14120 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14121
14122         * delegate.cs (Delegate.Define): Correctly define the types in the
14123         presence of fixed and array parameters.
14124
14125         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14126         doing FindMembers.
14127
14128         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14129         include NonPublic after the first iteration.
14130
14131         * class.cs (Indexer.CheckBase): Only check if both parents are
14132         non-null. 
14133
14134         * cs-parser.jay (accessor_body): If empty, set to null.
14135
14136         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14137         same code path here to resolve constants names that we did have in
14138         MemberAccess.DoResolve.  There is too much code duplicated here.
14139
14140 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14141
14142         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14143
14144         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14145         to MakeUnionSet.
14146
14147         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14148         tokens, numbers and strings.
14149
14150         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14151         parenthesis.
14152
14153         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14154         asyncronous parameters and the regular parameters.  
14155
14156         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14157         specify the target directory.
14158
14159         * expression.cs: (This.DoResolve): Simplify
14160         (As.Emit): Optimize, do not generate IsInst if the expression is
14161         always of the given type.
14162
14163         (Is.DoResolve): Bug fix, we were reporting both always/never for
14164         the is expression.
14165
14166         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14167         creating too many unnecessary arrays.
14168
14169 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14170
14171         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14172         fields instead of rolling our own initializer.   Takes care of all
14173         implicit conversions, and drops unnecessary static checks/argument.
14174
14175 2002-03-31  Dick Porter  <dick@ximian.com>
14176
14177         * driver.cs: use the GetDirectories() return values properly, and
14178         use "/" as path separator.
14179
14180 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14181
14182         * expression.cs (Unary): Optimize - - expr into expr.
14183         (Binary): Optimize a + (-b) into a -b.
14184
14185         * codegen.cs (CodeGen): Made all methods static.
14186
14187 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14188
14189         * rootcontext.cs: 
14190
14191         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14192         TypeBuilder property.
14193
14194         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14195         instead. 
14196
14197         * tree.cs: Removed the various RecordXXXX, and replaced with a
14198         single RecordDecl.  Removed all the accessor methods, and just
14199         left a single access point Type 
14200
14201         * enum.cs: Rename DefineEnum to DefineType.
14202
14203         * decl.cs: New abstract method `DefineType' used to unify the
14204         Defines for Enumerations, Interfaces, TypeContainers and
14205         Delegates.
14206
14207         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14208         LookupBaseClasses method that used to live in class.cs and
14209         interface.cs here, and renamed to FindType.
14210
14211         * delegate.cs: Implement DefineType.  Take advantage of the
14212         refactored pattern for locating the parent builder without taking
14213         the parent_builder argument (which we know does not work if we are
14214         nested, and triggering a toplevel definition).
14215
14216 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14217
14218         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14219         accessibility of a member has changed during override and report
14220         an error if so.
14221
14222         * class.cs (Method.Define, Property.Define): Only complain on
14223         overrides if the method is private, any other accessibility is
14224         fine (and since we just checked the permission is the same, we are
14225         good to go).
14226
14227         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14228         and elif are processed always.  The other pre-processing
14229         directives are only processed if we are "taking" the path
14230
14231 2002-03-29  Martin Baulig  <martin@gnome.org>
14232
14233         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14234         current location is not Null.
14235
14236         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14237         a separate method so we can profile it.
14238
14239         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14240         `span.Seconds' are just seconds, but no minutes or hours.
14241         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14242
14243 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14244
14245         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14246         Remove the gratuitous set of Final:
14247
14248                                 // If an interface implementation, then we can set Final.
14249                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14250                                     implementing.DeclaringType.IsInterface)
14251                                         flags |= MethodAttributes.Final;
14252
14253         I do not know what I was smoking when I used that.
14254
14255
14256         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14257         step into fixing the name resolution issues for delegates and
14258         unifying the toplevel name resolution.
14259
14260 2002-03-28  Martin Baulig  <martin@gnome.org>
14261
14262         * class.cs (Method.Emit): If we have a symbol writer, call its
14263         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14264         tell it about the current method.
14265
14266         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14267         writer that we're going to emit the first byte of IL code for a new
14268         statement (a new source line).
14269         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14270         EmitContext.Mark() before emitting any code.
14271
14272         * location.cs (SymbolDocument): Return null when we're Null.
14273
14274         * statement.cs (Statement): Moved the `Location loc' variable here.
14275         (Statement.EmitBoolExpression): If we have a symbol writer, call
14276         ec.Mark() before emitting any code to tell it that we're at the
14277         beginning of a new statement.
14278         (StatementExpression): Added `Location' argument to the constructor.
14279         (Block): Added public readonly variable `StartLocation' and public
14280         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14281         (Block): Added constructor which takes a start and end location.
14282         (Block.SetEndLocation): New method. This sets the end location.
14283         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14284         local variables we create.
14285         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14286         each statement and do also mark the begin and end of the block.
14287
14288         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14289         tell it the current lexer.Location, use Location.Null for the end of the
14290         block.
14291         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14292         current block, set its end location using SetEndLocation().
14293         (statement_expression): StatementExpression constructor now takes the
14294         lexer.Location as additional argument.
14295         (for_statement, declare_local_variables): Likewise.
14296         (declare_local_variables): When creating a new implicit block, use the
14297         new Block constructor and pass it the lexer.Location.
14298
14299 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14300
14301         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14302         members also on the parent interfaces recursively.
14303
14304 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14305
14306         * report.cs: Use new formats, since Gonzalo finished the missing
14307         bits. 
14308
14309         * expression.cs (Binary.ResolveOperator): added missing operator|
14310         operator& and operator^ for bool/bool.
14311
14312         * cs-parser.jay: CheckDef now takes a Location argument that is
14313         used to report errors more precisly (instead of reporting the end
14314         of a definition, we try to track something which is a lot closer
14315         to the source of the problem).
14316
14317         * cs-tokenizer.cs: Track global token use, so we can properly flag
14318         the use of #define/#undef after the first token has been seen.
14319
14320         Also, rename the reportXXXX to Error_DescriptiveName
14321
14322         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14323         TypeContainer, so that Enum and Interface can use this too.
14324
14325         * class.cs (TypeContainer.LookupInterfaceOrClass,
14326         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14327         `builder' argument.  Typically this was used to pass the parent
14328         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14329         the definition).  
14330
14331         The problem is that a nested class could trigger the definition of
14332         a toplevel class, and the builder would be obviously wrong in that
14333         case. 
14334
14335         So we drop this argument, and we compute dynamically the
14336         TypeBuilder/ModuleBuilder (the correct information was available
14337         to us anyways from DeclSpace.Parent)
14338
14339         * interface.cs (Interface.DefineInterface): Drop builder
14340         parameter cleanup like class.cs
14341
14342         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14343         like class.cs
14344
14345         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14346         values. 
14347
14348         (Try.Emit): Propagate the returns value from the statement.
14349
14350         (Return.Emit): Even if we are leavning 
14351
14352         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14353
14354         * modifiers.cs: Fix the computation of MethodAttributes flags.
14355
14356 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14357
14358         * driver.cs: allow compilation of files that start with '/'.
14359         Add a default case when checking the argument of --target.
14360
14361 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14362
14363         * interface.cs: Implement the same search algorithm for types in
14364         the interface code.
14365
14366         * delegate.cs: Do not allow multiple definition.
14367
14368         * Recovered ChangeLog that got accidentally amputated
14369
14370         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14371
14372         * rootcontext.cs: Load manually enum to allow core classes to
14373         contain enumerations.
14374
14375         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14376         Update to new static methods in TypeManager.
14377
14378         * typemanager.cs (GetMethod, GetConstructor): Use our
14379         implementation of FindMembers to find the members, since during
14380         corlib compilation, the types are TypeBuilders and GetMethod and
14381         GetConstructor do not work.
14382
14383         Make all methods in TypeManager static.
14384
14385         (InitCodeHelpers): Split the functionality from
14386         the InitCodeTypes function.
14387
14388         * driver.cs: Call InitCodeHelpers after we have populated the
14389         types. 
14390
14391         * cs-parser.jay (delegate_declaration): we did not used to compute
14392         the delegate name correctly for void delegates.
14393
14394 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14395
14396         * rootcontext.cs (RootContext): Init the interface_resolve_order
14397         and type_container_resolve_order always.
14398
14399         (ResolveCore, BootstrapCorlib_ResolveClass,
14400         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14401         compiler when compiling with --nostdlib
14402
14403         * class.cs (TypeContainer.DefineType): Check that our parent is
14404         not null.  This test is most important when we are bootstraping
14405         the core types.
14406
14407         * codegen.cs: Split out the symbol writing code.
14408
14409 2002-03-25  Martin Baulig  <martin@gnome.org>
14410
14411         * driver.cs (-g): Made -g an alias for --debug.
14412
14413 2002-03-24  Martin Baulig  <martin@gnome.org>
14414
14415         * codegen.cs (SymbolWriter): New public variable. Returns the
14416         current symbol writer.
14417         (CodeGen): Added `bool want_debugging_support' argument to the
14418          constructor. If true, tell the ModuleBuild that we want debugging
14419         support and ask it for the ISymbolWriter.
14420         (Save): If we have a symbol writer, call it's Close() method after
14421         saving the assembly.
14422
14423         * driver.c (--debug): New command line argument to create a
14424         debugger information file.
14425
14426         * location.cs (SymbolDocument): New public property. Returns an
14427         ISymbolDocumentWriter object for the current source file or null
14428         if we don't have a symbol writer.
14429
14430 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14431
14432         * driver.cs (LoadAssembly): Correctly return when all the paths
14433         have been tried and not before.
14434
14435         * statement.cs (Switch.Emit): return the actual coverage for this
14436         statement (returns/not-returns)
14437
14438         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14439         switch of the statement if we are the last switch section.  That
14440         kills two problems: try/catch problems (we used to emit an empty
14441         nop at the end) and switch statements where all branches would
14442         return. 
14443
14444 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14445
14446         * driver.cs: Add default assemblies (the equivalent to the
14447         Microsoft CSC.RSP file)
14448
14449         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14450         also update tokens_seen and set it to false.
14451
14452         * driver.cs: Implement --recurse for Mike.
14453
14454         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14455         correctly splitting out the paths.
14456
14457 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14458
14459         * interface.cs (Interface.PopulateProperty): Instead of using
14460         `parent' as the declaration space for the set parameters, use
14461         `this' 
14462
14463         * support.cs (InternalParameters): InternalParameters constructor
14464         takes a DeclSpace instead of a TypeContainer.
14465
14466         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14467         types are being initialized, load the address of it before calling
14468         the function.  
14469
14470         (New): Provide a mechanism to disable the generation of local
14471         value type temporaries when the caller will be providing us with
14472         an address to store it.
14473
14474         (ArrayCreation.EmitDynamicInitializers): Use it.
14475
14476 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14477
14478         * expression.cs (Invocation.EmitArguments): Only probe for array
14479         property if there is more than one argument.  Sorry about that.
14480
14481         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14482         empty param arrays.
14483
14484         * class.cs (Method.LabelParameters): Fix incorrect code path that
14485         prevented the `ParamArrayAttribute' from being applied to the
14486         params attribute.
14487
14488 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14489
14490         * support.cs (ReflectionParameters): Correctly compute whether the
14491         last argument is a params array.  Fixes the problem with
14492         string.Split ('a')
14493
14494         * typemanager.cs: Make the assemblies array always be non-null
14495         (empty, but non-null)
14496
14497         * tree.cs (RecordDecl): New function that abstracts the recording
14498         of names.  This reports error 101, and provides a pointer to the
14499         previous declaration.  Fixes a crash in the compiler.
14500
14501         * cs-parser.jay (constructor_declaration): Update to new grammar,
14502         and provide a constructor_body that can be empty.
14503
14504 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14505
14506         * driver.cs: Add support for --resources.
14507
14508         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14509         Make all types for the various array helper methods be integer.
14510
14511         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14512         CheckState to ConvCast.
14513
14514         (ConvCast): Now it takes a `checked' state argument, to avoid
14515         depending on the emit context for the conversion, and just using
14516         the resolve time setting.
14517
14518         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14519         instead of Invocation.EmitArguments.  We do not emit the original
14520         arguments, instead we emit those which have been converted to
14521         unsigned int expressions.
14522
14523         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14524
14525         * codegen.cs: ditto.
14526
14527         * expression.cs (LocalVariableReference): Drop the use of the
14528         Store function that depended on the variable index.
14529
14530         * statement.cs (VariableInfo): Drop the `Idx' property from this
14531         class, as this is not taking into account the indexes for
14532         temporaries tat we generate during the execution, getting the
14533         indexes wrong.
14534
14535         * class.cs: First emit class initializers, then call the parent
14536         constructor. 
14537
14538         * expression.cs (Binary): Fix opcode emision.
14539         (UnaryMutator.EmitCode): Support checked code generation
14540
14541         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14542         matches for events for both the Static and Instance scans,
14543         pointing to the same element.   Fix that.
14544
14545 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14546
14547         * rootcontext.cs (ResolveTree): Always set the
14548         interface_resolve_order, because nested interfaces will be calling
14549         into us.
14550
14551         * class.cs (GetInterfaceOrClass): Track the same resolution
14552         process used by TypeManager.LookupType.  This fixes the nested
14553         type lookups in class declarations (separate path from
14554         LookupType). 
14555
14556         (TypeContainer.DefineType): Also define nested interfaces.
14557         (TypeContainer.RegisterOrder): New public function used to
14558         register the order in which child interfaces need to be closed.
14559
14560         Nested interfaces need to be closed after their parents have been
14561         created. 
14562
14563         * interface.cs (InterfaceAttr): Put all the logic for computing
14564         the interface attribute here. 
14565
14566         (DefineInterface): Register our interface order with the
14567         RootContext or with the TypeContainer depending on the case.
14568
14569 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14570
14571         * cs-parser.jay: rework foreach statement to work with the new
14572         changes to the policy on SimpleNames.
14573
14574         * report.cs: support Stacktrace on warnings as well.
14575
14576         * makefile: drop --unsafe and /unsafe from the compile.
14577
14578 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14579
14580         * ecore.cs (StandardConversionExists): Modify to take an Expression
14581         as the first parameter. Ensure we do null -> reference type conversion
14582         checking.
14583
14584         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14585         temporary Expression objects.
14586
14587 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14588
14589         * interface.cs: workaround bug in method overloading resolution
14590         (there is already a bugzilla bug for it).
14591
14592 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14593
14594         We could also solve this problem by having a separate path for
14595         performing type lookups, instead of DoResolve, we could have a
14596         ResolveType entry point, and only participating pieces of the
14597         production (simplename, deref, array) would implement this. 
14598
14599         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14600         signal SimpleName to only resolve type names and not attempt to
14601         resolve anything else.
14602
14603         * expression.cs (Cast): Set the flag.
14604
14605         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14606
14607         * class.cs: Only report 108 if there is no `new' modifier.
14608
14609         * cs-parser.jay: rework foreach statement to work with the new
14610         changes to the policy on SimpleNames.
14611         
14612         * report.cs: support Stacktrace on warnings as well.
14613
14614         * makefile: drop --unsafe and /unsafe from the compile.
14615
14616 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14617
14618         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14619         lookups here, instead of doing that at parse time.  This means
14620         that our grammar will not introduce `LocalVariableReferences' as
14621         expressions at this point.  That solves the problem of code like
14622         this:
14623
14624         class X {
14625            static void Main ()
14626            { int X = 1;
14627             { X x = null }}}
14628
14629         This is only half the fix.  The full fix requires parameters to
14630         also be handled in this way.
14631
14632         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14633         makes the use more obvious of the DeclSpace.  The
14634         ec.TypeContainer.TypeBuilder is now only used to pull the
14635         TypeBuilder for it.
14636
14637         My theory is that I can get rid of the TypeBuilder completely from
14638         the EmitContext, and have typecasts where it is used (from
14639         DeclSpace to where it matters).  
14640
14641         The only pending problem is that the code that implements Aliases
14642         is on TypeContainer, and probably should go in DeclSpace.
14643
14644         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14645         lookups here, instead of doing that at parse time.  This means
14646         that our grammar will not introduce `LocalVariableReferences' as
14647         expressions at this point.  That solves the problem of code like
14648         this:
14649
14650         class X {
14651            static void Main ()
14652            { int X = 1;
14653             { X x = null }}}
14654
14655         This is only half the fix.  The full fix requires parameters to
14656         also be handled in this way.
14657
14658         * class.cs (Property.DefineMethod): When implementing an interface
14659         method, set newslot, when implementing an abstract method, do not
14660         set the flag (before we tried never setting it, or always setting
14661         it, which is the difference).
14662         (Indexer.DefineMethod): same.
14663         (Method.DefineMethod): same.
14664
14665         * ecore.cs: Only set the status used flag if we get back a Field.
14666
14667         * attribute.cs: Temporary hack, so Paolo can keep working.
14668
14669 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14670
14671         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14672         the unmanaged type in the case we have a MarshalAs attribute.
14673
14674         (Resolve): Handle the case when we are parsing the special MarshalAs
14675         attribute [we need to store the unmanaged type to use later]
14676
14677         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14678         MarshalAs Attribute.
14679
14680         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14681         on parameters and accordingly set the marshalling info.
14682
14683 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14684
14685         * class.cs: Optimizing slightly by removing redundant code after
14686         we switched to the `NoTypes' return value.
14687         (Property.DefineMethod): use NoTypes here too.
14688
14689         This fixes the bug I introduced in my last batch of changes.
14690
14691 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14692
14693         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14694
14695         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14696         Enums since those are types too. 
14697
14698         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14699
14700         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14701         thanks to a call during the lookup process.
14702
14703 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14704
14705         * statement.cs (Foreach): Lots of work to accomodate a particular
14706         kind of foreach statement that I had not kept in mind.  It is
14707         possible to have foreachs on classes that provide a GetEnumerator
14708         method that return objects that implement the "pattern" for using
14709         a foreach, there is no need to support GetEnumerator
14710         specifically. 
14711
14712         This is needed to compile nant.
14713
14714         * decl.cs: Only report 114 if the member is not `Finalize' and if
14715         the warning level is at least 2.
14716
14717         * class.cs: Moved the compare function from Method to
14718         MethodSignature. 
14719
14720         (MethodSignature.InheritableMemberSignatureCompare): Add new
14721         filter function that is used to extract inheritable methods from a
14722         class. 
14723
14724         (Method.Define): Use the new `inheritable_method_signature_filter'
14725         delegate
14726
14727         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14728         command. 
14729
14730 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14731
14732         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14733
14734         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14735
14736         * expression.cs: Pass location information to
14737         ConvertImplicitStandard. 
14738
14739         * class.cs: Added debugging code to track return values from
14740         interfaces. 
14741
14742 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14743
14744         * expression.cs (Is.DoResolve): If either side of the `is' is an
14745         interface, do not flag the warning.
14746
14747         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14748         for interfaces
14749
14750         * report.cs: Allow for --fatal to be used with --probe.
14751
14752         * typemanager.cs (NoTypes): Move the definition for the empty Type
14753         array here. 
14754
14755         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14756         properties. 
14757         (TypeContainer.DefineProxy): New function used to proxy to parent
14758         implementations when implementing interfaces.
14759         (TypeContainer.ParentImplements): used to lookup if our parent
14760         implements a public function that is required by an interface.
14761         (TypeContainer.VerifyPendingMethods): Hook this up.
14762
14763         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14764         `modules' and `assemblies' arraylists into arrays.  We only grow
14765         these are the very early start up of the program, so this improves
14766         the speedof LookupType (nicely measured).
14767
14768         * expression.cs (MakeByteBlob): Replaced unsafe code with
14769         BitConverter, as suggested by Paolo.
14770
14771         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14772         folding of string concatenation, but if either side is a string,
14773         and the other is not, then return null, and let the runtime use
14774         the concatenation on the string plus the object (using
14775         `Object.ToString'). 
14776
14777 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14778
14779         Constant Folding has been implemented now.
14780
14781         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14782         the error instead on types that are not supported in one's
14783         complement. 
14784
14785         * constant.cs (Constant and all children): New set of functions to
14786         perform implict and explicit conversions.
14787
14788         * ecore.cs (EnumConstant): Implement the new functions to perform
14789         conversion by proxying to the child expression.
14790
14791         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14792         own separate setting that can not be turned off from the command
14793         line using --unchecked or --checked and is only controlled using
14794         the checked/unchecked statements and expressions.  This setting is
14795         used by the constant folder to flag errors.
14796
14797         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14798         ConstantCheckState as well.   
14799
14800         During Resolve, they also have to flag the state, because the
14801         constant folder runs completely in the Resolve phase.
14802
14803         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14804         well.
14805
14806 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14807
14808         * cfold.cs: New file, this file contains the constant folder.
14809
14810         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14811         argument to track whether we are using the resulting address to
14812         load or store a value and provide better error messages. 
14813
14814         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14815         new AddressOf arguments.
14816
14817         * statement.cs (Foreach.EmitCollectionForeach): Update
14818
14819         * expression.cs (Argument.Emit): Call AddressOf with proper
14820         arguments to track usage.
14821
14822         (New.DoEmit): Call AddressOf with new arguments.
14823
14824         (Unary.Emit): Adjust AddressOf call.
14825
14826 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14827
14828         * cs-parser.jay (member_access): Change the case for pre-defined types
14829         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14830         this suggestion.
14831
14832         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14833         a method body.
14834
14835         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14836         essentially like methods and apply attributes like MethodImplOptions to them too.
14837
14838         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14839         not being null.
14840
14841         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14842         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14843         is the DeclSpace.
14844
14845         * Update code everywhere accordingly.
14846
14847         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14848
14849         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14850
14851 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14852
14853         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14854         try performing lookups against those instead of jumping straight into using
14855         the 'using' clauses.
14856
14857         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14858
14859         (LookupType): Perform lookups in implicit parents too.
14860
14861         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14862         sequence as RootContext.LookupType. 
14863
14864         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14865         the various cases of namespace lookups into this method.
14866
14867 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14868
14869         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14870         in positional arguments)
14871
14872         * class.cs (Operator): Update the AllowedModifiers to contain
14873         extern. 
14874
14875         * cs-parser.jay: Update operator declaration to allow for the
14876         operator body to be empty.
14877
14878         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14879         values. 
14880
14881 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14882
14883         * class.cs (Method.Emit): Label parameters.
14884
14885         * driver.cs: Return 1 or 0 as the program exit code.
14886
14887 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14888
14889         * expression.cs: Special case the `null' object when trying to
14890         auto-compute the type, as anything can be explicitly converted to
14891         that. 
14892
14893         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14894         spotting this Paolo.
14895
14896         (Expression.ImplicitNumericConversion): Perform comparissions of
14897         the type using the underlying type in the case of an enumeration
14898         rather than using the enumeration type for the compare.
14899
14900         Cope with the underlying == type case, which is not possible to
14901         catch before. 
14902
14903         (Expression.ConvertNumericExplicit): Perform comparissions of
14904         the type using the underlying type in the case of an enumeration
14905         rather than using the enumeration type for the compare.
14906
14907         * driver.cs: If the user does not supply an extension, assume .exe
14908
14909         * cs-parser.jay (if_statement): Rewrote so that we can track the
14910         location for the if statement.
14911
14912         * expression.cs (Binary.ConstantFold): Only concat strings when
14913         the operation is "+", not everything ;-)
14914
14915         * statement.cs (Statement.EmitBoolExpression): Take a location
14916         argument. 
14917         (If, While, Do): Track location.
14918
14919         * expression.cs (Binary.ResolveOperator): In the object + string
14920         case, I was missing a call to ConvertImplicit
14921
14922 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14923
14924         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14925         Location arguments. Ensure we use RootContext.LookupType to do our work
14926         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14927
14928         * interface.cs (PopulateMethod): Handle the type of the parameter being
14929         null gracefully.
14930
14931         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14932         have a params method with no fixed arguments and a call is made with no
14933         arguments.
14934
14935 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14936
14937         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14938         the verbatim-string-literal
14939
14940         * support.cs (InternalParameters.ParameterModifier): handle null
14941         fixed parameters.
14942         (InternalParameters.ParameterType): ditto.
14943
14944         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14945         duplicating the name of the variable parameter.
14946         (GetParameterByName): Fix bug where we were not looking up array
14947         paramters if they were the only present (thanks Paolo!).
14948         (GetParameterInfo): We only have an empty set of types if both
14949         fixed and array are set to null.
14950         (GetParameterInfo-idx): Handle FixedParameter == null
14951
14952         * cs-parser.jay: Handle the case where there is no catch
14953         statements (missing null test).
14954
14955 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
14956
14957         * driver.cs (MainDriver): Be conservative on our command line
14958         handling.
14959
14960         Catch DirectoryNotFoundException when calling GetFiles.
14961
14962         (SplitPathAndPattern): Used to split the input specification into
14963         a path and a pattern that we can feed to Directory.GetFiles.
14964
14965 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14966
14967         * statement.cs (Fixed): Implement the last case of the Fixed
14968         statement (string handling).
14969
14970         * expression.cs (StringPtr): New class used to return a char * to
14971         a string;  Used by the Fixed statement.
14972
14973         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14974
14975         * expression.cs (Binary.ResolveOperator): Remove redundant
14976         MemberLookup pn parent type.
14977         Optimize union call, we do not need a union if the types are the same.
14978         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14979         type.
14980
14981         Specialize the use of MemberLookup everywhere, instead of using
14982         the default settings. 
14983
14984         (StackAlloc): Implement stackalloc keyword.
14985
14986         * cs-parser.jay: Add rule to parse stackalloc.
14987
14988         * driver.cs: Handle /h, /help, /?
14989
14990         * expression.cs (MakeByteBlob): Removed the hacks we had in place
14991         before we supported unsafe code.
14992
14993         * makefile: add --unsafe to the self compilation of mcs.
14994
14995 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
14996
14997         * expression.cs (PointerArithmetic): New class that is used to
14998         perform pointer arithmetic.
14999         (Binary.Resolve): Handle pointer arithmetic
15000         Handle pointer comparission.
15001         (ArrayPtr): Utility expression class that is used to take the
15002         address of an array.
15003
15004         (ElementAccess): Implement array access for pointers
15005
15006         * statement.cs (Fixed): Implement fixed statement for arrays, we
15007         are missing one more case before we are done.
15008
15009         * expression.cs (Indirection): Implement EmitAssign and set the
15010         ExprClass to Variable.  This allows pointer dereferences to be
15011         treated as variables, and to have values assigned to them.
15012
15013         * ecore.cs (Expression.StoreFromPtr): New utility function to
15014         store values dereferencing.
15015
15016 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15017
15018         * expression.cs (Binary.ResolveOperator): Ensure that we are
15019         not trying to operate on a void type - this fixes the reported
15020         bug.
15021
15022         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15023         the parent implementation is sealed.
15024
15025         * ../errors/cs0239.cs : Add.
15026
15027         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15028
15029         * typemanager.cs (unverifiable_code_type): Corresponds to 
15030         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15031         which have unsafe code in them.
15032
15033         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15034         unsafe context.
15035
15036 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15037
15038         * cs-tokenizer.cs: Add support for @"litreal strings"
15039
15040         Make tokenizer accept pre-processor directives
15041         on any column (remove the old C-like limitation). 
15042
15043         * rootcontext.cs (EmitCode): Emit any global attributes.
15044         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15045
15046         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15047
15048         * cs-parser.jay: Add support for global attributes.  
15049
15050 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15051
15052         * expression.cs (Indirection): New helper class.  Unary will
15053         create Indirection classes to be able to implement the
15054         IMemoryLocation interface on it.
15055
15056 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15057
15058         * cs-parser.jay (fixed_statement): reference the right statement.
15059
15060         * statement.cs (Fixed.Emit): Finish implementing the fixed
15061         statement for the &x case.
15062
15063 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15064
15065         * class.cs (Property.Define, Method.Define): Remove newslot when
15066         `implementing'.  
15067
15068         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15069         wrong.  NewSlot should only be used if the `new' keyword is present.
15070
15071         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15072         locating our system dir.  Sorry about this.
15073
15074 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15075
15076         * driver.cs (GetSystemDir): Compute correctly the location of our
15077         system assemblies.  I was using the compiler directory instead of
15078         the library directory.
15079
15080 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15081
15082         * expression.cs (BetterFunction): Put back in what Miguel commented out
15083         since it is the correct fix. The problem is elsewhere ;-)
15084
15085         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15086         parameters of the parms method are themselves compatible or not !
15087
15088         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15089         to check that a class implements an interface before saying that an implicit
15090         conversion was allowed. Use ImplementsInterface to do the checking.
15091
15092 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15093
15094         * class.cs (Method.Define): Track whether we are an explicit
15095         implementation or not.  And only call DefineMethodOverride if we
15096         are an explicit implementation.
15097
15098         (Property.DefineMethod): Ditto.
15099
15100 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15101
15102         * expression.cs (BetterFunction): Catch hideous bug which was
15103          preventing us from detecting ambiguous calls due to implicit casts i.e
15104         cs0121.
15105
15106 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15107
15108         * support.cs (Pair): Remove un-needed method.  I figured why I was
15109         getting the error in cs-parser.jay, the variable in a foreach loop
15110         is readonly, and the compiler does not really treat this as a variable.
15111
15112         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15113         instead of EQUALS in grammar.  
15114
15115         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15116
15117         * expression.cs (Unary.DoResolve): Check whether the argument is
15118         managed or not.
15119
15120 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15121
15122         * support.cs: Api for Pair to set a value.  Despite the fact that
15123         the variables are public the MS C# compiler refuses to compile
15124         code that accesses the field if the variable is part of a foreach
15125         statement. 
15126
15127         * statement.cs (Fixed): Begin implementation of the fixed
15128         statement.
15129
15130         (Block.AddVariable): Return the VariableInfo on success and null
15131         on failure instead of true/false. 
15132
15133         * cs-parser.jay (foreach): Catch errors on variables already
15134         defined (we were ignoring this value before) and properly unwind
15135         the block hierarchy
15136
15137         (fixed_statement): grammar for the fixed statement.
15138
15139 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15140
15141         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15142         pointer types to be incretemented.
15143
15144         (SizeOf): Implement.
15145
15146         * cs-parser.jay (pointer_member_access): Implement
15147         expr->IDENTIFIER production.
15148
15149         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15150         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15151         on safe contexts.
15152
15153         (Unary): Implement indirection.
15154
15155         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15156         use in non-unsafe context).
15157
15158         (SimpleName.DoResolve): Check for pointers in field access on safe
15159         contexts. 
15160
15161         (Expression.LoadFromPtr): Factor the load-indirect code in this
15162         function.  This was duplicated in UnboxCast and ParameterReference
15163
15164 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15165
15166         * expression.cs (ComposedCast): report an error if a pointer cast
15167         is used in a safe region.
15168
15169         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15170         pointer type casts in unsafe context.
15171
15172         * codegen.cs (EmitContext): Set up IsUnsafe.
15173
15174         * cs-parser.jay (non_expression_type): Add productions for pointer
15175         casts. 
15176
15177         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15178         code.  We should not use force into static mode if the method is
15179         not virtual.  Fixes bug in MIS
15180
15181         * statement.cs (Do.Emit, While.Emit, For.Emit,
15182         Statement.EmitBoolExpression): Add support to Do and While to
15183         propagate infinite loop as `I do return' semantics.
15184
15185         Improve the For case to also test for boolean constants.
15186
15187         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15188         to the list of attributes we can add.
15189
15190         Remove `EmitContext' argument.
15191
15192         * class.cs (Method.Define): Apply parameter attributes.
15193         (Constructor.Define): Apply parameter attributes.
15194         (MethodCore.LabelParameters): Move here the core of labeling
15195         parameters. 
15196
15197         * support.cs (ReflectionParameters.ParameterModifier,
15198         InternalParameters.ParameterModifier): Use IsByRef on the type and
15199         only return the OUT bit for these parameters instead of in/out/ref
15200         flags.
15201
15202         This is because I miss-understood things.  The ParameterInfo.IsIn
15203         and IsOut represent whether the parameter has the [In] and [Out]
15204         attributes set.  
15205
15206 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15207
15208         * ecore.cs (FieldExpr.Emit): Release temporaries.
15209
15210         * assign.cs (LocalTemporary.Release): new function.
15211
15212         * codegen.cs (EmitContext.GetTemporaryStorage,
15213         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15214         temporary storage.  Now we can "put back" localbuilders when we
15215         are done with them
15216
15217 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15218
15219         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15220         need to make a copy of the variable to generate verifiable code.
15221
15222 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15223
15224         * driver.cs: Compute dynamically the system directory.
15225
15226         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15227         Slower, but more generally useful.  Used by the abstract
15228         registering implementation. 
15229
15230         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15231         the rules for the special rule on Type/instances.  First check if
15232         we have the same name, and if so, try that special static path
15233         rather than the instance path.
15234
15235 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15236
15237         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15238         for, while and if.
15239
15240         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15241         Enum, ValueType, Delegate or Array for non-corlib compiles.
15242
15243         * cs-tokenizer.cs: Catch long identifiers (645)
15244
15245         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15246         piece of code.
15247
15248         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15249         fix, we were returning too early, so we were not registering
15250         pending methods from abstract classes.
15251
15252         Do not register pending methods if the class is abstract.
15253
15254         * expression.cs (Conditional.DoResolve): Report circular implicit
15255         conversions when we neecd to compute it for conditional
15256         expressions. 
15257
15258         (Is.DoResolve): If the expression is always of the provided type,
15259         flag warning 183.  If the expression can not ever be of the
15260         provided type flag warning 184.
15261
15262         * class.cs: Catch 169 as well.
15263
15264         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15265         read. 
15266
15267 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15268
15269         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15270
15271 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15272
15273         * interface.cs: (PopulateMethod): Check for pointers being defined
15274         only if the unsafe context is active.
15275         (PopulateProperty): ditto.
15276         (PopulateIndexer): ditto.
15277
15278         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15279         specified.  If pointers are present, make sure that they are
15280         present in an unsafe context.
15281         (Constructor, Constructor.Define): ditto.
15282         (Field, Field.Define): ditto.
15283         (Property, Property.Define): ditto.
15284         (Event, Event.Define): ditto.
15285
15286         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15287         hashtable if there are classes or structs defined.
15288
15289         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15290         code, as the constant resolution moved.
15291
15292         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15293         the metadata, so we can flag error 133. 
15294
15295         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15296         pointer is being declared in an unsafe context.
15297
15298 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15299
15300         * modifiers.cs (Modifiers.Check): Require a Location argument.
15301         Report error 227 for Unsafe use.
15302
15303         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15304
15305         * statement.cs (For.Emit): If the test is null, then report that
15306         we do `return', as we wont reach anything afterwards.
15307
15308         (Switch.SwitchGoverningType): Track the expression that matched
15309         the conversion.
15310
15311         * driver.cs: Allow negative numbers as an error code to flag.
15312
15313         * cs-parser.jay: Handle 1551.
15314
15315         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15316
15317 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15318
15319         * cs-parser.jay: Report 1518 (type declaration can only contain
15320         class, struct, interface, enum or delegate)
15321
15322         (switch_label): Report 1523 (keywords `case' or `default' must
15323         preced code)
15324
15325         (opt_switch_sections): Report 1522 (empty switch)
15326
15327         * driver.cs: Report 1515 (response file specified multiple times)
15328         Report 1516 (Source file specified multiple times).
15329
15330         * expression.cs (Argument.Resolve): Signal 1510
15331
15332         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15333         access not allowed in static code)
15334
15335 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15336
15337         * typemanager.cs (IsPointerType): Utility method which we are going
15338         to need a lot.
15339
15340         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15341         the object type, so we take care of that.
15342
15343         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15344
15345         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15346         added to non-params parameters :-)
15347
15348         * typemanager.cs (CSharpName): Include 'void' type too. 
15349
15350         (void_ptr_type): Include in the set of core types.
15351
15352         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15353         duplicating code.
15354
15355         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15356         an unsafe context.
15357
15358         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15359         completely forgotten about it.
15360
15361 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15362
15363         * cs-parser.jay (pointer_type): Add. This begins our implementation
15364         of parsing rules for unsafe code.
15365
15366         (unsafe_statement): Implement.
15367
15368         (embedded_statement): Modify to include the above.
15369
15370         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15371
15372         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15373         if the current context is an unsafe one.
15374
15375         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15376         are handled differently, we need separate rules for them.
15377
15378         (local_variable_declaration): Update to use local_variable_pointer_type
15379         to allow variable declarations of unmanaged pointer types.
15380
15381         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15382         in unsafe contexts.
15383
15384         * ../errors/cs0214.cs : Add.
15385
15386 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15387
15388         * makefile: remove 'response' file when cleaning.
15389
15390 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15391
15392         * cs-parser.jay: Report 1524.
15393
15394 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15395
15396         * typemanager.cs (RegisterMethod): drop checking if we have
15397         registered this from here
15398
15399 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15400
15401         * class.cs (Method.EmitDestructor): Implement calling our base
15402         destructor. 
15403
15404         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15405         value of InFinally.
15406
15407         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15408         this routine and will wrap the call in a try/catch block.  Deal
15409         with the case.
15410
15411 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15412
15413         * ecore.cs (Expression.MemberLookup): instead of taking a
15414         parameter `same_type' that was used to tell whether we could
15415         access private members we compute our containing type from the
15416         EmitContext.
15417
15418         (FieldExpr): Added partial support for volatile fields.  This does
15419         not work for volatile fields exposed from assemblies, as I can not
15420         figure out how to extract the modreq from it.
15421
15422         Updated all the source files to use this.
15423
15424         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15425         because it is referenced by MemberLookup very often. 
15426
15427 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15428
15429         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15430         TypeBuilder.GetCustomAttributes to retrieve what we need.
15431
15432         Get rid of redundant default_member_attr_type as this is the same as
15433         default_member_type which already exists.
15434
15435         * interface.cs, attribute.cs : Update accordingly.
15436
15437 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15438
15439         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15440         work for TYpeBuilders though.  Ravi, can you please fix this?
15441
15442         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15443
15444         * expression.cs (Argument.Emit): Handle the case of ref objects
15445         being passed to ref functions;  
15446
15447         (ParameterReference.EmitLoad): Loads the content of the pointer
15448         without dereferencing.
15449
15450 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15451
15452         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15453
15454 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15455
15456         * class.cs (Indexer.DefineMethod): Incorporate the interface
15457         type in the name of the method if we are doing explicit interface
15458         implementation.
15459
15460         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15461
15462         (BetterConversion): Fix extremely trivial bug where we were referring to
15463         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15464         again !
15465
15466         * ../errors/bug16.cs : Add although we have fixed it.
15467
15468 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15469
15470         * expression.cs (BaseIndexer): Begin implementation.
15471
15472         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15473
15474         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15475         production directly to remove a shift/reduce, and implement
15476         explicit interface implementation.
15477
15478         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15479         after a floating point suffix.
15480
15481         * expression.cs (DoNumericPromotions): Improved the conversion for
15482         uint/uint.  If we have a constant, we avoid doing a typecast to a
15483         larger type.
15484
15485         * class.cs (Indexer): Implement explicit interface implementation
15486         for indexers.
15487
15488 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15489
15490         * class.cs: make the default instance constructor public and hidebysig.
15491
15492 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15493
15494         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15495         so we can call it from elsewhere.
15496
15497         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15498         we emit it internally if the class has a defined indexer; otherwise the user
15499         emits it by decorating the class definition with the DefaultMemberAttribute.
15500
15501         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15502         attribute is not used on a type which defines an indexer.
15503
15504         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15505         character when we skip whitespace.
15506
15507         * ../errors/cs0646.cs : Add.
15508
15509 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15510
15511         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15512         again. 
15513
15514         * makefile: Add practical target `mcs3.exe' which builds the third
15515         generation compiler. 
15516
15517         * expression.cs (New): Fix structures constructor calling.
15518
15519         * class.cs (Property, Method, Indexer): Emit Final flag on the
15520         method if we are an interface implementation and we are not
15521         abstract. 
15522
15523         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15524         whether this property is referencing a `base' method.
15525
15526         * expression.cs (Invocation.EmitCall): take an extra argument:
15527         is_base, this is used to determine whether the `call' or
15528         `callvirt' opcode should be used.
15529
15530
15531         * delegate.cs: update EmitCall.
15532
15533         * class.cs (Method.Define): Set NewSlot for the cases where we are
15534         not implementing an interface method.
15535
15536         (Property.Define): ditto.
15537
15538 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15539
15540         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15541         'r'.  Allows mcs to parse itself fully.
15542
15543 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15544
15545         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15546         of the number of initializers that require the InitializeArray method.
15547
15548         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15549         update the above field where necessary.
15550
15551         (MakeByteBlob): Update accordingly.
15552
15553         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15554         greater than 2.
15555
15556         (EmitDynamicInitializers): Update in accordance with the new optimization.
15557
15558         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15559         same OpCode applies.
15560
15561         * cs-parser.jay : Fix some glaring errors I introduced.
15562
15563 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15564
15565         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15566         so that we can check for name clashes there too.
15567
15568         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15569         for interface indexers.
15570
15571         * interfaces.cs (Define): Emit the default member attribute.
15572
15573         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15574         variable was being referred to while setting the value ;-)
15575
15576 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15577
15578         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15579         byte-by-byte information when we know the data is zero.
15580
15581         Make the block always a multiple of 4, because
15582         DefineInitializedData has a bug.
15583
15584         * assign.cs: Fix, we should assign from the temporary, not from
15585         the source. 
15586
15587         * expression.cs (MakeByteBlob): Fix my incorrect code.
15588
15589 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15590
15591         * typemanager.cs (EnumToUnderlying): This function is used to get
15592         the underlying type from an enumeration, because it does not
15593         always work. 
15594
15595         * constant.cs: Use the I4_S form for values between -128 and 127.
15596
15597         * statement.cs (Block.LookupLabel): Looks up a label.
15598         (Block): Drop support for labeled blocks.
15599
15600         (LabeledStatement): New kind of statement that represents a label
15601         only.
15602
15603         (Goto): Finally implement this bad boy.
15604
15605         * cs-parser.jay: Update to reflect new mechanism to implement
15606         labels.
15607
15608 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15609
15610         * codegen.cs (EmitContext.This): a codegen property that keeps the
15611         a single instance of this instead of creating many different this
15612         instances. 
15613
15614         * delegate.cs (Delegate.DoResolve): Update to use the property;
15615
15616         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15617
15618         * expression.cs (BaseAccess.DoResolve): Ditto.
15619
15620 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15621
15622         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15623         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15624
15625         (InitCoreTypes): Update accordingly.
15626
15627         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15628         so we can quickly store the state.
15629
15630         (ApplyAttributes): Set the correct implementation flags
15631         for InternalCall methods.
15632
15633 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15634
15635         * expression.cs (EmitCall): if a method is not virtual, then do
15636         not use callvirt on it.
15637
15638         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15639         user defined stuff) requires the use of stobj, which takes an
15640         address on the stack instead of an array and an index.  So emit
15641         the Ldelema operation for it.
15642
15643         (EmitStoreOpcode): Use stobj for valuetypes.
15644
15645         (UnaryMutator.EmitCode): Use the right 1 value depending on
15646         whether we are dealing with int64/uint64, float or doubles.
15647
15648         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15649         constructors that I implemented last night.
15650
15651         (Constructor.IsDefault): Fix to work properly for static
15652         constructors.
15653
15654         * cs-parser.jay (CheckDef): report method signature errors.
15655         Update error number 103 to be 132.
15656
15657         * decl.cs: New AdditionResult enumeration value: MethodExists.
15658         Although we do this check for methods later on in the semantic
15659         analysis, catching repeated default constructors is so easy that
15660         we catch these here. 
15661
15662         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15663         promotions code.
15664
15665         (ParameterReference.EmitAssign, Emit): handle
15666         bools as bytes.
15667
15668         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15669         (ArrayAccess.EmitStoreOpcode): ditto.
15670
15671         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15672
15673         * expression.cs (MakeByteBlob): Complete all the missing types
15674         (uint, short, ushort, byte, sbyte)
15675
15676         * class.cs: Only init instance field initializers on instance
15677         constructors. 
15678
15679         Rename `constructors' to instance_constructors. 
15680
15681         (TypeContainer.AddConstructor): Only add constructors to the list
15682         if it is not static.
15683
15684         Make sure that we handle default_static_constructor independently
15685         everywhere where we handle instance_constructors
15686
15687 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15688
15689         * class.cs: Do not lookup or create a base initializer for a
15690         static constructor.
15691
15692         (ConstructorInitializer.Resolve): use the proper type to lookup
15693         for constructors.
15694
15695         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15696
15697         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15698         in DeclSpace. 
15699
15700         * decl.cs: CloseType is now an virtual method, the default
15701         implementation just closes this type.
15702
15703 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15704
15705         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15706         to PreserveSig by default. Also emit HideBySig on such methods.
15707
15708         Basically, set the defaults to standard values.
15709
15710         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15711         argument, if candidate is better, it can't be worse than the best !
15712
15713         (Invocation): Re-write bits to differentiate between methods being
15714         applicable in their expanded form and their normal form - for params
15715         methods of course.
15716
15717         Get rid of use_standard everywhere as only standard conversions are allowed
15718         in overload resolution. 
15719
15720         More spec conformance.
15721
15722 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15723
15724         * driver.cs: Add --timestamp, to see where the compiler spends
15725         most of its time.
15726
15727         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15728         `this' in static code.
15729
15730         (SimpleName.DoResolve): Implement in terms of a helper function
15731         that allows static-references to be passed upstream to
15732         MemberAccess.
15733
15734         (Expression.ResolveWithSimpleName): Resolve specially simple
15735         names when called by MemberAccess to implement the special
15736         semantics. 
15737
15738         (Expression.ImplicitReferenceConversion): Handle conversions from
15739         Null to reference types before others, as Null's type is
15740         System.Object. 
15741
15742         * expression.cs (Invocation.EmitCall): Handle the special case of
15743         calling methods declared on a reference type from a ValueType
15744         (Base classes System.Object and System.Enum)
15745
15746         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15747         the left hand side is a TypeExpr, not on every enumeration. 
15748
15749         (Binary.Resolve): If types are reference types, then do a cast to
15750         object on operators != and == of both arguments.
15751
15752         * typemanager.cs (FindMembers): Extract instance and static
15753         members if requested.
15754
15755         * interface.cs (PopulateProperty): Use void_type instead of null
15756         as the return type for the setter method.
15757
15758         (PopulateIndexer): ditto.
15759
15760 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15761
15762         * support.cs (ReflectionParameters): Fix minor bug where we
15763         were examining the wrong parameter for the ParamArray attribute.
15764
15765         Cope with requests for the type of the parameter at position
15766         greater than the params parameter's. We now return the element
15767         type of the params array as that makes more sense.
15768
15769         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15770         accordingly as we no longer have to extract the element type
15771         ourselves.
15772
15773         (Invocation.OverloadResolve): Update.
15774
15775 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15776
15777         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15778         against IEnumerator, test whether the return value is a descendant
15779         of the IEnumerator interface.
15780
15781         * class.cs (Indexer.Define): Use an auxiliary method to implement
15782         the other bits of the method definition.  Begin support for
15783         explicit interface implementation.
15784
15785         (Property.DefineMethod): Use TypeManager.void_type instead of null
15786         for an empty return value.
15787
15788 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15789
15790         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15791         dealing with a FieldExpr which is composed of a FieldBuilder, in
15792         the code path we did extract the constant, but we should have
15793         obtained the underlying value to be able to cast it (otherwise we
15794         end up in an infinite loop, this is what Ravi was running into).
15795
15796         (ArrayCreation.UpdateIndices): Arrays might be empty.
15797
15798         (MemberAccess.ResolveMemberAccess): Add support for section
15799         14.5.4.1 that deals with the special case of E.I when E is a type
15800         and something else, that I can be a reference to a static member.
15801
15802         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15803         handle a particular array type to create byte blobs, it is just
15804         something we dont generate byteblobs for.
15805
15806         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15807         arguments. 
15808
15809         * location.cs (Push): remove the key from the hashtable that we
15810         are about to add.   This happens for empty files.
15811
15812         * driver.cs: Dispose files after we have parsed them.
15813
15814         (tokenize): new function that only runs the tokenizer on its
15815         input, for speed testing.
15816
15817 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15818
15819         * class.cs (Event.Define): Define the private field only if there
15820         are no accessors defined.
15821
15822         * expression.cs (ResolveMemberAccess): If there is no associated
15823         field with the event, that means we have an event defined with its
15824         own accessors and we should flag error cs0070 since transforming
15825         ourselves into a field is not valid in that case.
15826
15827         * ecore.cs (SimpleName.DoResolve): Same as above.
15828
15829         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15830         and charset to sane values.
15831
15832 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15833
15834         * assign.cs (DoResolve): Perform check on events only if they 
15835         are being accessed outside the declaring type.
15836
15837         * cs-parser.jay (event_declarations): Update rules to correctly
15838         set the type of the implicit parameter etc.
15839
15840         (add_accessor, remove_accessor): Set current local parameters.
15841
15842         * expression.cs (Binary): For delegate addition and subtraction,
15843         cast the return value from the method into the appropriate delegate
15844         type.
15845
15846 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15847
15848         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15849         of these as the workaround is unnecessary.
15850
15851         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15852         delegate data - none of that is needed at all.
15853
15854         Re-write bits to extract the instance expression and the delegate method
15855         correctly.
15856
15857         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15858         on delegates too.
15859
15860         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15861         of attaching attributes instead of duplicating code everywhere.
15862
15863         * everywhere : Update code to do attribute emission using the above method.
15864
15865 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15866
15867         * expression.cs (IsParamsMethodApplicable): if there are not
15868         parameters, return immediately.
15869
15870         * ecore.cs: The 0 literal can be implicity converted to an enum
15871         type. 
15872
15873         (SimpleName.DoResolve): First lookup the type, then lookup the
15874         members. 
15875
15876         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15877         want to get its address.  If the InstanceExpression is not
15878         addressable, store the result in a temporary variable, then get
15879         the address of it.
15880
15881         * codegen.cs: Only display 219 errors on warning level or above. 
15882
15883         * expression.cs (ArrayAccess): Make it implement the
15884         IMemoryLocation interface.
15885
15886         (Binary.DoResolve): handle the operator == (object a, object b)
15887         and operator != (object a, object b) without incurring into a
15888         BoxedCast (because 5 != o should never be performed).
15889
15890         Handle binary enumerator operators.
15891
15892         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15893         value type, otherwise use Ldelem_ref.
15894
15895         Use precomputed names;
15896
15897         (AddressOf): Implement address of
15898
15899         * cs-parser.jay (labeled_statement): Fix recursive block
15900         addition by reworking the production.
15901
15902         * expression.cs (New.DoEmit): New has a special case:
15903                 
15904                  If we are dealing with a ValueType, we have a few
15905                  situations to deal with:
15906                 
15907                     * The target of New is a ValueType variable, that is
15908                       easy, we just pass this as the variable reference
15909                 
15910                     * The target of New is being passed as an argument,
15911                       to a boxing operation or a function that takes a
15912                       ValueType.
15913                 
15914                       In this case, we need to create a temporary variable
15915                       that is the argument of New.
15916
15917
15918 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15919
15920         * rootcontext.cs (LookupType): Check that current_type is not null before
15921         going about looking at nested types.
15922
15923         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15924         not implement the IAssignMethod interface any more.
15925
15926         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15927         where we tranform them into FieldExprs if they are being resolved from within
15928         the declaring type.
15929
15930         * ecore.cs (SimpleName.DoResolve): Do the same here.
15931
15932         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15933
15934         * ../errors/bug10.cs : Add.
15935
15936         * ../errors/cs0070.cs : Add.
15937
15938         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15939
15940         * assign.cs : Get rid of EventIsLocal everywhere.
15941
15942 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15943
15944         * ecore.cs (ConvertIntLiteral): finished the implementation.
15945
15946         * statement.cs (SwitchLabel): Convert the value we are using as a
15947         key before looking up the table.
15948
15949 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15950
15951         * codegen.cs (EmitTopBlock): Require a Location argument now.
15952
15953         * cs-parser.jay (constructor_declarator): We need to setup
15954         current_local_parameters before we parse the
15955         opt_constructor_initializer, to allow the variables to be bound
15956         to the constructor arguments.
15957
15958         * rootcontext.cs (LookupType): First lookup nested classes in our
15959         class and our parents before we go looking outside our class.
15960
15961         * expression.cs (ConstantFold): Extract/debox the values at the
15962         beginnning. 
15963
15964         * rootcontext.cs (EmitCode): Resolve the constants first before we
15965         resolve the types.  This is not really needed, but it helps debugging.
15966
15967         * statement.cs: report location.
15968
15969         * cs-parser.jay: pass location to throw statement.
15970
15971         * driver.cs: Small bug fix.
15972
15973         * report.cs: Updated format to be 4-zero filled digits.
15974
15975 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15976
15977         * expression.cs (CheckIndices): Fix minor bug where the wrong
15978         variable was being referred to ;-)
15979
15980         (DoEmit): Do not call EmitStaticInitializers when the 
15981         underlying type is System.Object.
15982
15983 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15984
15985         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15986         and do the usual workaround for SRE.
15987
15988         * class.cs (MyEventBuilder.EventType): New member to get at the type
15989         of the event, quickly.
15990
15991         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15992
15993         * assign.cs (Assign.DoResolve): Handle the case when the target
15994         is an EventExpr and perform the necessary checks.
15995
15996         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15997         interface.
15998
15999         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16000
16001         (EventExpr): Set the type in the constructor itself since we 
16002         are meant to be born fully resolved.
16003
16004         (EventExpr.Define): Revert code I wrote earlier.
16005                 
16006         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16007         instance expression is null. The instance expression is a This in that case
16008         or a null, depending on whether it is a static method or not.
16009
16010         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16011         refers to more than one method.
16012
16013         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16014         and accordingly flag errors.
16015
16016 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16017
16018         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16019
16020 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16021
16022         * location.cs (ToString): Provide useful rutine.
16023
16024 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16025
16026         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16027         objects, return the actual integral boxed.
16028
16029         * statement.cs (SwitchLabel): define an ILLabel for each
16030         SwitchLabel. 
16031
16032         (Switch.CheckSwitch): If the value is a Literal, extract
16033         the underlying literal.
16034
16035         Also in the unused hashtable we had, add the SwitchLabel so we can
16036         quickly look this value up.
16037
16038         * constant.cs: Implement a bunch of new constants.  Rewrite
16039         Literal based on this.  Made changes everywhere to adapt to this.
16040
16041         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16042         dereferencing array only once, and also copes with enumrations.
16043
16044         bytes are two bytes wide, not one.
16045
16046         (Cast): Perform constant conversions.
16047
16048         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16049         wrappers to the literals here.
16050
16051         * expression.cs (DoNumericPromotions): long literals can converted
16052         to ulong implicity (this is taken care of elsewhere, but I was
16053         missing this spot).
16054
16055         * ecore.cs (Expression.Literalize): Make the return type Literal,
16056         to improve type checking.
16057
16058         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16059
16060 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16061
16062         * literal.cs: Revert code from ravi that checked the bounds.  The
16063         bounds are sane by the definition of the type itself. 
16064
16065         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16066         need to actually look up in our parent hierarchy for interfaces
16067         implemented. 
16068
16069         * const.cs: Use the underlying type for enumerations
16070
16071         * delegate.cs: Compute the basename for the delegate creation,
16072         that should fix the delegate test case, and restore the correct
16073         Type Lookup semantics in rootcontext
16074
16075         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16076         referencing a nested type with the Reflection API is using the "+"
16077         sign. 
16078
16079         * cs-parser.jay: Do not require EOF token at the end.
16080
16081 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16082
16083         * rootcontext.cs (LookupType): Concatenate type names with
16084         a '.' instead of a '+' The test suite passes again.
16085
16086         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16087         field of the enumeration.
16088
16089         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16090         the case when the member is an EventExpr.
16091
16092         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16093         static has an associated instance expression.
16094
16095         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16096
16097         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16098
16099         * class.cs (Event.Define): Register event and perform appropriate checks
16100         for error #111.
16101
16102         We define the Add and Remove methods even if the use provides none because
16103         in that case, we provide default implementations ourselves.
16104
16105         Define a private field of the type of the event. This is done by the CSC compiler
16106         and we should be doing it too ;-)
16107
16108         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16109         More methods we use in code we generate.
16110
16111         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16112         is important.
16113
16114         (InitCoreTypes): Update accordingly for the above.
16115
16116         * class.cs (Event.Emit): Generate code for default accessors that we provide
16117
16118         (EmitDefaultMethod): Do the job in the above.
16119
16120         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16121         appropriate place.
16122
16123 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16124
16125         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16126         builders even if we were missing one.
16127
16128         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16129         pass the Basename as our class name instead of the Name.  The
16130         basename will be correctly composed for us.
16131
16132         * parameter.cs (Paramters): Now takes a Location argument.
16133
16134         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16135         make all the code call directly LookupType in RootContext and take
16136         this chance to pass the Location information everywhere.
16137
16138         * Everywhere: pass Location information.
16139
16140 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16141
16142         * class.cs (Constructor.Define): Updated way of detecting the
16143         length of the parameters.
16144
16145         (TypeContainer.DefineType): Use basename as the type name for
16146         nested types.
16147
16148         (TypeContainer.Define): Do not recursively define types here, as
16149         definition is taken care in order by the RootContext.
16150
16151         * tree.cs: Keep track of namespaces in a per-file basis.
16152
16153         * parameter.cs (Parameter.ComputeSignature): Update to use
16154         DeclSpace. 
16155
16156         (Parameters.GetSignature): ditto.
16157
16158         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16159         instead of a TypeContainer.
16160
16161         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16162         resolve names.  Because we need to be resolve in our context, not
16163         our parents.
16164
16165         * driver.cs: Implement response files.
16166
16167         * class.cs (TypeContainer.DefineType): If we are defined, do not
16168         redefine ourselves.
16169
16170         (Event.Emit): Emit the code for add/remove handlers.
16171         (Event.Define): Save the MethodBuilders for add/remove.
16172
16173         * typemanager.cs: Use pair here too.
16174
16175         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16176         DictionaryEntry requires the first argument to be non-null.  
16177
16178         (enum_declaration): Compute full name for registering the
16179         enumeration.
16180
16181         (delegate_declaration): Instead of using
16182         formal_parameter_list, use opt_formal_parameter_list as the list
16183         can be empty.
16184
16185         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16186         (EventParsing): New property that controls whether `add' and
16187         `remove' are returned as tokens or identifiers (for events);
16188
16189 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16190
16191         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16192         use MyEventBuilder only and let it wrap the real builder for us.
16193
16194         (MyEventBuilder): Revamp constructor etc.
16195
16196         Implement all operations that we perform on EventBuilder in precisely the same
16197         way here too.
16198
16199         (FindMembers): Update to use the EventBuilder member.
16200
16201         (Event.Emit): Update accordingly.
16202
16203 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16204
16205         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16206         by calling the appropriate methods.
16207
16208         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16209         useful.
16210
16211         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16212
16213 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16214
16215         * delegate.cs (Delegate.Populate): Check that the return type
16216         and various parameters types are indeed accessible.
16217
16218         * class.cs (Constructor.Define): Same here.
16219
16220         (Field.Define): Ditto.
16221
16222         (Event.Define): Ditto.
16223
16224         (Operator.Define): Check that the underlying Method defined itself
16225         correctly - so it's MethodBuilder should not be null.
16226
16227         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16228         expression happens to be null.
16229
16230         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16231         members but as of now we don't seem to be able to do anything really useful with it.
16232
16233         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16234         not the EventBuilder.
16235
16236 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16237
16238         * cs-tokenizer.cs: Add support for defines.
16239         Add support for #if, #elif, #else, #endif
16240
16241         (eval_var): evaluates a variable.
16242         (eval): stubbed for evaluating functions.
16243
16244         * cs-parser.jay: Pass the defines information
16245
16246         * driver.cs: Add --define command line option.
16247
16248         * decl.cs: Move MemberCore here.
16249
16250         Make it the base class for DeclSpace.  This allows us to catch and
16251         report 108 and 109 for everything now.
16252
16253         * class.cs (TypeContainer.Define): Extract all the members
16254         before populating and emit the warning 108 (new keyword required
16255         to override) instead of having each member implement this.
16256
16257         (MemberCore.Define): New abstract method, we will be using this in
16258         the warning reporting engine in Populate.
16259
16260         (Operator.Define): Adjust to new MemberCore protocol. 
16261
16262         * const.cs (Const): This does not derive from Expression, it is a
16263         temporary object we use to create fields, it is a MemberCore. 
16264
16265         * class.cs (Method.Define): Allow the entry point to be in a
16266         specific class.
16267
16268         * driver.cs: Rewrite the argument handler to clean it up a bit.
16269
16270         * rootcontext.cs: Made it just an auxiliary namespace feature by
16271         making everything static.
16272
16273         * driver.cs: Adapt code to use RootContext type name instead of
16274         instance variable.
16275
16276         * delegate.cs: Remove RootContext argument.
16277
16278         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16279         argument. 
16280
16281         * class.cs (Event.Define): The lookup can fail.
16282
16283         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16284
16285         * expression.cs: Resolve the this instance before invoking the code.
16286
16287 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16288
16289         * cs-parser.jay: Add a production in element_access that allows
16290         the thing to become a "type" reference.  This way we can parse
16291         things like "(string [])" as a type.
16292
16293         Note that this still does not handle the more complex rules of
16294         casts. 
16295
16296
16297         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16298
16299         * ecore.cs: (CopyNewMethods): new utility function used to
16300         assemble the list of methods from running FindMembers.
16301
16302         (MemberLookup): Rework FindMembers so that 
16303
16304 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16305
16306         * class.cs (TypeContainer): Remove Delegates who fail to be
16307         defined.
16308
16309         * delegate.cs (Populate): Verify that we dont get null return
16310         values.   TODO: Check for AsAccessible.
16311
16312         * cs-parser.jay: Use basename to emit error 574 (destructor should
16313         have the same name as container class), not the full name.
16314
16315         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16316         possible representation.  
16317
16318         Also implements integer type suffixes U and L.
16319
16320 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16321
16322         * expression.cs (ArrayCreation.DoResolve): We need to do the
16323         argument resolution *always*.
16324
16325         * decl.cs: Make this hold the namespace.  Hold the root context as
16326         well.
16327         (LookupType): Move here.
16328
16329         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16330
16331         * location.cs (Row, Name): Fixed the code, it was always returning
16332         references to the first file.
16333
16334         * interface.cs: Register properties defined through interfaces.
16335
16336         * driver.cs: Add support for globbing on the command line
16337
16338         * class.cs (Field): Make it derive from MemberCore as well.
16339         (Event): ditto.
16340
16341 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16342
16343         * class.cs (Event::Define): Check that the type of the event is a delegate
16344         type else flag error #66.
16345
16346         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16347         same.
16348
16349         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16350         values of EntryPoint, CharSet etc etc.
16351
16352         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16353
16354         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16355         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16356         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16357         which needs this to do its work.
16358
16359         * ../errors/cs0066.cs : Add.
16360
16361 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16362
16363         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16364         helper functions.
16365
16366         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16367         clears out the parameters field.
16368         (MemberSignatureCompare): Cleanup
16369
16370         (MemberCore): New base class used to share code between MethodCore
16371         and Property.
16372
16373         (RegisterRequiredImplementations) BindingFlags.Public requires
16374         either BindingFlags.Instace or Static.  Use instance here.
16375
16376         (Property): Refactored code to cope better with the full spec.
16377
16378         * parameter.cs (GetParameterInfo): Return an empty array instead
16379         of null on error.
16380
16381         * class.cs (Property): Abstract or extern properties have no bodies.
16382
16383         * parameter.cs (GetParameterInfo): return a zero-sized array.
16384
16385         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16386         method modifier validation to the typecontainer so we can reuse
16387         this on properties.
16388
16389         (MethodCore.ParameterTypes): return an empty sized array of types.
16390
16391         (Property.Define): Test property modifier validity.
16392
16393         Add tests for sealed/override too.
16394
16395         (Method.Emit): abstract or extern methods have no bodies.
16396
16397 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16398
16399         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16400         thing.
16401
16402         (Method::Define, ::Emit): Modify accordingly.
16403
16404         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16405
16406         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16407
16408         * makefile: Pass in /unsafe.
16409
16410 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16411
16412         * class.cs (MakeKey): Kill routine.
16413
16414         * class.cs (TypeContainer.Define): Correctly define explicit
16415         method implementations (they require the full interface name plus
16416         the method name).
16417
16418         * typemanager.cs: Deply the PtrHashtable here and stop using the
16419         lame keys.  Things work so much better.
16420
16421         This of course broke everyone who depended on `RegisterMethod' to
16422         do the `test for existance' test.  This has to be done elsewhere.
16423
16424         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16425         the object stupid Equals method (because, that like fails all over
16426         the place).  We still do not use it.
16427
16428         * class.cs (TypeContainer.SetRequiredInterface,
16429         TypeContainer.RequireMethods): Killed these two routines and moved
16430         all the functionality to RegisterRequiredImplementations.
16431
16432         (TypeContainer.RegisterRequiredImplementations): This routine now
16433         registers all the implementations required in an array for the
16434         interfaces and abstract methods.  We use an array of structures
16435         which can be computed ahead of time to reduce memory usage and we
16436         also assume that lookups are cheap as most classes will not
16437         implement too many interfaces.
16438
16439         We also avoid creating too many MethodSignatures.
16440
16441         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16442         clear the "pending" bit if we find that there are problems with
16443         the declaration.
16444
16445         (TypeContainer.VerifyPendingMethods): Update to report errors of
16446         methods that look like implementations but are not.
16447
16448         (TypeContainer.Define): Add support for explicit interface method
16449         implementation. 
16450
16451 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16452
16453         * typemanager.cs: Keep track of the parameters here instead of
16454         being a feature of the TypeContainer.
16455
16456         * class.cs: Drop the registration of parameters here, as
16457         InterfaceMethods are also interface declarations.
16458
16459         * delegate.cs: Register methods with the TypeManager not only with
16460         the TypeContainer.  This code was buggy.
16461
16462         * interface.cs: Full registation here.
16463
16464 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16465
16466         * expression.cs: Remove reducer for binary expressions, it can not
16467         be done this way.
16468
16469         * const.cs: Put here the code that used to go into constant.cs
16470
16471         * constant.cs: Put here the code for constants, this is a new base
16472         class for Literals.
16473
16474         * literal.cs: Make Literal derive from Constant.
16475
16476 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16477
16478         * statement.cs (Return.Emit): Report error 157 if the user
16479         attempts to return from a finally block.
16480
16481         (Return.Emit): Instead of emitting a return, jump to the end of
16482         the function.
16483
16484         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16485         LocalBuilder to store the result of the function.  ReturnLabel is
16486         the target where we jump.
16487
16488
16489 2001-12-09  Radek Doulik  <rodo@ximian.com>
16490
16491         * cs-parser.jay: remember alias in current namespace
16492
16493         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16494         namespaces
16495
16496         * class.cs (LookupAlias): lookup alias in my_namespace
16497
16498         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16499         aliases hashtable
16500         (LookupAlias): lookup alias in this and if needed in parent
16501         namespaces
16502
16503 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16504
16505         * support.cs: 
16506
16507         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16508         making things static.  I need this to avoid passing the
16509         TypeContainer when calling ParameterType.
16510
16511         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16512         that did string manipulation to compute the type and then call
16513         GetType.  Use Parameter.ParameterType instead.
16514
16515         * cs-tokenizer.cs: Consume the suffix for floating values.
16516
16517         * expression.cs (ParameterReference): figure out whether this is a
16518         reference parameter or not.  Kill an extra variable by computing
16519         the arg_idx during emission.
16520
16521         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16522         function that returns whether a parameter is an out/ref value or not.
16523
16524         (Parameter.ParameterType): The type of the parameter (base,
16525         without ref/out applied).
16526
16527         (Parameter.Resolve): Perform resolution here.
16528         (Parameter.ExternalType): The full type (with ref/out applied).
16529
16530         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16531         support for expressions on the using statement.
16532
16533 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16534
16535         * statement.cs (Using.EmitLocalVariableDecls): Split the
16536         localvariable handling of the using statement.
16537
16538         (Block.EmitMeta): Keep track of variable count across blocks.  We
16539         were reusing slots on separate branches of blocks.
16540
16541         (Try.Emit): Emit the general code block, we were not emitting it. 
16542
16543         Check the type of the declaration to be an IDisposable or
16544         something that can be implicity converted to it. 
16545
16546         Emit conversions if required.
16547
16548         * ecore.cs (EmptyExpression): New utility class.
16549         (Expression.ImplicitConversionExists): New utility function.
16550
16551 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16552
16553         * statement.cs (Using): Implement.
16554
16555         * expression.cs (LocalVariableReference): Support read only variables.
16556
16557         * statement.cs: Remove the explicit emit for the Leave opcode.
16558         (VariableInfo): Add a readonly field.
16559
16560 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16561
16562         * ecore.cs (ConvCast): new class used to encapsulate the various
16563         explicit integer conversions that works in both checked and
16564         unchecked contexts.
16565
16566         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16567         properly generate the overflow opcodes.
16568
16569 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16570
16571         * statement.cs: The correct type for the EmptyExpression is the
16572         element_type, not the variable type.  Ravi pointed this out.
16573
16574 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16575
16576         * class.cs (Method::Define): Handle PInvoke methods specially
16577         by using DefinePInvokeMethod instead of the usual one.
16578
16579         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16580         above to do the task of extracting information and defining the method.
16581
16582 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16583
16584         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16585         of the condition for string type.
16586
16587         (Emit): Move that here. 
16588
16589         (ArrayCreation::CheckIndices): Keep string literals in their expression
16590         form.
16591
16592         (EmitDynamicInitializers): Handle strings appropriately.
16593
16594 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16595
16596         * codegen.cs (EmitContext): Replace multiple variables with a
16597         single pointer to the current Switch statement.
16598
16599         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16600         EmitContext.
16601
16602 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16603
16604         * statement.cs 
16605
16606         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16607         default'.
16608
16609         (Foreach.Emit): Foreach on arrays was not setting
16610         up the loop variables (for break/continue).
16611
16612         (GotoCase): Semi-implented.
16613
16614 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16615
16616         * attribute.cs (CheckAttribute): Handle system attributes by using
16617         Attribute.GetAttributes to examine information we need.
16618
16619         (GetValidPlaces): Same here.
16620
16621         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16622
16623         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16624
16625         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16626
16627         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16628
16629         (Method::Emit): Handle the case when we are a PInvoke method.
16630
16631 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16632
16633         * expression.cs: Use ResolveWithSimpleName on compound names.
16634
16635 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16636
16637         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16638         before trying to reduce it.
16639
16640         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16641
16642         * constant.cs (LookupConstantValue): Implement.
16643
16644         (EmitConstant): Use the above in emitting the constant.
16645
16646         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16647         that are user-defined by doing a LookupConstantValue on them.
16648
16649         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16650         too, like above.
16651
16652 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16653
16654         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16655
16656         (BaseAccess.DoResolve): Implement.
16657
16658         (MemberAccess.DoResolve): Split this routine into a
16659         ResolveMemberAccess routine that can be used independently
16660
16661 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16662
16663         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16664         As that share bits of the implementation.  Is returns a boolean,
16665         while As returns the Type that is being probed.
16666
16667 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16668
16669         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16670         instead of a Literal - much easier.
16671
16672         (EnumInTransit): Remove - utterly useless :-)
16673
16674         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16675
16676         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16677
16678         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16679         chain when we have no associated expression.
16680
16681 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16682
16683         * constant.cs (Define): Use Location while reporting the errror.
16684
16685         Also emit a warning when 'new' is used and there is no inherited
16686         member to hide.
16687
16688         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16689         populated.
16690
16691         (LookupEnumValue): Implement to lookup an enum member's value and define it
16692         if necessary.
16693
16694         (Populate): Re-write accordingly to use the above routine.
16695
16696 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16697
16698         * expression.cs (This): Fix prototype for DoResolveLValue to
16699         override the base class DoResolveLValue.
16700
16701         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16702         declarations) 
16703
16704         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16705         (we need to load the address of the field here).  This fixes
16706         test-22. 
16707
16708         (FieldExpr.DoResolveLValue): Call the DoResolve
16709         function to initialize the Instance expression.
16710
16711         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16712         correctly the GetEnumerator operation on a value type.
16713
16714         * cs-parser.jay: Add more simple parsing error catches.
16715
16716         * statement.cs (Switch): Add support for string switches.
16717         Handle null specially.
16718
16719         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16720
16721 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16722
16723         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16724
16725         (declare_local_constant): New helper function.
16726
16727         * statement.cs (AddConstant): Keep a separate record of constants
16728
16729         (IsConstant): Implement to determine if a variable is a constant.
16730
16731         (GetConstantExpression): Implement.
16732
16733         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16734
16735         * statement.cs (IsVariableDefined): Re-write.
16736
16737 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16738
16739         * class.cs (TypeContainer::FindMembers): Look for constants
16740         in the case when we are looking for MemberTypes.Field
16741
16742         * expression.cs (MemberAccess::DoResolve): Check that in the
16743         case we are a FieldExpr and a Literal, we are not being accessed
16744         by an instance reference.
16745
16746         * cs-parser.jay (local_constant_declaration): Implement.
16747
16748         (declaration_statement): Implement for constant declarations.
16749
16750 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16751
16752         * statement.cs (Switch): Catch double defaults.
16753
16754         (Switch): More work on the switch() statement
16755         implementation.  It works for integral values now, need to finish
16756         string support.
16757
16758
16759 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16760
16761         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16762         integer literals into other integer literals.  To be used by
16763         switch. 
16764
16765 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16766
16767         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16768         some memory.
16769
16770         (EmitDynamicInitializers): Cope with the above since we extract data
16771         directly from ArrayData now.
16772
16773         (ExpectInitializers): Keep track of whether initializers are mandatory
16774         or not.
16775
16776         (Bounds): Make it a hashtable to prevent the same dimension being 
16777         recorded for every element in that dimension.
16778
16779         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16780         from being found.
16781
16782         Also fix bug which was causing the indices to be emitted in the reverse
16783         order.
16784
16785 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16786
16787         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16788         unfinished.  They do not work, because the underlying code is
16789         sloppy.
16790
16791 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16792
16793         * cs-parser.jay: Remove bogus fixme.
16794
16795         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16796         on Switch statement.
16797
16798 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16799
16800         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16801         the same. 
16802
16803         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16804         parameter. Apparently, any expression is allowed. 
16805
16806         (ValidateInitializers): Update accordingly.
16807
16808         (CheckIndices): Fix some tricky bugs thanks to recursion.
16809
16810         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16811         I was being completely brain-dead.
16812
16813         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16814         and re-write acordingly.
16815
16816         (DelegateInvocation): Re-write accordingly.
16817
16818         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16819
16820         (MakeByteBlob): Handle types more correctly.
16821
16822         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16823         initialization from expressions but it is incomplete because I am a complete
16824         Dodo :-|
16825
16826 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16827
16828         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16829         on If.  Basically, we have to return `true' (ie, we do return to
16830         our caller) only if both branches of the if return.
16831
16832         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16833         short-circuit operators, handle them as short circuit operators. 
16834
16835         (Cast.DoResolve): Resolve type.
16836         (Cast.Cast): Take an expression as the target type.
16837
16838         * cs-parser.jay (cast_expression): Remove old hack that only
16839         allowed a limited set of types to be handled.  Now we take a
16840         unary_expression and we resolve to a type during semantic
16841         analysis.
16842
16843         Use the grammar productions from Rhys to handle casts (this is
16844         not complete like Rhys syntax yet, we fail to handle that corner
16845         case that C# has regarding (-x), but we will get there.
16846
16847 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16848
16849         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16850         field which is an array type.
16851
16852         * cs-parser.jay (declare_local_variables): Support array initialization too.
16853
16854         * typemanager.cs (MakeKey): Implement.
16855
16856         (everywhere): Use the above appropriately.
16857
16858         * cs-parser.jay (for_statement): Update for array initialization while
16859         declaring variables.
16860
16861         * ecore.cs : The error message was correct, it's the variable's names that
16862         were misleading ;-) Make the code more readable.
16863
16864         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16865         the correct type etc.
16866
16867         (ConvertExplicit): Handle Enum types by examining the underlying type.
16868
16869 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16870
16871         * parameter.cs (GetCallingConvention): Always return
16872         CallingConventions.Standard for now.
16873
16874 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16875
16876         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16877         and `r' after calling DoNumericPromotions.
16878
16879         * ecore.cs: Fix error message (the types were in the wrong order).
16880
16881         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16882         BindingFlags.Instance as well 
16883
16884         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16885         implicit int literal conversion in an empty cast so that we
16886         propagate the right type upstream.
16887
16888         (UnboxCast): new class used to unbox value types.
16889         (Expression.ConvertExplicit): Add explicit type conversions done
16890         by unboxing.
16891
16892         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16893         the target type before applying the implicit LongLiterals to ULong
16894         literal cast.
16895
16896 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16897
16898         * cs-parser.jay (for_statement): Reworked the way For works: now
16899         we declare manually any variables that are introduced in
16900         for_initializer to solve the problem of having out-of-band code
16901         emition (that is what got for broken).
16902
16903         (declaration_statement): Perform the actual variable declaration
16904         that used to be done in local_variable_declaration here.
16905
16906         (local_variable_declaration): Do not declare anything, just pass
16907         the information on a DictionaryEntry
16908
16909 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16910
16911         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16912         re-write of the logic to now make it recursive.
16913
16914         (UpdateIndices): Re-write accordingly.
16915
16916         Store element data in a separate ArrayData list in the above methods.
16917
16918         (MakeByteBlob): Implement to dump the array data into a byte array.
16919
16920 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16921
16922         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16923         into CheckIndices.
16924
16925         * constant.cs (Define): Implement.
16926
16927         (EmitConstant): Re-write fully.
16928
16929         Pass in location info.
16930
16931         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16932         respectively.
16933
16934         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16935         DictionaryEntry since we need location info too.
16936
16937         (constant_declaration): Update accordingly.
16938
16939         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16940         code into another method : UpdateIndices.
16941
16942 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16943
16944         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16945         some type checking etc.
16946
16947 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16948
16949         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16950         bits to provide dimension info if the user skips doing that.
16951
16952         Update second constructor to store the rank correctly.
16953
16954 2001-11-16  Ravi Pratap  <ravi@ximian.com>
16955
16956         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16957         and try to implement.
16958
16959         * ../errors/cs0150.cs : Add.
16960
16961         * ../errors/cs0178.cs : Add.
16962
16963 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16964
16965         * statement.cs: Implement foreach on multi-dimensional arrays. 
16966
16967         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16968         name of the params argument.
16969
16970         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16971         initializing the array.
16972
16973         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16974         we can use this elsewhere.
16975
16976         * statement.cs: Finish implementation of foreach for single
16977         dimension arrays.
16978
16979         * cs-parser.jay: Use an out-of-band stack to pass information
16980         around, I wonder why I need this.
16981
16982         foreach_block: Make the new foreach_block the current_block.
16983
16984         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16985         function used to return a static Parameters structure.  Used for
16986         empty parameters, as those are created very frequently.
16987
16988         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16989
16990 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16991
16992         * interface.cs : Default modifier is private, not public. The
16993         make verify test passes again.
16994
16995 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16996
16997         * support.cs (ReflectionParameters): Fix logic to determine
16998         whether the last parameter is a params one. Test 9 passes again.
16999
17000         * delegate.cs (Populate): Register the builders we define with
17001         RegisterParameterForBuilder. Test 19 passes again.
17002
17003         * cs-parser.jay (property_declaration): Reference $6 instead
17004         of $$ to get at the location.
17005
17006         (indexer_declaration): Similar stuff.
17007
17008         (attribute): Ditto.
17009
17010         * class.cs (Property): Register parameters for the Get and Set methods
17011         if they exist. Test 23 passes again.
17012
17013         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17014         call to EmitArguments as we are sure there aren't any params arguments. 
17015         Test 32 passes again.
17016
17017         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17018         IndexOutOfRangeException. 
17019
17020         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17021         Test 33 now passes again.
17022
17023 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17024
17025         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17026         broke a bunch of things.  Will have to come up with a better way
17027         of tracking locations.
17028
17029         * statement.cs: Implemented foreach for single dimension arrays.
17030
17031 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17032
17033         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17034         an error.  This removes the lookup from the critical path.
17035
17036         * cs-parser.jay: Removed use of temporary_loc, which is completely
17037         broken. 
17038
17039 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17040
17041         * support.cs (ReflectionParameters.ParameterModifier): Report
17042         whether the argument is a PARAMS argument or not.
17043
17044         * class.cs: Set the attribute `ParamArrayAttribute' on the
17045         parameter argument.
17046
17047         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17048         and cons_param_array_attribute (ConstructorInfo for
17049         ParamArrayAttribute)., 
17050
17051         * codegen.cs: Emit the return using the `Return' statement, that
17052         way we can report the error correctly for missing return values. 
17053
17054         * class.cs (Method.Emit): Clean up.
17055
17056         * expression.cs (Argument.Resolve): Take another argument: the
17057         location where this argument is used.  Notice that this is not
17058         part of the "Argument" class as to reduce the size of the
17059         structure (we know the approximate location anyways).
17060
17061         Test if the argument is a variable-reference, if not, then
17062         complain with a 206.
17063
17064         (Argument.Emit): Emit addresses of variables.
17065
17066         (Argument.FullDesc): Simplify.
17067
17068         (Invocation.DoResolve): Update for Argument.Resolve.
17069
17070         (ElementAccess.DoResolve): ditto.
17071
17072         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17073         method should be virtual, as this method is always virtual.
17074
17075         (NewDelegate.DoResolve): Update for Argument.Resolve.
17076
17077         * class.cs (ConstructorInitializer.DoResolve): ditto.
17078
17079         * attribute.cs (Attribute.Resolve): ditto.
17080
17081 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17082
17083         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17084
17085         * expression.cs (ParameterReference): Drop IStackStorage and implement
17086         IAssignMethod instead. 
17087
17088         (LocalVariableReference): ditto.
17089
17090         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17091         IAssignMethod instead. 
17092
17093 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17094
17095         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17096         enumerations that are used in heavily used structures derive from
17097         byte in a laughable and pathetic attempt to reduce memory usage.
17098         This is the kind of pre-optimzations that you should not do at
17099         home without adult supervision.
17100
17101         * expression.cs (UnaryMutator): New class, used to handle ++ and
17102         -- separatedly from the other unary operators.  Cleans up the
17103         code, and kills the ExpressionStatement dependency in Unary.
17104
17105         (Unary): Removed `method' and `Arguments' from this class, making
17106         it smaller, and moving it all to SimpleCall, so I can reuse this
17107         code in other locations and avoid creating a lot of transient data
17108         strucutres when not required.
17109
17110         * cs-parser.jay: Adjust for new changes.
17111
17112 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17113
17114         * enum.cs (Enum.Populate): If there is a failure during
17115         definition, return
17116
17117         * cs-parser.jay (opt_enum_base): we used to catch type errors
17118         here, but this is really incorrect.  The type error should be
17119         catched during semantic analysis.
17120
17121 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17122
17123         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17124         current_local_parameters as expected since I, in my stupidity, had forgotten
17125         to do this :-)
17126
17127         * attribute.cs (GetValidPlaces): Fix stupid bug.
17128
17129         * class.cs (Method::Emit): Perform check on applicability of attributes.
17130
17131         (Constructor::Emit): Ditto.
17132
17133         (Field::Emit): Ditto.
17134
17135         (Field.Location): Store location information.
17136
17137         (Property, Event, Indexer, Operator): Ditto.
17138
17139         * cs-parser.jay (field_declaration): Pass in location for each field.
17140
17141         * ../errors/cs0592.cs : Add.
17142
17143 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17144
17145         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17146
17147         (InitCoreTypes): Update accordingly.
17148
17149         (RegisterAttrType, LookupAttr): Implement.
17150
17151         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17152         info about the same.
17153
17154         (Resolve): Update to populate the above as necessary.
17155
17156         (Error592): Helper.
17157
17158         (GetValidPlaces): Helper to the above.
17159
17160         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17161
17162         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17163
17164 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17165
17166         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17167
17168         * ../errors/cs0617.cs : Add.
17169
17170 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17171
17172         * enum.cs (Emit): Rename to Populate to be more consistent with what
17173         we expect it to do and when exactly it is called.
17174
17175         * class.cs, rootcontext.cs : Update accordingly.
17176
17177         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17178         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17179
17180         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17181
17182         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17183         of a fieldinfo using the above, when dealing with a FieldBuilder.
17184
17185 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17186
17187         * ../errors/cs0031.cs : Add.
17188
17189         * ../errors/cs1008.cs : Add.
17190
17191         * ../errrors/cs0543.cs : Add.
17192
17193         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17194         enum type.
17195
17196         (FindMembers): Implement.
17197
17198         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17199         enums and delegates too.
17200
17201         (enum_types): Rename to builder_to_enum.
17202
17203         (delegate_types): Rename to builder_to_delegate.
17204
17205         * delegate.cs (FindMembers): Implement.
17206
17207 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17208
17209         * typemanager.cs (IsEnumType): Implement.
17210
17211         * enum.cs (Emit): Re-write parts to account for the underlying type
17212         better and perform checking etc.
17213
17214         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17215         of the underlying type.
17216
17217         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17218         value
17219
17220         * enum.cs (error31): Helper to report error #31.
17221
17222         * cs-parser.jay (enum_declaration): Store location of each member too.
17223
17224         * enum.cs (member_to_location): New hashtable. 
17225
17226         (AddEnumMember): Update location hashtable.
17227
17228         (Emit): Use the location of each member while reporting errors.
17229
17230 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17231
17232         * cs-parser.jay: A for_initializer if is a
17233         local_variable_declaration really ammount to have an implicit
17234         block with the variable declaration and no initializer for for.
17235
17236         * statement.cs (For.Emit): Cope with null initializers.
17237
17238         This fixes the infinite loop on for initializers.
17239
17240 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17241
17242         * enum.cs: More cleanup.
17243
17244         * ecore.cs: Remove dead code.
17245
17246         * class.cs (Property.Emit): More simplification.
17247         (Event.Emit): ditto.
17248
17249         Reworked to have less levels of indentation.
17250
17251 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17252
17253         * class.cs (Property): Emit attributes.
17254
17255         (Field): Ditto.
17256
17257         (Event): Ditto.
17258
17259         (Indexer): Ditto.
17260
17261         (Operator): Ditto.
17262
17263         * enum.cs (Emit): Ditto.
17264
17265         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17266         Enums too.
17267
17268         * class.cs (Field, Event, etc.): Move attribute generation into the
17269         Emit method everywhere.
17270
17271         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17272         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17273         as we had no way of defining nested enums !
17274
17275         * rootcontext.cs : Adjust code accordingly.
17276
17277         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17278
17279 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17280
17281         * expression.cs (EvalConstantExpression): Move into ecore.cs
17282
17283         * enum.cs (Enum): Rename some members and make them public and readonly
17284         according to our convention.
17285
17286         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17287         nothing else.
17288
17289         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17290
17291         (Enum::Emit): Write a simple version for now which doesn't try to compute
17292         expressions. I shall modify this to be more robust in just a while.
17293
17294         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17295
17296         (TypeContainer::CloseType): Create the Enum types too.
17297
17298         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17299
17300         * expression.cs (EvalConstantExpression): Get rid of completely.
17301
17302         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17303         user-defined values and other cases.
17304
17305         (IsValidEnumLiteral): Helper function.
17306
17307         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17308         out there in the case we had a literal FieldExpr.
17309
17310         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17311
17312         (Literalize): Revamp a bit to take two arguments.
17313
17314         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17315
17316 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17317
17318         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17319
17320         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17321
17322         (Resolve): Use the above to ensure we have proper initializers.
17323
17324 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17325
17326         * expression.cs (Expression::EvalConstantExpression): New method to 
17327         evaluate constant expressions.
17328
17329         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17330
17331 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17332
17333         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17334         in an array.
17335
17336         (Binary.ResolveOperator): Handle operator != (object a, object b)
17337         and operator == (object a, object b);
17338
17339         (Binary.DoNumericPromotions): Indicate whether the numeric
17340         promotion was possible.
17341
17342         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17343         Implement.  
17344
17345         Made the ArrayAccess implement interface IAssignMethod instead of
17346         IStackStore as the order in which arguments are passed reflects
17347         this.
17348
17349         * assign.cs: Instead of using expr.ExprClass to select the way of
17350         assinging, probe for the IStackStore/IAssignMethod interfaces.
17351
17352         * typemanager.cs: Load InitializeArray definition.
17353
17354         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17355         static data that can be used to initialize arrays. 
17356
17357 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17358
17359         * expression.cs: Handle operator== and operator!= for booleans.
17360
17361         (Conditioal.Reduce): Implement reducer for the ?: operator.
17362
17363         (Conditional.Resolve): Implement dead code elimination.
17364
17365         (Binary.Resolve): Catch string literals and return a new
17366         concatenated string.
17367
17368         (Unary.Reduce): Implement reduction of unary expressions.
17369
17370         * ecore.cs: Split out the expression core handling here.
17371
17372         (Expression.Reduce): New method used to perform constant folding
17373         and CSE.  This is needed to support constant-expressions. 
17374
17375         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17376         targets, and optimize for !x.
17377
17378 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17379
17380         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17381         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17382         set custom atttributes.
17383
17384         * literal.cs (Literal::GetValue): New abstract method to return the actual
17385         value of the literal, cast as an object.
17386
17387         (*Literal): Implement GetValue method.
17388
17389         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17390         expressions to the arraylist but objects of type Argument.
17391
17392         * class.cs (TypeContainer::Emit): Emit our attributes too.
17393
17394         (Method::Emit, Constructor::Emit): Ditto.
17395
17396         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17397         to be ignoring earlier.
17398
17399 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17400
17401         * attribute.cs (AttributeSection::Define): Implement to do the business
17402         of constructing a CustomAttributeBuilder.
17403
17404         (Attribute): New trivial class. Increases readability of code.  
17405
17406         * cs-parser.jay : Update accordingly.
17407
17408         (positional_argument_list, named_argument_list, named_argument): New rules
17409
17410         (attribute_arguments): Use the above so that we are more correct.
17411
17412 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17413
17414         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17415         to perform all checks for a method with a params parameter.
17416
17417         (Invocation::OverloadResolve): Update to use the above method and therefore
17418         cope correctly with params method invocations.
17419
17420         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17421         params too.
17422
17423         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17424         constructors in our parent too because we can't afford to miss out on 
17425         protected ones ;-)
17426
17427         * attribute.cs (AttributeSection): New name for the class Attribute
17428
17429         Other trivial changes to improve readability.
17430
17431         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17432         use the new class names.
17433
17434 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17435
17436         * class.cs (Method::Define): Complete definition for params types too
17437
17438         (Indexer::Define): Ditto.
17439
17440         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17441         Cope everywhere with a request for info about the array parameter.
17442
17443 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17444
17445         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17446
17447         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17448         local_variable_type to extract the string corresponding to the type.
17449
17450         (local_variable_type): Fixup the action to use the new helper method.
17451
17452         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17453         go.
17454
17455         * expression.cs : Clean out code which uses the above.
17456
17457 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17458
17459         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17460         and bale out if necessary by returning a false.
17461
17462         (RegisterProperty): Ditto.
17463
17464         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17465         and print out appropriate error messages.
17466
17467         * interface.cs (everywhere): Ditto.
17468
17469         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17470         location to constructor.
17471
17472         * class.cs (Property, Event, Indexer): Update accordingly.
17473
17474         * ../errors/cs111.cs : Added.
17475
17476         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17477         of a method, as laid down by the spec.
17478
17479         (Invocation::OverloadResolve): Use the above method.
17480
17481 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17482
17483         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17484         now take a TypeContainer and a Parameters object.
17485
17486         (ParameterData): Modify return type of ParameterModifier method to be 
17487         Parameter.Modifier and not a string.
17488
17489         (ReflectionParameters, InternalParameters): Update accordingly.
17490
17491         * expression.cs (Argument::GetParameterModifier): Same here.
17492
17493         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17494         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17495         symbol in it at all so maybe this is only for now.
17496
17497 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17498
17499         * support.cs (InternalParameters): Constructor now takes an extra argument 
17500         which is the actual Parameters class.
17501
17502         (ParameterDesc): Update to provide info on ref/out modifiers.
17503
17504         * class.cs (everywhere): Update call to InternalParameters to pass in
17505         the second argument too.
17506
17507         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17508         to return the modifier info [ref/out etc]
17509
17510         (InternalParameters, ReflectionParameters): Implement the above.
17511
17512         * expression.cs (Argument::ParameterModifier): Similar function to return
17513         info about the argument's modifiers.
17514
17515         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17516         too.
17517
17518         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17519         a new SetFormalParameters object which we pass to InternalParameters.
17520
17521 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17522
17523         * expression.cs (NewArray): Merge into the ArrayCreation class.
17524
17525 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17526
17527         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17528         NewUserdefinedArray into one as there wasn't much of a use in having
17529         two separate ones.
17530
17531         * expression.cs (Argument): Change field's name to ArgType from Type.
17532
17533         (Type): New readonly property which returns the proper type, taking into 
17534         account ref/out modifiers.
17535
17536         (everywhere): Adjust code accordingly for the above.
17537
17538         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17539         whether we are emitting for a ref or out parameter.
17540
17541         * expression.cs (Argument::Emit): Use the above field to set the state.
17542
17543         (LocalVariableReference::Emit): Update to honour the flag and emit the
17544         right stuff.
17545
17546         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17547
17548         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17549
17550         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17551
17552         (ReflectionParameters, InternalParameters): Implement the above method.
17553
17554         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17555         reporting errors.
17556
17557         (Invocation::FullMethodDesc): Ditto. 
17558
17559 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17560
17561         * cs-parser.jay: Add extra production for the second form of array
17562         creation. 
17563
17564         * expression.cs (ArrayCreation): Update to reflect the above
17565         change. 
17566
17567         * Small changes to prepare for Array initialization.
17568
17569 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17570
17571         * typemanager.cs (ImplementsInterface): interface might be null;
17572         Deal with this problem;
17573
17574         Also, we do store negative hits on the cache (null values), so use
17575         this instead of calling t.GetInterfaces on the type everytime.
17576
17577 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17578
17579         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17580
17581         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17582         split functionality out into different classes.
17583
17584         (New::FormArrayType): Move into NewBuiltinArray.
17585
17586         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17587         quite useless.
17588
17589         (NewBuiltinArray): New class to handle creation of built-in arrays.
17590
17591         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17592         account creation of one-dimensional arrays.
17593
17594         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17595
17596         (NewUserdefinedArray::DoResolve): Implement.
17597
17598         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17599
17600         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17601         we maintain inside the TypeManager. This is necessary to perform lookups on the
17602         module builder.
17603
17604         (LookupType): Update to perform GetType on the module builders too.     
17605
17606         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17607
17608         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17609
17610 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17611
17612         * expression.cs (New::DoResolve): Implement guts of array creation.
17613
17614         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17615
17616 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17617
17618         * expression.cs: Fix bug I introduced lsat night that broke
17619         Delegates. 
17620
17621         (Expression.Resolve): Report a 246 error (can not resolve name)
17622         if we find a SimpleName in the stream.
17623
17624         (Expression.ResolveLValue): Ditto.
17625
17626         (Expression.ResolveWithSimpleName): This function is a variant of
17627         ResolveName, this one allows SimpleNames to be returned without a
17628         warning.  The only consumer of SimpleNames is MemberAccess
17629
17630 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17631
17632         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17633         might arrive here.  I have my doubts that this is correct.
17634
17635         * statement.cs (Lock): Implement lock statement.
17636
17637         * cs-parser.jay: Small fixes to support `lock' and `using'
17638
17639         * cs-tokenizer.cs: Remove extra space
17640
17641         * driver.cs: New flag --checked, allows to turn on integer math
17642         checking. 
17643
17644         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17645         Threading.Monitor.Exit 
17646
17647 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17648
17649         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17650         Expression Class to be IndexerAccess.
17651
17652         Notice that Indexer::DoResolve sets the eclass to Value.
17653
17654 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17655
17656         * class.cs (TypeContainer::Emit): Emit code for indexers.
17657
17658         * assign.cs (IAssignMethod): New interface implemented by Indexers
17659         and Properties for handling assignment.
17660
17661         (Assign::Emit): Simplify and reuse code. 
17662
17663         * expression.cs (IndexerAccess, PropertyExpr): Implement
17664         IAssignMethod, clean up old code. 
17665
17666 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17667
17668         * typemanager.cs (ImplementsInterface): New method to determine if a type
17669         implements a given interface. Provides a nice cache too.
17670
17671         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17672         method.
17673
17674         (ConvertReferenceExplicit): Ditto.
17675
17676         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17677         various methods, with correct names etc.
17678
17679         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17680         Operator.UnaryNegation.
17681
17682         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17683         we have a unary plus or minus operator.
17684
17685         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17686         UnaryMinus.
17687
17688         * everywhere : update accordingly.
17689
17690         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17691         respectively.
17692
17693         * class.cs (Method::Define): For the case where we are implementing a method
17694         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17695         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17696
17697 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17698
17699         * interface.cs (FindMembers): Implement to work around S.R.E
17700         lameness.
17701
17702         * typemanager.cs (IsInterfaceType): Implement.
17703
17704         (FindMembers): Update to handle interface types too.
17705
17706         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17707         use IsAssignableFrom as that is not correct - it doesn't work.
17708
17709         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17710         and accordingly override EmitStatement.
17711
17712         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17713         using the correct logic :-)
17714
17715 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17716
17717         * ../errors/cs-11.cs : Add to demonstrate error -11 
17718
17719 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17720
17721         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17722         then pass this as a hint to ResolveLValue.
17723
17724         * expression.cs (FieldExpr): Add Location information
17725
17726         (FieldExpr::LValueResolve): Report assignment to readonly
17727         variable. 
17728
17729         (Expression::ExprClassFromMemberInfo): Pass location information.
17730
17731         (Expression::ResolveLValue): Add new method that resolves an
17732         LValue. 
17733
17734         (Expression::DoResolveLValue): Default invocation calls
17735         DoResolve. 
17736
17737         (Indexers): New class used to keep track of indexers in a given
17738         Type. 
17739
17740         (IStackStore): Renamed from LValue, as it did not really describe
17741         what this did.  Also ResolveLValue is gone from this interface and
17742         now is part of Expression.
17743
17744         (ElementAccess): Depending on the element access type
17745
17746         * typemanager.cs: Add `indexer_name_type' as a Core type
17747         (System.Runtime.CompilerServices.IndexerNameAttribute)
17748
17749         * statement.cs (Goto): Take a location.
17750
17751 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17752
17753         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17754         if two delegates are compatible.
17755
17756         (NewDelegate::DoResolve): Update to take care of the case when
17757         we instantiate a delegate from another delegate.
17758
17759         * typemanager.cs (FindMembers): Don't even try to look up members
17760         of Delegate types for now.
17761
17762 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17763
17764         * delegate.cs (NewDelegate): New class to take care of delegate
17765         instantiation.
17766
17767         * expression.cs (New): Split the delegate related code out into 
17768         the NewDelegate class.
17769
17770         * delegate.cs (DelegateInvocation): New class to handle delegate 
17771         invocation.
17772
17773         * expression.cs (Invocation): Split out delegate related code into
17774         the DelegateInvocation class.
17775
17776 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17777
17778         * expression.cs (New::DoResolve): Implement delegate creation fully
17779         and according to the spec.
17780
17781         (New::DoEmit): Update to handle delegates differently.
17782
17783         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17784         because of which we were printing out arguments in reverse order !
17785
17786         * delegate.cs (VerifyMethod): Implement to check if the given method
17787         matches the delegate.
17788
17789         (FullDelegateDesc): Implement.
17790
17791         (VerifyApplicability): Implement.
17792
17793         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17794         delegate invocations too.
17795
17796         (Invocation::Emit): Ditto.
17797
17798         * ../errors/cs1593.cs : Added.
17799
17800         * ../errors/cs1594.cs : Added.
17801
17802         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17803
17804 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17805
17806         * typemanager.cs (intptr_type): Core type for System.IntPtr
17807
17808         (InitCoreTypes): Update for the same.
17809
17810         (iasyncresult_type, asynccallback_type): Ditto.
17811
17812         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17813         correct.
17814
17815         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17816         too.
17817
17818         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17819         the builders for the 4 members of a delegate type :-)
17820
17821         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17822         type.
17823
17824         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17825
17826         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17827
17828 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17829
17830         * statement.cs (Break::Emit): Implement.   
17831         (Continue::Emit): Implement.
17832
17833         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17834         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17835         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17836         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17837         end loop
17838
17839         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17840         properties that track the label for the current loop (begin of the
17841         loop and end of the loop).
17842
17843 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17844
17845         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17846         use of emitting anything at all.
17847
17848         * class.cs, rootcontext.cs : Get rid of calls to the same.
17849
17850         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17851
17852         (Populate): Define the constructor correctly and set the implementation
17853         attributes.
17854
17855         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17856         have been defined.
17857
17858         (AddDelegateType): Implement.
17859
17860         (IsDelegateType): Implement helper method.
17861
17862         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17863
17864         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17865         and accordingly handle it.
17866
17867         * delegate.cs (Populate): Take TypeContainer argument.
17868         Implement bits to define the Invoke method. However, I still haven't figured out
17869         how to take care of the native int bit :-(
17870
17871         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17872         Qualify the name of the delegate, not its return type !
17873
17874         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17875         conversion.
17876
17877         (StandardConversionExists): Checking for array types turns out to be recursive.
17878
17879         (ConvertReferenceExplicit): Implement array conversion.
17880
17881         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17882
17883 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17884
17885         * cs-parser.jay (delegate_declaration): Store the fully qualified
17886         name as it is a type declaration.
17887
17888         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17889         readonly.
17890
17891         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17892         as TypeContainer::DefineType.
17893
17894         (Populate): Method in which all the definition of the various methods (Invoke)
17895         etc is done.
17896
17897         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17898         see.
17899
17900         (CloseDelegate): Finally creates the delegate.
17901
17902         * class.cs (TypeContainer::DefineType): Update to define delegates.
17903         (Populate, Emit and CloseType): Do the same thing here too.
17904
17905         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17906         delegates in all these operations.
17907
17908 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17909
17910         * expression.cs: LocalTemporary: a new expression used to
17911         reference a temporary that has been created.
17912
17913         * assign.cs: Handle PropertyAccess back here, so that we can
17914         provide the proper semantic access to properties.
17915
17916         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17917         a few more explicit conversions. 
17918
17919         * modifiers.cs: `NEW' modifier maps to HideBySig.
17920
17921         * expression.cs (PropertyExpr): Make this into an
17922         ExpressionStatement, and support the EmitStatement code path. 
17923
17924         Perform get/set error checking, clean up the interface.
17925
17926         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17927         them into toplevel access objects.
17928
17929 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17930
17931         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17932         SRE.
17933
17934         * typemanager.cs: Keep track here of our PropertyBuilders again to
17935         work around lameness in SRE.
17936
17937 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17938
17939         * expression.cs (LValue::LValueResolve): New method in the
17940         interface, used to perform a second resolution pass for LValues. 
17941
17942         (This::DoResolve): Catch the use of this in static methods.
17943
17944         (This::LValueResolve): Implement.
17945
17946         (This::Store): Remove warning, assigning to `this' in structures
17947         is 
17948
17949         (Invocation::Emit): Deal with invocation of
17950         methods on value types.  We need to pass the address to structure
17951         methods rather than the object itself.  (The equivalent code to
17952         emit "this" for structures leaves the entire structure on the
17953         stack instead of a pointer to it). 
17954
17955         (ParameterReference::DoResolve): Compute the real index for the
17956         argument based on whether the method takes or not a `this' pointer
17957         (ie, the method is static).
17958
17959         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17960         value types returned from functions when we need to invoke a
17961         method on the sturcture.
17962
17963
17964 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17965
17966         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17967         defining the type in the Modulebuilder or Typebuilder. This is to take
17968         care of nested types which need to be defined on the TypeBuilder using
17969         DefineNestedMethod.
17970
17971         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17972         methods in RootContext, only ported to be part of TypeContainer.
17973
17974         (TypeContainer::GetInterfaceOrClass): Ditto.
17975
17976         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17977
17978         * interface.cs (Interface::DefineInterface): New method. Does exactly
17979         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17980         too.
17981
17982         (Interface::GetInterfaces): Move from RootContext here and port.
17983
17984         (Interface::GetInterfaceByName): Same here.
17985
17986         * rootcontext.cs (ResolveTree): Re-write.
17987
17988         (PopulateTypes): Re-write.
17989
17990         * class.cs (TypeContainer::Populate): Populate nested types too.
17991         (TypeContainer::Emit): Emit nested members too.
17992
17993         * typemanager.cs (AddUserType): Do not make use of the FullName property,
17994         instead just use the name argument passed in as it is already fully
17995         qualified.
17996
17997         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17998         to TypeContainer mapping to see if a type is user-defined.
17999
18000         * class.cs (TypeContainer::CloseType): Implement. 
18001
18002         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18003         the default constructor.
18004
18005         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18006         twice.
18007
18008         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18009
18010         * interface.cs (CloseType): Create the type here.
18011
18012         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18013         the hierarchy.
18014
18015         Remove all the methods which are now in TypeContainer.
18016
18017 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18018
18019         * delegate.cs (Define): Re-write bits to define the delegate
18020         correctly.
18021
18022 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18023
18024         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18025
18026         * expression.cs (ImplicitReferenceConversion): handle null as well
18027         as a source to convert to any reference type.
18028
18029         * statement.cs (Return): Perform any implicit conversions to
18030         expected return type.  
18031
18032         Validate use of return statement.  
18033
18034         * codegen.cs (EmitContext): Pass the expected return type here.
18035
18036         * class.cs (Method, Constructor, Property): Pass expected return
18037         type to EmitContext.
18038
18039 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18040
18041         * expression.cs: Make DoResolve take an EmitContext instead of a
18042         TypeContainer.
18043
18044         Replaced `l' and `location' for `loc', for consistency.
18045
18046         (Error, Warning): Remove unneeded Tc argument.
18047
18048         * assign.cs, literal.cs, constant.cs: Update to new calling
18049         convention. 
18050
18051         * codegen.cs: EmitContext now contains a flag indicating whether
18052         code is being generated in a static method or not.
18053
18054         * cs-parser.jay: DecomposeQI, new function that replaces the old
18055         QualifiedIdentifier.  Now we always decompose the assembled
18056         strings from qualified_identifier productions into a group of
18057         memberaccesses.
18058
18059 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18060
18061         * rootcontext.cs: Deal with field-less struct types correctly now
18062         by passing the size option to Define Type.
18063
18064         * class.cs: Removed hack that created one static field. 
18065
18066 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18067
18068         * statement.cs: Moved most of the code generation here. 
18069
18070 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18071
18072         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18073         seem very right.
18074
18075         (ElementAccess): Remove useless bits for now - keep checks as the spec
18076         says.
18077
18078 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18079
18080         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18081         and start performing checks according to the spec.
18082
18083 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18084
18085         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18086         rank_specifiers instead.
18087
18088         (rank_specifiers): Change the order in which the rank specifiers are stored
18089
18090         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18091
18092         * expression.cs (ElementAccess): Implement the LValue interface too.
18093
18094 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18095
18096         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18097         except that user defined conversions are not included.
18098
18099         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18100         perform the conversion of the return type, if necessary.
18101
18102         (New::DoResolve): Check whether we are creating an array or an object
18103         and accordingly do the needful.
18104
18105         (New::Emit): Same here.
18106
18107         (New::DoResolve): Implement guts of array creation.
18108
18109         (New::FormLookupType): Helper function.
18110
18111 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18112
18113         * codegen.cs: Removed most of the code generation here, and move the
18114         corresponding code generation bits to the statement classes. 
18115
18116         Added support for try/catch/finalize and throw.
18117
18118         * cs-parser.jay: Added support for try/catch/finalize.
18119
18120         * class.cs: Catch static methods having the flags override,
18121         virtual or abstract.
18122
18123         * expression.cs (UserCast): This user cast was not really doing
18124         what it was supposed to do.  Which is to be born in fully resolved
18125         state.  Parts of the resolution were being performed at Emit time! 
18126
18127         Fixed this code.
18128
18129 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18130
18131         * expression.cs: Implicity convert the result from UserCast.
18132
18133 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18134
18135         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18136         prevented it from working correctly. 
18137
18138         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18139         merely ConvertImplicit.
18140
18141 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18142
18143         * typemanager.cs: Make the LookupTypeContainer function static,
18144         and not per-instance.  
18145
18146         * class.cs: Make static FindMembers (the one that takes a Type
18147         argument). 
18148
18149         * codegen.cs: Add EmitForeach here.
18150
18151         * cs-parser.jay: Make foreach a toplevel object instead of the
18152         inline expansion, as we need to perform semantic analysis on it. 
18153
18154 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18155
18156         * expression.cs (Expression::ImplicitUserConversion): Rename to
18157         UserDefinedConversion.
18158
18159         (Expression::UserDefinedConversion): Take an extra argument specifying 
18160         whether we look for explicit user conversions too.
18161
18162         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18163
18164         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18165
18166         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18167         with the appropriate arguments.
18168
18169         * cs-parser.jay (cast_expression): Record location too.
18170
18171         * expression.cs (Cast): Record location info.
18172
18173         (Expression::ConvertExplicit): Take location argument.
18174
18175         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18176         to determine if we are doing explicit conversions.
18177
18178         (UserCast::Emit): Update accordingly.
18179
18180         (Expression::ConvertExplicit): Report an error if everything fails.
18181
18182         * ../errors/cs0030.cs : Add.
18183
18184 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18185
18186         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18187         virtual and newslot bits. 
18188
18189         * class.cs (TypeContainer::RegisterRequiredImplementations):
18190         Record methods we need.
18191
18192         (TypeContainer::MakeKey): Helper function to make keys for
18193         MethodBases, since the Methodbase key is useless.
18194
18195         (TypeContainer::Populate): Call RegisterRequiredImplementations
18196         before defining the methods.   
18197
18198         Create a mapping for method_builders_to_methods ahead of time
18199         instead of inside a tight loop.
18200
18201         (::RequireMethods):  Accept an object as the data to set into the
18202         hashtable so we can report interface vs abstract method mismatch.
18203
18204 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18205
18206         * report.cs: Make all of it static.
18207
18208         * rootcontext.cs: Drop object_type and value_type computations, as
18209         we have those in the TypeManager anyways.
18210
18211         Drop report instance variable too, now it is a global.
18212
18213         * driver.cs: Use try/catch on command line handling.
18214
18215         Add --probe option to debug the error reporting system with a test
18216         suite. 
18217
18218         * report.cs: Add support for exiting program when a probe
18219         condition is reached.
18220
18221 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18222
18223         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18224         we do a forcible conversion regardless of type, to check if 
18225         ForceConversion returns a null.
18226
18227         (Binary::error19): Use location to report error.
18228
18229         (Unary::error23): Use location here too.
18230
18231         * ../errors/cs0019.cs : Check in.
18232
18233         * ../errors/cs0023.cs : Check in.
18234
18235         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18236         case of a non-null MethodInfo object with a length of 0 !
18237
18238         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18239         an applicable member - according to the spec :-)
18240         Also fix logic to find members in base types.
18241
18242         (Unary::ResolveOperator): Same here.
18243
18244         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18245         as I was getting thoroughly confused between this and error19 :-)
18246
18247         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18248         (::FindMostEncompassedType): Implement.
18249         (::FindMostEncompassingType): Implement.
18250         (::StandardConversionExists): Implement.
18251
18252         (UserImplicitCast): Re-vamp. We now need info about most specific
18253         source and target types so that we can do the necessary conversions.
18254
18255         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18256         mathematical union with no duplicates.
18257
18258 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18259
18260         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18261         in order from base classes to child classes, so that we can in
18262         child classes look up in our parent for method names and
18263         attributes (required for handling abstract, virtual, new, override
18264         constructs: we need to instrospect our base class, and if we dont
18265         populate the classes in order, the introspection might be
18266         incorrect.  For example, a method could query its parent before
18267         the parent has any methods and would determine that the parent has
18268         no abstract methods (while it could have had them)).
18269
18270         (RootContext::CreateType): Record the order in which we define the
18271         classes.
18272
18273 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18274
18275         * class.cs (TypeContainer::Populate): Also method definitions can
18276         fail now, keep track of this.
18277
18278         (TypeContainer::FindMembers): Implement support for
18279         DeclaredOnly/noDeclaredOnly flag.
18280
18281         (Constructor::Emit) Return the ConstructorBuilder.
18282
18283         (Method::Emit) Return the MethodBuilder. 
18284         Check for abstract or virtual methods to be public.
18285
18286         * rootcontext.cs (RootContext::CreateType): Register all the
18287         abstract methods required for the class to be complete and the
18288         interface methods that must be implemented. 
18289
18290         * cs-parser.jay: Report error 501 (method requires body if it is
18291         not marked abstract or extern).
18292
18293         * expression.cs (TypeOf::Emit): Implement.
18294
18295         * typemanager.cs: runtime_handle_type, new global type.
18296
18297         * class.cs (Property::Emit): Generate code for properties.
18298
18299 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18300
18301         * expression.cs (Unary::ResolveOperator): Find operators on base type
18302         too - we now conform exactly to the spec.
18303
18304         (Binary::ResolveOperator): Same here.
18305
18306         * class.cs (Operator::Define): Fix minor quirk in the tests.
18307
18308         * ../errors/cs0215.cs : Added.
18309
18310         * ../errors/cs0556.cs : Added.
18311
18312         * ../errors/cs0555.cs : Added.
18313
18314 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18315
18316         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18317         single integer which is really efficient
18318
18319 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18320
18321         *  expression.cs (Expression::ImplicitUserConversion): Use location
18322         even in the case when we are examining True operators.
18323  
18324         * class.cs (Operator::Define): Perform extensive checks to conform
18325         with the rules for operator overloading in the spec.
18326
18327         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18328         some of the other conversions mentioned in the spec.
18329
18330         * typemanager.cs (array_type): New static member for the System.Array built-in
18331         type.
18332
18333         (cloneable_interface): For System.ICloneable interface.
18334
18335         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18336         we start resolving the tree and populating types.
18337
18338         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18339  
18340 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18341
18342         * expression.cs (Expression::ExprClassFromMemberInfo,
18343         Expression::Literalize): Create literal expressions from
18344         FieldInfos which are literals.
18345
18346         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18347         type casts, because they were wrong.  The test suite in tests
18348         caught these ones.
18349
18350         (ImplicitNumericConversion): ushort to ulong requires a widening
18351         cast. 
18352
18353         Int32 constant to long requires widening cast as well.
18354
18355         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18356         for integers because the type on the stack is not i4.
18357
18358 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18359
18360         * expression.cs (report118): require location argument. 
18361
18362         * parameter.cs: Do not dereference potential null value.
18363
18364         * class.cs: Catch methods that lack the `new' keyword when
18365         overriding a name.  Report warnings when `new' is used without
18366         anything being there to override.
18367
18368         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18369
18370         * class.cs: Only add constructor to hashtable if it is non-null
18371         (as now constructors can fail on define).
18372
18373         (TypeManager, Class, Struct): Take location arguments.
18374
18375         Catch field instance initialization in structs as errors.
18376
18377         accepting_filter: a new filter for FindMembers that is static so
18378         that we dont create an instance per invocation.
18379
18380         (Constructor::Define): Catch errors where a struct constructor is
18381         parameterless 
18382
18383         * cs-parser.jay: Pass location information for various new
18384         constructs. 
18385
18386         * delegate.cs (Delegate): take a location argument.
18387
18388         * driver.cs: Do not call EmitCode if there were problesm in the
18389         Definition of the types, as many Builders wont be there. 
18390
18391         * decl.cs (Decl::Decl): Require a location argument.
18392
18393         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18394         into integers, and find the most appropiate integer for it.
18395
18396         * literal.cs: Implement ULongLiteral.
18397
18398         * rootcontext.cs: Provide better information about the location of
18399         failure when CreateType fails.
18400
18401 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18402
18403         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18404         as well.
18405
18406         * expression.cs (Binary::CheckShiftArguments): Add missing type
18407         computation.
18408         (Binary::ResolveOperator): Add type to the logical and and logical
18409         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18410         before.
18411
18412         (Binary::DoNumericPromotions): In the case where either argument
18413         is ulong (and most signed types combined with ulong cause an
18414         error) perform implicit integer constant conversions as well.
18415
18416 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18417
18418         * expression.cs (UserImplicitCast): Method should always be
18419         non-null. 
18420         (Invocation::BetterConversion): Simplified test for IntLiteral.
18421
18422         (Expression::ImplicitNumericConversion): Split this routine out.
18423         Put the code that performs implicit constant integer conversions
18424         here. 
18425
18426         (Expression::Resolve): Become a wrapper around DoResolve so we can
18427         check eclass and type being set after resolve.
18428
18429         (Invocation::Badness): Remove this dead function
18430
18431         (Binary::ResolveOperator): Do not compute the expensive argumnets
18432         unless we have a union for it.
18433
18434         (Probe::Emit): Is needs to do an isinst and then
18435         compare against null.
18436
18437         (::CanConvert): Added Location argument.  If the Location argument
18438         is null (Location.Null), then we do not report errors.  This is
18439         used by the `probe' mechanism of the Explicit conversion.  We do
18440         not want to generate an error for something that the user
18441         explicitly requested to be casted.  But the pipeline for an
18442         explicit cast first tests for potential implicit casts.
18443
18444         So for now, if the Location is null, it means `Probe only' to
18445         avoid adding another argument.   Might have to revise this
18446         strategy later.
18447
18448         (ClassCast): New class used to type cast objects into arbitrary
18449         classes (used in Explicit Reference Conversions).
18450
18451         Implement `as' as well.
18452
18453         Reverted all the patches from Ravi below: they were broken:
18454
18455                 * The use of `level' as a mechanism to stop recursive
18456                   invocations is wrong.  That was there just to catch the
18457                   bug with a strack trace but not as a way of addressing
18458                   the problem.
18459
18460                   To fix the problem we have to *understand* what is going
18461                   on and the interactions and come up with a plan, not
18462                   just get things going.
18463
18464                 * The use of the type conversion cache that I proposed
18465                   last night had an open topic: How does this work across
18466                   protection domains.  A user defined conversion might not
18467                   be public in the location where we are applying the
18468                   conversion, a different conversion might be selected
18469                   (ie, private A->B (better) but public B->A (worse),
18470                   inside A, A->B applies, but outside it, B->A will
18471                   apply).
18472
18473                 * On top of that (ie, even if the above is solved),
18474                   conversions in a cache need to be abstract.  Ie, `To
18475                   convert from an Int to a Short use an OpcodeCast', not
18476                   `To convert from an Int to a Short use the OpcodeCast on
18477                   the variable 5' (which is what this patch was doing).
18478
18479 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18480
18481         * expression.cs (Invocation::ConversionExists): Re-write to use
18482         the conversion cache
18483
18484         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18485         cache all conversions done, not just user-defined ones.
18486
18487         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18488         to determine if a conversion exists instead of acutually trying to 
18489         perform the conversion. It's faster too.
18490
18491         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18492         and only then attempt the implicit conversion.
18493
18494 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18495
18496         * expression.cs (ConvertImplicit): Use a cache for conversions
18497         already found. Check level of recursion and bail out if necessary.
18498
18499 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18500
18501         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18502         Export standard methods that we expect for string operations.
18503
18504         * statement.cs (Block::UsageWarning): Track usage of variables and
18505         report the errors for not used variables.
18506
18507         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18508         operator. 
18509
18510 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18511
18512         * codegen.cs: remove unnneded code 
18513
18514         * expression.cs: Removed BuiltinTypeAccess class
18515
18516         Fix the order in which implicit conversions are
18517         done.  
18518
18519         The previous fixed dropped support for boxed conversions (adding a
18520         test to the test suite now)
18521
18522         (UserImplicitCast::CanConvert): Remove test for source being null,
18523         that code is broken.  We should not feed a null to begin with, if
18524         we do, then we should track the bug where the problem originates
18525         and not try to cover it up here.
18526
18527         Return a resolved expression of type UserImplicitCast on success
18528         rather than true/false.  Ravi: this is what I was talking about,
18529         the pattern is to use a static method as a "constructor" for
18530         objects. 
18531
18532         Also, do not create arguments until the very last minute,
18533         otherwise we always create the arguments even for lookups that
18534         will never be performed. 
18535
18536         (UserImplicitCast::Resolve): Eliminate, objects of type
18537         UserImplicitCast are born in a fully resolved state. 
18538
18539         * typemanager.cs (InitCoreTypes): Init also value_type
18540         (System.ValueType). 
18541
18542         * expression.cs (Cast::Resolve): First resolve the child expression.
18543
18544         (LValue): Add new method AddressOf to be used by
18545         the `&' operator.  
18546
18547         Change the argument of Store to take an EmitContext instead of an
18548         ILGenerator, because things like FieldExpr need to be able to call
18549         their children expression to generate the instance code. 
18550
18551         (Expression::Error, Expression::Warning): Sugar functions for
18552         reporting errors.
18553
18554         (Expression::MemberLookup): Accept a TypeContainer instead of a
18555         Report as the first argument.
18556
18557         (Expression::ResolvePrimary): Killed.  I still want to improve
18558         this as currently the code is just not right.
18559
18560         (Expression::ResolveMemberAccess): Simplify, but it is still
18561         wrong. 
18562
18563         (Unary::Resolve): Catch errors in AddressOf operators.
18564
18565         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18566         index to a byte for the short-version, or the compiler will choose
18567         the wrong Emit call, which generates the wrong data.
18568
18569         (ParameterReference::Emit, ::Store): same.
18570
18571         (FieldExpr::AddressOf): Implement.
18572
18573         * typemanager.cs: TypeManager: made public variable instead of
18574         property.
18575
18576         * driver.cs: document --fatal.
18577
18578         * report.cs (ErrorMessage, WarningMessage): new names for the old
18579         Error and Warning classes.
18580
18581         * cs-parser.jay (member_access): Turn built-in access to types
18582         into a normal simplename
18583
18584 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18585
18586         * expression.cs (Invocation::BetterConversion): Fix to cope
18587         with q being null, since this was introducing a bug.
18588
18589         * expression.cs (ConvertImplicit): Do built-in conversions first.
18590
18591 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18592
18593         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18594
18595 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18596
18597         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18598         I had introduced long ago (what's new ?).
18599
18600         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18601         the work of all the checking. 
18602         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18603         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18604
18605         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18606         that is the right way. 
18607
18608         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18609         overloading resolution. Use everywhere instead of cutting and pasting code.
18610
18611         (Binary::ResolveOperator): Use MakeUnionSet.
18612
18613         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18614         we have to convert to bool types. Not complete yet.
18615
18616 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18617
18618         * typemanager.cs (TypeManager::CSharpName): support ushort.
18619
18620         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18621         to provide an expression that performsn an implicit constant int
18622         conversion (section 6.1.6).
18623         (Expression::ConvertImplicitRequired): Reworked to include
18624         implicit constant expression conversions.
18625
18626         (Expression::ConvertNumericExplicit): Finished.
18627
18628         (Invocation::Emit): If InstanceExpression is null, then it means
18629         that we perform a call on this.
18630
18631 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18632
18633         * expression.cs (Unary::Emit): Remove some dead code.
18634         (Probe): Implement Resolve and Emit for `is'.
18635         (Expression::ConvertImplicitRequired): Attempt to do constant
18636         expression conversions here.  Maybe should be moved to
18637         ConvertImplicit, but I am not sure.
18638         (Expression::ImplicitLongConstantConversionPossible,
18639         Expression::ImplicitIntConstantConversionPossible): New functions
18640         that tell whether is it possible to apply an implicit constant
18641         expression conversion.
18642
18643         (ConvertNumericExplicit): Started work on explicit numeric
18644         conversions.
18645
18646         * cs-parser.jay: Update operator constants.
18647
18648         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18649         (Parameters::GetSignature): Hook up VerifyArgs here.
18650         (Parameters::VerifyArgs): Verifies that no two arguments have the
18651         same name. 
18652
18653         * class.cs (Operator): Update the operator names to reflect the
18654         ones that the spec expects (as we are just stringizing the
18655         operator names).
18656
18657         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18658         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18659         previous usage did only work for our methods.
18660         (Expression::ConvertImplicit): Handle decimal implicit numeric
18661         conversions as well.
18662         (Expression::InternalTypeConstructor): Used to invoke constructors
18663         on internal types for default promotions.
18664
18665         (Unary::Emit): Implement special handling for the pre/post
18666         increment/decrement for overloaded operators, as they need to have
18667         the same semantics as the other operators.
18668
18669         (Binary::ResolveOperator): ditto.
18670         (Invocation::ConversionExists): ditto.
18671         (UserImplicitCast::Resolve): ditto.
18672
18673 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18674
18675         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18676         operator, return after emitting body. Regression tests pass again !
18677
18678         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18679         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18680         (Invocation::OverloadResolve): Ditto.
18681         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18682
18683         * everywhere : update calls to the above methods accordingly.
18684
18685 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18686
18687         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18688
18689         * expression.cs (ExpressionStatement): New base class used for
18690         expressions that can appear in statements, so that we can provide
18691         an alternate path to generate expression that do not leave a value
18692         on the stack.
18693
18694         (Expression::Emit, and all the derivatives): We no longer return
18695         whether a value is left on the stack or not.  Every expression
18696         after being emitted leaves a single value on the stack.
18697
18698         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18699         facilties of ExpressionStatement if possible.
18700
18701         * cs-parser.jay: Update statement_expression.
18702
18703 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18704
18705         * driver.cs: Change the wording of message
18706
18707 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18708
18709         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18710         the type of the expression to the return type of the method if
18711         we have an overloaded operator match ! The regression tests pass again !
18712         (Unary::ResolveOperator): Ditto.
18713
18714         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18715         to find "op_Implicit", not "implicit" ;-)
18716         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18717         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18718
18719         * everywhere : Correct calls to the above accordingly.
18720
18721         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18722         (ConvertImplicit): Do user-defined conversion if it exists.
18723
18724 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18725
18726         * assign.cs: track location.
18727         (Resolve): Use implicit conversions on assignment.
18728
18729         * literal.cs: Oops.  Not good, Emit of short access values should
18730         pass (Bytes) or the wrong argument will be selected.
18731
18732         * expression.cs (Unary::Emit): Emit code for -expr.
18733
18734         (Unary::ResolveOperator): Handle `Substract' for non-constants
18735         (substract from zero from the non-constants).
18736         Deal with Doubles as well. 
18737
18738         (Expression::ConvertImplicitRequired): New routine that reports an
18739         error if no implicit conversion exists. 
18740
18741         (Invocation::OverloadResolve): Store the converted implicit
18742         expressions if we make them
18743
18744 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18745
18746         * class.cs (ConstructorInitializer): Take a Location argument.
18747         (ConstructorBaseInitializer): Same here.
18748         (ConstructorThisInitializer): Same here.
18749
18750         * cs-parser.jay : Update all calls accordingly.
18751
18752         * expression.cs (Unary, Binary, New): Take location argument.
18753         Update accordingly everywhere.
18754
18755         * cs-parser.jay : Update all calls to the above to take a location
18756         argument.
18757
18758         * class.cs : Ditto.
18759
18760 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18761
18762         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18763         (Invocation::BetterConversion): Same here
18764         (Invocation::ConversionExists): Ditto.
18765
18766         (Invocation::ConversionExists): Implement.
18767
18768 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18769
18770         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18771         Also take an additional TypeContainer argument.
18772
18773         * All over : Pass in TypeContainer as argument to OverloadResolve.
18774
18775         * typemanager.cs (CSharpName): Update to check for the string type and return
18776         that too.
18777
18778         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18779         a given method.
18780
18781 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18782
18783         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18784         (Invocation::BetterFunction): Implement.
18785         (Invocation::BetterConversion): Implement.
18786         (Invocation::ConversionExists): Skeleton, no implementation yet.
18787
18788         Okay, things work fine !
18789
18790 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18791
18792         * typemanager.cs: declare and load enum_type, delegate_type and
18793         void_type. 
18794
18795         * expression.cs (Expression::Emit): Now emit returns a value that
18796         tells whether a value is left on the stack or not.  This strategy
18797         might be reveted tomorrow with a mechanism that would address
18798         multiple assignments.
18799         (Expression::report118): Utility routine to report mismatches on
18800         the ExprClass.
18801
18802         (Unary::Report23): Report impossible type/operator combination
18803         utility function.
18804
18805         (Unary::IsIncrementableNumber): Whether the type can be
18806         incremented or decremented with add.
18807         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18808         complemented. 
18809         (Unary::ResolveOperator): Implement ++, !, ~,
18810
18811         (Invocation::Emit): Deal with new Emit convetion.
18812
18813         * All Expression derivatives: Updated their Emit method to return
18814         whether they leave values on the stack or not.
18815
18816         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18817         stack for expressions that are statements. 
18818
18819 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18820
18821         * expression.cs (LValue): New interface.  Must be implemented by
18822         LValue objects.
18823         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18824         LValue interface.
18825
18826         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18827         interface for generating code, simplifies the code.
18828
18829 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18830
18831         * expression.cs (everywhere): Comment out return statements in ::Resolve
18832         methods to avoid the warnings.
18833
18834 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18835
18836         * driver.cs (parse): Report error 2001 if we can not open the
18837         source file.
18838
18839         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18840         not resolve it.
18841
18842         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18843         object. 
18844
18845         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18846         otherwise nested blocks end up with the same index.
18847
18848         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18849
18850         * expression.cs:  Instead of having FIXMEs in the Resolve
18851         functions, throw exceptions so it is obvious that we are facing a
18852         bug. 
18853
18854         * cs-parser.jay (invocation_expression): Pass Location information.
18855
18856         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18857         Use a basename for those routines because .NET does not like paths
18858         on them. 
18859
18860         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18861         already defined.
18862
18863 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18864
18865         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18866         are loading the correct data types (throws an exception if not).
18867         (TypeManager::InitCoreTypes): Use CoreLookupType
18868
18869         * expression.cs (Unary::ResolveOperator): return the child
18870         expression for expressions which are just +expr.
18871         (Unary::ResolveOperator): Return negative literals for -LITERAL
18872         expressions (otherwise they are Unary {Literal}).
18873         (Invocation::Badness): Take into account `Implicit constant
18874         expression conversions'.
18875
18876         * literal.cs (LongLiteral): Implement long literal class.
18877         (IntLiteral): export the `Value' of the intliteral. 
18878
18879 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18880
18881         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18882
18883         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18884         instead of 'Operator'
18885
18886         * expression.cs (Binary::ResolveOperator): Update accordingly.
18887         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18888         and 'Minus'
18889
18890         * cs-parser.jay (unary_expression): Update to use the new names.
18891
18892         * gen-treedump.cs (GetUnary): Same here.
18893
18894         * expression.cs (Unary::Resolve): Implement.
18895         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18896         operators are found instead of making noise ;-)
18897         (Unary::ResolveOperator): New method to do precisely the same thing which
18898         Binary::ResolveOperator does for Binary expressions.
18899         (Unary.method, .Arguments): Add.
18900         (Unary::OperName): Implement.   
18901         (Unary::ForceConversion): Copy and Paste !
18902
18903         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18904         a unary operator.
18905
18906         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18907         for the inbuilt operators. Only overloading works for now ;-)
18908
18909 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18910
18911         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18912         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18913
18914         * expression.cs (This::Emit): Implement. 
18915         (This::Resolve): Implement.
18916         (TypeOf:Resolve): Implement.
18917         (Expression::ResolveSimpleName): Add an implicit this to instance
18918         field references. 
18919         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18920         Bind instance variable to Field expressions.
18921         (FieldExpr::Instance): New field used to track the expression that
18922         represents the object instance.
18923         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18924         binding 
18925         (FieldExpr::Emit): Implement.
18926
18927         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18928         the last instruction contains a return opcode to avoid generating
18929         the last `ret' instruction (this generates correct code, and it is
18930         nice to pass the peverify output).
18931
18932         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18933         initializer for static and instance variables.
18934         (Constructor::Emit): Allow initializer to be null in the case of
18935         static constructors.  Only emit initializer for instance
18936         constructors. 
18937
18938         (TypeContainer::FindMembers): Return a null array if there are no
18939         matches.
18940
18941         Also fix the code for the MemberTypes.Method branch, as it was not
18942         scanning that for operators (or tried to access null variables before).
18943
18944         * assign.cs (Assign::Emit): Handle instance and static fields. 
18945
18946         * TODO: Updated.
18947
18948         * driver.cs: Stop compilation if there are parse errors.
18949
18950         * cs-parser.jay (constructor_declaration): Provide default base
18951         initializer for non-static constructors.
18952         (constructor_declarator): Do not provide a default base
18953         initializers if none was specified.
18954         Catch the fact that constructors should not have parameters.
18955
18956         * class.cs: Do not emit parent class initializers for static
18957         constructors, that should be flagged as an error.
18958
18959 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18960
18961         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18962         Move back code into TypeContainer::Populate.
18963
18964 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18965
18966         * class.cs (TypeContainer::AddConstructor): Fix the check to
18967         compare against Name, not Basename. 
18968         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18969
18970         * cs-parser.jay : Update accordingly.
18971
18972         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18973         for methods, don't forget to look into the operators too.
18974         (RegisterMethodBuilder): Helper method to take care of this for
18975         methods, constructors and operators.
18976         (Operator::Define): Completely revamp.
18977         (Operator.OperatorMethod, MethodName): New fields.
18978         (TypeContainer::Populate): Move the registering of builders into
18979         RegisterMethodBuilder.
18980         (Operator::Emit): Re-write.
18981
18982         * expression.cs (Binary::Emit): Comment out code path to emit method
18983         invocation stuff for the case when we have a user defined operator. I am
18984         just not able to get it right !
18985
18986 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18987
18988         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18989         argument. 
18990
18991         (Expression::MemberLookup): Provide a version that allows to
18992         specify the MemberTypes and BindingFlags. 
18993
18994         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18995         so it was not fetching variable information from outer blocks.
18996
18997         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18998         Beforefieldinit as it was buggy.
18999
19000         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19001         that Ravi put here.  
19002
19003         * class.cs (Constructor::Emit): Only emit if block is not null.
19004         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19005         deal with this by semantically definining it as if the user had
19006         done it.
19007
19008         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19009         constructors as we now "emit" them at a higher level.
19010
19011         (TypeContainer::DefineDefaultConstructor): Used to define the
19012         default constructors if none was provided.
19013
19014         (ConstructorInitializer): Add methods Resolve and Emit. 
19015
19016         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19017
19018 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19019
19020         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19021         the default constructor builder with our hashtable for methodbuilders
19022         to methodcores.
19023
19024         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19025         and argument_count is 0 in which case we have a match.
19026         (Binary::ResolveOperator): More null checking and miscellaneous coding
19027         style cleanup.
19028
19029 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19030
19031         * rootcontext.cs (IsNameSpace): Compare against null.
19032
19033         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19034
19035         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19036         and Unary::Operator.
19037
19038         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19039         accordingly.
19040
19041         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19042         we have overloaded operators.
19043         (Binary::ResolveOperator): Implement the part which does the operator overload
19044         resolution.
19045
19046         * class.cs (Operator::Emit): Implement.
19047         (TypeContainer::Emit): Emit the operators we have too.
19048
19049         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19050         the case when we have a user-defined operator.
19051
19052 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19053
19054         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19055
19056 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19057
19058         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19059         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19060         (Constructor::Emit): Implement.
19061         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19062         if we have no work to do. 
19063         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19064         Emit method.
19065
19066         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19067         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19068
19069         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19070         of parent.parent.
19071
19072 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19073
19074         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19075         in the source.
19076         (Tree::RecordNamespace): Method to do what the name says ;-)
19077         (Tree::Namespaces): Property to get at the namespaces hashtable.
19078
19079         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19080         keep track.
19081
19082         * rootcontext.cs (IsNamespace): Fixed it :-)
19083
19084 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19085
19086         * class.cs (TypeContainer::FindMembers): Add support for
19087         constructors. 
19088         (MethodCore): New class that encapsulates both the shared aspects
19089         of a Constructor and a Method.  
19090         (Method, Constructor): Factored pieces into MethodCore.
19091
19092         * driver.cs: Added --fatal which makes errors throw exceptions.
19093         Load System assembly as well as part of the standard library.
19094
19095         * report.cs: Allow throwing exceptions on errors for debugging.
19096
19097         * modifiers.cs: Do not use `parent', instead use the real type
19098         container to evaluate permission settings.
19099
19100         * class.cs: Put Ravi's patch back in.  He is right, and we will
19101         have to cope with the
19102
19103 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19104
19105         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19106         FamORAssem, not FamANDAssem.
19107
19108 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19109
19110         * driver.cs: Added --parse option that only parses its input files
19111         and terminates.
19112
19113         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19114         incorrect.  IsTopLevel is not used to tell whether an object is
19115         root_types or not (that can be achieved by testing this ==
19116         root_types).  But to see if this is a top-level *class* (not
19117         necessarly our "toplevel" container). 
19118
19119 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19120
19121         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19122         parent instead of a direct call to GetType.
19123
19124 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19125
19126         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19127         Modifiers.TypeAttr. This should just be a call to that method.
19128
19129         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19130         object so that we can determine if we are top-level or not.
19131
19132         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19133         TypeContainer too.
19134
19135         * enum.cs (Enum::Define): Ditto.
19136
19137         * modifiers.cs (FieldAttr): Re-write.
19138
19139         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19140         (TypeContainer::HaveStaticConstructor): New property to provide access
19141         to precisely that info.
19142
19143         * modifiers.cs (MethodAttr): Re-write.
19144         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19145
19146         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19147         of top-level types as claimed.
19148
19149 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19150
19151         * expression.cs (MemberLookup): Fruitless attempt to lookup
19152         constructors.  Maybe I need to emit default constructors?  That
19153         might be it (currently .NET emits this for me automatically).
19154         (Invocation::OverloadResolve): Cope with Arguments == null.
19155         (Invocation::EmitArguments): new function, shared by the new
19156         constructor and us.
19157         (Invocation::Emit): Handle static and instance methods.  Emit
19158         proper call instruction for virtual or non-virtual invocations.
19159         (New::Emit): Implement.
19160         (New::Resolve): Implement.
19161         (MemberAccess:Resolve): Implement.
19162         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19163         to track instances.
19164         (FieldExpr::Resolve): Set type.
19165
19166         * support.cs: Handle empty arguments.
19167                 
19168         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19169         SimpleLookup): Auxiliary routines to help parse a qualifier
19170         identifier.  
19171
19172         Update qualifier_identifier rule.
19173
19174         * codegen.cs: Removed debugging messages.
19175
19176         * class.cs: Make this a global thing, this acts just as a "key" to
19177         objects that we might have around.
19178
19179         (Populate): Only initialize method_builders_to_methods once.
19180
19181         * expression.cs (PropertyExpr): Initialize type from the
19182         PropertyType. 
19183
19184         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19185         Resolve pattern.  Attempt to implicitly convert value to boolean.
19186         Emit code.
19187
19188         * expression.cs: Set the type for the int32/int32 argument case.
19189         (Binary::ResolveOperator): Set the return type to boolean for
19190         comparission operators
19191
19192         * typemanager.cs: Remove debugging print code.
19193
19194         (Invocation::Resolve): resolve type.
19195
19196         * class.cs: Allocate a MemberInfo of the correct size, as the code
19197         elsewhere depends on the test to reflect the correct contents.
19198
19199         (Method::) Keep track of parameters, due to System.Reflection holes
19200
19201         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19202         mapping here.
19203
19204         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19205         of the exact size and return that.
19206
19207         (Class::LookupMethodByBuilder): New function that maps
19208         MethodBuilders to its methods.  Required to locate the information
19209         on methods because System.Reflection bit us again.
19210
19211         * support.cs: New file, contains an interface ParameterData and
19212         two implementations: ReflectionParameters and InternalParameters
19213         used to access Parameter information.  We will need to grow this
19214         as required.
19215
19216         * expression.cs (Invocation::GetParameterData): implement a cache
19217         and a wrapper around the ParameterData creation for methods. 
19218         (Invocation::OverloadResolve): Use new code.
19219
19220 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19221
19222         * class.cs (TypeContainer::EmitField): Remove and move into 
19223         (Field::Define): here and modify accordingly.
19224         (Field.FieldBuilder): New member.
19225         (TypeContainer::Populate): Update accordingly.
19226         (TypeContainer::FindMembers): Implement.
19227
19228 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19229
19230         * statement.cs: (VariableInfo::VariableType): New field to be
19231         initialized with the full type once it is resolved. 
19232
19233 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19234
19235         * parameter.cs (GetParameterInfo): Use a type cache to compute
19236         things only once, and to reuse this information
19237
19238         * expression.cs (LocalVariableReference::Emit): Implement.
19239         (OpcodeCast::Emit): fix.
19240
19241         (ParameterReference::Resolve): Implement.
19242         (ParameterReference::Emit): Implement.
19243
19244         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19245         that are expressions need to stay as Expressions.
19246
19247         * typemanager.cs (CSharpName): Returns the C# name of a type if
19248         possible. 
19249
19250         * expression.cs (Expression::ConvertImplicit): New function that
19251         implements implicit type conversions.
19252
19253         (Expression::ImplicitReferenceConversion): Implements implicit
19254         reference conversions.
19255
19256         (EmptyCast): New type for transparent casts.
19257
19258         (OpcodeCast): New type for casts of types that are performed with
19259         a sequence of bytecodes.
19260
19261         (BoxedCast): New type used for casting value types into reference
19262         types.  Emits a box opcode.
19263
19264         (Binary::DoNumericPromotions): Implements numeric promotions of
19265         and computation of the Binary::Type.
19266
19267         (Binary::EmitBranchable): Optimization.
19268
19269         (Binary::Emit): Implement code emission for expressions.
19270
19271         * typemanager.cs (TypeManager): Added two new core types: sbyte
19272         and byte.
19273
19274 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19275
19276         * class.cs (TypeContainer::FindMembers): Method which does exactly
19277         what Type.FindMembers does, only we don't have to use reflection. No
19278         implementation yet.
19279
19280         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19281         typecontainer objects as we need to get at them.
19282         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19283
19284         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19285         typecontainer object.
19286
19287         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19288         of just a Report object.
19289
19290 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19291
19292         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19293         "remove_"
19294         (TypeContainer::Populate): Now define the delegates of the type too.
19295         (TypeContainer.Delegates): Property to access the list of delegates defined
19296         in the type.
19297
19298         * delegates.cs (Delegate::Define): Implement partially.
19299
19300         * modifiers.cs (TypeAttr): Handle more flags.
19301
19302 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19303
19304         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19305         and not <=
19306         (Operator::Define): Re-write logic to get types by using the LookupType method
19307         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19308         (Indexer::Define): Ditto.
19309         (Event::Define): Ditto.
19310         (Property::Define): Ditto.
19311
19312 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19313
19314         * class.cs (TypeContainer::Populate): Now define operators too. 
19315         (TypeContainer.Operators): New property to access the list of operators
19316         in a type.
19317         (Operator.OperatorMethodBuilder): New member to hold the method builder
19318         for the operator we are defining.
19319         (Operator::Define): Implement.
19320
19321 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19322
19323         * class.cs (Event::Define): Make the prefixes of the accessor methods
19324         addOn_ and removeOn_ 
19325
19326         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19327         of the location being passed in too. Ideally, this should go later since all
19328         error reporting should be done through the Report object.
19329
19330         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19331         (Populate): Iterate thru the indexers we have and define them too.
19332         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19333         for the get and set accessors.
19334         (Indexer::Define): Implement.
19335
19336 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19337
19338         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19339         my previous implementation, did not work.
19340
19341         * typemanager.cs: Add a couple of missing types (the longs).
19342
19343         * literal.cs: Use TypeManager.bool_type instead of getting it.
19344
19345         * expression.cs (EventExpr): New kind of expressions.
19346         (Expressio::ExprClassFromMemberInfo): finish
19347
19348 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19349
19350         * assign.cs: Emit stores to static fields differently.
19351
19352 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19353
19354         * Merge in changes and adjust code to tackle conflicts. Backed out my
19355         code in Assign::Resolve ;-) 
19356
19357 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19358
19359         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19360         instead Report.Error and also pass in the location.
19361         (CSharpParser::Lexer): New readonly property to return the reference
19362         to the Tokenizer object.
19363         (declare_local_variables): Use Report.Error with location instead of plain 
19364         old error.
19365         (CheckDef): Ditto.
19366
19367         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19368         (Operator.CheckBinaryOperator): Ditto.
19369
19370         * cs-parser.jay (operator_declarator): Update accordingly.
19371
19372         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19373         (CheckBinaryOperator): Same here.
19374
19375         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19376         on the name without any prefixes of namespace names etc. This is because we
19377         already might have something already fully qualified like 
19378         'System.Console.WriteLine'
19379
19380         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19381
19382 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19383
19384         * cs-tokenizer.cs (location): Return a string which also contains
19385         the file name.
19386
19387         * expression.cs (ElementAccess): New class for expressions of the
19388         type 'element access.'
19389         (BaseAccess): New class for expressions of the type 'base access.'
19390         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19391         respectively.
19392
19393         * cs-parser.jay (element_access): Implement action.
19394         (base_access): Implement actions.
19395         (checked_expression, unchecked_expression): Implement.
19396
19397         * cs-parser.jay (local_variable_type): Correct and implement.
19398         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19399
19400         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19401
19402         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19403         name and the specifiers.
19404
19405         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19406
19407         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19408         making them all public ;-)
19409
19410         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19411         class anyways.
19412
19413 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19414
19415         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19416         PropertyExprs.
19417         (FieldExpr, PropertyExprs): New resolved expressions.
19418         (SimpleName::MemberStaticCheck): Perform static checks for access
19419         to non-static fields on static methods. Maybe this should be
19420         generalized for MemberAccesses. 
19421         (SimpleName::ResolveSimpleName): More work on simple name
19422         resolution. 
19423
19424         * cs-parser.jay (primary_expression/qualified_identifier): track
19425         the parameter index.
19426
19427         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19428         (EmitContext::EmitBoolExpression): Chain to expression generation
19429         instead of temporary hack.
19430         (::EmitStatementExpression): Put generic expression code generation.
19431
19432         * assign.cs (Assign::Emit): Implement variable assignments to
19433         local variables, parameters and fields.
19434
19435 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19436
19437         * statement.cs (Block::GetVariableInfo): New method, returns the
19438         VariableInfo for a variable name in a block.
19439         (Block::GetVariableType): Implement in terms of GetVariableInfo
19440
19441         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19442         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19443
19444 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19445
19446         * cs-parser.jay (operator_declaration): Continue on my quest : update
19447         to take attributes argument.
19448         (event_declaration): Ditto.
19449         (enum_declaration): Ditto.
19450         (indexer_declaration): Ditto.
19451
19452         * class.cs (Operator::Operator): Update constructor accordingly.
19453         (Event::Event): Ditto.
19454
19455         * delegate.cs (Delegate::Delegate): Same here.
19456
19457         * enum.cs (Enum::Enum): Same here.
19458
19459 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19460
19461         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19462
19463         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19464
19465         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19466         being passed around as an arraylist.
19467         (Attributes::AddAttribute): Method to add attribute sections.
19468
19469         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19470         (struct_declaration): Update accordingly.
19471         (constant_declaration): Update.
19472         (field_declaration): Update.
19473         (method_header): Update.
19474         (fixed_parameter): Update.
19475         (parameter_array): Ditto.
19476         (property_declaration): Ditto.
19477         (destructor_declaration): Ditto.
19478
19479         * class.cs (Struct::Struct): Update constructors accordingly.
19480         (Class::Class): Ditto.
19481         (Field::Field): Ditto.
19482         (Method::Method): Ditto.
19483         (Property::Property): Ditto.
19484         (TypeContainer::OptAttribute): update property's return type.
19485
19486         * interface.cs (Interface.opt_attributes): New member.
19487         (Interface::Interface): Update to take the extra Attributes argument.
19488
19489         * parameter.cs (Parameter::Parameter): Ditto.
19490
19491         * constant.cs (Constant::Constant): Ditto.
19492
19493         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19494         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19495         the attributes as a parameter.
19496         (InterfaceProperty): Update constructor call.
19497         (InterfaceEvent): Ditto.
19498         (InterfaceMethod): Ditto.
19499         (InterfaceIndexer): Ditto.
19500
19501         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19502         pass the attributes too.
19503         (interface_event_declaration): Ditto.
19504         (interface_property_declaration): Ditto.
19505         (interface_method_declaration): Ditto.
19506         (interface_declaration): Ditto.
19507
19508 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19509
19510         * class.cs (Method::Define): Track the "static Main" definition to
19511         create an entry point. 
19512
19513         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19514         EntryPoint if we find it. 
19515
19516         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19517         (EmitContext::ig): Make this variable public.
19518
19519         * driver.cs: Make the default output file be the first file name
19520         with the .exe extension.  
19521
19522         Detect empty compilations
19523
19524         Handle various kinds of output targets.  Handle --target and
19525         rename -t to --dumper.
19526
19527         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19528         methods inherited from Expression return now an Expression.  This
19529         will is used during the tree rewriting as we resolve them during
19530         semantic analysis.
19531
19532         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19533         the spec.  Missing entirely is the information about
19534         accessability of elements of it.
19535
19536         (Expression::ExprClassFromMemberInfo): New constructor for
19537         Expressions that creates a fully initialized Expression based on
19538         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19539         a Type.
19540
19541         (Invocation::Resolve): Begin implementing resolution of invocations.
19542
19543         * literal.cs (StringLiteral):  Implement Emit.
19544
19545 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19546
19547         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19548         member.
19549
19550 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19551
19552         * cs-parser.jay (attribute_arguments): Implement actions.
19553         (attribute): Fix bug in production. Implement action.
19554         (attribute_list): Implement.
19555         (attribute_target): Implement.
19556         (attribute_target_specifier, opt_target_specifier): Implement
19557         (CheckAttributeTarget): New method to check if the attribute target
19558         is valid.
19559         (attribute_section): Implement.
19560         (opt_attributes): Implement.
19561
19562         * attribute.cs : New file to handle attributes.
19563         (Attribute): Class to hold attribute info.
19564
19565         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19566         (attribute_section): Modify production to use 2 different rules to 
19567         achieve the same thing. 1 s/r conflict down !
19568         Clean out commented, useless, non-reducing dimension_separator rules.
19569
19570         * class.cs (TypeContainer.attributes): New member to hold list
19571         of attributes for a type.
19572         (Struct::Struct): Modify to take one more argument, the attribute list.
19573         (Class::Class): Ditto.
19574         (Field::Field): Ditto.
19575         (Method::Method): Ditto.
19576         (Property::Property): Ditto.
19577
19578         * cs-parser.jay (struct_declaration): Update constructor call to
19579         pass in the attributes too.
19580         (class_declaration): Ditto.
19581         (constant_declaration): Ditto.
19582         (field_declaration): Ditto.
19583         (method_header): Ditto.
19584         (fixed_parameter): Ditto.
19585         (parameter_array): Ditto.
19586         (property_declaration): Ditto.
19587
19588         * constant.cs (Constant::Constant): Update constructor similarly.
19589         Use System.Collections.
19590
19591         * parameter.cs (Parameter::Parameter): Update as above.
19592
19593 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19594
19595         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19596         (TypeContainer.delegates): New member to hold list of delegates.
19597
19598         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19599         this time as I seem to be on crack ;-)
19600
19601 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19602
19603         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19604         tell whether an identifier represents a namespace.
19605
19606         * expression.cs (NamespaceExpr): A namespace expression, used only
19607         temporarly during expression resolution.
19608         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19609         utility functions to resolve names on expressions.
19610
19611 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19612
19613         * codegen.cs: Add hook for StatementExpressions. 
19614
19615         * class.cs: Fix inverted test for static flag in methods.
19616
19617 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19618
19619         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19620         to make it coincide with MS' number.
19621         (Operator::CheckBinaryOperator): Ditto.
19622
19623         * ../errors/errors.txt : Remove error numbers added earlier.
19624
19625         * ../errors/cs1019.cs : Test case for error # 1019
19626
19627         * ../errros/cs1020.cs : Test case for error # 1020
19628
19629         * cs-parser.jay : Clean out commented cruft.
19630         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19631         used anywhere - non-reducing rule.
19632         (namespace_declarations): Non-reducing rule - comment out.
19633
19634         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19635         with TypeContainer::AddEnum.
19636
19637         * delegate.cs : New file for delegate handling classes.
19638         (Delegate): Class for declaring delegates.
19639
19640         * makefile : Update.
19641
19642         * cs-parser.jay (delegate_declaration): Implement.
19643
19644 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19645
19646         * class.cs (Event::Define): Implement.
19647         (Event.EventBuilder): New member.
19648
19649         * class.cs (TypeContainer::Populate): Update to define all enums and events
19650         we have.
19651         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19652         readonly fields for all these cases ?
19653
19654 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19655
19656         * class.cs (Property): Revamp to use the convention of making fields readonly.
19657         Accordingly modify code elsewhere.
19658
19659         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19660         the Define method of the Property class.
19661
19662         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19663         trivial bug.
19664         (TypeContainer::Populate): Update to define all the properties we have. Also
19665         define all enumerations.
19666
19667         * enum.cs (Define): Implement.
19668
19669 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19670
19671         * cs-parser.jay (overloadable_operator): The semantic value is an
19672         enum of the Operator class.
19673         (operator_declarator): Implement actions.
19674         (operator_declaration): Implement.
19675
19676         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19677         validity of definitions.
19678         (Operator::CheckBinaryOperator): Static method to check for binary operators
19679         (TypeContainer::AddOperator): New method to add an operator to a type.
19680
19681         * cs-parser.jay (indexer_declaration): Added line to actually call the
19682         AddIndexer method so it gets added ;-)
19683
19684         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19685         already taken care of by the MS compiler ?  
19686
19687 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19688
19689         * class.cs (Operator): New class for operator declarations.
19690         (Operator::OpType): Enum for the various operators.
19691
19692 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19693
19694         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19695         ostensibly handle this in semantic analysis.
19696
19697         * cs-parser.jay (general_catch_clause): Comment out
19698         (specific_catch_clauses, specific_catch_clause): Ditto.
19699         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19700         (catch_args, opt_catch_args): New productions.
19701         (catch_clause): Rewrite to use the new productions above
19702         (catch_clauses): Modify accordingly.
19703         (opt_catch_clauses): New production to use in try_statement
19704         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19705         and re-write the code in the actions to extract the specific and
19706         general catch clauses by being a little smart ;-)
19707
19708         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19709         Hooray, try and catch statements parse fine !
19710
19711 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19712
19713         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19714         string from the hashtable of variables.
19715
19716         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19717         I end up making that mistake ;-)
19718         (catch_clauses): Fixed gross error which made Key and Value of the 
19719         DictionaryEntry the same : $1 !!
19720
19721 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19722
19723         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19724
19725         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19726         when the add and remove accessors are specified. 
19727
19728 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19729
19730         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19731         information about indexer_declarator.
19732         (indexer_declarator): Implement actions.
19733         (parsing_indexer): New local boolean used to keep track of whether
19734         we are parsing indexers or properties. This is necessary because 
19735         implicit_parameters come into picture even for the get accessor in the 
19736         case of an indexer.
19737         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19738
19739         * class.cs (Indexer): New class for indexer declarations.
19740         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19741         (TypeContainer::indexers): New member to hold list of indexers for the
19742         type.
19743
19744 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19745
19746         * cs-parser.jay (add_accessor_declaration): Implement action.
19747         (remove_accessor_declaration): Implement action.
19748         (event_accessors_declaration): Implement
19749         (variable_declarators): swap statements for first rule - trivial.
19750
19751         * class.cs (Event): New class to hold information about event
19752         declarations.
19753         (TypeContainer::AddEvent): New method to add an event to a type
19754         (TypeContainer::events): New member to hold list of events.
19755
19756         * cs-parser.jay (event_declaration): Implement actions.
19757
19758 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19759
19760         * cs-parser.jay (dim_separators): Implement. Make it a string
19761         concatenating all the commas together, just as they appear.
19762         (opt_dim_separators): Modify accordingly
19763         (rank_specifiers): Update accordingly. Basically do the same
19764         thing - instead, collect the brackets here.
19765         (opt_rank_sepcifiers): Modify accordingly.
19766         (array_type): Modify to actually return the complete type string
19767         instead of ignoring the rank_specifiers.
19768         (expression_list): Implement to collect the expressions
19769         (variable_initializer): Implement. We make it a list of expressions
19770         essentially so that we can handle the array_initializer case neatly too.
19771         (variable_initializer_list): Implement.
19772         (array_initializer): Make it a list of variable_initializers
19773         (opt_array_initializer): Modify accordingly.
19774
19775         * expression.cs (New::NType): Add enumeration to help us
19776         keep track of whether we have an object/delegate creation
19777         or an array creation.
19778         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19779         members to hold data about array creation.
19780         (New:New): Modify to update NewType
19781         (New:New): New Overloaded contructor for the array creation
19782         case.
19783
19784         * cs-parser.jay (array_creation_expression): Implement to call
19785         the overloaded New constructor.
19786
19787 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19788
19789         * class.cs (TypeContainer::Constructors): Return member
19790         constructors instead of returning null.
19791
19792 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19793
19794         * typemanager.cs (InitCoreTypes): Initialize the various core
19795         types after we have populated the type manager with the user
19796         defined types (this distinction will be important later while
19797         compiling corlib.dll)
19798
19799         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19800         on Expression Classification.  Now all expressions have a method
19801         `Resolve' and a method `Emit'.
19802
19803         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19804         generation from working.     Also add some temporary debugging
19805         code. 
19806
19807 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19808
19809         * codegen.cs: Lots of code generation pieces.  This is only the
19810         beginning, will continue tomorrow with more touches of polish.  We
19811         handle the fundamentals of if, while, do, for, return.  Others are
19812         trickier and I need to start working on invocations soon.
19813
19814         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19815         s.InitStatement. 
19816
19817         * codegen.cs (EmitContext): New struct, used during code
19818         emission to keep a context.   Most of the code generation will be
19819         here. 
19820
19821         * cs-parser.jay: Add embedded blocks to the list of statements of
19822         this block.  So code generation proceeds in a top down fashion.
19823
19824 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19825
19826         * statement.cs: Add support for multiple child blocks.
19827
19828 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19829
19830         * codegen.cs (EmitCode): New function, will emit the code for a
19831         Block of code given a TypeContainer and its ILGenerator. 
19832
19833         * statement.cs (Block): Standard public readonly optimization.
19834         (Block::Block constructors): Link children. 
19835         (Block::Child): Child Linker.
19836         (Block::EmitVariables): Emits IL variable declarations.
19837
19838         * class.cs: Drop support for MethodGroups here, delay until
19839         Semantic Analysis.
19840         (Method::): Applied the same simplification that I did before, and
19841         move from Properties to public readonly fields.
19842         (Method::ParameterTypes): Returns the parameter types for the
19843         function, and implements a cache that will be useful later when I
19844         do error checking and the semantic analysis on the methods is
19845         performed.
19846         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19847         and made a method, optional argument tells whether this is a class
19848         or a structure to apply the `has-this' bit.
19849         (Method::GetCallingConvention): Implement, returns the calling
19850         convention. 
19851         (Method::Define): Defines the type, a second pass is performed
19852         later to populate the methods.
19853
19854         (Constructor::ParameterTypes): implement a cache similar to the
19855         one on Method::ParameterTypes, useful later when we do semantic
19856         analysis. 
19857
19858         (TypeContainer::EmitMethod):  New method.  Emits methods.
19859
19860         * expression.cs: Removed MethodGroup class from here.
19861
19862         * parameter.cs (Parameters::GetCallingConvention): new method.
19863
19864 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19865
19866         * class.cs (TypeContainer::Populate): Drop RootContext from the
19867         argument. 
19868
19869         (Constructor::CallingConvention): Returns the calling convention.
19870         (Constructor::ParameterTypes): Returns the constructor parameter
19871         types. 
19872
19873         (TypeContainer::AddConstructor): Keep track of default constructor
19874         and the default static constructor.
19875
19876         (Constructor::) Another class that starts using `public readonly'
19877         instead of properties. 
19878
19879         (Constructor::IsDefault): Whether this is a default constructor. 
19880
19881         (Field::) use readonly public fields instead of properties also.
19882
19883         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19884         track of static constructors;  If none is used, turn on
19885         BeforeFieldInit in the TypeAttributes. 
19886
19887         * cs-parser.jay (opt_argument_list): now the return can be null
19888         for the cases where there are no arguments. 
19889
19890         (constructor_declarator): If there is no implicit `base' or
19891         `this', then invoke the default parent constructor. 
19892
19893         * modifiers.cs (MethodAttr): New static function maps a set of
19894         modifiers flags into a MethodAttributes enum
19895         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19896         MethodAttr, TypeAttr to represent the various mappings where the
19897         modifiers are used.
19898         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19899
19900 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19901
19902         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19903         method arguments.
19904
19905         * interface.cs (PopulateIndexer): Implemented the code generator
19906         for interface indexers.
19907
19908 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19909
19910         * interface.cs (InterfaceMemberBase): Now we track the new status
19911         here.  
19912
19913         (PopulateProperty): Implement property population.  Woohoo!  Got
19914         Methods and Properties going today. 
19915
19916         Removed all the properties for interfaces, and replaced them with
19917         `public readonly' fields. 
19918
19919 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19920
19921         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19922         initialize their hashtables/arraylists only when they are needed
19923         instead of doing this always.
19924
19925         * parameter.cs: Handle refs and out parameters.
19926
19927         * cs-parser.jay: Use an ArrayList to construct the arguments
19928         instead of the ParameterCollection, and then cast that to a
19929         Parameter[] array.
19930
19931         * parameter.cs: Drop the use of ParameterCollection and use
19932         instead arrays of Parameters.
19933
19934         (GetParameterInfo): Use the Type, not the Name when resolving
19935         types. 
19936
19937 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19938
19939         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19940         and instead use public readonly fields.
19941
19942         * class.cs: Put back walking code for type containers.
19943
19944 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19945
19946         * class.cs (MakeConstant): Code to define constants.
19947
19948         * rootcontext.cs (LookupType): New function.  Used to locate types 
19949
19950
19951 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19952
19953         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
19954         this System.Reflection code is.  Kudos to Microsoft
19955
19956         * typemanager.cs: Implement a type cache and avoid loading all
19957         types at boot time.  Wrap in LookupType the internals.  This made
19958         the compiler so much faster.  Wow.  I rule!
19959
19960         * driver.cs: Make sure we always load mscorlib first (for
19961         debugging purposes, nothing really important).
19962
19963         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19964         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19965
19966         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19967         on namespaces that have been imported using the `using' keyword.
19968
19969         * class.cs (TypeContainer::TypeAttr): Virtualize.
19970         (Class::TypeAttr): Return attributes suitable for this bad boy.
19971         (Struct::TypeAttr): ditto.
19972         Handle nested classes.
19973         (TypeContainer::) Remove all the type visiting code, it is now
19974         replaced with the rootcontext.cs code
19975
19976         * rootcontext.cs (GetClassBases): Added support for structs. 
19977
19978 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19979
19980         * interface.cs, statement.cs, class.cs, parameter.cs,
19981         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19982         Drop use of TypeRefs, and use strings instead.
19983
19984 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
19985
19986         * rootcontext.cs: 
19987
19988         * class.cs (Struct::Struct): set the SEALED flags after
19989         checking the modifiers.
19990         (TypeContainer::TypeAttr): new property, returns the
19991         TypeAttributes for a class.  
19992
19993         * cs-parser.jay (type_list): Oops, list production was creating a
19994         new list of base types.
19995
19996         * rootcontext.cs (StdLib): New property.
19997         (GetInterfaceTypeByName): returns an interface by type name, and
19998         encapsulates error handling here.
19999         (GetInterfaces): simplified.
20000         (ResolveTree): Encapsulated all the tree resolution here.
20001         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20002         types. 
20003
20004         * driver.cs: Add support for --nostdlib, to avoid loading the
20005         default assemblies.
20006         (Main): Do not put tree resolution here. 
20007
20008         * rootcontext.cs: Beginning of the class resolution.
20009
20010 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20011
20012         * rootcontext.cs: Provide better error reporting. 
20013
20014         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20015
20016         * rootcontext.cs (CreateInterface): Handle the case where there
20017         are no parent interfaces.
20018
20019         (CloseTypes): Routine to flush types at the end.
20020         (CreateInterface): Track types.
20021         (GetInterfaces): Returns an array of Types from the list of
20022         defined interfaces.
20023
20024         * typemanager.c (AddUserType): Mechanism to track user types (puts
20025         the type on the global type hash, and allows us to close it at the
20026         end). 
20027
20028 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20029
20030         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20031         RecordInterface instead.
20032
20033         * cs-parser.jay: Updated to reflect changes above.
20034
20035         * decl.cs (Definition): Keep track of the TypeBuilder type that
20036         represents this type here.  Not sure we will use it in the long
20037         run, but wont hurt for now.
20038
20039         * driver.cs: Smaller changes to accomodate the new code.
20040
20041         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20042         when done. 
20043
20044         * rootcontext.cs (CreateInterface):  New method, used to create
20045         the System.TypeBuilder type for interfaces.
20046         (ResolveInterfaces): new entry point to resolve the interface
20047         hierarchy. 
20048         (CodeGen): Property, used to keep track of the code generator.
20049
20050 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20051
20052         * cs-parser.jay: Add a second production for delegate_declaration
20053         with `VOID'.
20054
20055         (enum_body): Put an opt_comma here instead of putting it on
20056         enum_body or enum_member_declarations so we can handle trailing
20057         commas on enumeration members.  Gets rid of a shift/reduce.
20058
20059         (type_list): Need a COMMA in the middle.
20060
20061         (indexer_declaration): Tell tokenizer to recognize get/set
20062
20063         * Remove old targets.
20064
20065         * Re-add the parser target.
20066
20067 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20068
20069         * cs-parser.jay: Add precendence rules for a number of operators
20070         ot reduce the number of shift/reduce conflicts in the grammar.
20071
20072 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20073
20074         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20075         and put it here.
20076
20077         Get rid of old crufty code.
20078
20079         * rootcontext.cs: Use this to keep track of the parsed
20080         representation and the defined types available to the program. 
20081
20082         * gen-treedump.cs: adjust for new convention.
20083
20084         * type.cs: Split out the type manager, and the assembly builder
20085         from here. 
20086
20087         * typemanager.cs: the type manager will live here now.
20088
20089         * cil-codegen.cs: And the code generator here. 
20090
20091 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20092
20093         * makefile: Fixed up for easy making.
20094
20095 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20096
20097         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20098         the 
20099
20100         (unary_expression): Expand pre_increment_expression and
20101         post_decrement_expression to reduce a shift/reduce.
20102
20103 2001-07-11  Simon Cozens
20104
20105         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20106
20107         Improve allow_keyword_as_indent name.
20108
20109 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20110
20111         * Adjustments for Beta2. 
20112
20113 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20114
20115         * decl.cs: Added `Define' abstract method.
20116         (InTransit): new property, used to catch recursive definitions. 
20117
20118         * interface.cs: Implement `Define'. 
20119
20120         * modifiers.cs: Map Modifiers.constants to
20121         System.Reflection.TypeAttribute flags.
20122
20123         * class.cs: Keep track of types and user-defined types.
20124         (BuilderInit): New method for creating an assembly
20125         (ResolveType): New function to launch the resolution process, only
20126         used by interfaces for now.
20127
20128         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20129         that are inserted into the name space. 
20130
20131 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20132
20133         * ARGH.  I have screwed up my tree so many times due to the use of
20134         rsync rather than using CVS.  Going to fix this at once. 
20135
20136         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20137         load types.
20138
20139 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20140
20141         * Experiment successful: Use System.Type rather that our own
20142         version of Type.  
20143
20144 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20145
20146         * cs-parser.jay: Removed nsAliases from here.
20147
20148         Use new namespaces, handle `using XXX;' 
20149
20150         * namespace.cs: Reimplemented namespace handling, use a recursive
20151         definition of the class.  Now we can keep track of using clauses
20152         and catch invalid using clauses.
20153
20154 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20155
20156         * gen-treedump.cs: Adapted for all the renaming.
20157
20158         * expression.cs (Expression): this class now has a Type property
20159         which returns an expression Type.
20160
20161         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20162         `Type', as this has a different meaning now in the base
20163
20164 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20165
20166         * interface.cs, class.cs: Removed from all the sources the
20167         references to signature computation, as we can not do method
20168         signature computation during the parsing time, as we are not
20169         trying to solve at that point distinguishing:
20170
20171         class X {
20172                 void a (Blah x) {}
20173                 void a (NS.Blah x) {}
20174         }
20175
20176         Which depending on the context might be valid or not, as we do not
20177         know if Blah is the same thing as NS.Blah at that point.
20178
20179         * Redid everything so the code uses TypeRefs now instead of
20180         Types.  TypeRefs are just temporary type placeholders, that need
20181         to be resolved.  They initially have a pointer to a string and the
20182         current scope in which they are used.  This is used later by the
20183         compiler to resolve the reference to an actual Type. 
20184
20185         * DeclSpace is no longer a CIR.Type, and neither are
20186         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20187         are all DeclSpaces, but no Types. 
20188
20189         * type.cs (TypeRefManager): This implements the TypeRef manager,
20190         which keeps track of all the types that need to be resolved after
20191         the parsing has finished. 
20192
20193 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20194
20195         * ARGH.  We are going to have to store `foreach' as a class rather
20196         than resolving it, as we need to verify error 1579 after name
20197         resolution.   *OR* we could keep a flag that says `This request to
20198         IEnumerator comes from a foreach statement' which we can then use
20199         to generate the error.
20200
20201 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20202
20203         * class.cs (TypeContainer.AddMethod): we now add methods to the
20204         MethodGroup instead of the method hashtable.  
20205
20206         * expression.cs: Add MethodGroup abstraction, which gets us one
20207         step closer to the specification in the way we handle method
20208         declarations.  
20209
20210         * cs-parser.jay (primary_expression): qualified_identifier now
20211         tried to match up an identifier to a local variable reference or
20212         to a parameter reference.
20213
20214         current_local_parameters is now a parser global variable that
20215         points to the current parameters for the block, used during name
20216         lookup.
20217
20218         (property_declaration): Now creates an implicit `value' argument to
20219         the set accessor.
20220
20221 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20222
20223         * parameter.cs: Do not use `param' arguments as part of the
20224         signature, per the spec.
20225
20226 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20227
20228         * decl.cs: Base class for classes, structs and interfaces.  This
20229         is the "Declaration Space" 
20230
20231         * cs-parser.jay: Use CheckDef for checking declaration errors
20232         instead of having one on each function.
20233
20234         * class.cs: Factor out some code for handling error handling in
20235         accordance to the "Declarations" section in the "Basic Concepts"
20236         chapter in the ECMA C# spec.
20237
20238         * interface.cs: Make all interface member classes derive from
20239         InterfaceMemberBase.
20240
20241 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20242
20243         * Many things: all interfaces are parsed and generated in
20244         gen-treedump.  Support for member variables, constructors,
20245         destructors, properties, constants is there.
20246
20247         Beginning of the IL backend, but very little done, just there for
20248         testing purposes. 
20249
20250 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20251
20252         * cs-parser.jay: Fix labeled statement.
20253
20254         * cs-tokenizer.cs (escape): Escape " and ' always.
20255         ref_line, ref_name: keep track of the line/filename as instructed
20256         by #line by the compiler.
20257         Parse #line.
20258
20259 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20260
20261         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20262         to match the values in System.CodeDOM.
20263
20264         Divid renamed to Divide.
20265
20266         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20267         statements. 
20268         (Statements.set): remove.
20269
20270         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20271         statements. 
20272
20273         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20274         falseStatements always have valid values. 
20275
20276         * cs-parser.jay: Use System.CodeDOM now.
20277