**** Merged r40457-r40460 from MCS ****
[mono.git] / mcs / gmcs / ChangeLog
1 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2
3         * anonymous.cs (CaptureContext): Track whether `this' has been
4         referenced.   
5
6         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
7         only captured `this' if it was implicitly done (instance
8         methods/variables were used). 
9
10         * codegen.cs (EmitContext.CaptureThis): New method to flag that
11         `this' must be captured.
12
13 2005-01-30  Miguel de Icaza  <miguel@novell.com>
14  
15         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
16         is null it means that there has been no need to capture anything,
17         so we just create a sibling.
18
19         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
20
21         Just a partial fix.  The other half is fairly elusive.
22         
23 2005-02-10  Raja R Harinath  <rharinath@novell.com>
24
25         Fix #52586, cs0121-4.cs.
26         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
27         and return a hashtable.
28         (MemberCache.ClearDeclaredOnly): New.
29         (MemberCache.MemberCache): Update to change.  Make a deep copy of
30         the method_hash of a base type too.
31         (MemberCache.AddMethods): Adapt to having a deep copy of the base
32         type methods.  Overwrite entries with the same MethodHandle so
33         that the ReflectedType is correct.  The process leaves in base
34         virtual functions and their overrides as distinct entries.
35         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
36         matters since it was boxed in a ArrayList before.
37         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
38         modifier.
39         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
40         case of a virtual function and its override (choose the overload
41         as better).
42         (Invocation.OverloadResolve): Avoid 'override' members during
43         'applicable_type' calculation.
44
45 2005-02-09  Raja R Harinath  <rharinath@novell.com>
46
47         Combine two near-redundant caches.
48         * typemanager.cs (method_params): Rename from method_internal_params.
49         (TypeManager.GetParameterData): New.  Replace
50         Invocation.GetParameterData.
51         (TypeManager.LookupParametersByBuilder): Remove.
52         * expression.cs (Invocation.method_parameter_cache): Remove.
53         (Invocation.GetParameterData): Remove.
54         Update to changes.
55         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
56         Update to changes.
57
58 2005-02-08  Raja R Harinath  <rharinath@novell.com>
59
60         Fix #72015.
61         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
62         TypeManager.multicast_delegate_type is null, resolve it by looking
63         up "System.MulticastDelegate".
64         * rootcontext.cs (RootContext.ResolveCore): Simplify.
65
66 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
67             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
68             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
69
70         Fix cs0164.cs.
71         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
72         (LabeledStatement.AddReference): New.  Set 'referenced'.
73         (Goto.Resolve): Use it.
74
75 2005-02-05  John Luke  <john.luke@gmail.com>
76
77         * driver.cs: remove duplicate -doc line in Usage ()
78
79 2005-02-04  Raja R Harinath  <rharinath@novell.com>
80
81         * location.cs (Location.AddFile): Fix CS2002 error report.
82
83 2005-02-02  Martin Baulig  <martin@ximian.com>
84
85         * delegate.cs (Delegate.DefineType): Report an internal error if
86         TypeManager.multicast_delegate_type is null.  See bug #72015 for
87         details.        
88
89 2005-02-02  Raja R Harinath  <rharinath@novell.com>
90
91         Fix a crasher in a variant of #31984.
92         * const.cs (Constant.CheckBase): New override that defers the
93         new-or-override check in case the base type hasn't been populated
94         yet.
95         (Constant.Define): Ensure the new-or-override check is performed.
96
97 2005-02-01  Duncan Mak  <duncan@ximian.com>
98
99         * const.cs (LookupConstantValue): Check that `ce' is not null
100         before calling GetValue ().
101
102 2005-02-01  Raja R Harinath  <rharinath@novell.com>
103
104         Fix test-334.cs (#69519).
105         * cs-parser.jay (using_alias_directive): Pass in an expression to
106         NamespaceEntry.UsingAlias.
107         (using_namespace_directive): Pass in an expression to
108         NamespaceEntry.Using.
109         (namespace_name): Don't flatten to a string.
110         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
111         (NamespaceEntry.AliasEntry.Resolve): Lookup using
112         ResolveAsTypeStep.
113         (NamespaceEntry.UsingEntry): Likewise.
114         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
115         changes.
116         (NamespaceEntry.LookupForUsing): Remove.
117         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
118         names.
119         (NamespaceEntry.Lookup): Remove support for dotted names.
120
121 2005-02-01  Raja R Harinath  <rharinath@novell.com>
122
123         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
124         split into two.
125         (NamespaceEntry.ImplicitParent): Compute on demand.
126         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
127         parallels the current.
128         (NamespaceEntry.LookupForUsing): Use it.
129         (NamespaceEntry.Lookup): If the current namespace-entry is
130         implicit, don't search aliases and using tables.
131
132 2005-02-01  Raja R Harinath  <rharinath@novell.com>
133
134         Fix #31984.
135         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
136         BaseCache here.
137         (TypeContainer.BaseCache): Compute on demand.
138         (TypeContainer.FindMembers): Define constants and types if they're
139         not already created.
140         (FieldMember.Define): Move resetting of ec.InUnsafe before error
141         check.
142         * const.cs (Constant.Define): Make idempotent.
143
144 2005-01-29  Miguel de Icaza  <miguel@novell.com>
145
146         * pending.cs: Produce better code (no nops produced by using Ldarg
147         + value).
148         
149         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
150         i - 1' it should be arg + 1.
151
152         Fixes bug #71819.
153
154 2005-01-28  Raja R Harinath  <rharinath@novell.com>
155
156         * attribute.cs (Attribute.CheckAttributeType): Make private
157         non-virtual.
158         (Attribute.ResolveType): Make virtual.
159         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
160         handling of RootContext.Tree.Types.
161
162 2005-01-27  Raja R Harinath  <rharinath@novell.com>
163
164         Update attribute-handling to use the SimpleName/MemberAccess
165         mechanisms.
166         * cs-parser.jay (attribute): Pass in an expression to the
167         constructors of Attribute and GlobalAttribute.
168         * attribute.cs (Attribute): Take an expression for the name.
169         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
170         passed in attribute name expression.
171         (Attribute.CheckAttributeType): Use it.
172         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
173         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
174         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
175         argument to prevent error messages if the lookup fails.
176
177 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
178
179         * expression.cs (Indirection): Implemented IVariable interface
180         to support indirection in AddressOf operator.
181         (PointerArithmetic.Emit): Add optimalization for case where
182         result can be precomputed.
183
184 2005-01-26  Martin Baulig  <martin@ximian.com>
185
186         * class.cs (TypeContainer.AttributeTargets): Return the correct
187         AttributeTargets depending on our `Kind' instead of throwing an
188         exception; fixes #71632.
189
190 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
191
192         Fix #71257
193         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
194         constant members.
195
196 2005-03-17  Martin Baulig  <martin@ximian.com>
197
198         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
199         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
200
201 2005-03-17  Martin Baulig  <martin@ximian.com>
202
203         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
204         to bool so we can return an error condition.
205         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
206         returned an error.
207
208 2005-03-17  Martin Baulig  <martin@ximian.com>
209
210         * generic.cs (TypeMananager.IsIEnumerable): New public method.
211
212         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
213         converting from an array-type of T to `IEnumerable<T>'.
214
215 2005-03-16  Martin Baulig  <martin@ximian.com>
216
217         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
218         (Nullable.LiftedUnaryMutator): New public class.
219
220         * expression.cs (UnaryMutator.DoResolve): Added support for
221         Nullable Types.
222
223 2005-03-14  Martin Baulig  <martin@ximian.com>
224
225         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
226
227 2005-03-14  Martin Baulig  <martin@ximian.com>
228
229         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
230         the comparision operators `<', `>', `<=' and `>='.
231
232 2005-03-13  Martin Baulig  <martin@ximian.com>
233
234         * generic.cs
235         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
236         avoid confusion with the `NullLiteral'.
237         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
238
239 2005-03-13  Martin Baulig  <martin@ximian.com>
240
241         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
242         comparing arbitrary types with the null literal.
243
244 2005-03-13  Martin Baulig  <martin@ximian.com>
245
246         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
247         boolean operators '&&', '||', '&' and '|'.
248         (Nullable.OperatorTrueOrFalse): New public class.
249
250         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
251         instead of a `StaticCallExpr'; added support for nullables.
252
253 2005-03-10  Martin Baulig  <martin@ximian.com>
254
255         * expression.cs
256         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
257         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
258
259 2005-03-07  Martin Baulig  <martin@ximian.com>
260
261         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
262         it work if `expr' is not an IMemoryLocation.
263         (Nullable.Lifted): Implement IMemoryLocation.
264         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
265         target type.
266
267 2005-03-05  Martin Baulig  <martin@ximian.com>
268
269         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
270         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
271         (Nullable): Added support for lifted unary and binary operators.
272
273         * expression.cs (Unary.DoResolve): Added support for nullable types.
274         (Binary.DoResolve): Likewise.
275         (Conditional.DoResolve): Likewise.
276
277 2005-03-02  Martin Baulig  <martin@ximian.com>
278
279         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
280
281         * class.cs (ClassPart.SetParameterInfo): Override this.
282         (PartialContainer.SetParameterInfo): Override this.
283         (TypeContainer.CheckConstraints): New protected method.
284         (PartialContainer.CheckConstraints): Override this and check
285         whether the same contraints were specified in all parts of a
286         partial generic type definition.
287         (PartialContainer.UpdateConstraints): New public method.
288
289         * generic.cs (TypeParameter.UpdateConstraints): New public method.
290
291 2005-03-02  Martin Baulig  <martin@ximian.com>
292
293         Committing a patch from Carlos Alberto Cortez to fix #72887.
294
295         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
296         casts from `T []' to `int []'.
297
298 2005-03-02  Martin Baulig  <martin@ximian.com>
299
300         * generic.cs (TypeManager.IsEqual): Make this symmetric.
301
302         * expression.cs (Binary.ResolveOperator): When resolving a
303         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
304         `=='.  Fixes #71866.  See gen-127.cs.
305
306 2005-03-02  Martin Baulig  <martin@ximian.com>
307
308         * class.cs (TypeContainer.DoDefineMembers): We also need a default
309         static constructor in static classes.
310
311 2005-03-02  Martin Baulig  <martin@ximian.com>
312
313         * generic.cs
314         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
315         (Nullable.LiftedConversion): Added support for user-defined
316         conversions.
317
318         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
319
320         * cs-parser.jay: Use ComposedCast everywhere instead of
321         NullableType, so we don't need to check for NullableType
322         everywhere.
323         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
324         case where we'll be resolved into a `parenthesized_expression_0'
325         afterwards.
326
327         * convert.cs
328         (Convert.UserDefinedConversion): Added nullable conversions.
329
330 2005-02-28  Martin Baulig  <martin@ximian.com>
331
332         * generic.cs (TypeManager.IsNullableType): New static method.
333         (Nullable): New abstract class.
334         (Nullable.NullLiteral): New public class.
335         (Nullable.LiftedConversion): New public class.
336
337         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
338         `builtin_types opt_nullable'.
339
340         * convert.cs
341         (Convert.ImplicitConversionStandard): Added nullable conversions.
342         (Convert.ExplicitConversionStandard): Likewise.
343         (Convert.ExplicitConversion): Likewise.
344
345 2005-02-26  Martin Baulig  <martin@ximian.com>
346
347         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
348         begin with a "?", for instance "?[]".  Don't do a type lookup if
349         `dim' is empty.
350
351 2005-02-25  Martin Baulig  <martin@ximian.com>
352
353         The first part of Nullable Types :-)
354
355         * generic.cs (NullableType): New public class.
356         (NullCoalescingOperator): New public class.
357         (TypeArguments.Resolve): Add a CS0306 check.
358
359         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
360         (opt_nullable): New rule.
361         (type): Added `opt_nullable' to `namespace_or_type_name',
362         `builtin_types' and `pointer_type'.
363         (array_type): Added `opt_nullable'.
364         (opt_rank_specifier_or_nullable): New rule; this is the
365         combination of `opt_rank_specifier' and `opt_nullable'.
366         (opt_error): New rule; catch errors here.
367         (nullable_type_or_conditional): New rule; we use this to check for
368         nullable and still detect the conditional operator.
369         (local_variable_type): Use `opt_rank_specifier_or_nullable'
370         instead `opt_rank_specifier'.
371
372         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
373         for nullables.
374
375 2005-02-24  Martin Baulig  <martin@ximian.com>
376
377         * README, README.Changes: Removed; they're old and obsolete.
378
379 2005-02-22  Martin Baulig  <martin@ximian.com>
380
381         * generic.cs (TypeParameter.Resolve): If resolving the constraints
382         returned an error, set `constraints' to null to avoid a crash
383         later on.
384         (TypeParameter.ResolveType): Likewise.
385
386 2005-02-22  Martin Baulig  <martin@ximian.com>
387
388         * generic.cs
389         (Constraints.ResolveTypes): Protect against being called twice.
390         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
391         (TypeParameter.ResolveType): New public method; calls
392         constraints.ResolveTypes().
393         (TypeParameter.DefineType): Moved constraints.ResolveType() out
394         into the new ResolveType().
395         (GenericMethod.Define): Call ResolveType() on all our
396         TypeParameter's.        
397
398 2005-02-21  Martin Baulig  <martin@ximian.com>
399
400         * generic.cs
401         (TypeManager.generic_nullable_type): New static public field.
402         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
403
404         * rootcontext.cs
405         (RootContext.ResolveCore): Resolve "System.Nullable`1".
406
407 2005-02-15  Martin Baulig  <martin@ximian.com>
408
409         * generic.cs (ConstructedType.Constraints): Correctly check
410         constraints if the argument type is a type parameter; fixes
411         #72326. 
412
413 2005-02-02  Martin Baulig  <martin@ximian.com>
414
415         * delegate.cs (Delegate.DefineType): Report an internal error if
416         TypeManager.multicast_delegate_type is null.  See bug #72015 for
417         details.        
418
419 2005-01-29  Miguel de Icaza  <miguel@novell.com>
420
421         * pending.cs: Produce better code (no nops produced by using Ldarg
422         + value).
423         
424         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
425         i - 1' it should be arg + 1.
426
427         Fixes bug #71819.
428         
429 2005-01-26  Martin Baulig  <martin@ximian.com>
430
431         * cs-parser.jay (indexer_declarator): Don't report an error if we
432         have type parameters since we can be an explicit interface
433         implementation; fixes #71449.
434
435 2005-01-26  Martin Baulig  <martin@ximian.com>
436
437         * class.cs (TypeContainer.AttributeTargets): Return the correct
438         AttributeTargets depending on our `Kind' instead of throwing an
439         exception; fixes #71632.
440
441 2005-01-26  Martin Baulig  <martin@ximian.com>
442
443         * delegate.cs (Delegate.DefineType): Correctly define our type
444         parameters.  Fixes #71483.
445
446 2005-01-25  Raja R Harinath  <rharinath@novell.com>
447
448         Fix #71602.
449         * expression.cs (MemberAccess.DoResolve): Don't complain with
450         cs0572 when the LHS of a member access has identical name and type
451         name.
452
453 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
454
455         Fix #71651, #71675
456         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
457         CreatePermission.
458         Create custom PermissionSet only for PermissionSetAttribute.
459
460 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
461
462         Fix #71649
463         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
464         delegates in static class.
465
466 2005-01-24  Martin Baulig  <martin@ximian.com>
467
468         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
469         merging an implicit block, just use its reachability.
470
471         * statement.cs (Block.Resolve): Make the unreachable code check
472         work wrt. implicit blocks; see test-337 from #63842.
473
474 2005-01-21  Alp Toker  <alp@atoker.com>
475  
476         * cs-parser.jay: destructor_declaration's container is PartialContainer
477         not Class when partial types are used, so use Kind prop instead of
478         'is'.
479         
480 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
481
482         * cs-parser.jay: Improve error reporting when an interface
483         declares new types.
484
485 2005-01-20  Dick Porter  <dick@ximian.com>
486
487         * support.cs: SeekableStreamReader fix from Sandor Dobos
488         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
489         chars are read.  Fixes bug 70369.
490
491 2005-01-20  Raja R Harinath  <rharinath@novell.com>
492
493         * cs-parser.jay (catch_clause): Simplify current_block handling
494         somewhat.
495
496 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
497
498         * convert.cs (ImplicitStandardConversionExists): Synchronize the
499         code with ImplicitStandardConversion to handle the implicit
500         conversion of method groups into valid delegate invocations. 
501
502         The problem is that in parameter handling we were using this code
503         path.  Fixes bug #64698
504
505 2005-01-19  Raja R Harinath  <rharinath@novell.com>
506
507         * cs-parser.jay: Fix several infelicities.
508         - Avoid assigning to the parser value stack.  Code like 
509           '$3 = null' is unclean.  Synthesize a value for the code block
510           instead. 
511         - Avoid using oob_stack for storing location information.  Use ...
512         (_mark_): ... this.  New (empty) rule.  Saves the current location
513         in $$.
514         (foreach_statement): Avoid using oob_stack for current_block
515         handling.  Use technique used in for_statement and
516         using_statement.  Synthesize a value for the code block to store
517         additional intermediate information.
518
519 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
520
521         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
522         of a different type is only allowed to private fields of a
523         containing type, not on fields of a base class.
524
525         See test-174.cs and error cs0122-9.cs
526
527 2005-01-13  Raja R Harinath  <rharinath@novell.com>
528
529         Fix test-335.cs (bug #58126).
530         * cs-parser.jay (argument): Split out non-expression parts of the
531         rule into 'non_simple_argument'.
532         (invocation_expression): Support parenthesized invocations with
533         multiple arguments, and with single non-simple arguments.
534
535 2005-01-13  Raja R Harinath  <rharinath@novell.com>
536
537         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
538         places.
539
540 2005-01-12  Raja R Harinath  <rharinath@novell.com>
541
542         Fix cs0038-1.cs, cs1640-6.cs.
543         * ecore.cs (Expression.Resolve): Remove special-case for
544         SimpleName in error-handling.
545         (Expression.almostMatchedMembers): Relax access permission to
546         protected.
547         (Expression.MemberLookupFailed): Handle duplicates in
548         almostMatchedMembers list.
549         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
550         * expression.cs (New.DoResolve): Report CS1540 for more cases.
551         * typemanager.cs (GetFullNameSignature): Use the MethodBase
552         overload if the passed in MemberInfo is a MethodBase.
553
554 2005-01-25  Martin Baulig  <martin@ximian.com>
555
556         * doc.cs
557         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
558
559 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
560
561         Fix #70749
562         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
563         for non-CAS & merge permission sets properly.
564
565 2005-01-11  Raja R Harinath  <rharinath@novell.com>
566
567         Improve standard-compliance of simple name and member access 
568         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
569         * ecore.cs (FullNamedExpression): New abstract base class 
570         for Namespaces and TypeExpressions.
571         (ResolveFlags.SimpleName): Remove.
572         (SimpleName): Remove support for dotted names.
573         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
574         DeclSpace.FindType and DeclSpace.LookupType.
575         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
576         (Expression.ExprClassName): Make member function.
577         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
578         a namespace.  Remove creation of dotted "SimpleName"s.
579         (MemberAccess.DoResolve): Likewise.
580         * decl.cs (DeclSpace.Cache): Make private.
581         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
582         (DeclSpace.FindType): Update.
583         (DeclSpace.LookupType): Move here from RootContext.  Return a 
584         FullNamedExpression.
585         * namespace.cs (Namespace): Derive from FullNamedExpression
586         so that it can be part of expression resolution.
587         (Namespace.Lookup): Return an FullNamedExpression.
588         (NamespaceEntry.LookupAlias): Lookup aliases only in current
589         namespace.
590         * rootcontext.cs (NamespaceLookup): Remove.
591         (LookupType): Move to DeclSpace.
592         * attribute.cs (CheckAttributeType): Update.
593         * doc.cs (FindDocumentedType): Remove allowAlias argument.
594         (FindDocumentedTypeNonArray): Likewise.
595
596 2005-01-11  Raja R Harinath  <rharinath@novell.com>
597
598         Fix cs0509.cs, cs1632.cs.
599         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
600         is the same as IsInterface.
601         (TypeContainer.GetClassBases): Likewise.
602         * statement.cs (LabeledStatement.ig): New field.
603         (LabeledStatement.LabelTarget): Save ILGenerator which created the
604         label.
605         (LabeledStatement.DoEmit): Check that the label was created with
606         the same ILGenerator.
607
608 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
609
610         Fix #71058
611         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
612         accessors to its properties.
613
614         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
615         from accessors to property.
616         
617 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
618
619         Fix #70722
620         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
621         only for overrides.
622         
623 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
624
625         * attribute.cs: Check for null and empty strings.  
626
627         I have lost another battle to Paolo.
628
629 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
630
631         Fix #70942
632         * class.cs (PropertyMethod): Set Parent field in ctors.
633         (SetMethod.InternalParameters): Add unsafe switch hack.
634         Override MarkForDuplicationCheck where it is appropriate.
635
636         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
637         It says whether container allows members with the same name.
638         Base default is no.
639         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
640         Removed is_method parameter.
641
642 2005-01-06  Duncan Mak  <duncan@ximian.com>
643
644         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
645         because the previous change led to incorrect reporting of CS1032
646         ("Cannot define/undefine preprocessor symbols after first token in
647         file"). Instead of using `tokens_seen' as the only flag that
648         triggers CS1040, introduce `comments_seen'. This new flag is used
649         to signify having seen comments on the current line, so it is
650         unset after a newline.
651
652 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
653
654         * doc.cs : When searching for a type, find nested type too.
655           This fixes bug #71040.
656
657 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
658
659         * doc.cs :
660           - Warn missing member comment on those classes which also does not
661             have doc comments. Fixed bug #71041.
662           - Don't warn missing doc comment on default constructor.
663             Fixed bug #71042.
664
665 2005-01-06  Duncan Mak  <duncan@ximian.com>
666
667         * cs-tokenizer.cs (xtoken): After handling traditional C-style
668         comments, set `tokens_seen' to true. This allows us to detect
669         misplaced preprocessor directives (i.e. not at the beginning of
670         the a line, nor after whitespaces). In that case, report error
671         CS1040. This fixes bug #56460.
672
673         * cs-parser.jay (interface_member_declaration): Add checks for
674         IsExplicitImpl, and report CS0541 error if an interface member is
675         defined as an explicit interface declaration.
676
677 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
678
679         Fix #70817
680         * class.cs (PropertyMethod): Set Parent field in ctors.
681         (SetMethod.InternalParameters): Add unsafe switch hack.
682         
683         * decl.cs (MemberCore.Parent): Cannot be readonly.
684
685 2005-01-06  Raja R Harinath  <rharinath@novell.com>
686
687         * decl.cs (DeclSpace.ResolveType): Remove.
688         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
689         Merge in code from ...
690         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
691         * class.cs, enum.cs: Update to changes.
692
693 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
694
695         * anonymous.cs: Ensure that we init the scope of our parent if it
696         has not been initialized yet.
697
698 2004-12-30  Duncan Mak  <duncan@ximian.com>
699
700         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
701         if field.FieldBuilder is null. Fixes #70758.
702
703         * convert.cs: Fixed some typos and updated some of the comments.
704         (ImplicitStandardConversionExists):
705         (TryImplicitIntConversion): If `target_type' is an interface and
706         the type of `ic' implements this interface, return true or a new
707         BoxedCast instead of null. This fixes #70468.
708
709 2004-12-29  Duncan Mak  <duncan@ximian.com>
710
711         * expression.cs (Argument.Emit): Check that Expr is
712         IMemoryLocation before casting to it, and report CS1510 otherwise.
713
714         This fixes #70402.
715
716 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
717
718         * statement.cs (Block.ThisVariable): remove the recursion here, to
719         make the --profile more sane.
720
721 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
722
723         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
724         assembly, by JB Evain.
725
726 2004-12-17  Raja R Harinath  <rharinath@novell.com>
727
728         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
729           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
730         "parent" refers to enclosing type/class.  "base" refers to superclass.
731
732 2004-12-17  Raja R Harinath  <rharinath@novell.com>
733
734         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
735         Ensure that we only have GlobalAttributes.
736         * attribute.cs (Attribute.Emit): Make non-virtual.
737         (GlobalAttribute.Emit): Remove.
738         (Attribute.Resolve): Make virtual.
739         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
740         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
741         the argument. Don't create one.
742         (Attribute.GetObsoleteAttribute): Likewise.
743         (Attribute.GetClsCompliantAttributeValue): Likewise.
744         * class.cs, decl.cs: Update to changes.
745
746 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
747
748         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
749         
750         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
751         
752         * statement.cs (Foreach.Resolve): Add error 186 report.
753
754 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
755
756         * expression.cs (Conditional.DoResolve): Add warning 429.
757         
758         * statement.cs (If.Resolve): Add warning 665.
759
760 2004-12-16  Raja R Harinath  <rharinath@novell.com>
761
762         New invariant: RootContext.Tree.Types.NamespaceEntry == null
763         except when in the parser, and in GlobalAttribute.
764         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
765         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
766         RootContext.Tree.Types.NamespaceEntry once work is done.
767         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
768         and resets RootContext.Tree.Types.NamespaceEntry.
769
770 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
771
772         * cs-parser.jay: Don't create a block for every variable.
773
774 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
775
776         * location.cs: Provide extra information.
777
778         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
779         variables from the captured environment, it is the ldarg_0.
780
781 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
782
783         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
784         find a conclusion.
785         
786         * class.cs: Changed warning level for 169 to avoid developer
787         displeasure from warning flooding. It will be changed back when they
788         fix most of current BCL warnings.
789         
790         * RootContext.cs: Pushed default WarningLevel to 3.
791         
792         * statement.cs: Removed unused variable.
793
794 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
795
796         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
797         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
798         Add error 502 report.
799         (StaticClass.DefineType): Add error 441 report.
800         (Class.AllowedModifiersProp): New virtual property as temporary
801         extension to AllowedModifiers.
802         (Class.DefineType): Add error 418 report. Moved ModFlags check here
803         to share implementation with StaticClass and don't call virtual
804         methods from ctor.
805         
806         * driver.cs (MainDriver): Add error 1558 test.
807
808         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
809         report. Moved error 36 test here.
810
811         * statement.cs (Throw.Resolve): Add error 724 report.
812
813         * typemanager.cs: Add out_attribute_type core type.
814         
815 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
816
817         * class.cs (TypeContainer.VerifyClsCompliance): Add error
818         3018 report.
819         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
820
821         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
822         3017 report.
823         
824         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
825
826         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
827         Add error 3023 report.
828         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
829
830         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
831         implementation.
832
833 2004-12-12  John Luke  <john.luke@gmail.com>
834
835         * driver.cs (AddArgs): take -- into account when
836         adding arguments, fixes bug 65710 
837
838 2004-12-12  Martin Baulig  <martin@ximian.com>
839
840         * expression.cs (Unary.TryReduceNegative): Added support for
841         SByteConstant and ByteConstant.
842         (Unary.Reduce): Check error values from TryReduceNegative().
843
844 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
845
846         * attributes.cs (Attribute.Resolve): Avoid multiple error report
847         and report exception as error 182.
848
849 2004-12-10  Raja R Harinath  <rharinath@novell.com>
850
851         * driver.cs (Main): Fix message when there are warnings.
852
853 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
854
855         * delegate.cs: Fixed my fix from yesterday, sorry about that.
856
857 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
858
859         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
860         Reduced number of warnings.
861         
862         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
863
864 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
865
866         * driver.cs: Removed message.
867
868         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
869
870 2004-12-08    <vargaz@freemail.hu>
871
872         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
873
874 2004-12-08  Martin Baulig  <martin@ximian.com>
875
876         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
877         instead of a CS3002 for properties and indexer.
878
879 2004-12-08  Martin Baulig  <martin@ximian.com>
880
881         * decl.cs (MemberName.ToString): Make this work again.
882
883 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
884
885         * attribute.cs (Resolve): Add error 591 detection.
886
887         * class.cs (FieldMember.Define): Add error 1547 detection.
888         (Indexer.Define): Add error 620 detection.
889         (Operator.Define): Add error 590 detection.
890
891         * ecore.cs: Missing argument for error 79.
892
893         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
894         detection.
895
896 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
897
898         Fix #70106
899         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
900         only.
901
902 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
903
904         * cs-parser.jay : handle doc comments on implicit/explicit operators.
905           Some operator comments were suppressed.
906         * doc.cs : Implicit/explicit operator name in doc comments are like
907           "op_Explicit(type)~returnType", so added suffix handling.
908
909 2005-01-21  Alp Toker  <alp@atoker.com>
910
911         * cs-parser.jay: destructor_declaration's container is PartialContainer
912         not Class when partial types are used, so use Kind prop instead of 'is'.
913
914 2004-12-12  Martin Baulig  <martin@ximian.com>
915
916         * expression.cs (Unary.TryReduceNegative): Added support for
917         SByteConstant and ByteConstant.
918         (Unary.Reduce): Check error values from TryReduceNegative().
919
920 2004-12-11  Martin Baulig  <martin@ximian.com>
921
922         * support.cs (ReflectionParameters.ParameterName): If we have a
923         `gpd', call `ParameterName' on it.
924
925         * parameter.cs (Parameter.GetParameterAttributes): New static method.
926
927         * pending.cs (PendingImplementation.DefineProxy): Call
928         DefineParameter() for all of the MethodBuilder's arguments.
929
930 2004-12-09  Martin Baulig  <martin@ximian.com>
931
932         * doc.cs (DocUtil): Make this a static class.
933
934 2004-12-09  Martin Baulig  <martin@ximian.com>
935
936         * expression.cs (Invocation.InferType): Moved the type inference
937         implementation into TypeManager.
938
939         * generics.cs (TypeManager): Moved the type inference
940         implementation here.
941
942 2004-12-09  Martin Baulig  <martin@ximian.com>
943
944         * typemanager.cs (TypeManager): Make this a partial class.
945
946         * generics.cs
947         (TypeManager): Move the generics part of `TypeManager' here.
948
949 2004-12-08  Martin Baulig  <martin@ximian.com>
950
951         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
952         instead of a CS3002 for properties and indexer.  Added CS3024
953         check for generic interfaces.
954
955         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
956         instances are not CLS-compliant.
957
958 2004-12-08  Martin Baulig  <martin@ximian.com>
959
960         * cs-parser.jay
961         (void_pointer_expression): New rule for `void*', `void**' etc.
962         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
963
964 2004-12-08  Martin Baulig  <martin@ximian.com>
965
966         * expression.cs (Invocation.InferType): Removed the hack for
967         MethodCore.MayUnify().  
968
969         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
970         this actually work.
971
972         * class.cs (MethodCore.MayUnify): Use
973         TypeManager.MayBecomeEqualGenericTypes().       
974
975 2004-12-08  Martin Baulig  <martin@ximian.com>
976
977         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
978         parameter, box it.  Fixes #69233.
979
980 2004-12-08  Martin Baulig  <martin@ximian.com>
981
982         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
983         have the ctor constraint.  Fixes #68326.
984
985 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
986
987         * cs-parser.jay : interface comment was not consumed because of
988           extra opt_semicolon before doc handling.
989
990 2004-12-03  Raja R Harinath  <rharinath@novell.com>
991
992         Fix test-327.cs, test-328.cs, and put in early infrastructure
993         for eventually fixing #52697.
994         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
995         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
996         from other methods.
997         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
998         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
999         (VerifyUsing, error246): Update.
1000         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1001         'NamespaceEntry.LookupNamespaceOrType'.
1002
1003 2004-12-07  Martin Baulig  <martin@ximian.com>
1004
1005         * driver.cs: Call it "BETA SOFTWARE" :-)
1006
1007 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1008
1009         Fix crash on cs0657-17.cs.
1010         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1011         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1012         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1013         the case where the NamespaceEntry gets overwritten.
1014
1015 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1016
1017         Fixed #69195, #56821
1018         * ecore.cs (ResolveBoolean): Tiny refactoring.
1019
1020         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1021         of right expression resolving when left is false constant and
1022         operator is LogicalAnd OR true constant and operator is LogicalOr.
1023
1024         * statement.cs (ResolveUnreachable): Always reports warning.
1025
1026 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1027
1028         * class.cs: Distinguish between 1721 and 1722 (just a little help
1029         for the programmer).
1030
1031 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1032
1033         * delegate.cs: Only allow this on new versions of the language. 
1034
1035 2004-12-02  Duncan Mak  <duncan@ximian.com>
1036
1037         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1038         Expression class.
1039         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1040         here as a static method. Take an additional bool out parameter
1041         `must_do_cs1540_check' for signaling to InstanceResolve.
1042         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1043         member field from PropertyExpr class and made it an argument of
1044         the method instead.
1045         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1046         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1047         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1048         and `remove_accessor' as well as InstanceResolve: report CS0122
1049         where applicable.
1050
1051         Fixes #70129.
1052
1053 2004-12-07  Martin Baulig  <martin@ximian.com>
1054
1055         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
1056         and CS0692 where appropriate.
1057
1058 2004-12-06  Martin Baulig  <martin@ximian.com>
1059
1060         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
1061         IsDuplicateImplementation() and improved it.
1062
1063         * expression.cs (Invocation.InferTypeArguments): Added
1064         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
1065         and removed the "ref" modifier from `infered_types'.
1066
1067         * decl.cs (MemberName.ToString): Removed the exception.
1068
1069 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1070
1071         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1072           comments are allowed.
1073
1074 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1075
1076         * delegate.cs: Add checks for subtypes in paramaters and return values
1077         in VerifyMethod () to add support for Covariance/Contravariance
1078         in delegates.
1079         
1080 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1081
1082         * report.cs: Remove extra closing parenthesis.
1083
1084         * convert.cs (Error_CannotImplicitConversion): If the name of the
1085         types are the same, provide some extra information.
1086
1087 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1088
1089         Fix bug #70102
1090         * attribute.cs (Resolve): Improved implementation of params
1091         attribute arguments.
1092
1093         * support.cs (ParameterData): Add HasParams to be faster.
1094
1095 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1096
1097         all things are for /doc support:
1098
1099         * doc.cs: new file that supports XML documentation generation.
1100         * mcs.exe.sources: added doc.cs.
1101         * driver.cs:
1102           Handle /doc command line option.
1103           Report error 2006 instead of 5 for missing file name for /doc.
1104           Generate XML documentation when required, after type resolution.
1105         * cs-tokenizer.cs:
1106           Added support for picking up documentation (/// and /** ... */),
1107           including a new XmlCommentState enumeration.
1108         * cs-parser.jay:
1109           Added lines to fill Documentation element for field, constant,
1110           property, indexer, method, constructor, destructor, operator, event
1111           and class, struct, interface, delegate, enum.
1112           Added lines to warn incorrect comment.
1113         * rootcontext.cs :
1114           Added Documentation field (passed only when /doc was specified).
1115         * decl.cs:
1116           Added DocComment, DocCommentHeader, GenerateDocComment() and
1117           OnGenerateDocComment() and some supporting private members for
1118           /doc feature to MemberCore.
1119         * class.cs:
1120           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1121         * delegate.cs:
1122           Added overriden DocCommentHeader.
1123         * enum.cs:
1124           Added overriden DocCommentHeader and GenerateDocComment().
1125
1126 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1127
1128         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1129         unwrapping the enumeration values, chain to
1130         DoConstantNumericPromotions again, so we can promote things to the
1131         fundamental types (takes care of enums that are bytes, sbytes).
1132
1133         Fixes bug #62054.
1134
1135 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1136
1137         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1138         Fix long-standing bug in type-lookup.  Use FindType instead of
1139         LookupType when ec.ResolvingTypeTree.
1140         (Attribute.ResolveType, Attribute.Resolve)
1141         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1142         Update to changes.
1143         (Attributes.Search): Remove internal version.  Update.
1144         (Attributes.SearchMulti): Update.
1145         (Attributes.GetClsCompliantAttribute): Remove.
1146         (Attributes.GetIndexerNameAttribute): Remove.
1147         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1148         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1149         * class.cs (Indexer.Define): Likewise.
1150
1151 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1152
1153         Fix bug #68790
1154         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1155         MarshallByReference members access.
1156
1157         * expression.cs: Use CheckMarshallByRefAccess;
1158         Better error CS0197 message.
1159
1160         * report.cs: Print whole related error message.
1161
1162 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1163
1164         * class (GetClassBases): Better error 60 report.
1165         (EventProperty): Disabled warning 67 detection.
1166
1167 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1168
1169         Fix bug #60324
1170         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1171
1172         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1173         precise values.
1174
1175 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1176
1177         Fix bug #49488
1178         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1179
1180         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1181
1182 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
1183
1184         * attribute.cs (Attribute.Resolve): Refine error reporting and
1185         report a cs0117 if the identifier does not exist, to distinguish
1186         from 0617 which is a miss-use of the actual identifier.
1187
1188         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1189         between cs0070 and cs0079.
1190
1191         * class.cs (MemberBase.DoDefine): When reporting a wrong
1192         accessibility level, we use MethodCore to compare instead of
1193         Method (this was a regression in some refactoring effort).
1194
1195         So now we correctly report cs0056 again.
1196
1197         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1198         testing the target_type (which was known to be object_type) and
1199         not the source type (which is anonymous_method).
1200
1201         Fixed reporting of error cs1660.
1202
1203         * expression.cs (UserCast.Source): Expose the underlying cast.
1204
1205         * statement.cs (Switch.SwitchGoverningType): Sort the list of
1206         allowed types to find a match to int32 first (most common).
1207
1208         In addition, it ignores any ImplicitUserConversions that did an
1209         internal implicit conversion (as the switch statement allows only
1210         one integral conversion to exist).
1211
1212         * class.cs (PartialContainer.Create): rename `name' to
1213         `member_name' for clarity.  Then replace the string calls with a
1214         call to MemberName.GetPartialName, as now using
1215         MemberName.ToString is an error (this is due to the side effects
1216         it had, that were fixed in the past).
1217
1218         This will restore the error reporting on a number of partial class
1219         errors that were missusing this (and getting an exception as a
1220         results, which is now just a plain textual warning, because
1221         yyparse debug output would crash otherwise).
1222
1223 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1224
1225         * Makefile (PROGRAM_INSTALL_DIR): Remove.
1226
1227 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1228
1229         * rootcontext.cs (LookupType): Make sure to cache lookups that
1230         don't give us a negative result. This saves about 5% of corlib
1231         compilation time.
1232
1233 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1234
1235         * report.cs (AbstractMessage.Print): messages are sent to stderr
1236
1237         * class.cs (TypeContainer.GetClassBases): It is an error to have a
1238         non-interface in the list of interfaces (at this point, either
1239         parent was properly set, or a base class is being listed in the
1240         interfaces section).
1241
1242         This flags error 1722, and resolves the crash from bug 69259.
1243
1244 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1245
1246         * statement.cs (Using.EmitExpressionFinally): make this work right
1247         for valuetypes. Fixes 69926.
1248
1249 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1250
1251         * const.cs (Const.ChangeType): Cope with the "0 literal can be
1252         converted to an enum" here, before we try to change the underlying
1253         type.  This code exists, but it is a different code path than the
1254         one used while encoding constants.
1255
1256         (ImplicitReferenceConversionExists): In addition, resynchronized
1257         the code here, so it matches the same code in
1258         ImplicitReferenceConversionExists for the `from any class-type S
1259         to any interface-type T'.       
1260
1261 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
1262
1263         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1264
1265 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
1266
1267         * cs-parser.jay: Use verbosity accordingly. 
1268
1269 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1270
1271         * expression.cs (Unary.ResolveOperator): Do not report warning;
1272         AddressOf reads from variable.
1273         
1274         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1275
1276 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1277
1278         Fix bug #69462
1279
1280         * attribute.cs (Attributable): Removed CheckTargets.
1281         (Attributes.Emit): Explicit attribute targets are tested here.
1282
1283         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1284         not enabled for interfaces.
1285
1286         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1287         (GetAssemblyName): Ouch next bug there.
1288
1289 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1290
1291         * expression.cs: Error 275 added.
1292         
1293 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1294
1295         Fix bug #69177 (Implemented decimal constant support)
1296
1297         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1298         (BinaryFold): Add DecimalConstant.
1299
1300         * const.cs (Define): Decimal constant 
1301         (is not constant.
1302         (ChangeType): Add decimal type handling.
1303         (LookupConstantValue): Don't set value for decimal type but
1304         emit DecimalConstantAttribute. Needed for constant optimization.
1305
1306         * constant.cs (ToDecimal): New method.
1307         (ConvertToDecimal): New method.
1308         (IntConstant): Implemented ConvertToDecimal.
1309         (DecimalConstant.Emit): Emit optimized version for decimals in
1310         int range.
1311
1312         * expression.cs (ResolveOperator): Changed order of constant
1313         reduction to work correctly with native types which have
1314         overloaded operators.
1315         (ResolveMemberAccess): Extract constant value from attribute
1316         for decimal type.
1317
1318         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1319
1320         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1321         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1322         (ChangeType): Decimal is special.
1323         (TypeToCoreType): Add decimal type.
1324
1325 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1326
1327         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1328         decimal types.
1329
1330 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1331
1332         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1333         test cs1667-5.cs.
1334
1335 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1336
1337         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1338
1339         * pending.cs (PendingImplementation): Grab only interfaces.
1340
1341 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1342
1343         * statement.cs (ForeachHelperMethods): Add location member and
1344         error 202 detection.
1345
1346 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1347
1348         * expression.cs (DoResolveBase): Fixed wrong warning for out
1349         variables.
1350
1351 2004-12-04  Martin Baulig  <martin@ximian.com>
1352
1353         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
1354         to check whether the conversion is ok.
1355
1356         * typemanager.cs (TypeManager.GetTypeArguments): Just return
1357         `Type.EmptyTypes' if we're not a generic TypeContainer.
1358
1359 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1360
1361         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1362         old bug: when converting from the null literal to a pointer,
1363         return an EmptyCast, not the NullLiteral.
1364
1365         This fixes #69921, the recent null_type changes probably made this
1366         bug more prominent.
1367
1368 2004-12-03  Martin Baulig  <martin@ximian.com>
1369
1370         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1371         method as our child, call AnonymousMethod.Compatible() on it.
1372
1373 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1374
1375         * class.cs (FieldBase): Use an unused bit field from the field to
1376         encode the `has_offset' property from the FieldMember.  This saves
1377         a couple of Ks on bootstrap compilation.
1378
1379         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1380         method as our child, return the AnonymousMethod resolved
1381         expression.
1382
1383         * expression.cs (New.DoResolve): Allow return values from
1384         NewDelegate to also include AnonymousMethods.
1385
1386         Fixes #70150.
1387
1388 2004-11-29  Raja R Harinath  <rharinath@novell.com>
1389
1390         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
1391         cs1648 report.
1392         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
1393         System.Runtime.InteropServices._Exception, since it's a base
1394         interface of the core type System.Exception in the net_2_0 profile.
1395
1396 2004-11-27  Martin Baulig  <martin@ximian.com>
1397
1398         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
1399
1400 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1401
1402         * Makefile: Convert to use executable.make.
1403         * gmcs.exe.sources: New.
1404
1405 2004-11-25  Martin Baulig  <martin@ximian.com>
1406
1407         * expression.cs (Invocation.InferType): Added support for byref types.
1408
1409 2004-11-25  Martin Baulig  <martin@ximian.com>
1410
1411         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1412         in TypeManager.TypeToCoreType().
1413
1414 2004-11-25  Martin Baulig  <martin@ximian.com>
1415
1416         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1417         "Dispose" method from the `current_type'.
1418         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1419         DoDefineMembers() instead of using the MethodBuilder; this is
1420         required for generic iterators.
1421
1422         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1423
1424 2004-11-24  Martin Baulig  <martin@ximian.com>
1425
1426         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1427
1428 2004-11-20  Martin Baulig  <martin@ximian.com>
1429
1430         * expression.cs (Invocation.InferType): Correctly infer generic
1431         instances; see gen-103.cs.
1432         (Invocation.InferTypeArguments): If a generic method doesn't have
1433         any unbound type parameters, we don't need to infer anything.
1434
1435 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1436
1437         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1438
1439 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1440
1441         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1442         (TypeHandle.GetMemberCache): New.
1443         (TypeHandle.TypeHandle): Update.
1444         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1445         (TypeManager.LookupParentInterfacesCache):
1446         Rename from LookupInterfaceCache.  Optimize slightly.
1447         (TypeManager.MemberLookup_FindMembers): Update.
1448         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1449         multi-type variant.
1450         (AddCacheContents): Rename from AddHashtable.
1451         * class.cs (TypeContainer.parent_container): Remove.
1452         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1453         (TypeContainer.DoDefineMembers): Don't initialize it.
1454         Update to name changes.
1455         
1456 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1457
1458         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1459         that factors the code to check access modifiers on override.  
1460
1461         (PropertyBase): Use the code here.
1462
1463         Patch from Lluis S'anchez, fixes bug #69361.
1464
1465 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1466
1467         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1468         routine that is used to report the use of a captured variable
1469         whose address has been taken.
1470
1471         There are two checks: one when variables are being captured and
1472         the other check is when the address of a variable is taken. 
1473         
1474         (because an anonymous methods might be resolved before *or* after
1475         the address has been taken) and 
1476
1477         * expression.cs (Conditional.DoResolve): Remove the special
1478         casing that Martin added to trueExpr and falseExpr being both
1479         NullLiteral.  We get the right behavior now just by introducing
1480         the null_type into the compiler. 
1481
1482         * convert.cs (ExplicitConversion): Change the code to use
1483         null_type instead of testing `expr is NullLiteral'.
1484         (ImplicitConversionStandard): use null_type too.
1485         (ImplicitReferenceConversionExists): use null_type too.
1486         (ImplicitReferenceConversion): use null_type too.
1487
1488         * literal.cs: The type of `NullLiteral' is now null_type instead
1489         of object_type. 
1490         (Resolve): Set the type here.
1491
1492         * typemanager.cs: Introduce null_type.
1493
1494 2004-11-18  Martin Baulig  <martin@ximian.com>
1495
1496         * rootcontext.cs
1497         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1498
1499 2004-11-18  Martin Baulig  <martin@ximian.com>
1500
1501         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1502
1503 2004-11-18  Martin Baulig  <martin@ximian.com>
1504
1505         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1506         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1507         call ResolveConstructedType() on it to resolve it without checking
1508         constraints.
1509         (Constraints.ResolveTypes): Check them here.
1510         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1511         but don't check constraints.
1512         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1513         check constraints here.
1514         (ConstructedType.ResolveConstructedType): New public method.  This
1515         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1516         resolve ourselves without checking constraints.
1517
1518         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1519
1520 2004-11-18  Martin Baulig  <martin@ximian.com>
1521
1522         * decl.cs
1523         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1524
1525         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1526
1527 2004-11-18  Martin Baulig  <martin@ximian.com>
1528
1529         * ecore.cs (TypeExpr.ResolveType): Removed.
1530         (Expression.ResolveAsTypeTerminal): We always return a fully
1531         resolved `TypeExpr', so we can just access its `Type'.
1532
1533         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1534
1535 2004-11-17  Martin Baulig  <martin@ximian.com>
1536
1537         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1538         sure we don't return any unresolved TypeExpr's.
1539         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1540         a `TypeExpr'.
1541         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1542
1543         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1544         unresolved `ConstructedType's.
1545
1546 2004-11-17  Martin Baulig  <martin@ximian.com>
1547
1548         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1549
1550 2004-11-17  Martin Baulig  <martin@ximian.com>
1551
1552         * ecore.cs
1553         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1554
1555         * decl.cs (DeclSpace.ResolveType): Removed.
1556         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1557
1558 2004-11-17  Martin Baulig  <martin@ximian.com>
1559
1560         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1561         direction, like FindMembers() does.  Fixes #69546, testcase is in
1562         test-315.cs.    
1563
1564 2004-11-16  Martin Baulig  <martin@ximian.com>
1565
1566         This is based on a patch from Marek Safar, see bug #69082.
1567         Fixes bugs #63705 and #67130.
1568
1569         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1570         method; create a MemberCache for an interface type and cache the
1571         result.
1572
1573         * decl.cs (IMemberContainer.ParentContainer): Removed.
1574         (IMemberContainer.ParentCache): New property.
1575         (MemberCache.SetupCacheForInterface): Removed.
1576         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1577         to create a cache for an interface's "parent".
1578
1579         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1580         interfaces too.
1581
1582 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1583
1584         * statement.cs: Avoid adding bools to a hashtable.
1585
1586 2004-11-15  Martin Baulig  <martin@ximian.com>
1587
1588         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1589
1590 2004-11-11  Martin Baulig  <martin@ximian.com>
1591
1592         * typemanager.cs (TypeManager.GetMethodName): New method.
1593
1594         * class.cs (MethodData.Define): Include the generic arity in the
1595         name of an explicit interface; also add it to the method name.
1596
1597         * pending.cs (PendingImplementation.InterfaceMethod): The method
1598         name now includes the generic arity.
1599
1600 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1601
1602         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1603         calling an unsafe method from a safe location.
1604
1605 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1606
1607         Fix #69167
1608         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1609
1610 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1611
1612         * namespace.cs (VerifyUsing): use GetPartialName instead of
1613         ToString. 
1614
1615 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1616
1617         * statement.cs (Return.Resolve): Fix regression in typo: if
1618         `in_exc', we have to request a NeedReturnLabel, this was a typo
1619         introduced in the anonymous method check-in.  Fixes #69131.
1620
1621         * Indexers were using the ShortName when defining themselves,
1622         causing a regression in the compiler bootstrap when applying the
1623         patch from 2004-11-02 (first part), now they use their full name
1624         and the bug is gone.
1625
1626 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1627
1628         * driver.cs: Strip the path from the names of embedded resources. Fixes
1629         #68519.
1630
1631 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1632
1633         Fix error message regression: cs0104-2.cs.
1634         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1635         (AliasEntry.Resolve): Update.
1636         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1637         'silent' flag.
1638         (RootContext.LookupType): Update.
1639
1640 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1641
1642         * cs-parser.jay: Add support for handling accessor modifiers
1643         * class: Add support port accessor modifiers and error checking,
1644         define PropertyMethod.Define as virtual (not abstract anymore)
1645         * ecore.cs: Add checking for proeprties access with access modifiers
1646         * iterators.cs: Modify Accessor constructor call based in the modified
1647         constructor
1648 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1649
1650         * expression.cs (StringConcat): Handle being called twice,
1651         as when we have a concat in a field init with more than two
1652         ctors in the class
1653
1654 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1655
1656         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1657         special case explicit implementations, we should always produce
1658         the .property or .event declaration.
1659         
1660         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1661         since it will not return correct data if people use this
1662         unresolved in the presence of using statements (see test-313).
1663
1664         * class.cs (MethodData.Define): If we are an explicit interface
1665         implementation, set the method name to the full name of the
1666         interface plus the name of the method.  
1667
1668         Notice that using the method.MethodName.GetFullName() does not
1669         work, as it will only contain the name as declared on the source
1670         file (it can be a shorthand in the presence of using statements)
1671         and not the fully qualifed type name, for example:
1672
1673         using System;
1674
1675         class D : ICloneable {
1676                 object ICloneable.Clone ()  {
1677                 }
1678         }
1679
1680         Would produce a method called `ICloneable.Clone' instead of
1681         `System.ICloneable.Clone'.
1682
1683         * namespace.cs (Alias.Resolve): Use GetPartialName.
1684         
1685 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1686
1687         * cs-parser.jay: Add error 1055 report.
1688
1689 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1690
1691         * assign.cs (Assign.DoResolve): Only do the transform of
1692         assignment into a New if the types are compatible, if not, fall
1693         through and let the implicit code deal with the errors and with
1694         the necessary conversions. 
1695
1696 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1697
1698         * cs-parser.jay: Add error 1031 report.
1699
1700         * cs-tokenizer.cs: Add location for error 1038.
1701
1702 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1703
1704         * cs-parser.jay: Add error 1016 report.
1705
1706 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1707
1708         * cs-parser.jay: Add errors 1575,1611 report.
1709
1710 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1711
1712         * cs-parser.jay: Add error 1001 report.
1713
1714 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1715
1716         Fix #68850
1717         * attribute.cs (GetMarshal): Add method argument for
1718         caller identification.
1719
1720         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1721         agument for GetMarshal and RuntimeMissingSupport.
1722
1723 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1724
1725         * attribute.cs (ExtractSecurityPermissionSet): Removed
1726         TypeManager.code_access_permission_type.
1727
1728         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1729
1730 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1731
1732         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1733         for obsolete use of a variable here.   Fixes regression on errors
1734         cs0619-25 and cs0619-26.
1735
1736 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1737
1738         Fix #62358, implemented security attribute encoding.
1739
1740         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1741         Tests permitted SecurityAction for assembly or other types.
1742         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1743         data from SecurityPermissionAttribute to PermisionSet class.
1744
1745         * class.cs (ApplyAttributeBuilder): Added special handling
1746         for System.Security.Permissions.SecurityAttribute based types.
1747
1748         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1749         special handling for System.Security.Permissions.SecurityAttribute
1750         based types.
1751
1752         * enum.cs (ApplyAttributeBuilder): Added special handling
1753         for System.Security.Permissions.SecurityAttribute based types.
1754
1755         * parameter.cs (ApplyAttributeBuilder): Added special handling
1756         for System.Security.Permissions.SecurityAttribute based types.
1757
1758         * rootcontext.cs: Next 2 core types.
1759
1760         * typemanager.cs (TypeManager.security_permission_attr_type):
1761         Built in type for the SecurityPermission Attribute.
1762         (code_access_permission_type): Build in type.
1763
1764 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1765
1766         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1767         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1768         all of this information into
1769         EmitContext.EmitCapturedVariableInstance.
1770         
1771         * codegen.cs (EmitCapturedVariableInstance): move here the
1772         funcionality of emitting an ldarg.0 in the presence of a
1773         remapping.   This centralizes the instance emit code.
1774
1775         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1776         then emit a load of this: it means that we have reached the
1777         topmost ScopeInfo: the one that contains the pointer to the
1778         instance of the class hosting the anonymous method.
1779
1780         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1781         captures to the topmost CaptureContext.
1782
1783 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1784
1785         * expression.cs (LocalVariableReference): Move the knowledge about
1786         the iterators into codegen's EmitCapturedVariableInstance.
1787
1788 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1789
1790         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1791         all code paths return a value from an anonymous method (it is the
1792         same as the 161 error, but for anonymous methods).
1793
1794 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1795
1796         The introduction of anonymous methods in the compiler changed
1797         various ways of doing things in the compiler.  The most
1798         significant one is the hard split between the resolution phase
1799         and the emission phases of the compiler.
1800
1801         For instance, routines that referenced local variables no
1802         longer can safely create temporary variables during the
1803         resolution phase: they must do so from the emission phase,
1804         since the variable might have been "captured", hence access to
1805         it can not be done with the local-variable operations from the runtime.
1806         
1807         * statement.cs 
1808
1809         (Block.Flags): New flag `IsTopLevel' to indicate that this block
1810         is a toplevel block.
1811
1812         (ToplevelBlock): A new kind of Block, these are the blocks that
1813         are created by the parser for all toplevel method bodies.  These
1814         include methods, accessors and anonymous methods.
1815
1816         These contain some extra information not found in regular blocks:
1817         A pointer to an optional CaptureContext (for tracking captured
1818         local variables and parameters).  A pointer to the parent
1819         ToplevelBlock.
1820         
1821         (Return.Resolve): Catch missmatches when returning a value from an
1822         anonymous method (error 1662).
1823         Invoke NeedReturnLabel from the Resolve phase instead of the emit
1824         phase.
1825
1826         (Break.Resolve): ditto.
1827
1828         (SwitchLabel): instead of defining the labels during the
1829         resolution phase, we now turned the public ILLabel and ILLabelCode
1830         labels into methods called GetILLabelCode() and GetILLabel() that
1831         only define the label during the Emit phase.
1832
1833         (GotoCase): Track the SwitchLabel instead of the computed label
1834         (its contained therein).  Emit the code by using
1835         SwitchLabel.GetILLabelCode ().
1836
1837         (LocalInfo.Flags.Captured): A new flag has been introduce to track
1838         whether the Local has been captured or not.
1839
1840         (LocalInfo.IsCaptured): New property, used to tell whether the
1841         local has been captured.
1842         
1843         * anonymous.cs: Vastly updated to contain the anonymous method
1844         support.
1845
1846         The main classes here are: CaptureContext which tracks any
1847         captured information for a toplevel block and ScopeInfo used to
1848         track the activation frames for various local variables.   
1849
1850         Each toplevel block has an optional capture context associated
1851         with it.  When a method contains an anonymous method both the
1852         toplevel method and the anonymous method will create a capture
1853         context.   When variables or parameters are captured, they are
1854         recorded on the CaptureContext that owns them, for example:
1855
1856         void Demo () {
1857              int a;
1858              MyDelegate d = delegate {
1859                  a = 1;
1860              }
1861         }
1862
1863         Here `a' will be recorded as captured on the toplevel
1864         CapturedContext, the inner captured context will not have anything
1865         (it will only have data if local variables or parameters from it
1866         are captured in a nested anonymous method.
1867
1868         The ScopeInfo is used to track the activation frames for local
1869         variables, for example:
1870
1871         for (int i = 0; i < 10; i++)
1872                 for (int j = 0; j < 10; j++){
1873                    MyDelegate d = delegate {
1874                         call (i, j);
1875                    }
1876                 }
1877
1878         At runtime this captures a single captured variable `i', but it
1879         captures 10 different versions of the variable `j'.  The variable
1880         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
1881         recorded on a child.  
1882
1883         The toplevel ScopeInfo will also track information like the `this'
1884         pointer if instance variables were referenced (this is necessary
1885         as the anonymous method lives inside a nested class in the host
1886         type of the method). 
1887
1888         (AnonymousMethod): Expanded to track the Toplevel, implement
1889         `AnonymousMethod.Compatible' to tell whether an anonymous method
1890         can be converted to a target delegate type. 
1891
1892         The routine now also produces the anonymous method content
1893
1894         (AnonymousDelegate): A helper class that derives from
1895         DelegateCreation, this is used to generate the code necessary to
1896         produce the delegate for the anonymous method that was created. 
1897
1898         * assign.cs: API adjustments for new changes in
1899         Convert.ImplicitStandardConversionExists.
1900
1901         * class.cs: Adjustments to cope with the fact that now toplevel
1902         blocks are of type `ToplevelBlock'. 
1903
1904         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
1905         insteda of standard blocks.
1906
1907         Flag errors if params arguments are passed to anonymous methods.
1908
1909         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
1910         `CurrentAnonymousMethod' which points to the current Anonymous
1911         Method.  The variable points to the AnonymousMethod class that
1912         holds the code being compiled.  It is set in the new EmitContext
1913         created for the anonymous method.
1914
1915         (EmitContext.Phase): Introduce a variable and an enumeration to
1916         assist in enforcing some rules about when and where we are allowed
1917         to invoke certain methods (EmitContext.NeedsReturnLabel is the
1918         only one that enfonces this right now).
1919
1920         (EmitContext.HaveCaptureInfo): new helper method that returns
1921         whether we have a CapturedContext initialized.
1922
1923         (EmitContext.CaptureVariable): New method used to register that a
1924         LocalInfo must be flagged for capturing. 
1925
1926         (EmitContext.CapturedParameter): New method used to register that a
1927         parameters must be flagged for capturing. 
1928         
1929         (EmitContext.CapturedField): New method used to register that a
1930         field must be flagged for capturing. 
1931
1932         (EmitContext.HaveCapturedVariables,
1933         EmitContext.HaveCapturedFields): Return whether there are captured
1934         variables or fields. 
1935
1936         (EmitContext.EmitMethodHostInstance): This is used to emit the
1937         instance for the anonymous method.  The instance might be null
1938         (static methods), this (for anonymous methods that capture nothing
1939         and happen to live side-by-side with the current method body) or a
1940         more complicated expression if the method has a CaptureContext.
1941
1942         (EmitContext.EmitTopBlock): Routine that drives the emission of
1943         code: it will first resolve the top block, then emit any metadata
1944         and then emit the code.  The split is done so that we can extract
1945         any anonymous methods and flag any captured variables/parameters.
1946         
1947         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
1948         during this phase, the ILGenerator should not be used as labels
1949         and local variables declared here might not be accessible to any
1950         code that is part of an anonymous method.  
1951
1952         Exceptions to this include the temporary variables that are
1953         created by some statements internally for holding temporary
1954         variables. 
1955         
1956         (EmitContext.EmitMeta): New routine, in charge of emitting all the
1957         metadata for a cb
1958
1959         (EmitContext.TemporaryReturn): This method is typically called
1960         from the Emit phase, and its the only place where we allow the
1961         ReturnLabel to be defined other than the EmitMeta.  The reason is
1962         that otherwise we would have to duplicate a lot of logic in the
1963         Resolve phases of various methods that today is on the Emit
1964         phase. 
1965
1966         (EmitContext.NeedReturnLabel): This no longer creates the label,
1967         as the ILGenerator is not valid during the resolve phase.
1968
1969         (EmitContext.EmitThis): Extended the knowledge in this class to
1970         work in anonymous methods in addition to iterators. 
1971
1972         (EmitContext.EmitCapturedVariableInstance): This emits whatever
1973         code is necessary on the stack to access the instance to a local
1974         variable (the variable will be accessed as a field).
1975
1976         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
1977         EmitContext.EmitAddressOfParameter): Routines to support
1978         parameters (not completed at this point). 
1979         
1980         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
1981         will also remove the parameters.
1982
1983         * convert.cs (Convert): Define a `ConstantEC' which points to a
1984         null.  This is just to prefity some code that uses
1985         ImplicitStandardConversion code and do not have an EmitContext
1986         handy.
1987
1988         The idea is to flag explicitly that at that point in time, it is
1989         known that the conversion will not trigger the delegate checking
1990         code in implicit conversions (which requires a valid
1991         EmitContext). 
1992
1993         Everywhere: pass new EmitContext parameter since
1994         ImplicitStandardConversionExists now requires it to check for
1995         anonymous method conversions. 
1996
1997         (Convert.ImplicitStandardConversionExists): If the type of an
1998         expression is the anonymous_method_type, and the type is a
1999         delegate, we invoke the AnonymousMethod.Compatible method to check
2000         whether an implicit conversion is possible. 
2001
2002         (Convert.ImplicitConversionStandard): Only do implicit method
2003         group conversions if the language level is not ISO_1.
2004
2005         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2006         MethodInfo for the Invoke method.  used by Delegate and
2007         AnonymousDelegate.
2008
2009         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2010         method conversions if the target type is a delegate.
2011
2012         Removed extra debugging nops.
2013
2014         (LocalVariableReference): Turn the `local_info' into a public
2015         field. 
2016
2017         Add `prepared' field, the same hack used for FieldExprs to cope
2018         with composed assignments, as Local variables do not necessarily
2019         operate purely on the stack as they used to: they can be captured
2020         fields. 
2021
2022         Add `temp' for a temporary result, like fields.
2023
2024         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2025
2026         It now copes with Local variables that are captured and emits the
2027         proper instance variable to load it from a field in the captured
2028         case. 
2029
2030         (ParameterReference.DoResolveBase): During the resolve phase,
2031         capture parameters if we are in an anonymous method.
2032
2033         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2034         anonymous method, use the EmitContext helper routines to emit the
2035         parameter reference.
2036
2037         * iterators.cs: Set RemapToProxy to true/false during the
2038         EmitDispose class.
2039
2040         * parameters.cs (GetParameterByName): New helper method. 
2041
2042         * typemanager.cs (anonymous_method_type) a new type that
2043         represents an anonyous method.  This is always an internal type,
2044         used as a fencepost to test against the anonymous-methodness of an
2045         expression. 
2046         
2047 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2048
2049         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2050         561 report.
2051         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2052
2053 2004-11-10  Martin Baulig  <martin@ximian.com>
2054
2055         * expression.cs (Invocation.BetterFunction): If two methods have
2056         equal parameter types, but only one of them is generic, the
2057         non-generic one wins.
2058         (New.DoResolve): Don't set `is_struct' to false if we're a generic
2059         instance; just use `Type.IsValueType' to determine whether
2060         something is a struct or not.
2061         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
2062         so we can be called multiple times.
2063
2064 2004-11-10  Martin Baulig  <martin@ximian.com>
2065
2066         * generic.cs (TypeParameter.DefineConstraints): New public method.
2067         (TypeParameter.CheckAccessLevel): Override this and return true.
2068         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
2069         override ResolveType() anymore.
2070         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
2071
2072 2004-11-10  Martin Baulig  <martin@ximian.com>
2073
2074         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
2075         call DeclSpace.ResolveNestedType() on it.
2076
2077 2004-11-10  Martin Baulig  <martin@ximian.com>
2078
2079         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
2080         non-null, call ParameterModifier() on it.
2081
2082 2004-11-10  Martin Baulig  <martin@ximian.com>
2083
2084         * iterators.cs
2085         (Iterators): Added `current_type' and `this_type' fields.
2086         (Iterators.DefineIterator): Create a new EmitContext and store it
2087         in `ec'; compute `this_type'.
2088
2089 2004-11-10  Martin Baulig  <martin@ximian.com>
2090
2091         * typemanager.cs
2092         (TypeManager.IsPrivateAccessible): New public method.
2093         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
2094
2095 2004-11-10  Martin Baulig  <martin@ximian.com>
2096
2097         * class.cs (TypeContainer.DefineType): Call
2098         TypeBuilder.DefineGenericParameters() before resolving the type
2099         parameters.
2100         (MethodData.parent_method): New protected field.
2101         (MethodData..ctor): Added `MethodInfo parent_method' argument.
2102         (MethodData.Define): Compute `parent_method'.
2103
2104         * decl.cs
2105         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2106         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2107         (DeclSpace.ec): New protected field; store the EmitContext here.
2108         (DeclSpace.EmitContext): New public property.
2109         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
2110         (DeclSpace.ResolveNestedType): New public method.
2111         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
2112         (DeclSpace.NestedAccessible): Added `Type tb' argument.
2113         (DeclSpace.FamilyAccessible): Likewise.
2114         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
2115         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2116         EmitContext.
2117
2118         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
2119         field.
2120
2121         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2122         (Enum.Emit): Don't create a new EmitContext.
2123
2124 2004-10-18  Martin Baulig  <martin@ximian.com>
2125
2126         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2127         `Type' directly, but call ResolveType() on it.
2128         (Catch.Resolve): Likewise.
2129         (Foreach.Resolve): Likewise.
2130
2131 2004-10-18  Martin Baulig  <martin@ximian.com>
2132
2133         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2134         `Type' directly, but call ResolveType() on it.
2135         (Probe.DoResolve): Likewise.
2136         (ArrayCreation.LookupType): Likewise.
2137         (TypeOf.DoResolve): Likewise.
2138         (SizeOf.DoResolve): Likewise.
2139
2140 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2141
2142         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2143         the ResolveType.
2144
2145 2004-10-17  John Luke  <john.luke@gmail.com>
2146
2147         * class.cs (Operator.GetSignatureForError): use CSharpName
2148
2149         * parameter.cs (Parameter.GetSignatureForError): Returns
2150         correct name even if was not defined.
2151
2152 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2153
2154         Fix #65816.
2155         * class.cs (TypeContainer.EmitContext): New property.
2156         (DefineNestedTypes): Create an emitcontext for each part.
2157         (MethodCore.DoDefineParameters): Use container's emitcontext.
2158         Pass type array to InternalParameters.
2159         (MemberBase.DoDefine): Use container's emitcontext.
2160         (FieldMember.Define): Likewise.
2161         (Event.Define): Likewise.
2162         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2163         Pass type array to InternalParameters.
2164         (SetIndexerMethod.GetParameterInfo): Likewise.
2165         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2166         * delegate.cs (Define): Pass emitcontext to
2167         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2168         array to InternalParameters.
2169         * expression.cs (ParameterReference.DoResolveBase): Pass
2170         emitcontext to GetParameterInfo.
2171         (ComposedCast.DoResolveAsTypeStep): Remove check on
2172         ec.ResolvingTypeTree.
2173         * parameter.cs (Parameter.Resolve): Change argument to
2174         EmitContext.  Use ResolveAsTypeTerminal.
2175         (Parameter.GetSignature): Change argument to EmitContext.
2176         (Parameters.ComputeSignature): Likewise.
2177         (Parameters.ComputeParameterTypes): Likewise.
2178         (Parameters.GetParameterInfo): Likewise.
2179         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2180         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2181         * support.cs (InternalParameters..ctor): Remove variant that takes
2182         a DeclSpace.
2183         * typemanager.cs (system_intptr_expr): New.
2184         (InitExpressionTypes): Initialize it.
2185
2186 2004-10-12  Chris Toshok  <toshok@ximian.com>
2187
2188         * cs-parser.jay: fix location for try_statement and catch_clause.
2189
2190 2004-10-18  Martin Baulig  <martin@ximian.com>
2191
2192         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2193         `Type' directly, but call ResolveType() on it.
2194         (MemberBase.DoDefine): Likewise.
2195
2196         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2197         `Type' directly, but call ResolveType() on it.
2198         (ComposedCast.DoResolveAsTypeStep): Likewise.
2199
2200         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2201         `Type' directly, but call ResolveType() on it.
2202
2203 2004-10-17  John Luke  <john.luke@gmail.com>
2204
2205         * class.cs (Operator.GetSignatureForError): use CSharpName
2206
2207         * parameter.cs (Parameter.GetSignatureForError): Returns
2208         correct name even if was not defined.
2209
2210 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2211
2212         Fix #65816.
2213         * class.cs (TypeContainer.EmitContext): New property.
2214         (DefineNestedTypes): Create an emitcontext for each part.
2215         (MethodCore.DoDefineParameters): Use container's emitcontext.
2216         Pass type array to InternalParameters.
2217         (MemberBase.DoDefine): Use container's emitcontext.
2218         (FieldMember.Define): Likewise.
2219         (Event.Define): Likewise.
2220         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2221         Pass type array to InternalParameters.
2222         (SetIndexerMethod.GetParameterInfo): Likewise.
2223         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2224         * delegate.cs (Define): Pass emitcontext to
2225         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2226         array to InternalParameters.
2227         * expression.cs (ParameterReference.DoResolveBase): Pass
2228         emitcontext to GetParameterInfo.
2229         (ComposedCast.DoResolveAsTypeStep): Remove check on
2230         ec.ResolvingTypeTree.
2231         * parameter.cs (Parameter.Resolve): Change argument to
2232         EmitContext.  Use ResolveAsTypeTerminal.
2233         (Parameter.GetSignature): Change argument to EmitContext.
2234         (Parameters.ComputeSignature): Likewise.
2235         (Parameters.ComputeParameterTypes): Likewise.
2236         (Parameters.GetParameterInfo): Likewise.
2237         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2238         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2239         * support.cs (InternalParameters..ctor): Remove variant that takes
2240         a DeclSpace.
2241         * typemanager.cs (system_intptr_expr): New.
2242         (InitExpressionTypes): Initialize it.
2243
2244 2004-10-12  Chris Toshok  <toshok@ximian.com>
2245
2246         * cs-parser.jay: fix location for try_statement and catch_clause.
2247
2248 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2249
2250         More DeclSpace.ResolveType avoidance.
2251         * decl.cs (MemberCore.InUnsafe): New property.
2252         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2253         with newly created EmitContext.
2254         (FieldMember.Define): Likewise.
2255         * delegate.cs (Delegate.Define): Likewise.
2256         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2257         only if normal name-lookup fails.
2258         (TypeExpr.DoResolve): Enable error-checking.
2259         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2260         (SizeOf.DoResolve): Likewise.
2261         (ComposedCast.DoResolveAsTypeStep): Likewise.
2262         (StackAlloc.DoResolve): Likewise.
2263         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2264         (Block.Unsafe): New property.
2265         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2266         (Unsafe): Set 'unsafe' flag of contained block.
2267         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2268         (Fixed.Resolve): Likewise.
2269         (Catch.Resolve): Likewise.
2270         (Using.ResolveLocalVariableDecls): Likewise.
2271         (Foreach.Resolve): Likewise.
2272
2273 2004-10-05  John Luke <john.luke@gmail.com>
2274
2275         * cs-parser.jay: add location to error CS0175
2276
2277 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2278
2279         * ecore.cs (Expression.Constantity): Add support for turning null
2280         into a constant.
2281
2282         * const.cs (Const.Define): Allow constants to be reference types
2283         as long as the value is Null.
2284
2285 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2286
2287         * namespace.cs (NamespaceEntry.Using): No matter which warning
2288         level is set, check if this namespace name has already been added.
2289
2290 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2291
2292         * expression.cs: reftype [!=]= null should always use br[true,false].
2293         # 67410
2294
2295 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2296
2297         Fix #67108
2298         * attribute.cs: Enum conversion moved to 
2299         GetAttributeArgumentExpression to be applied to the all
2300         expressions.
2301
2302 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2303
2304         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2305         * class.c (TypeContainer.DefineType): Flag error if
2306         base types aren't accessible due to access permissions.
2307         * decl.cs (DeclSpace.ResolveType): Move logic to
2308         Expression.ResolveAsTypeTerminal.
2309         (DeclSpace.ResolveTypeExpr): Thin layer over
2310         Expression.ResolveAsTypeTerminal.
2311         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2312         Refactor code into NestedAccess.  Use it.
2313         (DeclSpace.NestedAccess): New.
2314         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2315         argument to silence errors.  Check access permissions.
2316         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2317         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2318         (Cast.DoResolve): Likewise.
2319         (New.DoResolve): Likewise.
2320         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2321         (TypeOf.DoResolve): Likewise.
2322
2323         * expression.cs (Invocation.BetterConversion): Return the Type of
2324         the better conversion.  Implement section 14.4.2.3 more faithfully.
2325         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2326         section 14.4.2.2 explicit.
2327         (Invocation.OverloadResolve): Update.
2328         (Invocation): Remove is_base field.
2329         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2330         (Invocation.Emit): Likewise.
2331
2332 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2333
2334         * cs-parser.jay: Reverted 642 warning fix.
2335
2336 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2337
2338         Fix bug #66615
2339         * decl.cs (FindMemberWithSameName): Indexer can have more than
2340         1 argument.
2341
2342 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2343
2344         * expression.cs (LocalVariableReference.DoResolveLValue):
2345         Do not report warning 219 for out values.
2346         (EmptyExpression.Null): New member to avoid extra allocations.
2347
2348 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2349
2350         * cs-parser.jay: Fix wrong warning 642 report.
2351
2352         * cs-tokenizer.cs (CheckNextToken): New helper;
2353         Inspect next character if is same as expected.
2354
2355 2004-09-23  Martin Baulig  <martin@ximian.com>
2356
2357         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2358         (Convert.ImplicitReferenceConversionExists): Likewise.
2359
2360 2004-11-09  Raja R Harinath  <rharinath@novell.com>
2361
2362         * Makefile (DISTFILES): Comment out a few missing files.
2363
2364 2004-10-29  Raja R Harinath  <rharinath@novell.com>
2365
2366         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
2367         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
2368         (gmcs.exe): Invoke bootstrap-libs.
2369         (clean-local): Clean the net_2_0_bootstrap profile too.
2370         (PROGRAM_INSTALL_DIR): New.
2371         (install-local): Use it.
2372
2373 2004-10-13  Martin Baulig  <martin@ximian.com>
2374
2375         * generic.cs (TypeManager.InflatedConstraints): New nested class.
2376         (TypeParameter.DefineType): If we're a method type parameter and
2377         that method is overriding something, "inflate" its constraints.
2378
2379 2004-10-12  Martin Baulig  <martin@ximian.com>
2380
2381         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
2382         and have type arguments, create and resolve a ConstructedType.
2383
2384 2004-10-12  Martin Baulig  <martin@ximian.com>
2385
2386         * decl.cs (MemberCache.FindMemberToOverride): Use
2387         TypeManager.IsEqual() to compare the parameters and Type.Equals()
2388         to compare the invocationType.
2389
2390         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
2391         When comparing two type parameters, only do the signature-only
2392         comparision for method type parameters.
2393
2394 2004-10-11  Martin Baulig  <martin@ximian.com>
2395
2396         * report.cs: Don't make --fatal abort on warnings, we have
2397         -warnaserror for that.
2398
2399 2004-10-11  Martin Baulig  <martin@ximian.com>
2400
2401         * typemanager.cs
2402         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
2403         (TypeManager.IsEqual): Call ourself recursively instead of using
2404         Type.IsEqual(). 
2405
2406 2004-10-11  Martin Baulig  <martin@ximian.com>
2407
2408         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2409         on our own type parameters, not on the ones we inherit from a containing
2410         class.
2411
2412         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2413         the comparision.
2414
2415         * generic.cs (TypeParameter.Define): We may only be called once.
2416
2417         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2418         instead of TypeManager.IsEqual().
2419
2420 2004-09-28  Martin Baulig  <martin@ximian.com>
2421
2422         * generic.cs
2423         (GenericConstraints.EffectiveBaseClass): New public property.
2424         (TypeParameter.GenericConstraints): New public property.
2425         (ConstructedType.CheckConstraints): Improved.
2426
2427         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2428         (Convert.TypeParameterConversion): New private method; use this in
2429         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2430         for all conversions related to type parameters.
2431
2432 2004-09-24  Martin Baulig  <martin@ximian.com>
2433
2434         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2435         type parameter conversions for type parameters which are known to
2436         be reference types.
2437
2438 2004-09-24  Martin Baulig  <martin@ximian.com>
2439
2440         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2441         `IsValueType' properties.
2442
2443         * support.cs (ReflectionConstraints): Use
2444         Type.GetGenericParameterConstraints() instead of the old hack.
2445
2446 2004-09-24  Martin Baulig  <martin@ximian.com>
2447
2448         * generic.cs (GenericConstraints): Moved here and made it an
2449         abstract class.
2450
2451         * support.cs (GenericConstraints): Moved to generic.cs.
2452
2453 2004-09-24  Martin Baulig  <martin@ximian.com>
2454
2455         * support.cs
2456         (ReflectionConstraints): Un-nested this class and made it public.
2457
2458         * typemanager.cs
2459         (TypeManager.GetTypeParameterConstraints): New public method.
2460         (TypeManager.HasConstructorConstraint): Use the attributes.
2461
2462 2004-09-24  Martin Baulig  <martin@ximian.com>
2463
2464         * support.cs (GenericConstraints): Replaced `HasConstructor',
2465         `IsReferenceType' and `IsValueType' with `Attributes'.
2466         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2467         method and made the .ctor public.
2468
2469         * generic.cs (Constraints.Attributes): New public property.
2470         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2471         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2472         `IsValueType' -> `HasValueTypeConstraint'.
2473
2474 2004-09-23  Martin Baulig  <martin@ximian.com>
2475
2476         * generic.cs (Constraints): Reflect latest runtime changes.
2477
2478 2004-09-23  Martin Baulig  <martin@ximian.com>
2479
2480         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2481         (Convert.ImplicitReferenceConversionExists): Likewise.
2482
2483 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2484
2485         * class.cs (Operator.Define): Add error 448 and 559 report.
2486         
2487 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2488
2489         * class.cs (MemberBase.IsTypePermitted): New protected
2490         method for checking error CS0610.
2491
2492 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2493
2494         * class.cs (TypeContainer.HasExplicitLayout): New property
2495         Returns whether container has StructLayout attribute set Explicit.
2496         (FieldMember): New abstract class for consts and fields.
2497         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2498         (Field): Reuse FieldMember.
2499
2500         * const.cs (Const): Reuse FieldMember.
2501
2502         * rootcontext.cs: EmitConstants call moved to class.
2503
2504 2004-09-22  Martin Baulig  <martin@ximian.com>
2505
2506         Marek and me just fixed one of our oldest bugs: #28562 :-)
2507
2508         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2509
2510         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2511         we're an EnumConstant, just return that.
2512         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2513         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2514         to get the value which'll actually be written into the attribute.
2515         However, we have to use GetValue() to access the attribute's value
2516         in the compiler.        
2517
2518 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2519
2520         * constant.cs (Constant.IsNegative): New abstract property
2521         IsNegative.
2522
2523         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2524         (StackAlloc.DoResolve): Reused IsNegative.
2525
2526 2004-09-22  Martin Baulig  <martin@ximian.com>
2527
2528         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2529         public method; like LookupTypeContainer, but also works for
2530         generic instances.
2531
2532         * report.cs (Report.SymbolRelatedToPreviousError): Use
2533         TypeManager.LookupGenericTypeContainer().       
2534
2535 2004-09-22  Martin Baulig  <martin@ximian.com>
2536
2537         Thanks to Peter Sestoft for this bug report.
2538
2539         * expression.cs (Conditional): If both the `trueExpr' and the
2540         `falseExpr' is a NullLiteral, return a NullLiteral.
2541
2542 2004-09-22  Martin Baulig  <martin@ximian.com>
2543
2544         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2545         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2546         for the "get_Current" call.
2547
2548 2004-09-21  Martin Baulig  <martin@ximian.com>
2549
2550         * convert.cs (Convert.ImplicitReferenceConversion): When
2551         converting to an interface type, first check whether we're
2552         converting from a reference type.
2553
2554 2004-09-14  Martin Baulig  <martin@ximian.com>
2555
2556         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2557
2558 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2559
2560         Fixed bug #61902
2561         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2562         called and is obsolete then this member suppress message
2563         when call is inside next [Obsolete] method or type.
2564
2565         * expression.cs: Use TestObsoleteMethodUsage member.
2566
2567 2004-09-14  Martin Baulig  <martin@ximian.com>
2568
2569         * genericparser.cs: Removed.
2570
2571 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2572
2573         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2574
2575 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2576
2577         * attribute.cs (Attribute.Resolve): Add error 653 report.
2578
2579         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2580         report.
2581         (Method.ApplyAttributeBuilder): Add error 685 report.
2582         (Operator.Define): Add error 564 report.
2583
2584         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2585
2586         * expression.cs (Invocation.DoResolve): Add error
2587         245 and 250 report.
2588
2589         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2590         error 674 report.
2591
2592 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2593
2594         * class.cs (ConstructorInitializer.Resolve):
2595         Wrong error number (515->516).
2596
2597 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2598
2599         * class.cs (Indexer.Define): Add error 631 report.
2600
2601 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2602
2603         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2604
2605 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2606
2607         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2608
2609 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2610
2611         * cs-parser.jay: Added error CS0241 report.
2612
2613 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2614
2615         * cs-parser.jay (fixed_statement): Introduce a scope for the
2616         declaration in the 'fixed' statement.
2617
2618 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2619
2620         * cs-parser.jay: Added CS0230 error report.
2621
2622 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2623
2624         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2625
2626 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2627
2628         * expression.cs (Argument.Resolve): Added error CS0192 and
2629         CS0199 report.
2630
2631 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2632
2633         C# 2.0 #pragma warning feature
2634
2635         * cs-tokenizer.cs (PreProcessPragma): New method; 
2636         Handles #pragma directive.
2637
2638         * report.cs (WarningRegions): New class; Support
2639         class for #pragma warning directive. It tests whether
2640         warning is enabled for a given line.
2641
2642 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2643
2644         * const.cs: Add more descriptive error report, tahnks to
2645         Sebastien. 
2646
2647 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2648
2649         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2650
2651 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2652
2653         * expression.cs: Apply patch from Ben: Remove dead code from
2654         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2655         as that code just threw an exception anwyays.
2656
2657         * const.cs: Remove the call to the turnintoconstant, for details
2658         see bug: #63144
2659         
2660         * literal.cs: The type of the null-literal is the null type;  So
2661         we use a placeholder type (literal.cs:System.Null, defined here)
2662         for it.
2663
2664         * expression.cs (Conditional.DoResolve): Remove some old code that
2665         is no longer needed, conversions have been fixed.
2666
2667         (ArrayCreationExpression.DoResolve): Return false if we fail to
2668         resolve the inner expression.
2669
2670 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2671
2672         Fix test-290.cs.
2673         * cs-parser.jay (delegate_declaration): Record a delegate
2674         declaration as a type declaration.
2675         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2676
2677 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2678
2679         * parameter.cs: Do not crash if the type can not be resolved. 
2680
2681         * expression.cs: Report errors with unsafe pointers, fixes #64896
2682
2683 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2684
2685         * expression.cs: Pointer arith always needs to do a conv.i
2686         if the operand is a long. fix 65320
2687
2688 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2689
2690         Fixed cs0619-37.cs, cs0619-38.cs
2691
2692         * enum.cs (GetObsoleteAttribute): Removed.
2693
2694         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2695         on Enum member is double staged. The first is tested member
2696         and then enum.
2697
2698 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2699
2700         Fixed #56986, #63631, #65231
2701
2702         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2703         adds member to name container.
2704         (TypeContainer.AddToTypeContainer): New method, adds type to
2705         name container.
2706         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2707         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2708         AddOperator): Simplified by reusing AddToMemberContainer.
2709         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2710         instead of field.
2711         (Method.CheckForDuplications): Fixed implementation to test all
2712         possibilities.
2713         (MemberBase): Detection whether member is explicit interface
2714         implementation is now in constructor.
2715         (MemberBase.UpdateMemberName): Handles IndexerName.
2716         (Accessor): Changed to keep also location information.
2717         (AbstractPropertyEventMethod): Is derived from MemberCore.
2718         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2719         will be emited or not.
2720         (PropertyBase.AreAccessorsDuplicateImplementation):
2721         Tests whether accessors are not in collision with some method.
2722         (Operator): Is derived from MethodCore to simplify common
2723         operations.
2724
2725         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2726         must be performed.
2727         (DeclSpace.AddToContainer): Adds the member to defined_names
2728         table. It tests for duplications and enclosing name conflicts.
2729
2730         * enum.cs (EnumMember): Clean up to reuse the base structures
2731
2732 2004-09-03  Martin Baulig  <martin@ximian.com>
2733
2734         Merged latest changes into gmcs.  Please keep this comment in
2735         here, it makes it easier for me to see what changed in MCS since
2736         the last time I merged.
2737
2738 2004-09-03  Martin Baulig  <martin@ximian.com>
2739
2740         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2741         into TypeContainer, to make partial classes work again.
2742
2743 2004-09-03  Martin Baulig  <martin@ximian.com>
2744
2745         * rootcontext.cs (RootContext.V2): Removed.
2746
2747 2004-03-23  Martin Baulig  <martin@ximian.com>
2748
2749         * expression.cs (Invocation.OverloadResolve): Added `bool
2750         may_fail' argument and use it instead of the Location.IsNull() hack.
2751
2752 2004-09-09  Martin Baulig  <martin@ximian.com>
2753
2754         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2755
2756 2004-09-09  Martin Baulig  <martin@ximian.com>
2757
2758         * generic.cs (TypeParameter.DefineType): Added support for
2759         explicit interface methods.
2760
2761 2004-09-09  Martin Baulig  <martin@ximian.com>
2762
2763         * README.Changes: New document.  Started to list important changes
2764         between MCS and GMCS here.
2765
2766 2004-09-08  Martin Baulig  <martin@ximian.com>
2767
2768         * class.cs
2769         (TypeContainer.CheckRecursiveDefinition): New protected method.
2770         (TypeContainer.DefineType): Move the CS0146 check into
2771         CheckRecursiveDefinition().     
2772
2773 2004-09-06  Martin Baulig  <martin@ximian.com>
2774
2775         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2776         types for the constructor constraint.
2777
2778 2004-09-03  Martin Baulig  <martin@ximian.com>
2779
2780         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2781         into TypeContainer, to make partial classes work again.
2782
2783 2004-09-03  Martin Baulig  <martin@ximian.com>
2784
2785         * rootcontext.cs (RootContext.V2): Removed.
2786
2787 2004-03-23  Martin Baulig  <martin@ximian.com>
2788
2789         * expression.cs (Invocation.OverloadResolve): Added `bool
2790         may_fail' argument and use it instead of the Location.IsNull() hack.
2791
2792 2004-09-03  Martin Baulig  <martin@ximian.com>
2793
2794         Merged latest changes into gmcs.  Please keep this comment in
2795         here, it makes it easier for me to see what changed in MCS since
2796         the last time I merged.
2797
2798 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2799
2800         Fix #61128.
2801         * expression.cs (BetterConversion): Don't allow either conversion 
2802         to be null.  Remove redundant implicit conversion test when 'q ==
2803         null' -- when this function is invoked, we already know that the
2804         implicit conversion exists.
2805         (BetterFunction): Assume that 'best' is non-null.  Remove
2806         redundant reimplementation of IsApplicable when 'best' is null.
2807         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2808         number of arguments.
2809         (IsAncestralType): Extract from OverloadResolve.
2810         (OverloadResolve): Make robust to the MethodGroupExpr being
2811         unsorted.  Implement all the logic of Section 14.5.5.1, and
2812         support overloading of methods from multiple applicable types.
2813         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
2814
2815         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2816         (RealError, Warning): Append type of report to related symbol.
2817
2818 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
2819
2820         * enum.cs: Fixed CLS-Compliance checks for enum members.
2821         Error tests cs3008-8.cs, cs3014-8.cs
2822
2823 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2824
2825         Fixed bug #62342, #63102
2826         * class.cs: ImplementIndexer uses member.IsExplicitImpl
2827         like ImplementMethod.
2828
2829 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2830
2831         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2832         Fixed bug #65170.
2833
2834 2004-09-02  Martin Baulig  <martin@ximian.com>
2835
2836         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2837         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2838         on the MethodBase.
2839
2840 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
2841
2842         C# 2.0 Static classes implemented
2843
2844         * class.cs (TypeContainer): instance_constructors,
2845         initialized_fields, initialized_static_fields,
2846         default_constructor, base_inteface_types are protected to be
2847         accessible from StaticClass.
2848         (TypeContainer.DefineDefaultConstructor): New virtual method
2849         for custom default constructor generating
2850         (StaticClass): New class to handle "Static classes" feature.
2851
2852         * cs-parser.jay: Handle static keyword on class like instance
2853         of StaticClass.
2854
2855         * driver.cs: Added "/langversion" command line switch with two
2856         options (iso-1, default).
2857
2858 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
2859
2860         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
2861
2862 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
2863
2864         * delegate.cs: Style.
2865
2866 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2867
2868         * delegate.cs: Add seperate instance expr field for miguel.
2869
2870 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2871
2872         * PointerArithmetic (Resolve): make sure we are not doing
2873         pointer arith on void*. Also, make sure we are resolved
2874         by not setting eclass until resolve.
2875
2876         All callers: Make sure that PointerArithmetic gets resolved.
2877
2878 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2879
2880         * ArrayCreation (LookupType): If the type does not resolve 
2881         to an array, give an error.
2882
2883 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
2884
2885         * statement.cs (Try.Resolve): Fixed bug #64222
2886
2887 2004-08-27  Martin Baulig  <martin@ximian.com>
2888
2889         * class.cs
2890         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
2891         crash here.     
2892
2893 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
2894
2895         * ecore.cs (Constantify): Get underlying type via
2896         System.Enum.GetUnderlyingType to avoid StackOverflow on the
2897         Windows in special cases.
2898
2899 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
2900
2901         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
2902         for obtaining also private methods.
2903         (GetRemoveMethod): Used GetRemoveMethod (true)
2904         for obtaining also private methods.
2905
2906 2004-09-02  Martin Baulig  <martin@ximian.com>
2907
2908         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2909         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2910         on the MethodBase.
2911
2912 2004-08-27  Martin Baulig  <martin@ximian.com>
2913
2914         * class.cs
2915         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
2916         crash here.     
2917
2918 2004-08-25  Martin Baulig  <martin@ximian.com>
2919
2920         * support.cs (ReflectionParameters..ctor): If this is a generic
2921         method, retrieve and store its type parameters.
2922         (InternalParameters..ctor): Added `TypeParameter[]' argument.
2923         (ReflectionParameters.GenericConstraints): The argument specifies
2924         the type parameter, not the method parameter.
2925         (InternalParameters.GenericConstraints): Likewise.
2926
2927         * generic.cs (TypeParameter.DefineType): Correctly handle
2928         constraints wrt. generic methods in interfaces and their
2929         implementations.        
2930
2931 2004-08-24  Martin Baulig  <martin@ximian.com>
2932
2933         * generic.cs (TypeParameter.IsSubclassOf): New public method.
2934         (Constraints.IsSubclassOf): New internal method.
2935
2936         * typemanager.cs (TypeManager.FindMembers): Added special support
2937         for GenericTypeParameterBuilder's.      
2938         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
2939         type parameters.
2940
2941 2004-08-24  Martin Baulig  <martin@ximian.com>
2942
2943         * typemanager.cs
2944         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
2945         this for accessibility checks.
2946         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
2947         IsNestedFamilyAccessible.
2948         (TypeManager.IsSubclassOf): New method, do what the name actually
2949         says.   
2950
2951 2004-08-24  Martin Baulig  <martin@ximian.com>
2952
2953         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
2954         as a SimpleName, include the generic arity.
2955
2956 2004-08-24  Martin Baulig  <martin@ximian.com>
2957
2958         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
2959         MethodAttributes.HideBySig for operators.
2960
2961 2004-08-23  Martin Baulig  <martin@ximian.com>
2962
2963         Back to the old error reporting system :-)
2964
2965         * report.cs (Message): Removed.
2966         (Report.MessageData, ErrorData, WarningData): Removed.
2967         (Report.Error, Warning): Back to the old system.
2968
2969 2004-08-23  Martin Baulig  <martin@ximian.com>
2970
2971         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
2972
2973         * class.cs (TypeContainer.ParentContainer): New public virtual
2974         method; replaces the explicit interface implementation.
2975         (ClassPart.ParentContainer): Override.
2976
2977 2004-08-23  Martin Baulig  <martin@ximian.com>
2978
2979         * statement.cs (Switch): Added support for constant switches; see
2980         #59428 or test-285.cs.
2981
2982 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
2983
2984         Fixed bug #62740.
2985         * statement.cs (GetEnumeratorFilter): Removed useless
2986         logic because C# specs is strict. GetEnumerator must be
2987         public.
2988
2989 2004-08-22  Martin Baulig  <martin@ximian.com>
2990
2991         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2992         a switch and may break, reset the barrier.  Fixes #59867.
2993
2994 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
2995
2996         CLS-Compliance speed up (~5% for corlib)
2997
2998         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
2999         New method. Tests container for CLS-Compliant names
3000
3001         * class.cs (TypeContainer.VerifyClsName): New method.
3002         Checks whether container name is CLS Compliant.
3003         (Constructor): Implements IMethodData.
3004
3005         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3006         low-case table for CLS Compliance test.
3007         (MemberCache.VerifyClsParameterConflict): New method.
3008         Checks method parameters for CS3006 error.
3009
3010         * enum.cs (EnumMember): Is derived from MemberCore.
3011         (Enum.VerifyClsName): Optimized for better performance.
3012
3013 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3014
3015         * report.cs: Renamed Error_T to Error and changed all
3016         references.
3017
3018 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3019
3020         * class.cs (TypeContainer.IndexerArrayList): New inner class
3021         container for indexers.
3022         (TypeContainer.DefaultIndexerName): New constant for default
3023         indexer name. Replaced all "Item" with this constant.
3024         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3025
3026         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3027         DefaultMemberAttribute constructor.
3028
3029 2004-08-05  Martin Baulig  <martin@ximian.com>
3030
3031         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3032         Fix bug #59429.
3033
3034 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3035
3036         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3037         multi platforms problem.
3038
3039         * compiler.csproj: Included shared files.
3040
3041 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3042
3043         Fix bug 60333, 55971 in the more general way
3044         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3045         Added arg_type argument for constant conversion.
3046         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3047
3048 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3049
3050         Fix bug #59760
3051         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3052         OperatorArrayList, MethodCoreArrayList for typecontainer
3053         containers. Changed class member types to these new types.
3054         (MethodArrayList.DefineMembers): Added test for CS0659.
3055
3056 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3057
3058         * cfold.cs: Synchronize the folding with the code in expression.cs
3059         Binary.DoNumericPromotions for uint operands.
3060
3061         * attribute.cs: Revert patch from Raja, it introduced a regression
3062         while building Blam-1.2.1 (hard to isolate a test case).
3063
3064 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3065
3066         Fix for #55382
3067         * class.cs:
3068         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3069         name collision.
3070         (MethodCore.parent_method): New member. The method we're overriding
3071         if this is an override method.
3072         (MethodCore.CheckBase): Moved from Method class and made common.
3073         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3074         private.
3075         (MethodCore.CheckForDuplications): New abstract method. For custom
3076         member duplication search in a container
3077         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3078         method and its return type.
3079         (Event.conflict_symbol): New member. Symbol with same name in the
3080         parent class.
3081
3082         * decl.cs:
3083         (MemberCache.FindMemberWithSameName): New method. The method
3084         is looking for conflict with inherited symbols.
3085
3086 2004-08-04  Martin Baulig  <martin@ximian.com>
3087
3088         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3089
3090         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3091
3092 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3093
3094         * report.cs (Message): New enum for better error, warning reference in
3095         the code.
3096         (MessageData): New inner abstract class. It generally handles printing of
3097         error and warning messages.
3098         Removed unused Error, Warning, Message methods.
3099
3100 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3101
3102         Fix for cs0592-8.cs test
3103         * attribute.cs
3104         (Attributable.ValidAttributeTargets): Made public.
3105         (Attribute.ExplicitTarget): New member for explicit target value.
3106         (Attribute.CheckTargets): Now we translate explicit attribute
3107         target to Target here.
3108
3109 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3110
3111         * ecore.cs (MethodGroupExpr): new IsBase property.
3112
3113         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3114
3115         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3116         rather than an instance expr.
3117
3118         (DelegateCreation.Emit): Use the method group rather than
3119         the instance expression. Also, if you have base.Foo as the
3120         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3121
3122         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3123
3124         (NewDelegate.DoResolve): Only check for the existance of Invoke
3125         if the method is going to be needed. Use MethodGroupExpr.
3126
3127         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3128
3129         * expression.cs: For pointer arith., make sure to use
3130         the size of the type, not the size of the pointer to
3131         the type.
3132
3133 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3134
3135         Fix for #60722
3136         * class.cs (Class): Added error CS0502 test.
3137
3138 2004-08-03  John Luke  <jluke@cfl.rr.com>
3139             Raja R Harinath  <rharinath@novell.com>
3140
3141         Fix for #60997.
3142         * attribute.cs (Attribute.complained_before): New flag.
3143         (Attribute.ResolveType, Attribute.Resolve),
3144         (Attribute.DefinePInvokeMethod): Set it.
3145         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3146         
3147 2004-08-03  Martin Baulig  <martin@ximian.com>
3148
3149         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3150         use a user-defined operator; we still need to do numeric
3151         promotions in case one argument is a builtin type and the other
3152         one has an implicit conversion to that type.  Fixes #62322.
3153
3154 2004-08-18  Martin Baulig  <martin@ximian.com>
3155
3156         * class.cs (Method.Define): Use the correct method name when
3157         creating the MethodBuilder for a generic method.
3158
3159 2004-08-17  Martin Baulig  <martin@ximian.com>
3160
3161         * generic.cs (Constraints): Support type parameter constraints.
3162
3163 2004-08-16  Martin Baulig  <martin@ximian.com>
3164
3165         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
3166         (Token.GENERIC_DIMENSION): New token; this is returned if we
3167         encounter an unbound generic type in a typeof() expression.
3168
3169         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
3170         this token is only generated while parsing a typeof() expression.
3171         (typeof_expression): Removed the old unbound_type hack.
3172
3173         * generic.cs (TypeArguments.IsUnbound): New public property.
3174
3175         * decl.cs (MemberName): Added support for unbound types.
3176
3177 2004-08-14  Martin Baulig  <martin@ximian.com>
3178
3179         * typemanager.cs
3180         (TypeManager.IsEqualGenericInstance): New static method.
3181         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
3182         just used to check accessibility, so follow the rules of 26.1.6.        
3183
3184         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
3185         ConstructedType instead of a TypeExpression if we have type arguments.
3186
3187         * cs-parser.jay (typeof_expression): Support unbound generic types.
3188
3189         * ecore.cs (UnboundTypeExpression): New public class.
3190
3191 2004-08-12  Martin Baulig  <martin@ximian.com>
3192
3193         * typemanager.cs (TypeManager.IsNestedChildOf): Use
3194         TypeManager.IsEqual() rather than `=='.
3195
3196         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
3197         generic instances as well.
3198
3199 2004-08-12  Martin Baulig  <martin@ximian.com>
3200
3201         * expression.cs (Invocation.InferType): We can only infer method
3202         type parameters.  Fixes #62647.
3203
3204 2004-08-11  Martin Baulig  <martin@ximian.com>
3205
3206         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
3207         before resolving the base classes.
3208
3209 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3210
3211         * Makefile: install .mdb file too.
3212
3213 2004-08-05  Martin Baulig  <martin@ximian.com>
3214
3215         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
3216         initializer, the current type is just the TypeBuilder, not the
3217         instantiated generic type.
3218         (FieldExpr.IsFieldInitializer): New public property.
3219
3220 2004-08-04  Martin Baulig  <martin@ximian.com>
3221
3222         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3223
3224         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3225
3226 2004-08-03  Martin Baulig  <martin@ximian.com>
3227
3228         * class.cs (MethodData.Define): If we're an explicit
3229         implementation, remove the generic arity from the type name.
3230
3231 2004-08-03  Martin Baulig  <martin@ximian.com>
3232
3233         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3234         use a user-defined operator; we still need to do numeric
3235         promotions in case one argument is a builtin type and the other
3236         one has an implicit conversion to that type.  Fixes #62322.
3237
3238 2004-08-02  Martin Baulig  <martin@ximian.com>
3239
3240         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
3241         `TypeExpr[]' array.
3242         (TypeContainer.GetClassBases): Return the unexpanded list of
3243         interfaces; we expand them later.
3244         (TypeContainer.DefineType): After creating the TypeBuilder, call
3245         TypeManager.ExpandInterfaces() to get an expanded and resolved
3246         list of interfaces.
3247
3248         * ecore.cs (TypeExpr.GetInterfaces): Removed
3249
3250         * generics.cs (Constraints.InterfaceConstraints): Remove.
3251         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
3252         register the interface constraints.
3253
3254         * typemanager.cs
3255         (TypeManager.AddUserType): Removed the `ifaces' argument.
3256         (TypeManager.AddTypeParameter): Likewise.
3257         (TypeManager.AddUserInterface): Removed, was unused.
3258         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
3259         `TypeExpr[]' array for the interfaces.
3260         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
3261         has been defined, returns a list of the resolved interfaces types.
3262         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
3263         (TypeManager.GetExplicitInterfaces): Likewise.  
3264
3265 2004-08-02  Martin Baulig  <martin@ximian.com>
3266
3267         * expression.cs (Invocation.EmitCall): If we're invoking a method
3268         on a type parameter, use the new `Constrained' prefix opcode.
3269
3270 2004-08-02  Martin Baulig  <martin@ximian.com>
3271
3272         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3273         (LocalInfo.IsThis): New public property.
3274         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3275
3276 2004-08-01  Martin Baulig  <martin@ximian.com>
3277
3278         * class.cs (TypeContainer.GetClassBases): Don't set the default
3279         here since we may get called from GetPartialBases().
3280         (TypeContainer.DefineType): If GetClassBases() didn't return a
3281         parent, use the default one.
3282
3283 2004-07-30  Martin Baulig  <martin@ximian.com>
3284
3285         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3286
3287         * class.cs (SourceMethod): New public class, derive from the
3288         symbol writer's ISourceMethod.
3289         (Method): Use the new symbol writer API.
3290
3291         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3292         as argument and use the new symbol writer.
3293
3294         * location.cs
3295         (SourceFile): Implement the symbol writer's ISourceFile.
3296         (Location.SymbolDocument): Removed.
3297         (Location.SourceFile): New public property.
3298
3299         * symbolwriter.cs: Use the new symbol writer API.
3300
3301 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3302
3303         * Makefile (install-local): Remove.  Functionality moved to
3304         executable.make.
3305
3306 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3307
3308         * Makefile: Install mcs.exe.config file together with mcs.exe.
3309         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3310         correct runtime version.
3311         
3312 2004-07-25  Martin Baulig  <martin@ximian.com>
3313
3314         * class.cs
3315         (TypeContainer.RegisterOrder): Removed, this was unused.
3316         (TypeContainer, interface_order): Removed.
3317         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3318         TypeContainer as argument since we can also be called with a
3319         `PartialContainer' for a partial class/struct/interface.
3320         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3321         of checking whether we're an `Interface' - we could be a
3322         `PartialContainer'.
3323         (PartialContainer.Register): Override; call
3324         AddClass()/AddStruct()/AddInterface() on our parent.
3325
3326         * cs-parser.jay (interface_member_declaration): Add things to the
3327         `current_container', not the `current_class'.
3328
3329         * rootcontext.cs (RegisterOrder): The overloaded version which
3330         takes an `Interface' was unused, removed.
3331
3332         * typemanager.cs (TypeManager.LookupInterface): Return a
3333         `TypeContainer', not an `Interface'.
3334         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3335         contain a `PartialContainer' for an interface, so check it's
3336         `Kind' to figure out what it is.
3337
3338 2004-07-25  Martin Baulig  <martin@ximian.com>
3339
3340         * class.cs (Class.DefaultTypeAttributes): New public constant.
3341         (Struct.DefaultTypeAttributes): Likewise.
3342         (Interface.DefaultTypeAttributes): Likewise.
3343         (PartialContainer.TypeAttr): Override this and add the
3344         DefaultTypeAttributes.
3345
3346 2004-07-25  Martin Baulig  <martin@ximian.com>
3347
3348         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3349         we can just use the `Parent' field instead.
3350
3351 2004-07-25  Martin Baulig  <martin@ximian.com>
3352
3353         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3354
3355 2004-07-25  Martin Baulig  <martin@ximian.com>
3356
3357         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3358         our parts before defining any methods.
3359         (TypeContainer.VerifyImplements): Make this virtual.
3360         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3361         on our PartialContainer.
3362
3363 2004-07-25  Martin Baulig  <martin@ximian.com>
3364
3365         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3366
3367         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3368         argument, we can just use the `Parent' field instead.
3369
3370         * class.cs
3371         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3372         (MemberBase.DoDefine): Likewise.
3373
3374 2004-07-24  Martin Baulig  <martin@ximian.com>
3375
3376         * decl.cs (MemberCore.Parent): New public field.
3377         (DeclSpace.Parent): Moved to MemberCore.
3378
3379         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3380         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3381         parent's .ctor.
3382         (FieldBase, Field, Operator): Likewise.
3383         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3384         (EventField, Event): Likewise.
3385
3386 2004-07-23  Martin Baulig  <martin@ximian.com>
3387
3388         * class.cs (PartialContainer): New public class.
3389         (ClassPart): New public class.
3390         (TypeContainer): Added support for partial classes.
3391         (TypeContainer.GetClassBases): Splitted some of the functionality
3392         out into GetNormalBases() and GetPartialBases().
3393
3394         * cs-tokenizer.cs (Token.PARTIAL): New token.
3395         (Tokenizer.consume_identifier): Added some hacks to recognize
3396         `partial', but only if it's immediately followed by `class',
3397         `struct' or `interface'.
3398
3399         * cs-parser.jay: Added support for partial clases.
3400
3401 2004-07-23  Martin Baulig  <martin@ximian.com>
3402
3403         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3404         a `DeclSpace' and also made it readonly.
3405         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3406         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3407         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3408
3409         * cs-parser.jay: Pass the `current_class', not the
3410         `current_container' (at the moment, this is still the same thing)
3411         to a new Method, Property, Event, Indexer or Constructor.
3412
3413 2004-07-23  Martin Baulig  <martin@ximian.com>
3414
3415         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3416         and removed the `current_interface' one.
3417         (struct_declaration, class_declaration, interface_declaration):
3418         Set `current_class' to the newly created class/struct/interface;
3419         set their `Bases' and call Register() before parsing their body.
3420
3421 2004-07-23  Martin Baulig  <martin@ximian.com>
3422
3423         * class.cs (Kind): New public enum.
3424         (TypeContainer): Made this class abstract.
3425         (TypeContainer.Kind): New public readonly field.
3426         (TypeContainer.CheckDef): New public method; moved here from
3427         cs-parser.jay.
3428         (TypeContainer.Register): New public abstract method.
3429         (TypeContainer.GetPendingImplementations): New public abstract
3430         method.
3431         (TypeContainer.GetClassBases): Removed the `is_class' and
3432         `is_iface' parameters.
3433         (TypeContainer.DefineNestedTypes): Formerly known as
3434         DoDefineType().
3435         (ClassOrStruct): Made this class abstract.
3436
3437         * tree.cs (RootTypes): New public type. 
3438
3439 2004-07-20  Martin Baulig  <martin@ximian.com>
3440
3441         * tree.cs (Tree.RecordNamespace): Removed.
3442         (Tree.Namespaces): Removed.
3443
3444         * rootcontext.cs (RootContext.IsNamespace): Removed.
3445
3446         * cs-parser.jay (namespace_declaration): Just create a new
3447         NamespaceEntry here.
3448
3449 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3450
3451         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3452         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3453         entry to make sure it runs in the correct runtime version.
3454         
3455 2004-07-18  Martin Baulig  <martin@ximian.com>
3456
3457         * generic.cs (ConstructedType.CheckConstraints): Improved
3458         constraints checking.
3459
3460 2004-07-18  Martin Baulig  <martin@ximian.com>
3461
3462         * expression.cs (Invocation.BetterMethod): Call
3463         TypeManager.TypeToCoreType() on all types and removed my previous
3464         hack; we're already doig the right thing here.
3465
3466 2004-07-17  Martin Baulig  <martin@ximian.com>
3467
3468         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3469
3470 2004-07-16  Martin Baulig  <martin@ximian.com>
3471
3472         * iterators.cs: Added generics support.
3473
3474 2004-07-16  Martin Baulig  <martin@ximian.com>
3475
3476         * iterators.cs: Rewrote this.  We're now using one single Proxy
3477         class for both the IEnumerable and the IEnumerator interface and
3478         `Iterator' derives from Class so we can use the high-level API.
3479
3480         * class.cs (TypeContainer.AddIterator): New method.
3481         (TypeContainer.DoDefineType): New protected virtual method, which
3482         is called from DefineType().
3483         (TypeContainer.DoDefineMembers): Call DefineType() and
3484         DefineMembers() on all our iterators.
3485         (TypeContainer.Emit): Call Emit() on all our iterators.
3486         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3487
3488         * codegen.cs (EmitContext.CurrentIterator): New public field.
3489
3490 2004-07-15  Martin Baulig  <martin@ximian.com>
3491
3492         * typemanager.cs
3493         (TypeManager.not_supported_exception_type): New type.   
3494
3495 2004-07-14  Martin Baulig  <martin@ximian.com>
3496
3497         * typemanager.cs
3498         (TypeManager.generic_ienumerable_type): New type.
3499         (TypeManager.generic_ienumerator_type): New type.
3500
3501         * rootcontext.cs
3502         (RootContext.interfaces_first_stage): Added
3503         "System.Collections.Generic.IEnumerator`1" and
3504         "System.Collections.Generic.IEnumerable`1".     
3505
3506 2004-07-14  Martin Baulig  <martin@ximian.com>
3507
3508         * iterators.cs: Use real error numbers.
3509
3510 2004-07-14  Martin Baulig  <martin@ximian.com>
3511
3512         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3513         requires this to be a System.Collection.IEnumerable and not a
3514         class implementing that interface.
3515         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3516
3517 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3518
3519         * class.cs: Fixed previous fix, it broke some error tests.
3520
3521 2004-07-12  Martin Baulig  <martin@ximian.com>
3522
3523         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3524         Fixes #61293.
3525
3526 2004-07-14  Martin Baulig  <martin@ximian.com>
3527
3528         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3529         an exclamation mark (!) for the generic arity to reflect the
3530         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3531
3532 2004-07-13  Martin Baulig  <martin@ximian.com>
3533
3534         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3535         specifiers being part of a type argument.
3536
3537 2004-07-13  Martin Baulig  <martin@ximian.com>
3538
3539         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3540         name for generic types.
3541
3542 2004-07-13  Martin Baulig  <martin@ximian.com>
3543
3544         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3545         bit to fix #60119.
3546
3547 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3548
3549         * assign.cs (LocalTemporary): Add new argument: is_address,If
3550         `is_address' is true, then the value that we store is the address
3551         to the real value, and not the value itself.
3552         
3553         * ecore.cs (PropertyExpr): use the new local temporary
3554         stuff to allow us to handle X.Y += z (where X is a struct)
3555
3556 2004-07-08  Martin Baulig  <martin@ximian.com>
3557
3558         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3559         not always return, just like we're doing in Using.Resolve().
3560
3561 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3562
3563         * cs-parser.jay (fixed_statement): flag this as Pinned.
3564
3565 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3566
3567         * typemanager.cs (TypeManager): Removed MakePinned method, this
3568         mechanism is replaced with the .NET 2.x compatible mechanism of
3569         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3570
3571         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3572         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3573         `IsFixed' property which has a different meaning.
3574
3575 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3576
3577         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3578         visible from inside a nested class, not just the names of the
3579         immediately enclosing class.
3580         Fix for bug #60730.
3581
3582 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3583
3584         * expression.cs (BetterConversion): Remove buggy special-case
3585         handling of "implicit constant expression conversions".  At this
3586         point, we already know that the conversion is possible -- we're
3587         only checking to see which is better.
3588
3589 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3590
3591         * cs-parser.jay: Added error CS0210 test.
3592
3593 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3594
3595         * cs-parser.jay: Added error CS0134 test.
3596
3597 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3598
3599         Fix bug #52507
3600         * cs-parser.jay: Added error CS0145 test.
3601
3602 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3603
3604         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3605
3606 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3607         
3608         * expression.cs (StackAlloc.Resolve): The argument may not
3609         be a constant; deal with this case.
3610         
3611 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3612
3613         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3614         GetIndexerAttributeValue.
3615         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3616
3617         * class.cs (Indexer.Define): Added error tests for CS0415,
3618         CS0609.
3619
3620 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3621
3622         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3623         property code.
3624
3625 2004-06-23  Martin Baulig  <martin@ximian.com>
3626
3627         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3628         neither return nor throw, reset the barrier as well.  Fixes #60457.
3629
3630 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3631
3632         * class.cs : EventAttributes is now set to None by default.
3633           This fixes bug #60459.
3634
3635 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3636
3637         Fix bug #60219
3638         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3639         Don't throw exception but return null (it's sufficient now).
3640
3641 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3642
3643         * typemanager.cs (GetArgumentTypes): Faster implementation.
3644
3645 2004-06-18  Martin Baulig  <martin@ximian.com>
3646
3647         * attribute.cs (Attribute.Resolve): Check whether we're an
3648         EmptyCast which a Constant child.  Fixes #60333.
3649
3650 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3651
3652         * statement.cs (EmitCollectionForeach): Account for the fact that
3653         not all valuetypes are in areas which we can take the address of.
3654         For these variables, we store to a temporary variable. Also, make
3655         sure that we dont emit a `callvirt' on a valuetype method.
3656
3657 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3658
3659         * expression.cs (StackAlloc.DoReSolve): Added test for
3660         negative parameter (CS0247).
3661
3662 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3663
3664         Fix bug #59792
3665         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3666
3667 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3668
3669         Fix bug #59781
3670         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3671         ulong.
3672
3673 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3674
3675         Fix bug #58254 & cs1555.cs, cs1556.cs
3676         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3677
3678 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3679
3680         * cs-parser.jay: Added error CS1669 test for indexers.
3681
3682 2004-06-18  Martin Baulig  <martin@ximian.com>
3683
3684         * generics.cs (GenericMethod.ctor): Don't take an Attributes
3685         argument.  Fixes #60441.
3686
3687 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
3688         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3689         The name needs to have the actual name of the method in order
3690         for other tests (such as the one in OverloadResolve for Invoke
3691         on a delegate) to work. As well, it does not really help
3692         error reporting because the method group had multiple methods.
3693         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3694         Make profiling work.
3695         
3696 2004-06-13  Martin Baulig  <martin@ximian.com>
3697
3698         * cs-parser.jay: Don't allow generic attributes.
3699
3700 2004-06-13  Martin Baulig  <martin@ximian.com>
3701
3702         * class.cs (MemberBase.DoDefineBase): New protected method.
3703         (MemberBase.DoDefine): Compute the `flags' in the new
3704         DoDefineBase() which must be called first.
3705         (Method.Define): Call DoDefineBase() first so we have the flags
3706         when defining the generic method.
3707
3708         * cs-parser.jay (interface_method_declaration): Support generic methods.
3709
3710 2004-06-13  Martin Baulig  <martin@ximian.com>
3711
3712         * decl.cs (TypeName): Removed.
3713         (MemberName): Removed TypeName and MemberNow; now we just have
3714         MemberName.
3715
3716         * cs-parser.jay: Don't distinguish between type arguments and type
3717         parameters in the grammar and simplified the rules a bit.  The
3718         reduce/reduce conflicts are now gone (except the one we inherited
3719         from mcs).
3720
3721 2004-06-11  Martin Baulig  <martin@ximian.com>
3722
3723         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3724         call this twice: for params and varargs methods.
3725
3726 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3727
3728         * class.cs:
3729         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3730
3731 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3732
3733         * attribute.cs (Attribute.GetValidTargets): Made public.
3734
3735         * class.cs: 
3736         (AbstractPropertyEventMethod): New class for better code sharing.
3737         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3738         CS1667 report.
3739         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3740
3741 2004-06-09  Martin Baulig  <martin@ximian.com>
3742
3743         * cs-parser.jay: Removed a reduce/reduce conflict.
3744
3745 2004-06-03  Martin Baulig  <martin@ximian.com>
3746
3747         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3748         GetSimpleName() and return a SimpleName.
3749
3750         * ecore.cs (SimpleName.Arguments): New public field.
3751         (SimpleName): Added overloaded ctor which takes an additional
3752         TypeArguments argument.
3753         (SimpleName.SimpleNameResolve): Added support for generic methods.
3754         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
3755         formerly in MemberAccess.DoResolve(), but we also need it in
3756         SimpleNameResolve().
3757
3758         * expression.cs (MemberAccess.DoResolve): Use the new
3759         MethodGroupExpr.ResolveGeneric().       
3760
3761 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3762
3763         * decl.cs: If possible, use lookuptypedirect here. We can only do
3764         this if there is no `.' after the namespace. Avoids using
3765         LookupType, which does lots of slow processing.
3766         (FindNestedType) New method, does what it says :-).
3767         * namespace.cs: use LookupTypeDirect.
3768         * rootcontext.cs: use membercache, if possible.
3769         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3770
3771 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3772
3773         * expression.cs:
3774         According to the spec, 
3775
3776         In a member access of the form E.I, if E is a single identifier,
3777         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3778         field, property, localvariable, or parameter with the same type as
3779         the meaning of E as a type-name (§3.8), then both possible
3780         meanings of E are permitted.
3781
3782         We did not check that E as a simple-name had the same type as E as
3783         a type name.
3784
3785         This trivial check gives us 5-7% on bootstrap time.
3786
3787 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3788
3789         * expression.cs (Invocation.OverloadResolve): Avoid the
3790         use of hashtables and boxing here by allocating on demand.
3791
3792 2004-05-30  Martin Baulig  <martin@ximian.com>
3793
3794         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3795         we're doing a silent lookup.  Don't try to lookup nested types in
3796         TypeManager.object_type (thanks to Ben Maurer).
3797
3798 2004-05-30  Martin Baulig  <martin@ximian.com>
3799
3800         Committing a patch from Ben Maurer.
3801
3802         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3803
3804 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3805
3806         * convert.cs: add a trivial cache for overload operator resolution.
3807
3808 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
3809
3810         * attribute.cs
3811         (AttributeTester.GetObsoleteAttribute): Returns instance of
3812         ObsoleteAttribute when type is obsolete.
3813
3814         * class.cs
3815         (TypeContainer.VerifyObsoleteAttribute): Override.
3816         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3817         (MethodCode.VerifyObsoleteAttribute): Override.
3818         (MemberBase.VerifyObsoleteAttribute): Override.
3819
3820         * decl.cs
3821         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3822         and report proper error.
3823
3824         *delegate.cs
3825         (Delegate.VerifyObsoleteAttribute): Override.
3826
3827         * ecore.cs
3828         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3829         and report proper error.
3830         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3831
3832         * enum.cs
3833         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3834         and enum member.
3835
3836         * expression.cs
3837         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
3838         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
3839         Added test for ObsoleteAttribute.
3840
3841         * statement.cs
3842         (Catch): Derived from Statement.
3843
3844 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3845
3846         * decl.cs: If possible, use lookuptypedirect here. We can only do
3847         this if there is no `.' after the namespace. Avoids using
3848         LookupType, which does lots of slow processing.
3849         (FindNestedType) New method, does what it says :-).
3850         * namespace.cs: use LookupTypeDirect.
3851         * rootcontext.cs: use membercache, if possible.
3852         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3853
3854 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3855
3856         * expression.cs:
3857         According to the spec, 
3858
3859         In a member access of the form E.I, if E is a single identifier,
3860         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3861         field, property, localvariable, or parameter with the same type as
3862         the meaning of E as a type-name (§3.8), then both possible
3863         meanings of E are permitted.
3864
3865         We did not check that E as a simple-name had the same type as E as
3866         a type name.
3867
3868         This trivial check gives us 5-7% on bootstrap time.
3869
3870 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3871
3872         Fixed bug #59071 & cs0160.cs
3873         * statement.cs (Try.Resolve): Check here whether order of catch
3874         clauses matches their dependencies.
3875
3876 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3877
3878         Fixed bug #58624
3879         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
3880         unsafe type.
3881
3882 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3883
3884         * expression.cs (Invocation.OverloadResolve): Avoid the
3885         use of hashtables and boxing here by allocating on demand.
3886
3887 2004-05-30  Martin Baulig  <martin@ximian.com>
3888
3889         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3890         we're doing a silent lookup.  Don't try to lookup nested types in
3891         TypeManager.object_type (thanks to Ben Maurer).
3892
3893 2004-05-30  Martin Baulig  <martin@ximian.com>
3894
3895         Committing a patch from Ben Maurer.
3896
3897         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
3898
3899 2004-05-29  Martin Baulig  <martin@ximian.com>
3900
3901         * class.cs (IMethodData.ShouldIgnore): New method.
3902
3903         * typemanager.cs (TypeManager.MethodFlags): Don't take a
3904         `Location' argument, we don't need it anywhere.  Use
3905         `IMethodData.ShouldIgnore ()' instead of
3906         `MethodData.GetMethodFlags ()'.
3907         (TypeManager.AddMethod): Removed.
3908         (TypeManager.AddMethod2): Renamed to AddMethod.
3909
3910 2004-05-29  Martin Baulig  <martin@ximian.com>
3911
3912         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
3913
3914         * convert.cs (Convert.ImplicitReferenceConversion): If we're
3915         converting from a class type S to an interface type and we already
3916         have an object on the stack, don't box it again.  Fixes #52578.
3917
3918 2004-05-29  Martin Baulig  <martin@ximian.com>
3919
3920         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3921         Added support for `params' parameters.  Fixes #59267.
3922
3923 2004-05-29  Martin Baulig  <martin@ximian.com>
3924
3925         * literal.cs (NullPointer): Provide a private .ctor which sets
3926         `type' to TypeManager.object_type.  Fixes #59048.
3927
3928 2004-05-29  Martin Baulig  <martin@ximian.com>
3929
3930         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
3931         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
3932
3933         * ecore.cs (EventExpr.instance_expr): Make the field private.
3934
3935 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
3936
3937         Fixed bug #50080 & cs0214-2.cs
3938         * expression.cs (Cast.DoResolve): Check unsafe context here.
3939         
3940         * statement.cs (Resolve.DoResolve): Likewise.
3941
3942 2004-05-26  Martin Baulig  <martin@ximian.com>
3943
3944         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
3945
3946         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
3947         (RootContext.LookupType): Pass down the `silent' flag.
3948
3949 2004-05-25  Martin Baulig  <martin@ximian.com>
3950
3951         * expression.cs
3952         (MethodGroupExpr.IdenticalTypeName): New public property.
3953         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
3954         expression actually refers to a type.
3955
3956 2004-05-25  Martin Baulig  <martin@ximian.com>
3957
3958         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
3959         for #56176 and made it actually work.
3960
3961 2004-05-25  Martin Baulig  <martin@ximian.com>
3962
3963         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
3964         (FieldExpr, PropertyExpr): Override and implement
3965         CacheTemporaries.  Fixes #52279.
3966
3967 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
3968
3969         * location.cs: In the new compiler listing a file twice is a
3970         warning, not an error.
3971
3972 2004-05-24  Martin Baulig  <martin@ximian.com>
3973
3974         * enum.cs (Enum.DefineType): For the `BaseType' to be a
3975         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
3976
3977 2004-05-24  Martin Baulig  <martin@ximian.com>
3978
3979         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
3980         walking the `using' list.  Fixes #53921.
3981
3982 2004-05-24  Martin Baulig  <martin@ximian.com>
3983
3984         * const.cs (Const.LookupConstantValue): Added support for
3985         EmptyCast's; fixes #55251.
3986
3987 2004-05-24  Martin Baulig  <martin@ximian.com>
3988
3989         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
3990         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
3991         which does the CS0135 check.  The reason is that we first need to
3992         check whether the variable actually exists.
3993
3994 2004-05-24  Martin Baulig  <martin@ximian.com>
3995
3996         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
3997         than RootContext.LookupType() to find the explicit interface
3998         type.  Fixes #58584.
3999
4000 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4001
4002         * Makefile: Simplify.  Use executable.make.
4003         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4004
4005 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4006
4007         * decl.cs:
4008         * enum.cs:
4009         Use the invariant culture when doing String.Compare for CLS case
4010         sensitivity.
4011         
4012 2004-05-23  Martin Baulig  <martin@ximian.com>
4013
4014         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4015         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4016
4017         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4018
4019 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4020
4021         * class.cs (MemberBase.Define): Reuse MemberType member for 
4022         resolved type. Other methods can use it too.
4023
4024 2004-05-23  Martin Baulig  <martin@ximian.com>
4025
4026         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4027         the variable also exists in the current block (otherwise, we need
4028         to report a CS0103).  Fixes #58670.
4029
4030 2004-05-23  Martin Baulig  <martin@ximian.com>
4031
4032         * flowanalysis.cs (Reachability.Reachable): Compute this
4033         on-the-fly rather than storing it as a field.
4034
4035 2004-05-23  Martin Baulig  <martin@ximian.com>
4036
4037         * flowanalysis.cs (Reachability.And): Manually compute the
4038         resulting `barrier' from the reachability.      
4039        
4040 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4041
4042         Fix bug #57835
4043         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4044         instance of ObsoleteAttribute when symbol is obsolete.
4045
4046         * class.cs
4047         (IMethodData): Extended interface for ObsoleteAttribute support.
4048
4049 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4050
4051         * attribute.cs: Fix bug #55970
4052
4053 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4054
4055         Fix bug #52705
4056         * attribute.cs
4057         (GetObsoleteAttribute): New method. Creates the instance of
4058         ObsoleteAttribute.
4059         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4060         ObsoleteAttribute when member is obsolete.
4061         (AttributeTester.Report_ObsoleteMessage): Common method for
4062         Obsolete error/warning reporting.
4063
4064         * class.cs
4065         (TypeContainer.base_classs_type): New member for storing parent type.
4066
4067         * decl.cs
4068         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4069         for this MemberCore.
4070
4071 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4072
4073         * attribute.cs, const.cs: Fix bug #58590
4074
4075 2004-05-21  Martin Baulig  <martin@ximian.com>
4076
4077         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4078         out parameters if the end of the method is unreachable.  Fixes
4079         #58098. 
4080
4081 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4082
4083         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4084         Hari was right, why extra method.
4085
4086 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4087
4088         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4089
4090 2004-05-20  Martin Baulig  <martin@ximian.com>
4091
4092         * delegate.cs: Convert this file to Unix mode - like the original
4093         version in mcs is.
4094
4095 2004-05-20  Martin Baulig  <martin@ximian.com>
4096
4097         * attribute.cs: Convert this file to Unix mode - like the original
4098         version in mcs is.
4099
4100 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4101
4102        Fix bug #58688 (MCS does not report error when the same attribute
4103        is assigned twice)
4104
4105        * attribute.cs (Attribute.Emit): Distinction between null and default.
4106
4107 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4108
4109        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4110        of a top-level attribute without an attribute target.
4111        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4112        Make non-static.
4113        (Attribute.Conditional_GetConditionName), 
4114        (Attribute.Obsolete_GetObsoleteMessage): Update.
4115        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4116        part of ScanForIndexerName.
4117        (Attribute.CanIgnoreInvalidAttribute): New function.
4118        (Attribute.ScanForIndexerName): Move to ...
4119        (Attributes.ScanForIndexerName): ... here.
4120        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4121        (Attributes.Search): New internal variant that can choose not to
4122        complain if types aren't resolved.  The original signature now
4123        complains.
4124        (Attributes.GetClsCompliantAttribute): Use internal variant, with
4125        complaints suppressed.
4126        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4127        only if it not useful.
4128        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4129        top-level for attributes that are shared between the assembly
4130        and a top-level class.
4131        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4132        * class.cs: Update to reflect changes.
4133        (DefineIndexers): Fuse loops.
4134        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4135        a couple more variants of attribute names.
4136
4137 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4138
4139         Fix bug #52585 (Implemented explicit attribute declaration)
4140
4141         * attribute.cs:
4142         (Attributable.ValidAttributeTargets): New abstract method. It gets
4143         list of valid attribute targets for explicit target declaration.
4144         (Attribute.Target): It holds target itself.
4145         (AttributeSection): Removed.
4146         (Attribute.CheckTargets): New method. It checks whether attribute
4147         target is valid for the current element.
4148
4149         * class.cs:
4150         (EventProperty): New class. For events that are declared like
4151         property (with add and remove accessors).
4152         (EventField): New class. For events that are declared like field.
4153         class.cs
4154
4155         * cs-parser.jay: Implemented explicit attribute target declaration.
4156
4157         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4158         Override ValidAttributeTargets.
4159
4160         * parameter.cs:
4161         (ReturnParameter): Class for applying custom attributes on 
4162         the return type.
4163         (ParameterAtribute): New class. Class for applying custom
4164         attributes on the parameter type.
4165
4166 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4167
4168         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4169         definitions. 
4170
4171         (Method): Allow UNSAFE here.
4172
4173         * modifiers.cs: Support unsafe reporting.
4174
4175 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4176
4177         * decl.cs: Fix bug #58478.
4178
4179 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4180
4181         * statement.cs: When checking for unreachable code on an EmptyStatement,
4182         set the location. Fixes bug #58488.
4183
4184 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4185
4186         * driver.cs: Add -pkg handling.
4187
4188         From Gonzalo: UseShelLExecute=false
4189
4190 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4191
4192         * attribute.cs:
4193         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4194         for attribute.
4195         (Attribute.IsClsCompliaceRequired): Moved to base for better
4196         accesibility.
4197         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4198         when attribute is AttributeUsageAttribute.
4199         (Attribute.GetValidTargets): Simplified.
4200         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4201         attribute for this type.
4202         (Attribute.ApplyAttributes): Method renamed to Emit and make
4203         non-static.
4204         (GlobalAttributeSection): New class for special handling of global
4205         attributes (assembly, module).
4206         (AttributeSection.Emit): New method.
4207
4208         * class.cs: Implemented Attributable abstract methods.
4209         (MethodCore.LabelParameters): Moved to Parameter class.
4210         (Accessor): Is back simple class.
4211         (PropertyMethod): Implemented Attributable abstract class.
4212         (DelegateMethod): Implemented Attributable abstract class.
4213         (Event): New constructor for disctintion between normal Event
4214         and Event with accessors.
4215
4216         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4217
4218         * codegen.cs, const.cs, decl.cs, delegate.cs:
4219         (CommonAssemblyModulClass): Implemented Attributable abstract class
4220         and simplified.
4221
4222         * enum.cs: Implement IAttributeSupport interface.
4223         (EnumMember): New class for emum members. Implemented Attributable
4224         abstract class
4225
4226         * parameter.cs:
4227         (ParameterBase): Is abstract.
4228         (ReturnParameter): New class for easier [return:] attribute handling.
4229
4230         * typemanager.cs: Removed builder_to_attr.
4231
4232 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4233
4234         Fix bug #57151.
4235         * attribute.cs (Attribute.GetPositionalValue): New function.
4236         * class.cs (TypeContainer.VerifyMembers): New function.
4237         (TypeContainer.Emit): Use it.
4238         (ClassOrStruct): New base class for Class and Struct.
4239         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4240         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4241         class.
4242         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4243         then each non-static field should have a FieldOffset attribute.
4244         Otherwise, none of the fields should have a FieldOffset attribute.
4245         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4246         and FieldOffset attributes.
4247         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4248         (TypeManager.field_offset_attribute_type): New core types.
4249         (TypeManager.InitCoreTypes): Initialize them.
4250
4251 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4252
4253         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4254         Return correct type.
4255         From bug #58270.
4256
4257 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4258
4259         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4260         be implicitly converted to ulong.
4261         
4262         * expression.cs: The logic for allowing operator &, | and ^ worked
4263         was wrong, it worked before because we did not report an error in
4264         an else branch.  Fixes 57895.
4265
4266         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4267         allow volatile fields to be reference types.
4268
4269 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4270
4271         * driver.cs: Add support for /debug-
4272
4273 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4274
4275         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4276         Add a 'complain' parameter to silence errors.
4277         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4278         silently overlooked type-resolutions.
4279         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4280         to reflect changes.
4281         (Attributes.Search): New function.
4282         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4283         (Attributes.GetAttributeFullName): Remove hack.
4284         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4285         Update to reflect changes.
4286         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4287         Use Attributes.Search instead of nested loops.
4288
4289 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4290
4291         * decl.cs:
4292         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4293         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4294         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4295
4296         * report.cs: (Report.Warning): Renamed to Warning_T because of
4297         parameter collision.
4298
4299 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4300
4301         * expression.cs (MemberAccess.ResolveMemberAccess):
4302         Exit with non-zero status after Report.Error.
4303         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4304         Likewise.
4305         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4306
4307 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4308
4309         * support.cs: Don't hang when the file is empty.
4310
4311 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4312
4313         * support.cs: In SeekableStreamReader, compute the preamble size of the
4314           underlying stream. Position changes should take into account that initial
4315           count of bytes.
4316
4317 2004-05-03  Todd Berman  <tberman@sevenl.net>
4318
4319         * driver.cs: remove unused GetSysVersion function.
4320
4321 2004-05-03  Todd Berman  <tberman@sevenl.net>
4322
4323         * driver.cs: Remove the hack from saturday, as well as the hack
4324         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4325         link_paths to get that bit proper.
4326
4327 2004-05-01  Todd Berman  <tberman@sevenl.net>
4328
4329         * driver.cs: Try a LoadFrom before a Load, this checks the current
4330         path. This is currently a bug in mono that is be fixed, however, this
4331         provides a workaround for now. This will be removed when the bug
4332         is fixed.
4333
4334 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4335
4336         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4337         incomplete key pairs (#57941).
4338
4339 2004-05-01  Todd Berman  <tberman@sevenl.net>
4340
4341         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4342         from the GAC
4343
4344 2004-04-30  Jackson Harper  <jackson@ximian.com>
4345
4346         * codegen.cs: Open keys readonly.
4347         
4348 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4349
4350         * typemanager.cs: don't report cyclic struct layout when a struct
4351         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4352         which has 2 Pango.Rectangle fields.
4353
4354 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4355
4356         * expression.cs: Handle IntPtr comparisons with IL code
4357         rather than a method call.
4358
4359 2004-04-29  Martin Baulig  <martin@ximian.com>
4360
4361         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4362         the list of PropertyInfo's in class hierarchy and find the
4363         accessor.  Fixes #56013.
4364
4365 2004-04-29  Martin Baulig  <martin@ximian.com>
4366
4367         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4368
4369 2004-04-29  Martin Baulig  <martin@ximian.com>
4370
4371         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4372
4373         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4374
4375 2004-04-29  Martin Baulig  <martin@ximian.com>
4376
4377         * class.cs (ConstructorInitializer.Resolve): Check whether the
4378         parent .ctor is accessible.  Fixes #52146.
4379
4380 2004-04-29  Martin Baulig  <martin@ximian.com>
4381
4382         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4383
4384         * statement.cs (Using.EmitLocalVariableDecls): Use
4385         TypeManager.idisposable_type, not typeof (IDisposable).
4386         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4387
4388 2004-04-29  Martin Baulig  <martin@ximian.com>
4389
4390         * class.cs (Event.Define): Don't emit the field and don't set
4391         RTSpecialName and SpecialName for events on interfaces.  Fixes
4392         #57703. 
4393
4394 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4395
4396         Refactor Attribute.ApplyAttributes.
4397         * attribute.cs (Attributable): New base class for objects that can
4398         have Attributes applied on them.
4399         (Attribute): Make AttributeUsage fields public.
4400         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4401         (Attribute.IsInternalCall): New property.
4402         (Attribute.UsageAttr): Convert to a public read-only property.
4403         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4404         (Attribute.ResolveType, Attribute.Resolve)
4405         (Attribute.ScanForIndexerName): Update to reflect changes.
4406         (Attribute.CheckAttributeTarget): Re-format.
4407         (Attribute.ApplyAttributes): Refactor, to various
4408         Attributable.ApplyAttributeBuilder methods.
4409         * decl.cs (MemberCore): Make Attributable.
4410         * class.cs (Accessor): Make Attributable.
4411         (MethodData.ApplyAttributes): Use proper attribute types, not
4412         attribute names.
4413         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4414         (TypeContainer.ApplyAttributeBuilder)
4415         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4416         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4417         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4418         (Operator.ApplyAttributeBuilder): New factored-out methods.
4419         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4420         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4421         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4422         * parameter.cs (ParameterBase): New Attributable base class
4423         that can also represent Return types.
4424         (Parameter): Update to the changes.
4425
4426 2004-04-29  Jackson Harper  <jackson@ximian.com>
4427
4428         * driver.cs: Prefer the corlib system version when looking for
4429         assemblies in the GAC. This is still a hack, but its a better hack
4430         now.
4431         
4432 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4433
4434         * decl.cs, enum.cs: Improved error 3005 reporting.
4435   
4436         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4437         (related_symbols): New private member for list of symbols
4438         related to reported error/warning.
4439         
4440         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4441
4442 2004-04-29  Martin Baulig  <martin@ximian.com>
4443
4444         * ecore.cs (Expression.Constantify): If we're an enum and
4445         TypeManager.TypeToCoreType() doesn't give us another type, use
4446         t.UnderlyingSystemType.  Fixes #56178.  
4447
4448 2004-04-29  Martin Baulig  <martin@ximian.com>
4449
4450         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4451         interfaces and for each interface, only add members directly
4452         declared in that interface.  Fixes #53255.
4453
4454 2004-04-28  Martin Baulig  <martin@ximian.com>
4455
4456         * expression.cs (ConditionalLogicalOperator): Use a temporary
4457         variable for `left' to avoid that we evaluate it more than once;
4458         bug #52588.
4459
4460 2004-04-28  Martin Baulig  <martin@ximian.com>
4461
4462         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4463         `void[]' (CS1547).
4464
4465 2004-04-28  Martin Baulig  <martin@ximian.com>
4466
4467         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4468         void (CS1547).
4469
4470         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4471         whether the type is not void (CS1547).
4472
4473 2004-04-28  Martin Baulig  <martin@ximian.com>
4474
4475         * expression.cs (Unary.DoResolveLValue): Override this and report
4476         CS0131 for anything but Operator.Indirection.
4477
4478 2004-04-28  Martin Baulig  <martin@ximian.com>
4479
4480         Committing a patch from Ben Maurer; see bug #50820.
4481
4482         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4483         check for classes.
4484
4485         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4486         classes.        
4487
4488 2004-04-28  Martin Baulig  <martin@ximian.com>
4489
4490         Committing a patch from Ben Maurer; see bug #50820.
4491
4492         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4493         check for classes.
4494
4495         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4496         classes.        
4497
4498 2004-04-28  Martin Baulig  <martin@ximian.com>
4499
4500         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4501         (Block.AddLabel): Call DoLookupLabel() to only search in the
4502         current block.
4503
4504 2004-04-28  Martin Baulig  <martin@ximian.com>
4505
4506         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4507         comparing StringConstants and NullLiterals in Equality and Inequality.
4508
4509 2004-04-28  Jackson Harper  <jackson@ximian.com>
4510
4511         * driver.cs: Attempt to load referenced assemblies from the
4512         GAC. This is the quick and dirty version of this method that
4513         doesnt take into account versions and just takes the first
4514         canidate found. Will be good enough for now as we will not have more
4515         then one version installed into the GAC until I update this method.
4516
4517 2004-04-28  Martin Baulig  <martin@ximian.com>
4518
4519         * typemanager.cs (TypeManager.CheckStructCycles): New public
4520         static method to check for cycles in the struct layout.
4521
4522         * rootcontext.cs (RootContext.PopulateTypes): Call
4523         TypeManager.CheckStructCycles() for each TypeContainer.
4524         [Note: We only need to visit each type once.]
4525
4526 2004-04-28  Martin Baulig  <martin@ximian.com>
4527
4528         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4529
4530         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4531         success and added `out object value'.  Use a `bool resolved' field
4532         to check whether we've already been called rather than
4533         `ConstantValue != null' since this breaks for NullLiterals.
4534
4535 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4536
4537         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4538         setting of this flag, since the 'set' method may be non-public.
4539
4540 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4541
4542         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4543         check on current_vector.Block.
4544
4545 2004-04-27  Martin Baulig  <martin@ximian.com>
4546
4547         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4548         a field initializer.  Fixes #56459.
4549
4550 2004-04-27  Martin Baulig  <martin@ximian.com>
4551
4552         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4553         we're not attempting to use an indexer.  Fixes #52154.
4554
4555 2004-04-27  Martin Baulig  <martin@ximian.com>
4556
4557         * statement.cs (Return): Don't create a return label if we don't
4558         need it; reverts my change from January 20th.  Thanks to Ben
4559         Maurer for this.
4560
4561 2004-04-27  Martin Baulig  <martin@ximian.com>
4562
4563         According to the spec, `goto' can only leave a nested scope, but
4564         never enter it.
4565
4566         * statement.cs (Block.LookupLabel): Only lookup in the current
4567         block, don't recurse into parent or child blocks.
4568         (Block.AddLabel): Check in parent and child blocks, report
4569         CS0140/CS0158 if we find a duplicate.
4570         (Block): Removed this indexer for label lookups.
4571         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4572         this already does the error reporting for us.
4573
4574         * flowanalysis.cs
4575         (FlowBranching.UsageVector.Block): New public variable; may be null.
4576         (FlowBranching.CreateSibling): Added `Block' argument.
4577         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4578         label for the target of a `goto' and check whether we're not
4579         leaving a `finally'.
4580
4581 2004-04-27  Martin Baulig  <martin@ximian.com>
4582
4583         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4584         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4585         just for returns).
4586
4587 2004-04-27  Martin Baulig  <martin@ximian.com>
4588
4589         * statement.cs (Block.AddLabel): Also check for implicit blocks
4590         and added a CS0158 check.
4591
4592 2004-04-27  Martin Baulig  <martin@ximian.com>
4593
4594         * flowanalysis.cs (FlowBranchingLoop): New class.
4595         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4596         UsageVector's instead of an ArrayList.
4597         (FlowBranching.Label): Likewise.
4598         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4599         (FlowBranching.AddBreakVector): New method.
4600
4601 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4602
4603         * attribute.cs: Small regression fix: only convert the type if we
4604         the type is different, fixes System.Drawing build.
4605
4606 2004-04-27  Martin Baulig  <martin@ximian.com>
4607
4608         * attribute.cs (Attribute.Resolve): If we have a constant value
4609         for a named field or property, implicity convert it to the correct
4610         type.
4611
4612 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4613
4614         * statement.cs (Block.Block): Implicit blocks share
4615         'child_variable_names' fields with parent blocks.
4616         (Block.AddChildVariableNames): Remove.
4617         (Block.AddVariable): Mark variable as "used by a child block" in
4618         every surrounding block.
4619         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4620         been used in a child block, complain about violation of "Invariant
4621         meaning in blocks" rule.
4622         * cs-parser.jay (declare_local_variables): Don't use
4623         AddChildVariableNames.
4624         (foreach_statement): Don't create an implicit block: 'foreach'
4625         introduces a scope.
4626
4627 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4628
4629         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4630         converting from 0L to ulong.  Fixes 57522.
4631
4632 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4633
4634         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4635         derived class hides via 'new' keyword field from base class (test-242.cs).
4636         TODO: Handle this in the more general way.
4637         
4638         * class.cs (CheckBase): Ditto.
4639
4640 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4641
4642         * decl.cs (caching_flags): New member for storing cached values
4643         as bit flags.
4644         (MemberCore.Flags): New enum where bit flags for caching_flags
4645         are defined.
4646         (MemberCore.cls_compliance): Moved to caching_flags.
4647         (DeclSpace.Created): Moved to caching_flags.
4648
4649         * class.cs: Use caching_flags instead of DeclSpace.Created
4650         
4651 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4652
4653         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4654         if we are only a derived class, not a nested class.
4655
4656         * typemanager.cs: Same as above, but do this at the MemberLookup
4657         level (used by field and methods, properties are handled in
4658         PropertyExpr).   Allow for the qualified access if we are a nested
4659         method. 
4660
4661 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4662
4663         * class.cs: Refactoring.
4664         (IMethodData): New inteface; Holds links to parent members
4665         to avoid member duplication (reduced memory allocation).
4666         (Method): Implemented IMethodData interface.
4667         (PropertyBase): New inner classes for get/set methods.
4668         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4669         (Event): New inner classes for add/remove methods.
4670         (Event.DelegateMethod): Implemented IMethodData interface.
4671
4672         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4673         EmitContext (related to class.cs refactoring).
4674
4675 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4676
4677         * delegate.cs (Delegate.VerifyApplicability): If the number of
4678         arguments are the same as the number of parameters, first try to
4679         verify applicability ignoring  any 'params' modifier on the last
4680         parameter.
4681         Fixes #56442.
4682
4683 2004-04-08  Martin Baulig  <martin@ximian.com>
4684
4685         Merged latest changes into gmcs.  Please keep this comment in
4686         here, it makes it easier for me to see what changed in MCS since
4687         the last time I merged.
4688
4689 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4690
4691         * class.cs (TypeContainer.AddIndexer): Use
4692         'ExplicitInterfaceName' to determine if interface name was
4693         explicitly specified.  'InterfaceType' is not initialized at this time.
4694         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4695         Indexers array is already in the required order.  Initialize
4696         'IndexerName' only if there are normal indexers.
4697         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4698         (TypeContainer.Emit): Emit DefaultMember attribute only if
4699         IndexerName is initialized.
4700         Fixes #56300.
4701
4702 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4703
4704         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4705         Fixes #57007
4706
4707 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4708
4709         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4710         attributes.
4711         Fix for #56456.
4712
4713         * attribute.cs (Attribute.Resolve): Check for duplicate named
4714         attributes.
4715         Fix for #56463.
4716
4717 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4718
4719         * iterators.cs (MarkYield): track whether we are in an exception,
4720         and generate code accordingly.  Use a temporary value to store the
4721         result for our state.
4722
4723         I had ignored a bit the interaction of try/catch with iterators
4724         since their behavior was not entirely obvious, but now it is
4725         possible to verify that our behavior is the same as MS .NET 2.0
4726
4727         Fixes 54814
4728
4729 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4730
4731         * iterators.cs: Avoid creating temporaries if there is no work to
4732         do. 
4733
4734         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4735         Enumerations, use TypeManager.EnumToUnderlying and call
4736         recursively. 
4737
4738         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4739         bug #57013
4740
4741         (This.Emit): Use EmitContext.EmitThis to emit our
4742         instance variable.
4743
4744         (This.EmitAssign): Ditto.
4745
4746         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4747         codepaths, we will move all the functionality into
4748         Mono.CSharp.This 
4749
4750         (FieldExpr.EmitAssign): Ditto.
4751
4752         This fixes several hidden bugs that I uncovered while doing a code
4753         review of this today.
4754
4755         * codegen.cs (EmitThis): reworked so the semantics are more clear
4756         and also support value types "this" instances.
4757
4758         * iterators.cs: Changed so that for iterators in value types, we
4759         do not pass the value type as a parameter.  
4760
4761         Initialization of the enumerator helpers is now done in the caller
4762         instead of passing the parameters to the constructors and having
4763         the constructor set the fields.
4764
4765         The fields have now `assembly' visibility instead of private.
4766
4767 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4768
4769         * expression.cs (Argument.Resolve): Check if fields passed as ref
4770         or out are contained in a MarshalByRefObject.
4771
4772         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4773         another compiler type.
4774
4775 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4776
4777         * class.cs (Indexer.Define): use the new name checking method.
4778         Also, return false on an error.
4779         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4780         (is_identifier_[start/part]_character): make static.
4781
4782 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4783
4784         * expression.cs (Binary.ResolveOperator): Do no append strings
4785         twice: since we can be invoked more than once (array evaluation)
4786         on the same concatenation, take care of this here.  Based on a fix
4787         from Ben (bug #56454)
4788
4789 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4790
4791         * codegen.cs: Fix another case where CS1548 must be reported (when 
4792         delay-sign isn't specified and no private is available #56564). Fix
4793         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4794         error when MCS is used on the MS runtime and we need to delay-sign 
4795         (which seems unsupported by AssemblyBuilder - see #56621).
4796
4797 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4798
4799         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4800         (TypeManager.ComputeNamespaces): Faster implementation for
4801         Microsoft runtime.
4802
4803         * compiler.csproj: Updated AssemblyName to mcs.
4804
4805 2004-05-11  Jackson Harper  <jackson@ximian.com>
4806
4807         * Makefile: Preserve MONO_PATH
4808         
4809 2004-05-11  Jackson Harper  <jackson@ximian.com>
4810
4811         * Makefile: Use mono and mcs to build gmcs
4812         
4813 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
4814
4815         * codegen.cs: Add patch from Robert Shade
4816         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
4817         sync with mcs.
4818
4819 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
4820
4821         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4822         incomplete key pairs (#57941).
4823
4824 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4825
4826         * codegen.cs: Fix another case where CS1548 must be reported (when 
4827         delay-sign isn't specified and no private is available #56564). Fix
4828         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4829         error when MCS is used on the MS runtime and we need to delay-sign 
4830         (which seems unsupported by AssemblyBuilder - see #56621).
4831
4832 2004-04-29  Jackson Harper  <jackson@ximian.com>
4833
4834         * Makefile: Set MONO_PATH to use the bootstrap corlib
4835         * driver.cs: Check the GAC for referenced assemblies.
4836                 
4837 2004-04-29  Martin Baulig  <martin@ximian.com>
4838
4839         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
4840
4841 2004-04-07  Martin Baulig  <martin@ximian.com>
4842
4843         * expression.cs (Binary.ResolveOperator): Added special case for
4844         Equality/Inequality between a type parameter and a null literal.
4845
4846 2004-04-07  Martin Baulig  <martin@ximian.com>
4847
4848         * convert.cs: Check null literal -> type parameter conversions.
4849
4850 2004-04-07  Martin Baulig  <martin@ximian.com>
4851
4852         * generic.cs (ConstructedType.CheckConstraints): Enforce the
4853         `class' and `struct' constraints.
4854
4855 2004-04-07  Martin Baulig  <martin@ximian.com>
4856
4857         * generic.cs (SpecialConstraint): New public enum.
4858         (Constraints.Resolve): Added support for the `class' and `struct'
4859         constraints.
4860
4861         * cs-parser.jay (type_parameter_constraint): Added support for the
4862         `class' and `struct' constraints.
4863
4864 2004-04-07  Martin Baulig  <martin@ximian.com>
4865
4866         * support.cs (GenericConstraints): Replaced `Types' by
4867         `ClassConstraint' and `InterfaceConstraints'; added
4868         `HasClassConstraint'.   
4869
4870 2004-04-07  Martin Baulig  <martin@ximian.com>
4871
4872         * generic.cs
4873         (Constraints.InterfaceConstraints): New public property.
4874         (Constraints.Types): Make this property public
4875         (TypeParameter): Implement IMemberContainer.
4876         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
4877         instead of a TypeBuilder/MethodBuilder; pass the interface
4878         constraints to TypeManager.AddTypeParameter().
4879         (TypeParameter.DefineType): Just take an EmitContext and no
4880         TypeBuilder/MethodBuilder.  Use the new public API.
4881
4882         * typemanager.cs (TypeManager.AddTypeParameter): Added
4883         `TypeExpr[]' argument; add the interfaces to the
4884         `builder_to_ifaces' hash.
4885         (TypeManager.LookupMemberContainer): For
4886         GenericTypeParameterBuilders, get the TypeParameter from the
4887         `builder_to_type_param'.
4888         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
4889         the TypeParameter and call FindMembers on it.
4890
4891 2004-04-07  Martin Baulig  <martin@ximian.com>
4892
4893         * class.cs
4894         (MethodCore.GenericMethod): Moved this field here from Method.
4895         (MethodCore.IsDuplicateImplementation): Take the number of type
4896         parameters into account if we're a generic method.
4897
4898         * expression.cs (Invocation.InferTypeArguments): Don't return true
4899         if `arguments' is null; we still need to check whether we actually
4900         don't need to infer anything in this case.
4901         (MemberAccess): Merged the functionality from GenericMemberAccess
4902         into this class.
4903
4904         * generic.cs (GenericMemberAccess): Removed.
4905
4906 2004-04-05  Martin Baulig  <martin@ximian.com>
4907
4908         * decl.cs (MemberCore): For generic classes, interfaces and
4909         structs, `Name' now includes the number of type parameters
4910         ("Stack!1.Node!1").
4911         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
4912         encode the number of type arguments in the type name.
4913
4914         * expression.cs (Expression.MemberLookup): Removed the
4915         `num_type_args' argument; we now encode the number of type
4916         arguments in the type name.
4917
4918         * ecore.cs (SimpleName): Encode the number of type arguments in
4919         the type name itself.
4920
4921         * generic.cs (ConstructedType): Likewise.
4922
4923         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
4924         `MemberName'; we now include the number of type parameters in the
4925         type name.
4926
4927         * typemanager.cs (TypeManager.CheckGeneric): Removed.
4928         (TypeManager.MemberLookup): Removed the
4929         `num_type_args' argument; we now encode the number of type
4930         arguments in the type name.     
4931
4932 2004-04-03  Martin Baulig  <martin@ximian.com>
4933
4934         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
4935         (MemberCore.MemberName): Moved here from MemberBase.
4936         (DeclSpace.SetParameterInfo): Just take the constraints as an
4937         ArrayList; we already have the type parameters in our
4938         `MemberName'; also do the CS0080 reporting here.
4939
4940         * cs-parser.jay (struct_declaration): Use `member_name' instead of
4941         `IDENTIFIER opt_type_parameter_list'; when constructing our
4942         `MemberName', it'll already include our type parameters.
4943         (class_declaration, interface_declaration): Likewise.
4944         (delegate_declaration): Likewise.
4945         (MakeName): Take a MemberName and return a MemberName.
4946         The following two changes are required to avoid shift/reduce conflicts:
4947         (member_name): Don't include a TypeName anymore; ie. this is now
4948         just 'IDENTIFIER opt_type_parameter_list'.
4949         (property_declaration, event_declaration): Use a
4950         `namespace_or_type_name' instead of a `member_name'.            
4951
4952 2004-04-03  Martin Baulig  <martin@ximian.com>
4953
4954         * decl.cs (MemberName): Renamed to `TypeName' and created a new
4955         `MemberName' class.
4956         (TypeName): Formerly known as MemberName.
4957
4958         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
4959         instead of a `MemberName'.
4960
4961         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
4962         (member_name): New rule; create a MemberName.
4963
4964 2004-04-02  Martin Baulig  <martin@ximian.com>
4965
4966         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
4967         (CS0305 and CS0308).
4968
4969 2004-04-02  Martin Baulig  <martin@ximian.com>
4970
4971         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
4972         support for nested types.
4973
4974 2004-04-02  Martin Baulig  <martin@ximian.com>
4975
4976         * ecore.cs (IAlias): New public interface.
4977         (TypeExpr, TypeExpression): Implement IAlias.
4978         (TypeAliasExpression): New public class.
4979
4980         * namespace.cs (Namespace): Implement IAlias.
4981         (Namespace.Lookup): Return an IAlias instead on an object.
4982         (Namespace.DefineName): Take an IAlias instead of an object.
4983         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
4984         an object.
4985         (NamespaceEntry.UsingAlias): Take a Membername instead of an
4986         Expression.
4987         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
4988         object.
4989         (NamespaceEntry.Lookup): Likewise.
4990
4991         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
4992         instead of a Type.      
4993
4994         * decl.cs (DeclSpace): Implement IAlias.
4995         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
4996
4997         * generic.cs (ConstructedType): Improved error checking.
4998
4999 2004-04-02  Martin Baulig  <martin@ximian.com>
5000
5001         * convert.cs: Added type parameter conversions.
5002
5003         * ecore.cs
5004         (UnboxCast.Emit): Emit an `unbox.any' for type params.
5005         (ClassCast.Emit): If the source type is a type parameter, box it.
5006         If the target type is a type parameter, emit an `unbox.any'
5007         instead of a `classcast'.1      
5008
5009 2004-04-01  Martin Baulig  <martin@ximian.com>
5010
5011         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
5012
5013 2004-04-01  Martin Baulig  <martin@ximian.com>
5014
5015         * generic.cs (ConstructedType.CheckConstraints): Use
5016         Convert.ImplicitStandardConversionExists(); user-defined implicit
5017         conversions are not allowed according to the spec.
5018
5019 2004-03-30  Martin Baulig  <martin@ximian.com>
5020
5021         * expression.cs (New): Added support for type parameters.
5022
5023         * typemanager.cs
5024         (TypeManager.activator_type): New public static field.
5025         (TypeManager.activator_create_instance): Likewise.
5026
5027 2004-03-30  Martin Baulig  <martin@ximian.com>
5028
5029         * typemanager.cs (TypeManager.HasConstructorConstraint): New
5030         public method.
5031
5032 2004-03-30  Martin Baulig  <martin@ximian.com>
5033
5034         * generic.cs (ConstructedType.CheckConstraints): Actually follow
5035         the spec here: the argument type must be convertible to the
5036         constraints.
5037
5038 2004-03-30  Martin Baulig  <martin@ximian.com>
5039
5040         * generic.cs
5041         (TypeParameter.Define, TypeParameter.DefineMethod): Call
5042         TypeManager.AddTypeParameter().
5043         (ConstructedType.CheckConstraints): Re-enable this and actually
5044         check whether we have a constructor constraint.
5045
5046         * typemanager.cs
5047         (TypeManager.builder_to_type_param): New static field.
5048         (TypeManager.AddTypeParameter): New static method.
5049         (TypeManager.LookupTypeParameter): New public method.
5050
5051 2004-03-30  Martin Baulig  <martin@ximian.com>
5052
5053         * generic.cs (TypeParameter.DefineType): Return a boolean and use
5054         the new API to actually define the constructor constraint.
5055
5056         * typemanager.cs
5057         (TypeManager.new_constraint_attr_type): New static field.
5058         (TypeManager.InitCoreTypes): Initialize it.
5059
5060 2004-03-30  Martin Baulig  <martin@ximian.com>
5061
5062         * generic.cs (Constraints): Completed error checking, use correct
5063         error numbers.
5064
5065 2004-03-29  Martin Baulig  <martin@ximian.com>
5066
5067         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
5068
5069         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5070         public version which takes a `ParameterData pd' instead of an
5071         `ArrayList args'.
5072
5073 2004-03-29  Martin Baulig  <martin@ximian.com>
5074
5075         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
5076         not a MethodInfo.       
5077
5078 2004-03-29  Martin Baulig  <martin@ximian.com>
5079
5080         * expression.cs (Argument.ResolveMethodGroup): If we're a
5081         ConstructedType, call GetMemberAccess() on it.  
5082
5083 2004-03-29  Martin Baulig  <martin@ximian.com>
5084
5085         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
5086         (MethodCore.CheckGenericOverride): When overriding a generic
5087         method, check whether the constraints match.
5088
5089         * support.cs (GenericConstraints): New public interface.
5090         (ParameterData.GenericConstraints): New public method.
5091
5092         * parameter.cs (Parameter.Resolve): Check whether we're a generic
5093         method parameter and compute our constraints if appropriate.
5094         (Parameter.GenericConstraints): New public property.
5095
5096         * generic.cs (Constraints): Implement GenericConstraints.
5097
5098 2004-03-29  Martin Baulig  <martin@ximian.com>
5099
5100         * decl.cs (MemberCache.FindMemberToOverride): Use
5101         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
5102
5103 2004-03-29  Martin Baulig  <martin@ximian.com>
5104
5105         * generic.cs (GenericMethod.Define): Resolve our type parameters.
5106
5107 2004-03-29  Martin Baulig  <martin@ximian.com>
5108
5109         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
5110         not allowed on non-generic declarations").
5111
5112 2004-03-29  Martin Baulig  <martin@ximian.com>
5113
5114         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5115         public version of this method.
5116
5117         * class.cs (MethodCore.IsDuplicateImplementation): Use
5118         Invocation.InferTypeArguments() to check this.
5119
5120 2004-03-29  Martin Baulig  <martin@ximian.com>
5121
5122         * convert.cs: Use TypeManager.IsDelegateType() instead of
5123         comparing types correctly.
5124
5125 2004-03-29  Martin Baulig  <martin@ximian.com>
5126
5127         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
5128         types directly to make it work for generic instances.
5129
5130         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
5131
5132 2004-03-29  Martin Baulig  <martin@ximian.com>
5133
5134         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
5135         support for arrays.     
5136
5137 2004-03-24  Martin Baulig  <martin@ximian.com>
5138
5139         * decl.cs (DeclSpace.FindType): Also use
5140         TypeManager.CheckGeneric() for types from the using clauses.
5141
5142 2004-03-23  Martin Baulig  <martin@ximian.com>
5143
5144         * expression.cs (Invocation.OverloadResolve): Added `bool
5145         may_fail' argument and use it instead of the Location.IsNull() hack.
5146
5147 2004-03-23  Martin Baulig  <martin@ximian.com>
5148
5149         * expression.cs (Invocation.InferType): Use correct type inference
5150         rules here.     
5151
5152 2004-03-23  Martin Baulig  <martin@ximian.com>
5153
5154         * ecore.cs (MethodGroupExpr.Name): Use
5155         TypeManager.CSharpSignature() instead of just the name.
5156
5157         * expression.cs (Invocation.OverloadResolve): Provide better error
5158         reporting.
5159         (Invocation.DoResolve): OverloadResolve() never returns null
5160         without reporting an error, so removed the error -6 reporting here.
5161
5162 2004-03-23  Martin Baulig  <martin@ximian.com>
5163
5164         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
5165         generic methods.
5166
5167         * cs-parser.jay (delegate_declaration): Support generic delegates.
5168
5169         * delegate.cs: Support generic delegates.
5170
5171 2004-03-22  Martin Baulig  <martin@ximian.com>
5172
5173         * expression.cs (Invocation.InferParamsTypeArguments): New static
5174         method; does type inference for params arguments.
5175
5176 2004-03-21  Martin Baulig  <martin@ximian.com>
5177
5178         * typemanager.cs (TypeManager.IsGenericMethod): New public static
5179         method; checks whether a method is a generic method.    
5180
5181         * expression.cs (Invocation.InferTypeArguments): New static method;
5182         infer type arguments for generic method invocation.
5183
5184         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
5185         property; we set this to true if we're resolving a generic method
5186         invocation and the user specified type arguments, ie. we're not
5187         doing type inference.
5188
5189 2004-03-20  Martin Baulig  <martin@ximian.com>
5190
5191         * class.cs (MethodData.DeclaringType): New public property.
5192         (MethodData.Define): Set DeclaringType here.
5193         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
5194         instead of OperatorMethodBuilder.DeclaringType.
5195
5196 2004-03-20  Martin Baulig  <martin@ximian.com>
5197
5198         * cs-tokenizer.cs (xtoken): Return a special
5199         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
5200
5201         * cs-parser.jay (default_value_expression): Switch to the new
5202         syntax (14.5.13).
5203
5204 2004-03-19  Martin Baulig  <martin@ximian.com>
5205
5206         * decl.cs (MemberName): New class.  We use this to "construct"
5207         namespace_or_type_name's.
5208
5209         * generics.cs (TypeArguments.GetDeclarations): New public method;
5210         returns the type arguments as a string[] and reports a CS0081 if
5211         one of them is not an identifier.
5212
5213         * class.cs (MemberBase): The .ctor now takes the name as a
5214         MemberName instead of a string.
5215         (MemberBase.ExplicitInterfaceName): Changed type from string to
5216         Expression.
5217         (MemberBase.DoDefine): If we're an explicit implementation, the
5218         InterfaceType may be a generic instance.
5219
5220         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
5221         (namespace_name): Call MemberName.GetName () to transform the
5222         MemberName into a string and ensure we don't have any type
5223         arguments.
5224         (type_name): Call MemberName.GetTypeExpression() to transfrom the
5225         MemberName into an expression.
5226         (method_header): Use namespace_or_type_name instead of member_name.     
5227
5228 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5229
5230         * rootcontext.cs: Add new types to the boot resolution.
5231
5232         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5233         MulticastDelegate is not allowed.
5234
5235         * typemanager.cs: Add new types to lookup: System.TypedReference
5236         and ArgIterator.
5237
5238         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5239         check for TypedReference or ArgIterator, they are not allowed. 
5240
5241         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5242         makes us properly catch 1510 in some conditions (see bug 56016 for
5243         details). 
5244
5245 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5246
5247         * CryptoConvert.cs: update from corlib version
5248         with endian fixes.
5249
5250 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5251
5252         * class.cs (Indexer.Define): Check indexername declaration
5253
5254 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5255
5256         * attribute.cs (IsClsCompliant): Fixed problem with handling
5257         all three states (compliant, not-compliant, undetected).
5258
5259 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5260
5261         * attribute.cs (Attribute): Location is now public.
5262         (Resolve): Store resolved arguments (pos_values) in attribute class.
5263         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5264         (GetClsCompliantAttributeValue): New method that gets
5265         CLSCompliantAttribute value.
5266         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5267         if exists else null.
5268         (AttributeTester): New class for CLS-Compliant verification routines.
5269
5270         * class.cs (Emit): Add CLS-Compliant verification.
5271         (Method.GetSignatureForError): Implemented.
5272         (Constructor.GetSignatureForError): Implemented
5273         (Constructor.HasCompliantArgs): Returns if constructor has
5274         CLS-Compliant arguments.
5275         (Constructor.Emit): Override.
5276         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5277         is needed to test only parameters.
5278         (FieldBase.GetSignatureForError): Implemented.
5279         (TypeContainer): New member for storing base interfaces.
5280         (TypeContainer.FindMembers): Search in base interfaces too.
5281
5282         * codegen.cs (GetClsComplianceAttribute): New method that gets
5283         assembly or module CLSCompliantAttribute value.
5284         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5285         for assembly.
5286         (ModuleClass.Emit): Add error 3012 test.
5287
5288         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5289
5290         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5291         state for all decl types.
5292         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5293         if CLS-Compliant tests are required.
5294         (IsClsCompliaceRequired): New method. Analyze whether code
5295         must be CLS-Compliant.
5296         (IsExposedFromAssembly): New method. Returns true when MemberCore
5297         is exposed from assembly.
5298         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5299         value or gets cached value.
5300         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5301         is explicitly marked with CLSCompliantAttribute.
5302         (IsIdentifierClsCompliant): New abstract method. This method is
5303         used to testing error 3005.
5304         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5305         for identifier and parameters CLS-Compliant testing.
5306         (VerifyClsCompliance): New method. The main virtual method for
5307         CLS-Compliant verifications.
5308         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5309         null. I don't know why is null (too many public members !).
5310         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5311         and get value of first CLSCompliantAttribute that found.
5312
5313         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5314         (VerifyClsCompliance): Override and add extra tests.
5315
5316         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5317         clscheck- disable CLS-Compliant verification event if assembly is has
5318         CLSCompliantAttribute(true).
5319
5320         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5321         ApllyAttribute is now called in emit section as in the other cases.
5322         Possible future Emit integration.
5323         (IsIdentifierClsCompliant): New override.
5324         (VerifyClsCompliance): New override.
5325         (GetEnumeratorName): Returns full enum name.
5326
5327         * parameter.cs (GetSignatureForError): Implemented.
5328
5329         * report.cs (WarningData): New struct for Warning message information.
5330         (LocationOfPreviousError): New method.
5331         (Warning): New method. Reports warning based on the warning table.
5332         (Error_T): New method. Reports error based on the error table.
5333
5334         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5335         verifications are done here.
5336
5337         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5338
5339         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5340         CLSCompliantAttribute.
5341         (all_imported_types): New member holds all imported types from other
5342         assemblies.
5343         (LoadAllImportedTypes): New method fills static table with exported types
5344         from all referenced assemblies.
5345         (Modules): New property returns all assembly modules.
5346
5347 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5348
5349         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5350         throwing a parser error.
5351
5352         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5353         which removes the hardcoded get_/set_ prefixes for properties, as
5354         IL allows for the properties to be named something else.  
5355
5356         Bug #56013
5357
5358         * expression.cs: Do not override operand before we know if it is
5359         non-null.  Fix 56207
5360
5361 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5362
5363         * typemanager.cs: support for pinned variables.
5364
5365 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5366
5367         * decl.cs, typemanager.cs: Avoid using an arraylist
5368         as a buffer if there is only one result set.
5369
5370 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5371
5372         * expression.cs: Make sure you cant call a static method
5373         with an instance expression, bug #56174.
5374
5375 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5376
5377         * class.cs (IsDuplicateImplementation): Improve error reporting to
5378         flag 663 (method only differs in parameter modifier).
5379
5380         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5381         in preprocessor directives.
5382
5383         * location.cs (LookupFile): Allow for the empty path.
5384
5385         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5386         better approach for some of that patch, but its failing with the
5387         CharSet enumeration.  For now try/catch will do.
5388
5389         * typemanager.cs: Do not crash if a struct does not have fields.
5390         Fixes 56150.
5391
5392 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5393
5394         * expression.cs: cs0213, cant fix a fixed expression.
5395         fixes 50231.
5396
5397 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5398
5399         * cs-parser.jay: detect invalid embeded statements gracefully.
5400         bug #51113.
5401
5402 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5403
5404         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5405         As a regex:
5406         s/
5407         the invocation type may not be a subclass of the tye of the item/
5408         The type of the item must be a subclass of the invocation item.
5409         /g
5410
5411         Fixes bug #50820.
5412
5413 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5414
5415         * attribute.cs: Added methods to get a string and a bool from an
5416         attribute. Required to information from AssemblyKeyFileAttribute,
5417         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5418         * codegen.cs: Modified AssemblyName creation to include support for
5419         strongnames. Catch additional exceptions to report them as CS1548.
5420         * compiler.csproj: Updated include CryptoConvert.cs.
5421         * compiler.csproj.user: Removed file - user specific configuration.
5422         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5423         Mono.Security assembly. The original class is maintained and tested in
5424         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5425         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5426         like CSC 8.0 (C# v2) supports.
5427         * Makefile: Added CryptoConvert.cs to mcs sources.
5428         * rootcontext.cs: Added new options for strongnames.
5429
5430 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5431
5432         * driver.cs: For --expect-error, report error code `2'
5433         if the program compiled with no errors, error code `1' if
5434         it compiled with an error other than the one expected.
5435
5436 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5437
5438         * compiler.csproj: Updated for Visual Studio .NET 2003.
5439         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5440         * compiler.sln: Updated for Visual Studio .NET 2003.
5441
5442 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5443
5444         * expression.cs: Fix bug #47234. We basically need to apply the
5445         rule that we prefer the conversion of null to a reference type
5446         when faced with a conversion to 'object' (csc behaviour).
5447
5448 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5449
5450         * statement.cs: Shorter form for foreach, eliminates
5451         a local variable. r=Martin.
5452
5453 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5454
5455         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5456         checks if we can use brtrue/brfalse to test for 0.
5457         * expression.cs: use the above in the test for using brtrue/brfalse.
5458         cleanup code a bit.
5459
5460 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5461
5462         * expression.cs: Rewrite string concat stuff. Benefits:
5463
5464         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5465         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5466         rather than a concat chain.
5467
5468         * typemanager.cs: Add lookups for more concat overloads.
5469
5470 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5471
5472         * expression.cs: Emit shorter il code for array init.
5473
5474         newarr
5475         dup
5476         // set 1
5477
5478         // set 2
5479
5480         newarr
5481         stloc.x
5482
5483         ldloc.x
5484         // set 1
5485
5486         ldloc.x
5487         // set 2
5488
5489 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5490
5491         * statement.cs: Before, two switch blocks would be merged if the
5492         total size of the blocks (end_item - begin_item + 1) was less than
5493         two times the combined sizes of the blocks.
5494
5495         Now, it will only merge if after the merge at least half of the
5496         slots are filled.
5497
5498         fixes 55885.
5499
5500 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5501
5502         * class.cs : csc build fix for GetMethods(). See bug #52503.
5503
5504 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5505
5506         * expression.cs: Make sure fp comparisons work with NaN.
5507         This fixes bug #54303. Mig approved this patch a long
5508         time ago, but we were not able to test b/c the runtime
5509         had a related bug.
5510
5511 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5512
5513         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5514
5515 2004-03-19  Martin Baulig  <martin@ximian.com>
5516
5517         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5518         two overloads may unify for some type parameter substitutions and
5519         report a CS0408 if appropriate.
5520
5521 2004-03-19  Martin Baulig  <martin@ximian.com>
5522
5523         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5524         error here and not in our caller.
5525
5526 2004-03-19  Martin Baulig  <martin@ximian.com>
5527
5528         * interface.cs: Completely killed this file.
5529         (Interface): We're now a TypeContainer and live in class.cs.
5530
5531         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5532         argument; we're now also called for interfaces.
5533         (TypeContainer.DefineMembers): Allow this method being called
5534         multiple times.
5535         (TypeContainer.GetMethods): New public method; formerly known as
5536         Interface.GetMethod().  This is used by PendingImplementation.
5537         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5538         it's now private and non-static.
5539         (Interface): Moved this here; it's now implemented similar to
5540         Class and Struct.
5541         (Method, Property, Event, Indexer): Added `bool is_interface'
5542         argument to their .ctor's.
5543         (MemberBase.IsInterface): New public field.
5544
5545         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5546         instances instead of InterfaceMethod, InterfaceProperty, etc.
5547         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5548         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5549
5550 2004-03-19  Martin Baulig  <martin@ximian.com>
5551
5552         * class.cs (MethodCore.IsDuplicateImplementation): New private
5553         method which does the CS0111 checking.
5554         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5555         Use IsDuplicateImplementation().
5556
5557 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5558
5559         * decl.cs (FindMemberToOverride): New method to find the correct
5560         method or property to override in the base class.
5561         * class.cs
5562             - Make Method/Property use the above method to find the
5563               version in the base class.
5564             - Remove the InheritableMemberSignatureCompare as it is now
5565               dead code.
5566
5567         This patch makes large code bases much faster to compile, as it is
5568         O(n) rather than O(n^2) to do this validation.
5569
5570         Also, it fixes bug 52458 which is that nested classes are not
5571         taken into account when finding the base class member.
5572
5573         Reviewed/Approved by Martin.
5574
5575 2004-03-17  Martin Baulig  <martin@ximian.com>
5576
5577         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5578         of type arguments into account; use the `real_num_type_args'
5579         approach like in DoResolveAsTypeStep().
5580
5581         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5582         nested types.
5583
5584 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5585
5586         * interface.cs: In all interface classes removed redundant
5587         member initialization.
5588
5589 2004-03-16  Martin Baulig  <martin@ximian.com>
5590
5591         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5592
5593 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5594
5595         * decl.cs (DefineTypeAndParents): New helper method to define a
5596         type's containers before the type itself is defined;  This is a
5597         bug exposed by the recent changes to Windows.Forms when an
5598         implemented interface was defined inside a class that had not been
5599         built yet.   
5600
5601         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5602
5603         (Check): Loop correctly to report errors modifiers
5604         (UNSAFE was not in the loop, since it was the same as TOP).
5605
5606         * interface.cs: Every interface member now takes a ModFlags,
5607         instead of a "is_new" bool, which we set on the base MemberCore. 
5608
5609         Every place where we called "UnsafeOk" in the interface, now we
5610         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5611         the unsafe settings from the member declaration instead of the
5612         container interface. 
5613
5614         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5615
5616         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5617         `set_indexer_name' to the pending bits (one per type).
5618
5619         We fixed a bug today that was picking the wrong method to
5620         override, since for properties the existing InterfaceMethod code
5621         basically ignored the method name.  Now we make sure that the
5622         method name is one of the valid indexer names.
5623
5624 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5625  
5626         * support.cs (SeekableStreamReader): Keep track of stream byte
5627         positions and don't mix them with character offsets to the buffer.
5628
5629         Patch from Gustavo Giráldez
5630
5631 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5632
5633         * interface.cs (InterfaceSetGetBase): Removed double member
5634         initialization, base class does it as well.
5635
5636 2004-03-13  Martin Baulig  <martin@ximian.com>
5637
5638         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5639         when compiling corlib.
5640
5641 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5642
5643         * convert.cs (ExplicitConversion): We were reporting an error on
5644         certain conversions (object_type source to a value type, when the
5645         expression was `null') before we had a chance to pass it through
5646         the user defined conversions.
5647
5648         * driver.cs: Replace / and \ in resource specifications to dots.
5649         Fixes 50752
5650
5651         * class.cs: Add check for duplicate operators.  Fixes 52477
5652
5653 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5654
5655         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5656         that are in the middle of the statements, not only at the end.
5657         Fixes #54987
5658
5659         * class.cs (TypeContainer.AddField): No longer set the
5660         `HaveStaticConstructor' flag, now we call it
5661         `UserDefineStaticConstructor' to diferentiate the slightly
5662         semantic difference.
5663
5664         The situation is that we were not adding BeforeFieldInit (from
5665         Modifiers.TypeAttr) to classes that could have it.
5666         BeforeFieldInit should be set to classes that have no static
5667         constructor. 
5668
5669         See:
5670
5671         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5672
5673         And most importantly Zoltan's comment:
5674
5675         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5676
5677         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5678          before its static fields are used', i.e. initialization does not need
5679          to be triggered by the first access to the type. Setting this flag
5680          helps the JIT to compile better code, since it can run the static
5681          constructor at JIT time, and does not need to generate code to call it
5682          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5683          this flag for lots of classes like String. 
5684          
5685          csc sets this flag if the type does not have an explicit static 
5686          constructor. The reasoning seems to be that if there are only static
5687          initalizers for a type, and no static constructor, then the programmer
5688          does not care when this initialization happens, so beforefieldinit
5689          can be used.
5690          
5691          This bug prevents the AOT compiler from being usable, since it 
5692          generates so many calls to mono_runtime_class_init that the AOT code
5693          is much slower than the JITted code. The JITted code is faster, 
5694          because it does not generate these calls if the vtable is type is
5695          already initialized, which is true in the majority of cases. But the
5696          AOT compiler can't do this."
5697
5698 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5699
5700         * class.cs (MethodData.Emit): Refactor the code so symbolic
5701         information is generated for destructors;  For some reasons we
5702         were taking a code path that did not generate symbolic information
5703         before. 
5704
5705 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5706
5707         * class.cs: Create a Constructor.CheckBase method that
5708         takes care of all validation type code. The method
5709         contains some code that was moved from Define.
5710
5711         It also includes new code that checks for duplicate ctors.
5712         This fixes bug #55148.
5713
5714 2004-03-09  Joshua Tauberer <tauberer@for.net>
5715
5716         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5717         a { ... }-style array creation invokes EmitStaticInitializers
5718         which is not good for reference-type arrays.  String, decimal
5719         and now null constants (NullCast) are not counted toward
5720         static initializers.
5721
5722 2004-03-05  Martin Baulig  <martin@ximian.com>
5723
5724         * location.cs (SourceFile.HasLineDirective): New public field;
5725         specifies whether the file contains or is referenced by a "#line"
5726         directive.
5727         (Location.DefineSymbolDocuments): Ignore source files which
5728         either contain or are referenced by a "#line" directive.        
5729
5730 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5731
5732         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5733         direct access to our parent, so check the method inline there.
5734
5735 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5736
5737         * expression.cs (Invocation.EmitCall): Miguel's last commit
5738         caused a regression. If you had:
5739
5740             T t = null;
5741             t.Foo ();
5742
5743         In Foo the implict this would be null.
5744
5745 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5746
5747         * expression.cs (Invocation.EmitCall): If the method is not
5748         virtual, do not emit a CallVirt to it, use Call.
5749
5750         * typemanager.cs (GetFullNameSignature): Improve the method to
5751         cope with ".ctor" and replace it with the type name.
5752
5753         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5754         as an argument the ConstructorBuilder where it is being defined,
5755         to catch the recursive constructor invocations.
5756
5757 2004-03-16  Martin Baulig  <martin@ximian.com>
5758
5759         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5760         ConstructedType, call ResolveType() on it to get the type rather
5761         than just using `expr.Type'.
5762
5763 2004-03-16  Martin Baulig  <martin@ximian.com>
5764
5765         * generics.cs (ConstructedType.GetMemberAccess): Take the
5766         EmitContext instead on the TypeExpr and use
5767         ec.TypeContainer.CurrentType/ec.ContainerType.
5768
5769 2004-03-16  Martin Baulig  <martin@ximian.com>
5770
5771         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5772         parameters before aliases.
5773
5774 2004-03-16  Martin Baulig  <martin@ximian.com>
5775
5776         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5777         New oublic function; checks whether two generic instances may become
5778         equal under some instantiations (26.3.1).
5779
5780         * class.cs (TypeContainer.Define): Call
5781         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5782         error.
5783
5784 2004-03-16  Martin Baulig  <martin@ximian.com>
5785
5786         * class.cs (TypeContainer.GetClassBases): Moved
5787         Error_TypeParameterAsBase() here and also check whether the base
5788         class is not an attribute.
5789
5790 2004-03-16  Martin Baulig  <martin@ximian.com>
5791
5792         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5793
5794 2004-03-16  Martin Baulig  <martin@ximian.com>
5795
5796         * class.cs (Error_TypeParameterAsBase): Use correct error number
5797         here (CS0689).  
5798
5799 2004-03-16  Martin Baulig  <martin@ximian.com>
5800
5801         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5802         for generics.
5803
5804         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5805         error reporting.
5806
5807 2004-03-15  Martin Baulig  <martin@ximian.com>
5808
5809         * typemanager.cs (TypeManager.GetFullName): New public method.
5810         (TypeManager.MemberLookup): Added `int_num_type_arguments'
5811         argument; only return members with the correct number of type
5812         arguments.
5813         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
5814         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
5815         whether the number of type arguments matches.
5816
5817         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
5818         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
5819
5820         * expression.cs (MemberAccess): Added public `NumTypeArguments'
5821         field; it's set by the protected .ctor when we're actually a
5822         GenericMemberAccess.
5823         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
5824         arguments and pass it to MemberLookupFinal ().
5825
5826         * ecore.cs (Expression.MemberLookup): Added `int
5827         num_type_arguments' argument; only return members with the correct
5828         number of type arguments.
5829         (Expression.MemberLookupFailed): Check whether the MemberLookup
5830         failed because we did not have the correct number of type
5831         arguments; report CS0305 in this case.
5832
5833         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
5834         `e.ResolveAsTypeTerminal()' already did so.
5835
5836 2004-03-15  Martin Baulig  <martin@ximian.com>
5837
5838         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
5839         we're a ConstructedType; in this case, the caller must report an
5840         error (for instance CS0131).
5841
5842         * generic.cs (TypeArguments): Added Location argument to the .ctor.
5843         (TypeArguments.Resolve): Actually report errors here.
5844
5845 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5846
5847         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5848         `set_indexer_name' to the pending bits (one per type).
5849
5850         We fixed a bug today that was picking the wrong method to
5851         override, since for properties the existing InterfaceMethod code
5852         basically ignored the method name.  Now we make sure that the
5853         method name is one of the valid indexer names.
5854
5855 2004-03-15  Martin Baulig  <martin@ximian.com>
5856
5857         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
5858         for generic instances.
5859
5860 2004-03-13  Martin Baulig  <martin@ximian.com>
5861
5862         * class.cs (TypeContainer.DefineType): Call
5863         TypeManager.AddUserType() immediately after creating the
5864         TypeBuilder; pass all type parameters when creating the
5865         CurrentType.
5866
5867         * decl.cs (DeclSpace.FindNestedType): New public method.
5868         (DeclSpace.FindType): Added `int num_type_args' argument; only
5869         return types with the correct number of type parameters.
5870         (DeclSpace.CountTypeParams): New public property.
5871
5872         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
5873         the number of type parameters; defaults to zero.
5874
5875         * generic.cs (TypeArguments.Count): New public property.
5876         (ConstructedType.DoResolveAsTypeStep): First call
5877         ds.FindNestedType() to find out whether we're nested in the
5878         current generic type; in this case, we inherit all type parameters
5879         from the current class.
5880
5881         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
5882         num_type_args' argument.
5883         (RootContext.LookupType): Added overloaded version which takes the
5884         number of type arguments; only return types with the correct
5885         number of type arguments.
5886
5887         * typemanager.cs (TypeManager.CheckGeneric): New public function;
5888         checks whether `Type t' has `int num_type_args'.
5889
5890 2004-03-13  Martin Baulig  <martin@ximian.com>
5891
5892         * generic.cs (GenericMethod.DefineType): New method; calls
5893         DefineType() on all the type parameters.
5894
5895         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
5896         (MethodData.Define): If we're a generic method, call
5897         GenericMethod.DefineType() to define the type parameters.       
5898
5899 2004-03-10  Martin Baulig  <martin@ximian.com>
5900
5901         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
5902         instead of IsAssignableFrom.    
5903
5904 2004-03-10  Martin Baulig  <martin@ximian.com>
5905
5906         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
5907
5908         * support.cs (ParameterData.HasArrayParameter): New property.
5909         (ReflectionParameters.ctor): Take a MethodBase instead of a
5910         ParameterInfo[].  If we have any type parameters, get the generic
5911         method definition and ask it whether we have variable arguments.
5912
5913 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
5914
5915         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
5916         routines to check if a type is an enumerable/enumerator allow
5917         classes that implement the IEnumerable or IEnumerator interfaces.
5918
5919         * class.cs (Property, Operator): Implement IIteratorContainer, and
5920         implement SetYields.
5921
5922         (Property.Define): Do the block swapping for get_methods in the
5923         context of iterators.   We need to check if Properties also
5924         include indexers or not.
5925
5926         (Operator): Assign the Block before invoking the
5927         OperatorMethod.Define, so we can trigger the Iterator code
5928         replacement. 
5929
5930         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
5931         Property and Operator classes are not created when we parse the
5932         declarator but until we have the block completed, so we use a
5933         singleton SimpleIteratorContainer.Simple to flag whether the
5934         SetYields has been invoked.
5935
5936         We propagate this setting then to the Property or the Operator to
5937         allow the `yield' to function.
5938
5939 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
5940
5941         * codegen.cs: Implemented attribute support for modules.
5942         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
5943         Assembly/Module functionality.
5944
5945         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
5946         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
5947         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
5948
5949 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
5950
5951         * interface.cs (FindMembers): The operation is performed on all base
5952         interfaces and not only on the first. It is required for future CLS Compliance patch.
5953
5954 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
5955
5956         * statement.cs, codegen.cs:
5957         This patch deals with patterns such as:
5958
5959         public class List : IEnumerable {
5960
5961                 public MyEnumerator GetEnumerator () {
5962                         return new MyEnumerator(this);
5963                 }
5964
5965                 IEnumerator IEnumerable.GetEnumerator () {
5966                         ...
5967                 }
5968                 
5969                 public struct MyEnumerator : IEnumerator {
5970                         ...
5971                 }
5972         }
5973
5974         Before, there were a few things we did wrong:
5975         1) we would emit callvirt on a struct, which is illegal
5976         2) we emited ldarg when we needed to emit ldarga
5977         3) we would mistakenly call the interface methods on an enumerator
5978         type that derived from IEnumerator and was in another assembly. For example:
5979
5980         public class MyEnumerator : IEnumerator
5981
5982         Would have the interface methods called, even if there were public impls of the
5983         method. In a struct, this lead to invalid IL code.
5984
5985 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
5986
5987         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
5988           renamed to Emit.
5989
5990         * delegate.cs (Define): Fixed crash when delegate type is undefined.
5991
5992 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
5993
5994         * cs-parser.jay: Fix small regression: we were not testing V2
5995         compiler features correctly.
5996
5997         * interface.cs: If the emit context is null, then create one
5998
5999 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6000
6001         * decl.cs (GetSignatureForError): New virtual method to get full name
6002           for error messages.
6003
6004         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6005           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6006
6007         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6008           Duplicated members and code in these classes has been removed.
6009           Better encapsulation in these classes.
6010
6011 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
6012
6013         * assign.cs (Assign.DoResolve): When dealing with compound
6014         assignments, there is a new rule in ECMA C# 2.4 (might have been
6015         there before, but it is documented here) that states that in:
6016
6017         a op= b;
6018
6019         If b is of type int, and the `op' is a shift-operator, then the
6020         above is evaluated as:
6021
6022         a = (int) a op b 
6023
6024         * expression.cs (Binary.ResolveOperator): Instead of testing for
6025         int/uint/long/ulong, try to implicitly convert to any of those
6026         types and use that in pointer arithmetic.
6027
6028         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6029         method to print information for from the type, not from the
6030         null-method we were given.
6031
6032 2004-02-01  Duncan Mak  <duncan@ximian.com>
6033
6034         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6035         parsing for cmd, fixes bug #53694.
6036
6037 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6038
6039         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6040         in the member name duplication tests. Property and operator name duplication
6041         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6042
6043 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6044
6045         * interface.cs (PopulateMethod): Fixed crash when interface method
6046         returns not existing type (error test cs0246-3.cs).
6047
6048 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6049
6050         * cs-parser.jay (interface_accessors): Re-write actions to also
6051         store attributes attached to get and set methods. Fix spelling
6052         while at it.
6053
6054         (inteface_property_declaration): Modify accordingly.
6055
6056         (InterfaceAccessorInfo): New helper class to store information to pass
6057         around between rules that use interface_accessors.
6058
6059         * interface.cs (Emit): Apply attributes on the get and set
6060         accessors of properties and indexers too.
6061
6062         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6063         right MethodBuilder when applying attributes to the get and set accessors.
6064
6065 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6066
6067         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6068
6069 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6070
6071         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6072
6073 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6074
6075         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6076         changes that treat `yield' specially when present before `break'
6077         or `return' tokens.
6078
6079         * cs-tokenizer.cs: yield is no longer a keyword.
6080
6081 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6082
6083         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6084         setting for default constructors.
6085         For default constructors are almost every time set wrong Modifier. The
6086         generated IL code has been alright. But inside mcs this values was
6087         wrong and this was reason why several of my CLS Compliance tests
6088         failed.
6089
6090 2004-02-27  Martin Baulig  <martin@ximian.com>
6091
6092         * generics.cs (ConstructedType.ResolveType): Make the nested type
6093         stuff actually work.
6094
6095 2004-02-25  Martin Baulig  <martin@ximian.com>
6096
6097         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
6098         property; returns the type parameters just from the current type,
6099         ie. with the ones from outer classes.
6100         (DeclSpace.LookupGeneric): First search in the current class, then
6101         in outer classes.
6102         (DeclSpace.initialize_type_params): When hiding a type parameter
6103         from an outer class, put it into the `type_param_list' anyways.
6104
6105         * expression.cs (MemberAccess.expr): Made this field protected.
6106
6107         * class.cs (TypeContainer.Define): The `CurrentType' just contains
6108         the type parameters from the current class.
6109
6110         * generic.cs (ConstructedType.ResolveType): Support nested generic
6111         types by taking the type parameters which we inherit from outer
6112         classes into account.
6113         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
6114         support for nested generic types.
6115
6116 2004-02-23  Martin Baulig  <martin@ximian.com>
6117
6118         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
6119         field and check whether we're nested inside a generic type.
6120         (DeclSpace.ResolveType): If we're resolving to a generic type
6121         definition, create a ConstructedType and return its resolved type.
6122         (DeclSpace.initialize_type_params): New private method;
6123         initializes the `type_param_list' field from the type parameters
6124         from this and all enclosing classes.
6125         (DeclSpace.TypeParameters): Call initialize_type_params() unless
6126         we're already initialized.
6127
6128 2004-02-23  Martin Baulig  <martin@ximian.com>
6129
6130         * class.cs (Method.Define): Create the generic method before
6131         calling DoDefine().
6132         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
6133         the TypeContainer one); we use this for generic methods.
6134
6135         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
6136         parent's TypeBuilder.
6137
6138 2004-02-18  Martin Baulig  <martin@ximian.com>
6139
6140         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
6141         to check for equality.
6142
6143 2004-02-05  Martin Baulig  <martin@ximian.com>
6144
6145         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
6146         `ec.TypeContainer.CurrentType', use it instead of
6147         `ec.ContainerType' to check whether we're in the type's ctor.
6148
6149 2004-01-29  Martin Baulig  <martin@ximian.com>
6150
6151         * expression.cs (Invocation.DoResolve): If we're a
6152         `ConstructedType', then we're actually a generic method, so
6153         rewrite the expr as a GenericMemberAccess.
6154
6155         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
6156         here; manually parse it into a string.
6157
6158 2004-01-28  Martin Baulig  <martin@ximian.com>
6159
6160         * typemanager.cs (TypeManager.IsEqual): New static method.
6161         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
6162         check for equality instead of using `=='.
6163
6164 2004-01-26  Martin Baulig  <martin@ximian.com>
6165
6166         * decl.cs (DeclSpace.CurrentType): New public field.
6167
6168         * expression.cs (This.ResolveBase): If we have an
6169         `ec.TypeContainer.CurrentType', use it instead of
6170         `ec.ContainerType'.
6171
6172         * class.cs (TypeContainer.DefineType): If we're a generic type,
6173         create the `CurrentType' (unresolved).
6174         (TypeContainer.GenericType): New private field.
6175         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
6176         it and store it in `GenericType' before creating the MemberCache.
6177         (TypeContainer.GetMembers): If we have a `GenericType', call
6178         TypeManager.FindMembers() on it.
6179
6180         * interface.cs (Interface.GenericType): New private field.
6181         (Interface.DefineType): If we're a generic type, create the
6182         `CurrentType' (unresolved).
6183         (Interface.DefineMembers): If we have a `CurrentType', resolve it
6184         and store it in `GenericType' before creating the MemberCache.
6185         (Interface.GetMembers): If we have a `GenericType', call
6186         TypeManager.FindMembers() on it.
6187
6188 2004-01-22  Martin Baulig  <martin@ximian.com>
6189
6190         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6191         not a QualifiedIdentifier.  This is what `type_name_expression'
6192         was previously doing.
6193         (type_name_expression): Removed; the code is now in
6194         `namespace_or_type_name'.
6195         (qualified_identifier): Removed, use `namespace_or_type_name'
6196         instead.
6197         (QualifiedIdentifier): Removed this class.      
6198
6199 2004-01-22  Martin Baulig  <martin@ximian.com>
6200
6201         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6202         not a string as alias name.
6203
6204 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6205
6206         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6207         #52730 bug, and instead compute correctly the need to use a
6208         temporary variable when requesting an address based on the
6209         static/instace modified of the field and the constructor.
6210  
6211 2004-01-21  Martin Baulig  <martin@ximian.com>
6212
6213         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6214         class and namespace before looking up aliases.  Fixes #52517.
6215
6216 2004-01-21  Martin Baulig  <martin@ximian.com>
6217
6218         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6219         assinged in a 'try'; fixes exception4.cs.
6220
6221 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6222         * class.cs : Implemented parameter-less constructor for TypeContainer
6223
6224         * decl.cs: Attributes are now stored here. New property OptAttributes
6225
6226         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6227
6228         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6229
6230 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6231
6232         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6233           (CSharpSignature): New method for indexer and property signature.
6234
6235 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6236
6237         * pending.cs (IsVirtualFilter): Faster implementation.
6238
6239 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6240
6241         * typemanager.cs: Avoid inclusion of same assembly more than once.
6242
6243 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6244
6245         * cs-parser.jay: Fixed problem where the last assembly attribute
6246           has been applied also to following declaration (class, struct, etc.)
6247           
6248 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6249
6250         * class.cs: Added error CS0538, CS0539 reporting.
6251         Fixed crash on Microsoft runtime when field type is void.
6252
6253         * cs-parser.jay: Added error CS0537 reporting.
6254
6255         * pending.cs: Added error CS0535 reporting.
6256         Improved error report for errors CS0536, CS0534.
6257
6258 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6259
6260         Merge a few bits from the Anonymous Method MCS tree.
6261
6262         * statement.cs (ToplevelBlock): New class for toplevel methods,
6263         will hold anonymous methods, lifted variables.
6264
6265         * cs-parser.jay: Create toplevel blocks for delegates and for
6266         regular blocks of code. 
6267
6268 2004-01-20  Martin Baulig  <martin@ximian.com>
6269
6270         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6271         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6272         and `NeedExplicitReturn'; added `IsLastStatement'.
6273         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6274         have a `ReturnLabel' or we're not unreachable.
6275
6276         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6277         child's reachability; don't just override ours with it.  Fixes
6278         #58058 (lluis's example).
6279         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6280         InFinally(), InLoop(), InSwitch() and
6281         BreakCrossesTryCatchBoundary() methods.
6282
6283         * statement.cs (Return): Do all error checking in Resolve().
6284         Unless we are the last statement in a top-level block, always
6285         create a return label and jump to it.
6286         (Break, Continue): Do all error checking in Resolve(); also make
6287         sure we aren't leaving a `finally'.
6288         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6289         statement in a top-level block.
6290         (Block.Flags): Added `IsDestructor'.
6291         (Block.IsDestructor): New public property.
6292
6293 2004-01-20  Martin Baulig  <martin@ximian.com>
6294
6295         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6296
6297 2004-01-20  Martin Baulig  <martin@ximian.com>
6298
6299         * statement.cs (Statement.ResolveUnreachable): New public method.
6300         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6301         (Block.Resolve): Resolve unreachable statements.
6302
6303 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6304
6305         * expression.cs: We need to fix the case where we do
6306         not have a temp variable here.
6307
6308         * assign.cs: Only expression compound assignments need
6309         temporary variables.
6310
6311 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6312
6313         * flowanalysis.cs: Reduce memory allocation in a few ways:
6314           - A block with no variables should not allocate a bit
6315             vector for itself.
6316           - A method with no out parameters does not need any tracking
6317             for assignment of the parameters, so we need not allocate
6318             any data for it.
6319           - The arrays:
6320                 public readonly Type[] VariableTypes;
6321                 public readonly string[] VariableNames;
6322             Are redundant. The data is already stored in the variable
6323             map, so we need not allocate another array for it.
6324           - We need to add alot of checks for if (params | locals) == null
6325             due to the first two changes.
6326
6327 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6328
6329         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6330         implement IMemoryLocation, we store a copy on a local variable and
6331         take the address of it.  Patch from Benjamin Jemlich
6332
6333         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6334         to use a special "type_name_expression" rule which reduces the
6335         number of "QualifiedIdentifier" classes created, and instead
6336         directly creates MemberAccess expressions.
6337
6338 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6339
6340         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6341         that fixes #52853.  Null literal assignment to ValueType
6342
6343         * class.cs (MethodData.Emit): Instead of checking the name of the
6344         method to determine if its a destructor, create a new derived
6345         class from Method called Destructor, and test for that.  
6346
6347         * cs-parser.jay: Create a Destructor object instead of a Method.  
6348
6349         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6350
6351         Fixes: 52933
6352
6353 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6354
6355         * expression.cs (Binary.ResolveOperator): Perform an implicit
6356         conversion from MethodGroups to their delegate types on the
6357         Addition operation.
6358
6359         * delegate.cs: Introduce a new class DelegateCreation that is the
6360         base class for `NewDelegate' and `ImplicitDelegateCreation',
6361         factor some code in here.
6362
6363         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6364         conversion from MethodGroups to compatible delegate types. 
6365
6366         * ecore.cs (Expression.Resolve): Do not flag error 654
6367         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6368         we allow conversions from MethodGroups to delegate types now.
6369
6370         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6371         assignments in v2 either.
6372
6373 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6374
6375         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6376         static read-only fields in ctors.
6377
6378         Applied patch from Benjamin Jemlich 
6379
6380         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6381
6382 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6383
6384         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6385         here to return true, as they can be used like this:
6386
6387                 (XXX) int.MEMBER ()
6388
6389         Fixed 49836 and all the other dups
6390
6391 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6392
6393         * driver.cs: Implement /win32res and /win32icon.
6394
6395 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6396
6397         * cs-parser.jay: Add a rule to improve error handling for the
6398         common mistake of placing modifiers after the type.
6399
6400 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6401
6402         * cs-parser.jay (interface_event_declaration): Catch
6403         initialization of events on interfaces, and report cs0068
6404
6405         * cs-parser.jay (interface_event_declaration): Catch
6406         initialization of events. 
6407
6408         * ecore.cs: Better report missing constructors.
6409
6410         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6411         the error reporting done in the wrong place.  Fix.
6412
6413         * expression.cs (Binary.ResolveOperator): Catch the 
6414         operator + (E x, E y) error earlier, and later allow for implicit
6415         conversions in operator +/- (E e, U x) from U to the underlying
6416         type of E.
6417
6418         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6419         52596, if the container class is abstract, the default constructor
6420         is protected otherwise its public (before, we were always public).
6421
6422         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6423         fixed statement.
6424
6425         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6426         Jemlich that fixes bug #52597, MCS was generating invalid code for
6427         idisposable structs.   Thanks to Ben for following up with this
6428         bug as well.
6429
6430 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6431
6432         * driver.cs: Allow assemblies without code to be generated, fixes
6433         52230.
6434
6435 2004-01-07  Nick Drochak <ndrochak@gol.com>
6436
6437         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6438
6439 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6440
6441         * cs-parser.jay: Add rules to improve error reporting if fields or
6442         methods are declared at the namespace level (error 116)
6443
6444         * Add rules to catch event add/remove
6445
6446 2004-01-04  David Sheldon <dave-mono@earth.li>
6447
6448   * expression.cs: Added matching ")" to error message for 
6449   CS0077
6450
6451 2004-01-03 Todd Berman <tberman@gentoo.org>
6452
6453         * ecore.cs, attribute.cs:
6454         Applying fix from #52429.
6455
6456 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6457
6458         * ecore.cs, expression.cs, statement.cs:
6459         Total rewrite of how we handle branching. We
6460         now handle complex boolean expressions with fewer
6461         jumps. As well if (x == 0) no longer emits a ceq.
6462
6463         if (x is Foo) is much faster now, because we generate
6464         better code.
6465
6466         Overall, we get a pretty big improvement on our benchmark
6467         tests. The code we generate is smaller and more readable.
6468
6469         I did a full two-stage bootstrap. The patch was reviewed
6470         by Martin and Miguel.
6471
6472 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6473
6474         * cs-parser.jay: Make primary_expression not take a QI.
6475         we dont need this because the member_access rule covers
6476         us here. So we replace the rule with just IDENTIFIER.
6477
6478         This has two good effects. First, we remove a s/r conflict.
6479         Second, we allocate many fewer QualifiedIdentifier objects.
6480
6481 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6482
6483         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6484         set the correct information via SRE. This prevents
6485         hanging on the MS runtime. Fixes #29374.
6486
6487 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6488
6489         * convert.cs: correctly handle conversions to value types
6490         from Enum and ValueType as unboxing conversions.
6491
6492         Fixes bug #52569. Patch by Benjamin Jemlich.
6493
6494 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6495
6496         * expression.cs (BetterConversion): Prefer int -> uint
6497         over int -> ulong (csc's behaviour). This fixed bug #52046.
6498
6499 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6500
6501         * decl.cs (MemberCache.FindMembers): now returns a
6502         MemberInfo [].
6503
6504         * typemanager.cs: In general, go with with ^^.
6505         (CopyNewMethods): take an IList.
6506         (RealMemberLookup): Only allocate an arraylist
6507         if we copy from two sets of methods.
6508
6509         This change basically does two things:
6510         1) Fewer array lists allocated due to CopyNewMethods.
6511         2) the explicit cast in MemberList costed ALOT.
6512
6513 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6514
6515         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6516         a hashtable to avoid needless string allocations when an identifier is
6517         used more than once (the common case).
6518
6519 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6520
6521         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6522         is broken, it will not return anything. So, we
6523         have to use the information we have in mcs to
6524         do the task.
6525
6526         * typemanager.cs: Add a cache for GetInterfaces,
6527         since this will now be used more often (due to ^^)
6528
6529         (GetExplicitInterfaces) New method that gets the
6530         declared, not effective, interfaces on a type
6531         builder (eg, if you have interface IFoo, interface
6532         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6533         { IBar }.
6534
6535         This patch makes MCS able to bootstrap itself on
6536         Windows again.
6537
6538 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6539
6540         * expression.cs: Remove the Nop's that Miguel put
6541         in by mistake.
6542
6543 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6544
6545         * report.cs, codegen.cs: Give the real stack trace to
6546         the error when an exception is thrown.
6547
6548 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6549
6550         * decl.cs: only allocate hashtables for ifaces if 
6551         it is an iface!
6552
6553 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6554
6555         * expression.cs: fix the error from cs0121-2.cs
6556         (a parent interface has two child interfaces that
6557         have a function with the same name and 0 params
6558         and the function is called through the parent).
6559
6560 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6561
6562         * class.cs, rootcontext.cs, typmanager.cs: do not
6563         leak pointers.
6564
6565 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6566
6567         * codegen.cs: remove stack for the ec flow branching.
6568         It is already a linked list, so no need.
6569
6570 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6571
6572         * Makefile: Allow custom profiler here.
6573
6574 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6575
6576         * typemanager.cs (LookupType):
6577           - Use a static char [], because split takes
6578             a param array for args, so it was allocating
6579             every time.
6580           - Do not store true in a hashtable, it boxes.
6581
6582 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6583
6584         * flowanalysis.cs: bytify common enums.
6585
6586 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6587
6588         * modifiers.cs: Add a new set of flags for the
6589         flags allowed on explicit interface impls.
6590         * cs-parser.jay: catch the use of modifiers in
6591         interfaces correctly.
6592         * class.cs: catch private void IFoo.Blah ().
6593
6594         All related to bug #50572.
6595
6596 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6597
6598         * decl.cs: Rewrite the consistant accessability checking.
6599         Accessability is not linear, it must be implemented in
6600         a tableish way. Fixes #49704.
6601
6602 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6603
6604         * expression.cs: Handle negation in a checked context.
6605         We must use subtraction from zero. Fixes #38674.
6606
6607 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6608
6609         * class.cs: Ignore static void main in DLLs.
6610         * rootcontext.cs: Handle the target type here,
6611         since we are have to access it from class.cs
6612         * driver.cs: account for the above.
6613
6614 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6615
6616         * report.cs: Give line numbers and files if available.
6617
6618 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6619
6620         * driver.cs: Implement /addmodule.
6621
6622         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6623         ModuleBuilders.
6624
6625 2003-12-20  Martin Baulig  <martin@ximian.com>
6626
6627         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6628         (FieldBase.IsAssigned): Removed this field.
6629         (FieldBase.SetAssigned): New public method.
6630         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6631
6632 2003-12-20  Martin Baulig  <martin@ximian.com>
6633
6634         * expression.cs (LocalVariableReference.DoResolve): Don't set
6635         `vi.Used' if we're called from DoResolveLValue().
6636
6637         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6638         returns the usage vector it just merged into the current one -
6639         pass this one to UsageWarning().
6640         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6641         of the `EmitContext', don't call this recursively on our children.
6642
6643 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6644
6645         * driver.cs: Implement /target:module.
6646
6647 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6648
6649         * support.cs (CharArrayHashtable): New helper class.
6650
6651         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6652         char arrays, not strings, so we can avoid creating a string in
6653         consume_identifier if the identifier is a keyword.
6654
6655 2003-12-16  Martin Baulig  <martin@ximian.com>
6656
6657         * statement.cs (LocalInfo.Assigned): Removed this property.
6658         (LocalInfo.Flags): Removed `Assigned'.
6659         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6660         and uses flow analysis.
6661         (Block.UsageWarning): Made this method private.
6662         (Block.Resolve): Call UsageWarning() if appropriate.
6663
6664         * expression.cs (LocalVariableReference.DoResolve): Always set
6665         LocalInfo.Used here.
6666
6667 2003-12-13  Martin Baulig  <martin@ximian.com>
6668
6669         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6670         any value here; we're now using flow analysis to figure out
6671         whether a statement/block returns a value.
6672
6673 2003-12-13  Martin Baulig  <martin@ximian.com>
6674
6675         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6676         working again.
6677         (FlowBranching.MergeFinally): Don't call
6678         `branching.CheckOutParameters()' here, this is called in
6679         MergeTopBlock().
6680         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6681         when adding the `finally' vector.       
6682
6683 2003-12-13  Martin Baulig  <martin@ximian.com>
6684
6685         * flowanalysis.cs
6686         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6687         actually work and also fix #48962.
6688
6689 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6690
6691         * decl.cs: Do not check System.Object for nested types,
6692         since we know it does not have any. Big bang for buck:
6693
6694         BEFORE:
6695            Run 1:   8.35 seconds
6696            Run 2:   8.32 seconds
6697            corlib:  17.99 seconds
6698         AFTER:
6699            Run 1:   8.17 seconds
6700            Run 2:   8.17 seconds
6701            corlib:  17.39 seconds
6702
6703 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6704
6705         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6706         time we are returning 0 members, so we save alot here.
6707
6708 2003-12-11  Martin Baulig  <martin@ximian.com>
6709
6710         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6711         `MergeChild()', also just take the `FlowBranching' as argument;
6712         call Merge() on it and return the result.
6713         (FlowBranching.Merge): We don't need to do anything if we just
6714         have one sibling.
6715
6716 2003-12-11  Martin Baulig  <martin@ximian.com>
6717
6718         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6719         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6720         Maurer for this idea.
6721
6722 2003-12-11  Martin Baulig  <martin@ximian.com>
6723
6724         * flowanalysis.cs (MergeResult): This class is now gone; we now
6725         use the `UsageVector' for this.  The reason for this is that if a
6726         branching just has one sibling, we don't need to "merge" them at
6727         all - that's the next step to do.
6728         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6729         `MergeResult'.
6730
6731 2003-12-11  Martin Baulig  <martin@ximian.com>
6732
6733         Reworked flow analyis and made it more precise and bug-free.  The
6734         most important change is that we're now using a special `Reachability'
6735         class instead of having "magic" meanings of `FlowReturns'.  I'll
6736         do some more cleanups and optimizations and also add some more
6737         documentation this week.
6738
6739         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6740         largely reworked this class.
6741         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6742         the new `Reachability' class instead of having "magic" values here.
6743         (FlowBranching): We're now using an instance of `Reachability'
6744         instead of having separate `Returns', `Breaks' etc. fields.
6745
6746         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6747         based on flow analysis; ignore the return value of block.Emit ().
6748
6749 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6750
6751         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6752         if they are private.
6753
6754 2003-12-09  Martin Baulig  <martin@ximian.com>
6755
6756         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6757         call them directly on the UsageVector.
6758
6759 2003-12-09  Martin Baulig  <martin@ximian.com>
6760
6761         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6762         Changed return type from `FlowReturns' to `Reachability'.
6763
6764 2003-12-09  Martin Baulig  <martin@ximian.com>
6765
6766         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6767         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6768         `Reachable' fields with a single `Reachability' one.
6769
6770 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6771
6772         * class.cs (FindMembers): Remove foreach's.
6773
6774         Bootstrap times:
6775
6776         BEFORE
6777                 Run 1:   8.74 seconds
6778                 Run 2:   8.71 seconds
6779
6780         AFTER
6781                 Run 1:   8.64 seconds
6782                 Run 2:   8.58 seconds
6783
6784
6785 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6786
6787         * cs-parser.jay:
6788         * gen-treedump.cs:
6789         * statement.cs:
6790         This patch does a few things:
6791                 1. EmptyStatement is now a singleton, so it is never reallocated.
6792                 2. All blah is EmptyStatement constructs have been changed to
6793                    blah == EmptyStatement.Value, which is much faster and valid
6794                    now that EmptyStatement is a singleton.
6795                 3. When resolving a block, rather than allocating a new array for
6796                    the non-empty statements, empty statements are replaced with
6797                    EmptyStatement.Value
6798                 4. Some recursive functions have been made non-recursive.
6799         Mainly the performance impact is from (3), however (1) and (2) are needed for
6800         this to work. (4) does not make a big difference in normal situations, however
6801         it makes the profile look saner.
6802
6803         Bootstrap times:
6804
6805         BEFORE
6806         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6807         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6808         Total memory allocated: 56397 KB
6809
6810         AFTER
6811         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6812         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6813         Total memory allocated: 55666 KB
6814
6815 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6816
6817         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6818         than the hashtable in a hashtable version
6819
6820         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6821         we always end up concating a string. This results in a huge perf
6822         loss, because many strings have to be tracked by the GC. In this
6823         patch, we first use a hashtable that works with two keys, so that
6824         the strings do not need to be concat'ed.
6825
6826         Bootstrap times:
6827         BEFORE
6828                 Run 1:   8.74 seconds
6829                 Run 2:   8.71 seconds
6830
6831         AFTER
6832                 Run 1:   8.65 seconds
6833                 Run 2:   8.56 seconds
6834
6835 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6836
6837         * Makefile: Add a new target `do-time' that does a quick and simple
6838         profile, leaving easy to parse output.
6839
6840 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6841
6842         * codegen.cs (Init): Create the dynamic assembly with 
6843         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6844
6845 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6846
6847         * support.cs: Make the PtrHashtable use only one
6848         instance of its comparer.
6849
6850 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6851
6852         * typemanager.cs: Fix lookup of GetNamespaces.
6853
6854 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6855
6856         * expression.cs: Removed redundant line.
6857
6858         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6859         ArrayLists, use for loops with bounds.  
6860
6861         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6862         arraylist.
6863
6864         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6865         arraylists, use for loop with bounds.
6866
6867         The above three changes give us a 0.071 second performance
6868         improvement out of 3.294 seconds down to 3.223.  On my machine
6869         the above changes reduced the memory usage by 1,387 KB during
6870         compiler bootstrap.
6871
6872         * cs-parser.jay (QualifiedIdentifier): New class used to represent
6873         QualifiedIdentifiers.  Before we created a new string through
6874         concatenation, and mostly later on, the result would be
6875         manipulated by DecomposeQI through string manipulation.
6876
6877         This reduced the compiler memory usage for bootstrapping from
6878         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6879         compile times in 0.05 seconds.
6880
6881 2003-11-28  Dick Porter  <dick@ximian.com>
6882
6883         * support.cs: Do string compares with the Invariant culture.
6884
6885         * rootcontext.cs: 
6886         * gen-treedump.cs: 
6887         * expression.cs: 
6888         * driver.cs: 
6889         * decl.cs: 
6890         * codegen.cs: 
6891         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
6892         the comparison is done with the Invariant culture.
6893
6894 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
6895
6896         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
6897         GetEnumerator method.
6898
6899         (ProbeCollectionType): Iterate starting at the most specific type
6900         upwards looking for a GetEnumerator
6901
6902         * expression.cs: Shift count can be up to 31 for int/uint and 63
6903         for long/ulong.
6904
6905 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
6906
6907         * statement.cs (Block.LookupLabel): Also look for the label on the
6908         children blocks.  Use a hash table to keep track of visited
6909         nodes. 
6910
6911         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
6912         we actually did transform the other operand, otherwise fall back
6913         to the common codepath that casts to long.
6914
6915         * cs-tokenizer.cs: Use the same code pattern as the int case.
6916         Maybe I should do the parsing myself, and avoid depending on the
6917         Parse routines to get this done.
6918
6919 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
6920
6921         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6922         which fixes bug 51347.  This time test it.
6923
6924         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
6925         attributes for example can not tell the difference between these.
6926         The difference was only a syntax feature of the language. 
6927
6928         * attribute.cs: Apply attributes to delegates.
6929
6930         * delegate.cs: Call the apply attributes method.
6931
6932 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
6933
6934         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
6935         comparing 0 vs Byte.MinValue, not the value
6936
6937         (ImplicitConversionRequired): When reporting a conversion error,
6938         use error 31 to print out the constant error instead of the
6939         simpler 29.
6940
6941         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6942         which fixes bug 51347.
6943
6944 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
6945
6946         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
6947         which fixes the -warnaserror command line option.
6948
6949 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
6950
6951         * cfold.cs (DoNumericPromotions): During constant folding of
6952         additions on UIntConstant, special case intconstants with
6953         IntConstants like we do on the expression binary operator. 
6954
6955 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
6956
6957         * convert.cs (ImplicitReferenceConversion): We were missing a case
6958         (System.Enum are not value types or class types, so we need to
6959         classify them separatedly).
6960
6961         * driver.cs: We do not support error 2007.
6962
6963 2003-11-12 Jackson Harper <jackson@ximian.com>
6964
6965         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
6966         system directory. Also use the full file name so users can
6967         libraries names mscorlib-o-tron.dll in a non system dir.
6968         
6969 2004-01-04  David Sheldon <dave-mono@earth.li>
6970
6971         * expression.cs: Added matching ")" to error message for CS0077.
6972
6973 2003-12-19  Martin Baulig  <martin@ximian.com>
6974
6975         * typemanager.cs (TypeManager.IsEqualGenericType): New public
6976         static method; see documentation in the method.
6977         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
6978
6979         * convert.cs (Convert.ImplicitReferenceConversion,
6980         Convert.ImplicitReferenceConversionExists): Add support for
6981         generic type declarations; see gen-36.cs.
6982
6983 2003-12-19  Martin Baulig  <martin@ximian.com>
6984
6985         * pending.cs (Pending.InterfaceMethod): Use
6986         `Type.IsAssignableFrom()' instead of `=='.
6987
6988 2003-12-18  Martin Baulig  <martin@ximian.com>
6989
6990         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
6991         byref types first.
6992
6993         * convert.cs (Convert.ImplicitStandardConversionExists): Use
6994         `expr_type.Equals (target_type)' instead of `=='.
6995
6996 2003-12-08  Martin Baulig  <martin@ximian.com>
6997
6998         * generics.cs (Constraints.Types): Removed.
6999         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
7000         to Type's.
7001         (Constraints.ResolveTypes): New public method; resolves the
7002         TypeExpr's to Type's.
7003         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
7004         longer takes the constraints.
7005         (TypeParameter.DefineMethod): Likewise.
7006         (TypeParameter.DefineType): New public method.  Calls
7007         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
7008         the constraints.
7009
7010 2003-12-08  Martin Baulig  <martin@ximian.com>
7011
7012         * convert.cs (Convert.ImplicitConversionStandard): Use
7013         `expr_type.Equals (target_type)' instead of `=='.
7014
7015 2003-12-08  Martin Baulig  <martin@ximian.com>
7016
7017         * typemanager.cs (TypeManager.GetReferenceType): Call
7018         `Type.MakeByRefType ()'.
7019
7020 2003-12-08  Martin Baulig  <martin@ximian.com>
7021
7022         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
7023         just has some special meaning in some situations.  For instance,
7024         it is allowed to use `where' as the name of a variable etc.
7025
7026 2003-12-04  Martin Baulig  <martin@ximian.com>
7027
7028         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7029         `Type.MakeArrayType()' for array types.
7030
7031 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
7032
7033         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
7034         debugging message.
7035
7036         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
7037         corlib to compile.
7038
7039 2003-11-16  Martin Baulig  <martin@ximian.com>
7040
7041         * codegen.cs (EmitContext.IsGeneric): Removed.
7042
7043         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
7044         ResolveGeneric() on the DeclSpace.
7045
7046 2003-11-16  Martin Baulig  <martin@ximian.com>
7047
7048         * generic.cs (TypeArguments.Resolve):
7049         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
7050         `ResolveType()' on it to get the Type.
7051
7052 2003-11-15  Martin Baulig  <martin@ximian.com>
7053
7054         * generic.cs (ConstructedType.GetInterfaces): Override this.
7055
7056 2003-11-14  Martin Baulig  <martin@ximian.com>
7057
7058         * interface.cs (Interface.DefineType): Define all type parameters
7059         before adding the interfaces we inherit.
7060
7061 2003-11-11  Martin Baulig  <martin@ximian.com>
7062
7063         * generic.cs (ConstructedType.ResolveType): Always call
7064         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
7065
7066 2003-11-10  Martin Baulig  <martin@ximian.com>
7067
7068         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7069         (TypeManager.InitCoreTypes): Initialize them here, but instead of
7070         calling `ResolveType()' on them, directly assign their `Type'.
7071
7072 2003-11-08  Martin Baulig  <martin@ximian.com>
7073
7074         * generic.cs (ConstructedType): Override `IsClass' etc.
7075
7076 2003-11-08  Martin Baulig  <martin@ximian.com>
7077
7078         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7079         return value and the `out parent' parameter.
7080         (TypeContainer.DefineType): Moved the CS0644 check into
7081         GetClassBases().  Don't pass the interface types to the
7082         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7083         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7084
7085         * ecore.cs (TypeExpr.IsAttribute): New property.
7086         (TypeExpr.GetInterfaces): New method.
7087
7088         * interface.cs (Interface.GetInterfaceTypeByName): Return a
7089         TypeExpr instead of a Type.
7090         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7091         (Interface.DefineType): Don't pass the interface types to the
7092         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7093         them later and then call `TypeBulider.AddInterfaceImplementation()'.
7094
7095         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7096         instead of a `Type[]'.
7097         (TypeManager.RegisterBuilder): Likewise.
7098         (TypeManager.AddUserInterface): Likewise.
7099         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7100         `Type[]' and also return a `TypeExpr[]'.
7101         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7102
7103 2003-11-08  Martin Baulig  <martin@ximian.com>
7104
7105         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7106         Expression.     
7107
7108 2003-11-08  Martin Baulig  <martin@ximian.com>
7109
7110         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7111         TypeManager.ResolveExpressionTypes().
7112
7113         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7114         instead of an Expression.
7115         (TypeExpr): This is now an abstract base class for `TypeExpression'.
7116         (TypeExpression): New public class; formerly known as `TypeExpr'.
7117
7118         * expression.cs (ComposedCast): Derive from TypeExpr.
7119
7120         * typemanager.cs (TypeManager.system_*_expr): These are now
7121         TypExpr's instead of Expression's.
7122         (TypeManager.ResolveExpressionTypes): New public static function;
7123         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7124         of them.        
7125
7126 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
7127
7128         * expression.cs (New.DoResolve): Do not dereference value that
7129         might be a null return.
7130
7131         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7132         sure that the constant value has the right type.  Fixes an
7133         unreported bug, similar to 50425.
7134
7135         * const.cs (Const.LookupConstantValue): Call
7136         ImplicitStandardConversionExists before doing a conversion to
7137         avoid havng the TypeManager.ChangeType do conversions.
7138
7139         Reduced the number of casts used
7140
7141         (Const.ChangeType): New routine to enable reuse of the constant
7142         type changing code from statement.
7143
7144         * typemanager.cs (ChangeType): Move common initialization to
7145         static global variables.
7146
7147         Fixes #50425.
7148
7149         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7150         every value type to go through, even if it was void.  Fix that. 
7151
7152         * cs-tokenizer.cs: Use is_identifier_start_character on the start
7153         character of the define, and the is_identifier_part_character for
7154         the rest of the string.
7155
7156 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
7157
7158         * expression.cs (UnaryMutator.EmitCode): When I updated
7159         LocalVariableReference.DoResolve, I overdid it, and dropped an
7160         optimization done on local variable references.
7161
7162 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
7163
7164         * ecore.cs: Convert the return from Ldlen into an int.
7165
7166 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
7167
7168         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7169         the accessibility, this is a special case for toplevel non-public
7170         classes (internal for instance).
7171
7172 2003-10-20  Nick Drochak <ndrochak@gol.com>
7173
7174         * ecore.cs: Fix typo and build.  Needed another right paren.
7175
7176 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
7177
7178         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
7179         `internal' case regular and protected, but not allowing protected
7180         to be evaluated later.  Bug 49840
7181
7182 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
7183
7184         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7185         to kb.Nlast, and not the kb.nFirst to isolate the switch
7186         statement.
7187
7188         Extract the underlying type, so enumerations of long/ulong are
7189         treated like long/ulong.
7190
7191 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
7192
7193         * expression.cs (New): Overload the meaning of RequestedType to
7194         track the possible creation of the NewDelegate type, since
7195         DoResolve is invoked more than once for new constructors on field
7196         initialization.
7197
7198         See bugs: #48800 and #37014
7199
7200         * cs-parser.jay (declare_local_constants): Take an arraylist
7201         instead of a single constant.
7202
7203         (local_constant_declaration): It should take a
7204         constant_declarators, not a constant_declarator.  Fixes 49487
7205
7206         * convert.cs: Fix error report.
7207
7208 2003-10-13 Jackson Harper <jackson@ximian.com>
7209
7210         * typemanager.cs (TypeToCoreType): Add float and double this fixes
7211         bug #49611
7212         
7213 2003-11-03  Martin Baulig  <martin@ximian.com>
7214
7215         * expression.cs (ArrayAccess.GetStoreOpcode): Added
7216         `out bool has_type_arg'; if set, we need to pass the type to
7217         ig.Emit().
7218         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
7219         Stelem_Any/Ldelem_Any for generic parameters.   
7220
7221 2003-11-02  Martin Baulig  <martin@ximian.com>
7222
7223         * expression.cs (Invocation.EmitCall): Use
7224         `TypeManager.IsValueType()' to check whether it's a value type.
7225         Don't set `struct_call' when calling a method on a type parameter.
7226
7227 2003-11-02  Martin Baulig  <martin@ximian.com>
7228
7229         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
7230         and removed the TypeBuilder argument.
7231
7232         * typemanager.cs (TypeManager.IsValueType): Return
7233         `t.IsGenericParameter || t.IsValueType'.
7234
7235 2003-10-25  Martin Baulig  <martin@ximian.com>
7236
7237         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
7238         call ConstructedType.Resolve() on it.
7239
7240         * generic.cs (ConstructedType.Resolve): Set `type' on success.
7241
7242 2003-10-25  Martin Baulig  <martin@ximian.com>
7243
7244         * class.cs (TypeContainer.GetClassBases): Changed
7245         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
7246         CS8214 reporting here.
7247         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
7248         instead of a `Type' for our parent.  In case of a recursive
7249         declaration (see tests/gen-23.cs for an example), our parent is a
7250         ConstructedType and it doesn't have its type set.  So, first
7251         create our own TypeBuilder, then call constructed.Resolve() to get
7252         the parent's type and finally TypeBuilder.SetParent() it.
7253
7254         * ecore.cs (TypeExpr.Name): New public virtual property.
7255
7256         * generic.cs
7257         (ConstructedType): We're now a TypeExpr and not just an Expression.
7258         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
7259         arguments here; this is done later.
7260         (ConstructedType.Resolve): New public method to resolve the type
7261         arguments and bind them.
7262
7263 2003-10-21  Martin Baulig  <martin@ximian.com>
7264
7265         * convert.cs: Use `TypeManager.IsValueType' instead of
7266         'type.IsValueType' everywhere.
7267
7268         * typemanager.cs (TypeManager.IsValueType): Return true for type
7269         parameters.  The reason for this is that we need to box a type
7270         parameter when converting it to a reference type.
7271
7272         * cs-parser.jay: Added support for default value expressions.
7273
7274         * generics.cs (DefaultValueExpression): New public class.       
7275
7276 2003-10-17  Martin Baulig  <martin@ximian.com>
7277
7278         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
7279         TypeContainer so we can also use this for Interfaces.
7280         (TypeParameter.Resolve): Likewise.
7281
7282         * interface.cs (Interface.DefineType): Added support for generic
7283         interfaces.
7284
7285         * cs-parser.jay: Added support for generic structs and interfaces.
7286
7287 2003-10-17  Martin Baulig  <martin@ximian.com>
7288
7289         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
7290         call generic methods :-)
7291
7292 2003-10-16  Martin Baulig  <martin@ximian.com>
7293
7294         * cs-parser.jay (namespace_or_type_name): Only create a
7295         GenericMemberAccess if we actually have type arguments.
7296
7297 2003-10-13  Martin Baulig  <martin@ximian.com>
7298
7299         * class.cs (Method.Define): If we're a generic method, call
7300         TypeBuilder.DefineGenericMethod () before resolving
7301         the parameters.
7302         (MethodData): Added .ctor which takes an additional MethodBuilder
7303         argument; this is used for generic methods.
7304         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
7305         we already have a MethodBuilder.
7306
7307 2003-10-10  Martin Baulig  <martin@ximian.com>
7308
7309         * class.cs (Method): Added .ctor which takes a `GenericMethod'
7310         instead of a `DeclSpace'.  This is used for generic methods.
7311
7312         * cs-parser.jay (method_header): Added support for generic
7313         methods; create a `GenericMethod' instance and pass it to the
7314         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
7315         parameters and locals.
7316
7317         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
7318         since we already have the location.  Check whether we're a generic
7319         type declaration or a generic method and create the correct type
7320         parameter.
7321
7322         * generic.cs (TypeParameter.DefineMethod): New public method.
7323         (GenericMethod): New public class; derives from DeclSpace and is
7324         used for generic methods.       
7325
7326 2003-10-09  Martin Baulig  <martin@ximian.com>
7327
7328         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7329         to the .ctor.
7330         (MethodCore.DoDefineParameters): Removed the TypeContainer
7331         argument; use the DeclSpace which was passed to the .ctor instead.
7332         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7333         TypeContainer; we only need a DeclSpace here.
7334
7335 2003-10-09  Martin Baulig  <martin@ximian.com>
7336
7337         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7338         to the .ctor.
7339         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7340         EmitContext's .ctor.    
7341
7342 2003-10-09  Martin Baulig  <martin@ximian.com>
7343
7344         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7345         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7346         AsAccessible(), moved them as well.
7347
7348         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7349
7350 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7351
7352         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7353         generation for >=, as spotted by Paolo, bug 48679.  
7354         Patch from David Waite.
7355
7356         * cs-tokenizer.cs: Add handling for #pragma.
7357
7358         * cs-parser.jay: Allow for both yield and yield return in the
7359         syntax.  The anti-cobolization of C# fight will go on!
7360
7361         * class.cs (TypeBuilder.DefineType): Catch error condition here
7362         (Parent.DefineType erroring out and returning null).
7363
7364         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7365         coping with enumerations variables, we were mistakenly processing
7366         them as a regular value type instead of built-in types.  Fixes the
7367         bug #48063
7368
7369         * typemanager.cs (IsBuiltinOrEnum): New method.
7370
7371 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7372
7373         * cs-parser.jay: Upgrade: yield now needs the return clause.
7374
7375 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7376
7377         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7378
7379 2003-09-29  Martin Baulig  <martin@ximian.com>
7380
7381         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
7382         inflated generic methods.
7383
7384         * generics.cs (ConstructedType): Distinguish between open and
7385         closed constructed types; correctly resolve the arguments.
7386
7387 2003-09-22  Martin Baulig  <martin@ximian.com>
7388
7389         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
7390         all type arguments meet their constraints.
7391
7392 2003-09-19  Martin Baulig  <martin@ximian.com>
7393
7394         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7395         `MemberCache parent' argument.  Normally, an interface doesn't
7396         have a parent type except System.Object, but we use this in gmcs
7397         for generic type parameters.
7398
7399 2003-09-18  Martin Baulig  <martin@ximian.com>
7400
7401         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7402         on `type.IsInterface'; don't check whether the type has a parent
7403         to determine whether it's an interface.
7404
7405 2003-09-17  Martin Baulig  <martin@ximian.com>
7406
7407         * generic.cs (ConstructedType.ToString): Always use `name' as the
7408         type name.
7409
7410 2003-09-15  Martin Baulig  <martin@ximian.com>
7411
7412         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7413
7414         * generic.cs (Constraints.Resolve): New public method; this is
7415         called to resolve the constraint types and to check whether all
7416         the constraints are correct.
7417         (Constraints.Types): New public property.
7418         (TypeParameter.Resolve): New public method; resolves all the
7419         type's constraints.
7420
7421         * class.cs (TypeContainer.DefineType): Call
7422         TypeParameter.Resolve() before actually defining the type.
7423
7424 2003-09-15  Martin Baulig  <martin@ximian.com>
7425
7426         * class.cs (TypeContainer.DefineType): Added an error flag to
7427         avoid reporting duplicate CS0146's ("class definition is
7428         circular.").
7429
7430         * driver.cs (Driver.MainDriver): Abort if
7431         RootContext.ResolveTree() reported any errors.
7432
7433 2003-09-07  Martin Baulig  <martin@ximian.com>
7434
7435         * report.cs (Error, Warning): Added overloaded versions which take
7436         a `params object[] args' and call String.Format().
7437
7438 2003-09-07  Martin Baulig  <martin@ximian.com>
7439
7440         * decl.cs (DeclSpace..ctor): Don't call
7441         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7442         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7443         (DeclSpace.RecordDecl): New method.
7444
7445         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7446
7447 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7448
7449         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7450         value attributes to be applied to ParameterBuilders.
7451
7452         * class.cs (MethodCore.LabelParameters): Make static and more
7453         generic so that it can be used from other places - like interface
7454         methods, for instance.
7455
7456         * interface.cs (Interface.Emit): Call LabelParameters before
7457         emitting attributes on the InterfaceMethod.
7458
7459 2003-09-07  Martin Baulig  <martin@ximian.com>
7460
7461         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7462         if the number of type parameters doesn't match.
7463
7464 2003-09-04  Martin Baulig  <martin@ximian.com>
7465
7466         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7467         for arrays of generic type params (ie. `!0[]').
7468
7469 2003-09-04  Martin Baulig  <martin@ximian.com>
7470
7471         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7472         for the moment.
7473
7474 2003-09-04  Martin Baulig  <martin@ximian.com>
7475
7476         * decl.cs (DeclSpace.LookupGeneric): New method.
7477         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7478         moment.
7479
7480         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7481         argument, not just a string.
7482         (TypeParameter.Define): New public method; this is called to
7483         actually define the generic parameter; after this, you can use the
7484         new `Type' property to get the type.
7485
7486 2003-09-04  Martin Baulig  <martin@ximian.com>
7487
7488         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7489         is now an ArrayList; initialize the result of the `TypeParameters'
7490         property here.
7491         (DeclSpace.GetGenericData): Removed.
7492         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7493         implement this in a different way.
7494         (DeclSpace.GetTypeParameters): Removed; there's now a
7495         `TypeParameters' property.
7496         (DeclSpace.TypeParameters): New public property.
7497
7498         * generic.cs (Constraints): Make this class public.
7499         (TypeParameter): New public class.
7500
7501 2003-09-04  Martin Baulig  <martin@ximian.com>
7502
7503         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7504         generic parameters.
7505
7506         * class.cs (TypeContainer.DefineType): Call
7507         TypeBuilder.DefineGenericParameter () on all generic parameters if
7508         this is a generic type.
7509
7510 2003-08-28  Martin Baulig  <martin@ximian.com>
7511
7512         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7513         sample-stack.il".
7514
7515         * sample-hello.cs: Compile this with gmcs: "gmcs
7516         /r:sample-stack.dll sample-hello.cs".
7517
7518 2003-08-28  Martin Baulig  <martin@ximian.com>
7519
7520         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7521         the parameters to the generic type.
7522
7523 2003-08-28  Martin Baulig  <martin@ximian.com>
7524
7525         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7526
7527 2003-08-28  Martin Baulig  <martin@ximian.com>
7528
7529         * cs-parser.jay (opt_type_argument_list): Use
7530         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7531         (primary_expression): Replace `qualified_identifier' with `type_name'.
7532         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7533
7534         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7535         parser to check whether it is syntactically a type parameter list;
7536         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7537         this case.
7538
7539 2003-08-26  Martin Baulig  <martin@ximian.com>
7540
7541         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7542         resolving aliases; fixes #47927.
7543
7544 2003-08-26  Martin Baulig  <martin@ximian.com>
7545
7546         * statement.cs (Using.DoResolve): This is internally emitting a
7547         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7548         do not always return.  Fixes #47681.
7549
7550 2003-08-26  Martin Baulig  <martin@ximian.com>
7551
7552         * decl.cs (MemberCore): Moved WarningNotHiding(),
7553         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7554         into MemberBase.
7555         (AdditionResult): Make this nested in DeclSpace.
7556         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7557         argument; call NamespaceEntry.Define() unless we're nested in a
7558         class or struct.
7559
7560         * namespace.cs (Namespace.DefineName): New public function.  This
7561         is called from DeclSpace's .ctor to add 
7562         (Namespace.Lookup): Include DeclSpaces in the lookup.
7563
7564         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7565
7566         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7567
7568 2003-08-25  Martin Baulig  <martin@ximian.com>
7569
7570         * convert.cs (Convert.ExplicitReferenceConversion): When
7571         converting from an interface type to a class, unbox if the target
7572         type is a struct type.  Fixes #47822.
7573
7574 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7575
7576         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7577         #47854.
7578
7579 2003-08-22  Martin Baulig  <martin@ximian.com>
7580
7581         * class.cs (TypeManager.DefineType): When defining a nested type,
7582         call DefineType() on our parent; fixes #47801.
7583
7584 2003-08-22  Martin Baulig  <martin@ximian.com>
7585
7586         * class.cs (MethodData.Define): While checking if a method is an
7587         interface implementation, improve the test a bit more to fix #47654.
7588
7589 2003-08-22  Martin Baulig  <martin@ximian.com>
7590
7591         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7592         correctly; fixes #47722.
7593
7594 2003-08-22  Martin Baulig  <martin@ximian.com>
7595
7596         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7597         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7598
7599         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7600
7601 2003-08-22  Martin Baulig  <martin@ximian.com>
7602
7603         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7604         can only be assigned in static constructors.  Fixes #47161.
7605
7606 2003-08-22  Martin Baulig  <martin@ximian.com>
7607
7608         Rewrote and improved the flow analysis code.
7609
7610         * flowbranching.cs (FlowBranching): Make this class abstract.
7611         (FlowBranching.CreateBranching): New static function to create a
7612         new flow branching.
7613         (FlowBranchingBlock, FlowBranchingException): New classes.
7614         (FlowBranching.UsageVector.Type): New public readonly field.
7615         (FlowBranching.UsageVector.Breaks): Removed the setter.
7616         (FlowBranching.UsageVector.Returns): Removed the setter.
7617         (FlowBranching.UsageVector): Added Break(), Return(),
7618         NeverReachable() and Throw() methods to modify the reachability.
7619         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7620         done by FlowBranching.Merge().
7621         (FlowBranching.UsageVector.MergeChild): New method; merges the
7622         merge result into the current vector.
7623         (FlowBranching.Merge): New abstract method to merge a branching.
7624
7625 2003-08-12  Martin Baulig  <martin@ximian.com>
7626
7627         * expression.cs (Indirection.CacheTemporaries): Create the
7628         LocalTemporary with the pointer type, not its element type.
7629
7630 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7631
7632         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7633         token was a keyword or not.
7634
7635         Add `error' options where an IDENTIFIER was expected;  Provide
7636         CheckToken and CheckIdentifierToken convenience error reporting
7637         functions. 
7638
7639         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7640
7641         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7642         NameSpaceEntry NameSpaceEntry.
7643
7644         (LookupInterfaceOrClass): Avoid creating a full qualified name
7645         from namespace and name: avoid doing lookups when we know the
7646         namespace is non-existant.   Use new Tree.LookupByNamespace which
7647         looks up DeclSpaces based on their namespace, name pair.
7648
7649         * driver.cs: Provide a new `parser verbose' to display the
7650         exception thrown during parsing.  This is turned off by default
7651         now, so the output of a failure from mcs is more graceful.
7652
7653         * namespace.cs: Track all the namespaces defined in a hashtable
7654         for quick lookup.
7655
7656         (IsNamespace): New method
7657
7658 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7659
7660         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7661         we know that we need to concatenate (full typename can never be
7662         null). 
7663
7664         * class.cs: ditto.
7665
7666         * statement.cs: Use a bitfield;  Do not initialize to null things
7667         which are done by the constructor by default.
7668
7669         * cs-parser.jay: bug fix, parameter was 4, not 3.
7670
7671         * expression.cs: Just use the property;
7672
7673         * statement.cs: No need for GetVariableInfo method.
7674
7675 2003-08-08  Martin Baulig  <martin@ximian.com>
7676
7677         * flowanalysis.cs (FlowReturns): This is now nested in the
7678         `FlowBranching' class.
7679         (MyBitVector): Moved this here from statement.cs.
7680         (FlowBranching.SiblingType): New enum type.
7681         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7682
7683 2003-08-07  Martin Baulig  <martin@ximian.com>
7684
7685         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7686         `FlowBranching' class and called `BranchingType'.
7687
7688 2003-08-07  Martin Baulig  <martin@ximian.com>
7689
7690         * flowanalysis.cs: Moved all the control flow analysis code into
7691         its own file.
7692
7693 2003-08-07  Martin Baulig  <martin@ximian.com>
7694
7695         * assign.cs (Assign.DoResolve): `target' must either be an
7696         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7697         #37319.
7698
7699 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7700
7701         * expression.cs (BinaryMethod): This kind of expression is created by the
7702         Binary class if it determines that the operator has to be handled
7703         by a method.
7704
7705         (BinaryDelegate): This kind of expression is created if we are
7706         dealing with a + or - operator on delegates.
7707
7708         (Binary): remove method, argumetns, and DelegateOperator: when
7709         dealing with methods, 
7710
7711         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7712
7713         * statement.cs (Block): use bitfields for the three extra booleans
7714         we had in use.   Remove unused topblock parameter.
7715
7716         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7717
7718         * assign.cs: Drop extra unneeded tests.
7719
7720 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7721
7722         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7723
7724         * statement.cs (Foreach): Use VariableStorage instead of
7725         LocalBuilders.   
7726
7727         * codegen.cs (VariableStorage): New class used by clients that
7728         require a variable stored: locals or fields for variables that
7729         need to live across yield.
7730
7731         Maybe provide a convenience api for EmitThis+EmitLoad?
7732
7733         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7734         these bad boys.
7735
7736 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7737
7738         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7739         RemapParameterLValue): New methods that are used to turn a
7740         precomputed FieldInfo into an expression like this:
7741
7742                 instance.FieldInfo
7743
7744         The idea is to use this instead of making LocalVariableReference
7745         have more than one meaning.
7746
7747         * cs-parser.jay: Add error production to BASE.
7748
7749         * ecore.cs: Deal with TypeManager.GetField returning null, which
7750         is now a valid return value.
7751
7752         (FieldExprNoAddress): New expression for Fields whose address can
7753         not be taken.
7754
7755         * expression.cs (LocalVariableReference): During the resolve
7756         phases, create new expressions if we are in a remapping context.
7757         Remove code that dealt with remapping here.
7758
7759         (ParameterReference): same.
7760
7761         (ProxyInstance): New expression, like the `This' expression, but
7762         it is born fully resolved.  We know what we are doing, so remove
7763         the errors that are targeted to user-provided uses of `this'.
7764
7765         * statement.cs (Foreach): our variable is now stored as an
7766         Expression;  During resolution, follow the protocol, dont just
7767         assume it will return this.
7768
7769 2003-08-06  Martin Baulig  <martin@ximian.com>
7770
7771         * support.cs (SeekableStreamReader.cs): New public class.
7772
7773         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7774         SeekableStreamReader instead of the normal StreamReader.
7775
7776 2003-08-04  Martin Baulig  <martin@ximian.com>
7777
7778         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7779         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7780         deambiguate casts and delegate invocations.
7781         (parenthesized_expression): Use the new tokens to ensure this is
7782         not a cast of method invocation.
7783
7784         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7785         when reading a `)' and Deambiguate_CloseParens () was previously
7786         called.
7787
7788         * expression.cs (ParenthesizedExpression): New class.  This is
7789         just used for the CS0075 test.
7790         (Binary.DoResolve): Check for CS0075.   
7791
7792 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7793
7794         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7795         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7796         reference comparison.
7797
7798         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7799         examine the ReturnType for equality - this is necessary in the
7800         cases of implicit and explicit operators whose signature also
7801         includes the return type.
7802
7803 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7804
7805         * namespace.cs: Cache the result of the namespace computation,
7806         instead of computing it every time.
7807
7808 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7809
7810         * decl.cs: Use a global arraylist that we reuse over invocations
7811         to avoid excesive memory consumption.  Reduces memory usage on an
7812         mcs compile by one meg (45 average).
7813
7814         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7815         private, work around that.
7816
7817 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7818
7819         * literal.cs (IntLiteral): Define Zero and One static literals. 
7820
7821         * cs-parser.jay (integer_literal): use static literals to reduce
7822         memory usage for the most used literals (0, 1 and -1).  211kb
7823         reduced in memory usage.
7824
7825         Replace all calls to `new ArrayList' with `new
7826         ArrayList(4)' which is a good average number for most allocations,
7827         and also requires only 16 bytes of memory for its buffer by
7828         default. 
7829
7830         This reduced MCS memory usage in seven megabytes for the RSS after
7831         bootstrapping.
7832
7833 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7834
7835         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7836         handle params methods the correct way by forming only one
7837         applicable set with params and normal methods in them. Earlier we
7838         were looking at params methods only if we found no normal methods
7839         which was not the correct thing to do.
7840
7841         (Invocation.BetterFunction): Take separate arguments indicating
7842         when candidate and the best method are params methods in their
7843         expanded form.
7844
7845         This fixes bugs #43367 and #46199.
7846
7847         * attribute.cs: Documentation updates.
7848
7849         (CheckAttribute): Rename to CheckAttributeTarget.
7850         (GetValidPlaces): Rename to GetValidTargets.
7851
7852         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7853         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7854
7855         Fixes bug #44468.
7856
7857 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
7858
7859         * codegen.cs: Compute IsGeneric correctly.
7860
7861         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
7862         resolution. 
7863
7864         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
7865         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
7866         regressions, and I was chasing more bugs than I required.
7867
7868         * interface.cs: Use expressions for base type names (like classes
7869         and structs have been doing for a while now), and resolve that.
7870         This patch should probably go into head as well.
7871
7872         This makes it one less user of FindType.
7873
7874 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7875
7876         This compiler can not self host currently.  Need to fix that.
7877         
7878         * Makefile: compile to `gmcs.exe'
7879
7880         * driver.cs: Turn on v2 by default on gmcs.
7881
7882         * generic.cs (ConstructedType): Does no longer take a container
7883         type argument;  That will be taken care of later.
7884
7885         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
7886         Use SimpleName to resolve for now, so we can continue the work on
7887         the parser, until we get Type.GetType that understands generics.
7888
7889         (ConstructedType.ToString): Implement
7890
7891         (TypeArguments.Resolve): Resolve the child expressions as types. 
7892         
7893         * cs-parser.jay: Rename interface_constraints to
7894         type_parameter_constraints
7895
7896         (namespace_or_type_name): Only use constructed types for the basic
7897         construction, we will deal with identifier<...> later.
7898
7899         (type/type_name): No longer call DecomposeQI, as
7900         namespace_or_type_name is always decoded now.
7901         
7902 2003-07-22  Ravi Pratap  <ravi@ximian.com>
7903
7904         * expression.cs (Invocation.OverloadResolve): Follow the spec more
7905         closely: we eliminate methods in base types when we have an
7906         applicable method in a top-level type.
7907
7908         Please see section 14.5.5.1 for an exact description of what goes
7909         on. 
7910
7911         This fixes bug #45127 and a host of other related to corlib compilation.
7912
7913         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
7914         array is the method corresponding to the top-level type (this is
7915         because of the changes made to icall.c) so we change this
7916         accordingly.
7917
7918         (MethodGroupExpr.Name): This too.
7919
7920         * typemanager.cs (GetElementType): New method which does the right
7921         thing when compiling corlib. 
7922
7923         * everywhere: Make use of the above in the relevant places.
7924
7925 2003-07-22  Martin Baulig  <martin@ximian.com>
7926
7927         * cs-parser.jay (invocation_expression): Moved
7928         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
7929         `cast_expression', but create a InvocationOrCast which later
7930         resolves to either an Invocation or a Cast.
7931
7932         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
7933         method; call this before EmitStatement() to make sure that this
7934         expression can be used as a statement.
7935
7936         * expression.cs (InvocationOrCast): New class; resolves to either
7937         an Invocation or a Cast.
7938
7939         * statement.cs (StatementExpression): Call ResolveStatement() on
7940         the ExpressionStatement before emitting it.
7941
7942 2003-07-21  Martin Baulig  <martin@ximian.com>
7943
7944         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
7945         `ref' and `out' attributes match; fixes #46220.
7946         (MemberAccess.ResolveMemberAccess): You can't reference a type
7947         through an expression; fixes #33180.
7948         (Indexers.GetIndexersForType): Don't return the indexers from
7949         interfaces the class implements; fixes #46502.
7950
7951 2003-07-21  Martin Baulig  <martin@ximian.com>
7952
7953         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
7954         CS0661 checks; fixes bug #30442.
7955
7956 2003-07-21  Martin Baulig  <martin@ximian.com>
7957
7958         * decl.cs (AdditionResult): Added `Error'.
7959
7960         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
7961
7962         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
7963         cs0031.cs actually work.
7964
7965  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7966  
7967         * cs-parser.jay (namespace_name): do not use
7968         namespace_or_type_name, use qualified_identifier, because
7969         namespace_or_type_name will soon return a composed expression
7970         instead of a string.
7971  
7972         (namespace_or_type_name): Instead of returning a string, now this
7973         production returns an expression.
7974  
7975         * codegen.cs (EmitContext): Setup IsGeneric property based on
7976         whether our DeclSpace is generic, our the method is generic.
7977  
7978         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
7979         the method is generic.
7980  
7981         * cs-parser.jay (type_arguments, opt_type_argument_list,
7982         type_parameters, type_parameter_list, opt_type_parameter_list,
7983         type_parameter,, opt_type_parameter_constraints_clauses,
7984         type_parameter_constraints_clauses,
7985         type_parameter_constraint_clause, type_parameter_constraint,
7986         interface_constraints): Add new production
7987  
7988         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
7989         DeclSpace is generic or not.
7990  
7991         (DeclSpace.SetParameterInfo): New routine, used to set the
7992         parameter info for a type.
7993  
7994         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
7995         returns a GenericTypeExpr
7996  
7997         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
7998         generic, lookup the generic argument.
7999  
8000         * attribute.cs: Do not allow TypeParameterExpressions in
8001         Attributes.
8002  
8003         * class.cs: Do not allow the Main method to be defined in a
8004         Generic container.
8005  
8006         * expression.cs (SizeOf): Do not allow generic types to be used as
8007         arguments to sizeof.
8008  
8009         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
8010         it: whether a type is generic or not.  Only works for types we are
8011         currently building for now.
8012         
8013 2003-07-20  Martin Baulig  <martin@ximian.com>
8014
8015         * namespace.cs: Fixed that bug which caused a crash when compiling
8016         the debugger's GUI.
8017
8018 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8019
8020         * typemanager.cs (LookupTypeReflection): Never expose types which
8021         are NotPublic, NestedPrivate, NestedAssembly, or
8022         NestedFamANDAssem.  We used to return these, and later do a check
8023         that would report a meaningful error, but the problem is that we
8024         would not get the real match, if there was a name override.
8025
8026 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8027
8028         * namespace.cs (Namespace, Name): Do not compute the namespace
8029         name dynamically, compute it in the constructor.  This reduced
8030         memory usage by 1697 KB.
8031
8032         * driver.cs: Use --pause to pause at the end.
8033
8034 2003-07-17  Peter Williams  <peter@newton.cx>
8035
8036         * Makefile: Change the name of the test target so that it doesn't
8037         conflict with the recursive test target.
8038
8039 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8040
8041         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8042         AddressOf): Do not use EmitThis, that was wrong, use the actual
8043         this pointer.
8044
8045 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8046
8047         * class.cs (MethodData.Define): While checking if a method is an
8048         interface implementation, improve the test: If we are not public
8049         (use new test here: use the computed MethodAttributes directly,
8050         instead of the parsed modifier flags) check if the `implementing'
8051         method comes from an interface or not.
8052
8053         * pending.cs (VerifyPendingMethods): Slightly better error
8054         message.
8055
8056         * makefile: add test target that does the mcs bootstrap.
8057
8058 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8059
8060         * interface.cs (Define): Do nothing here since there are no
8061         members to populate etc. Move the attribute emission out of here
8062         since this was just totally the wrong place to put it. Attribute
8063         application happens during the 'Emit' phase, not in the 'Define'
8064         phase.
8065
8066         (Emit): Add this method and move the attribute emission here
8067
8068         * rootcontext.cs (EmitCode): Call the Emit method on interface
8069         types too.
8070
8071 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8072
8073         * expression.cs (OverloadResolve): Report error only if Location
8074         is not 'Null' which means that there was a probe going on.
8075
8076 2003-07-14  Martin Baulig  <martin@ximian.com>
8077
8078         * expression.cs (ConditionalLogicalOperator): New public class to
8079         implement user defined conditional logical operators.
8080         This is section 14.11.2 in the spec and bug #40505.
8081
8082 2003-07-14  Martin Baulig  <martin@ximian.com>
8083
8084         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8085
8086 2003-07-14  Martin Baulig  <martin@ximian.com>
8087
8088         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8089
8090         * ecore.cs (IVariable.VerifyFixed): New interface method.
8091
8092         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8093         operator, check whether the variable is actually fixed.  Fixes bug
8094         #36055.  Set a variable definitely assigned when taking its
8095         address as required by the spec.
8096
8097         * statement.cs (LocalInfo.IsFixed): New field.
8098         (LocalInfo.MakePinned): Set `IsFixed' to true.
8099
8100 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8101
8102         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8103         for .ctors, ensure that we only ask for members declared in the
8104         attribute type (BindingFlags.DeclaredOnly).
8105
8106         Fixes bug #43632.
8107
8108         * expression.cs (Error_WrongNumArguments): Report error 1501
8109         correctly the way CSC does.
8110
8111 2003-07-13  Martin Baulig  <martin@ximian.com>
8112
8113         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8114         lookup on the fully qualified name, to make things like "X.X" work
8115         where "X.X" is a fully qualified type name, but we also have a
8116         namespace "X" in the using list.  Fixes #41975.
8117
8118 2003-07-13  Martin Baulig  <martin@ximian.com>
8119
8120         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8121         function. If we're a CompoundAssign, we need to create an embedded
8122         CompoundAssign, not an embedded Assign.
8123         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8124         Fixes #45854.
8125
8126 2003-07-13  Martin Baulig  <martin@ximian.com>
8127
8128         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8129         work to fix bug #46088.
8130
8131 2003-07-13  Ravi Pratap <ravi@ximian.com>
8132
8133         * class.cs (Operator.Emit): Do not emit attributes here - it is
8134         taken care of by the Method class that we delegate too. This takes
8135         care of bug #45876.
8136
8137 2003-07-10  Martin Baulig  <martin@ximian.com>
8138
8139         * expression.cs (TypeOfVoid): New class.
8140         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8141
8142 2003-07-10  Martin Baulig  <martin@ximian.com>
8143
8144         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8145         bug #35957.
8146
8147 2003-07-10  Martin Baulig  <martin@ximian.com>
8148
8149         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8150         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8151
8152         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8153
8154         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8155
8156 2003-07-10  Martin Baulig  <martin@ximian.com>
8157
8158         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8159         of decimal.  Fixes #42850.
8160
8161         NOTE: I also fixed the created byte blob, but this doesn't work on
8162         the MS runtime and csc never produces any byte blobs for decimal
8163         arrays.
8164
8165 2003-07-10  Martin Baulig  <martin@ximian.com>
8166
8167         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8168         structs; fixes #32068.
8169         (Block.AddChildVariableNames): Fixed #44302.
8170
8171 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8172
8173         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8174
8175 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8176
8177         * attribute.cs: And this test is onger needed.
8178
8179 2003-07-08  Martin Baulig  <martin@ximian.com>
8180
8181         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8182         inaccessible types.  Fixes #36313.
8183
8184         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8185
8186         * namespace.cs (NamespaceEntry): Create implicit entries for all
8187         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8188         implicit entries for N1.N2 and N1.
8189
8190 2003-07-08  Martin Baulig  <martin@ximian.com>
8191
8192         Rewrote the handling of namespaces to fix a lot of the issues
8193         wrt. `using' aliases etc.
8194
8195         * namespace.cs (Namespace): Splitted this class into a
8196         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8197
8198         * typemanager.cs (TypeManager.IsNamespace): Removed.
8199         (TypeManager.ComputeNamespaces): Only compute namespaces from
8200         loaded assemblies here, not the namespaces from the assembly we're
8201         currently compiling.
8202
8203 2003-07-08  Martin Baulig  <martin@ximian.com>
8204
8205         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8206
8207 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8208
8209         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8210         already fixed it.  
8211
8212         I thought about the memory savings here, but LookupTypeReflection
8213         is used under already very constrained scenarios.  Compiling
8214         corlib or mcs only exposes one hit, so it would not really reduce
8215         any memory consumption.
8216
8217 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8218
8219         * typemanager.cs: fixes bug #45889 by only adding public types from
8220         other assemblies to the list of known types.
8221
8222 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8223
8224         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8225         on the type we resolved.
8226
8227 2003-07-05  Martin Baulig  <martin@ximian.com>
8228
8229         * pending.cs (PendingImplementation.ParentImplements): Don't
8230         create the proxy if the parent is abstract.
8231
8232         * class.cs (TypeContainer.DefineIndexers): Process explicit
8233         interface implementations first.  Fixes #37714.
8234
8235 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8236
8237         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8238         defined recursively;  but since we modify the input parameters
8239         (left is set to `this' temporarily), we reset this value if the
8240         left_is_explicit is false, which gives the original semantics to
8241         the code.  
8242
8243         * literal.cs (NullPointer): new class used to represent a null
8244         literal in a pointer context.
8245
8246         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8247         type is a pointer, use a NullPointer object instead of a
8248         NullLiteral.   Closes 43687
8249
8250         (ExplicitConversion): Convert pointer values using
8251         the conv opcode to the proper type.
8252
8253         * ecore.cs (New): change ValueTypeVariable property into a method,
8254         that returns whether the valuetype is suitable for being used.
8255
8256         * expression.cs (Binary.DoNumericPromotions): Only return if we
8257         the int constant was a valid uint, and we can return both left and
8258         right as uints.  If not, we continue processing, to trigger the
8259         type conversion.  This fixes 39018.
8260
8261         * statement.cs (Block.EmitMeta): During constant resolution, set
8262         the CurrentBlock property on the emitcontext, so that we resolve
8263         constants propertly.
8264
8265 2003-07-02  Martin Baulig  <martin@ximian.com>
8266
8267         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8268         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8269
8270         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8271         than emitting it here.
8272
8273         * statement.cs: Fixed some more flow analysis bugs.
8274
8275 2003-07-02  Martin Baulig  <martin@ximian.com>
8276
8277         * class.cs (MethodData.Define): When implementing interface
8278         methods, set Final unless we're Virtual.
8279
8280         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8281         check work for interface methods.
8282
8283 2003-07-01  Martin Baulig  <martin@ximian.com>
8284
8285         * ecore.cs (EmitContext.This): Replaced this property with a
8286         GetThis() method which takes a Location argument.  This ensures
8287         that we get the correct error location for a CS0188.
8288
8289 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8290
8291         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8292         ImplicitStandardConversion.
8293
8294         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8295
8296 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8297
8298         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8299         optimization.
8300
8301 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8302
8303         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8304         constructors.
8305
8306         (MethodData.Define): Turn off initlocals for unsafe methods.
8307
8308 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8309
8310         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8311         complete;  Fixes #37521.
8312
8313         * delegate.cs: Use Modifiers.TypeAttr to compute the
8314         TypeAttributes, instead of rolling our own.  This makes the flags
8315         correct for the delegates.
8316
8317 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8318
8319         * class.cs (Constructor.Define): Set the private flag for static
8320         constructors as well.
8321
8322         * cs-parser.jay (statement_expression): Set the return value to
8323         null, to avoid a crash when we catch an error.
8324
8325 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8326
8327         * cs-parser.jay: Applied patch from Jackson that adds support for
8328         extern and unsafe modifiers to destructor declarations.
8329
8330         * expression.cs: Report error 21 if the user is trying to index a
8331         System.Array.
8332
8333         * driver.cs: Add an error message, suggested by the bug report.
8334
8335         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8336         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8337
8338 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8339
8340         * namespace.cs: Add some information to reduce FAQs.
8341
8342 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8343
8344         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8345         underlying enumeration types.  Fixes #43915.
8346
8347         * expression.cs: Treat ushort/short as legal values to be used in
8348         bitwise operations.
8349
8350 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8351
8352         * delegate.cs: transfer custom attributes for paramenters from
8353         the delegate declaration to Invoke and BeginInvoke.
8354
8355 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8356
8357         * attribute.cs: handle custom marshalers and emit marshal info
8358         for fields, too.
8359
8360 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8361
8362         * makefile.gnu: Added anonymous.cs to the compiler sources.
8363
8364 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8365
8366         * iterators.cs: Change the name of the proxy class to include two
8367         underscores.
8368
8369         * cs-parser.jay: Update grammar to include anonymous methods.
8370
8371         * anonymous.cs: new file.
8372
8373 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8374
8375         * class.cs (Field.Define): Add missing test for pointers and
8376         safety. 
8377
8378 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8379
8380         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8381         we use the stobj opcode.
8382
8383         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8384         since it wasn't the correct fix. 
8385
8386         It still is puzzling that we are required to use stobj for IntPtr
8387         which seems to be a ValueType.
8388
8389 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8390
8391         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8392         during regular simple name resolution.   Now, the trick is that
8393         instead of returning for processing the simplename, we do a
8394         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8395         contextual lookup type).   If a match is found, return that, if
8396         not, return for further composition.
8397
8398         This fixes long-standing 30485.
8399
8400         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8401         using the address to initialize an object, do an Stobj instead of
8402         using the regular Stelem.
8403
8404         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8405         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8406         Because if we are a BaseIndexerAccess that value will be true.
8407         Fixes 43643.
8408
8409         * statement.cs (GotoCase.Resolve): Return after reporting an
8410         error, do not attempt to continue. 
8411
8412         * expression.cs (PointerArithmetic.Emit): If our operand is a
8413         long, convert our constants to match the operand before
8414         multiplying.  Convert to I type before adding.   Fixes 43670.
8415
8416 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8417
8418         * enum.cs (ImplicitConversionExists) : Rename to
8419         ImplicitEnumConversionExists to remove ambiguity. 
8420
8421         * ecore.cs (NullCast): New type of cast expression class which
8422         basically is very similar to EmptyCast with the difference being
8423         it still is a constant since it is used only to cast a null to
8424         something else
8425         (eg. (string) null)
8426
8427         * convert.cs (ImplicitReferenceConversion): When casting a null
8428         literal, we return a NullCast.
8429
8430         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8431         should be around anymore.
8432
8433         The renaming (reported was slightly wrong). Corrections:
8434
8435         ConvertImplicitStandard -> ImplicitConversionStandard
8436         ConvertExplicitStandard -> ExplicitConversionStandard
8437
8438         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8439         before passing them in !
8440
8441         * convert.cs (ImplicitConversionStandard): When comparing for
8442         equal expr and target types, ensure that expr is not a
8443         NullLiteral.
8444
8445         In general, we must not be checking (expr_type ==
8446         target_type) in the top level conversion methods
8447         (ImplicitConversion, ExplicitConversion etc). This checking is
8448         done in the methods that they delegate to.
8449
8450 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8451
8452         * convert.cs: Move Error_CannotConvertType,
8453         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8454         ImplicitNumericConversion, ImplicitConversionExists,
8455         ImplicitUserConversionExists, StandardConversionExists,
8456         FindMostEncompassedType, FindMostSpecificSource,
8457         FindMostSpecificTarget, ImplicitUserConversion,
8458         ExplicitUserConversion, GetConversionOperators,
8459         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8460         TryImplicitIntConversion, Error_CannotConvertImplicit,
8461         ConvertImplicitRequired, ConvertNumericExplicit,
8462         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8463         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8464         its own file.
8465
8466         Perform the following renames:
8467
8468         StandardConversionExists -> ImplicitStandardConversionExists
8469         ConvertImplicit -> ImplicitConversion
8470         ConvertImplicitStandard -> ImplicitStandardConversion
8471         TryImplicitIntConversion -> ImplicitIntConversion
8472         ConvertImplicitRequired -> ImplicitConversionRequired
8473         ConvertNumericExplicit -> ExplicitNumericConversion
8474         ConvertReferenceExplicit -> ExplicitReferenceConversion
8475         ConvertExplicit -> ExplicitConversion
8476         ConvertExplicitStandard -> ExplicitStandardConversion
8477
8478 2003-05-19  Martin Baulig  <martin@ximian.com>
8479
8480         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8481         (TypeInfo): Added support for structs having structs as fields.
8482
8483         * ecore.cs (FieldExpr): Implement IVariable.
8484         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8485         VariableInfo for the field.
8486
8487 2003-05-18  Martin Baulig  <martin@ximian.com>
8488
8489         * expression.cs (This.DoResolve): Report a CS0027 if we're
8490         emitting a field initializer.
8491
8492 2003-05-18  Martin Baulig  <martin@ximian.com>
8493
8494         * expression.cs (This.ResolveBase): New public function.
8495         (This.DoResolve): Check for CS0188.
8496
8497         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8498         This.Resolve().
8499
8500         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8501         `instance_expression' to null if we don't have any non-static
8502         methods.
8503
8504 2003-05-18  Martin Baulig  <martin@ximian.com>
8505
8506         Reworked the way how local variables and parameters are handled by
8507         the flow analysis code.
8508
8509         * statement.cs (TypeInfo, VariableMap): New public classes.
8510         (VariableInfo): New public class.  This is now responsible for
8511         checking whether a variable has been assigned.  It is used for
8512         parameters and local variables.
8513         (Block.EmitMeta): Take the InternalParameters as argument; compute
8514         the layout of the flow vectors here.
8515         (Block.LocalMap, Block.ParameterMap): New public properties.
8516         (FlowBranching): The .ctor doesn't get the InternalParameters
8517         anymore since Block.EmitMeta() now computes the layout of the flow
8518         vector.
8519         (MyStructInfo): This class is now known as `StructInfo' and nested
8520         in `TypeInfo'; we don't access this directly anymore.
8521
8522         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8523         property and removed IsAssigned(), IsFieldAssigned(),
8524         SetAssigned() and SetFieldAssigned(); we now call them on the
8525         VariableInfo so we don't need to duplicate this code everywhere.
8526
8527         * expression.cs (ParameterReference): Added `Block block' argument
8528         to the .ctor.
8529         (LocalVariableReference, ParameterReference, This): The new
8530         VariableInfo class is now responsible for all the definite
8531         assignment stuff.
8532
8533         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8534         IsParameterAssigned, SetParameterAssigned): Removed.
8535
8536 2003-05-18  Martin Baulig  <martin@ximian.com>
8537
8538         * typemanager.cs (InitCoreTypes): Try calling
8539         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8540         the 3-args-version.  Corlib now also needs our `void_type'.
8541         (GetMethod): Added overloaded version which takes an optional
8542         `bool report_errors' to allow lookups of optional methods.
8543
8544 2003-05-12  Martin Baulig  <martin@ximian.com>
8545
8546         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8547         only used for locals and not for parameters.
8548
8549 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8550
8551         * support.cs (InternalParameters.ParameterType): Return the
8552         ExternalType of the parameter.
8553
8554         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8555         they were unused.
8556
8557 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8558
8559         * class.cs (MethodData.Define): Do not set the `newslot' on
8560         interface members, if they are also flagged as "override".
8561
8562         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8563         better code for ++i and i++.  This only works for static fields
8564         and local variables.
8565
8566         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8567         want to pull the DeclSpace out of the builder_to_declspace instead
8568         of the TypeBuilder (like in TypeContainer.FindMembers).
8569
8570         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8571         instead of LookupTypeContainer.  Fixes the crash on .NET for
8572         looking up interface members.
8573
8574         * const.cs: Create our own emit context during the Definition
8575         stage, so that constants are evaluated in the proper context, when
8576         a recursive definition happens.
8577
8578 2003-05-11  Martin Baulig  <martin@ximian.com>
8579
8580         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8581         new block for a switch section.
8582         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8583         the adding/lookup in the switch block.  Fixes #39828.
8584
8585 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8586
8587         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8588         functionality: I needed to convert the data after I had performed
8589         the add/sub operation into the operands type size.
8590
8591         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8592         pass the type for the box operation, otherwise the resulting
8593         object would have been of type object.
8594
8595         (BoxedCast): Add constructor to specify the type to box as.
8596
8597 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8598
8599         * iterators.cs: I was reusing the `count' variable inadvertently,
8600         take steps to not allow this to happen.
8601
8602 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8603
8604         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8605         by creating an array at the point where the params starts and
8606         putting all those arguments there, then adjusting the size of the
8607         array.
8608
8609 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8610
8611         * expression.cs (New.AddressOf): Implement interface
8612         IMemoryLocation.  This is used when the `new' operator is used in
8613         the context of an invocation to a method on a value type.
8614
8615         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8616         example. 
8617
8618         * namespace.cs: Also check the using aliases here.
8619
8620         * driver.cs: Move the test for using validity after the types have
8621         been entered, so we do a single pass that also includes the using
8622         aliases. 
8623
8624         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8625         in the regular case.   CreateSiblingForFinally is doing extra
8626         error checking.
8627
8628         * attribute.cs (GetAttributeArgumentExpression): Store the result
8629         on an out value, and use the return value to indicate failure
8630         instead of using null (which is a valid return for Constant.GetValue).
8631
8632         * statement.cs: Perform the analysis flow for the increment
8633         portion after the statement, because this will be the real flow of
8634         execution.  Fixes #42385
8635
8636         * codegen.cs (EmitContext.EmitArgument,
8637         EmitContext.EmitStoreArgument): New helper functions when the
8638         RemapToProxy flag is set.
8639
8640         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8641         function.
8642
8643         Add support for remapping parameters. 
8644
8645         * iterators.cs: Propagate parameter values;  Store parameter
8646         values in the proxy classes.
8647
8648 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8649
8650         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8651         need a proxy reference;  I do not know what I was thinking
8652
8653         * cs-parser.jay (constructor_initializer): catch another error,
8654         and display nice message.
8655
8656         (field_declaration): catch void field declaration
8657         to flag a better error. 
8658
8659         * class.cs (MemberBase.CheckBase): Report an error instead of a
8660         warning if a new protected member is declared in a struct. 
8661         (Field.Define): catch the error of readonly/volatile.
8662
8663         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8664
8665         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8666         volatile variable is taken
8667
8668 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8669
8670         * statement.cs (Fixed.Resolve): Report an error if we are not in
8671         an unsafe context.
8672
8673 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8674
8675         * typemanager.cs: reuse the code that handles type clashes for
8676         delegates and enumerations.
8677
8678         * class.cs (Report28): Always report.
8679
8680         * expression.cs (EncodeAsAttribute): Allow nulls here.
8681
8682 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8683
8684         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8685         the functionality for testing whether an expression is valid for
8686         an attribute here.  Also handle the case of arrays of elements
8687         being stored. 
8688
8689         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8690         encoding a linear array into an array of objects that are suitable
8691         to be passed to an CustomAttributeBuilder.
8692
8693         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8694
8695         * ecore.cs: (FieldExpr): Handle field remapping here.
8696
8697         * iteratators.cs: Pass the instance variable (if the method is an
8698         instance method) to the constructors, so we can access the field
8699         variables on the class.
8700
8701         TODO: Test this with structs.  I think the THIS variable on
8702         structs might have to be a pointer, and not a refenrece
8703
8704 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8705
8706         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8707         local variables to fields in a proxy class.
8708
8709         * iterators.cs (PopulateProxy): Rename our internal fields to
8710         <XXX>.  
8711         Create a <THIS> field if we are an instance method, so we can
8712         reference our parent container variables.
8713         (MapVariable): Called back from the EmitContext code to enter a
8714         new variable to field mapping into the proxy class (we just create
8715         a FieldBuilder).
8716
8717         * expression.cs
8718         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8719         for using the remapped locals to fields.
8720
8721         I placed the code here, because that gives the same semantics to
8722         local variables, and only changes the Emit code.
8723
8724         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8725         statements inside iterators.
8726         (VariableInfo): Add a FieldBuilder for the cases when we are
8727         remapping local variables to fields in a proxy class
8728
8729         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8730         current_block != null.
8731
8732         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8733         not cope with strings, as it has been moved to the
8734         TableSwitchEmit.  Fixed bug in switch generation.
8735
8736         * expression.cs (New.DoResolve): Provide more context for the user
8737         when reporting an error.
8738
8739         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8740         pointers. 
8741
8742         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8743         check the permissions for it.  Note than in a type-resolution
8744         context the check was already present in DeclSpace.ResolveType,
8745         but was missing from the MemberAccess.
8746
8747         (ArrayCreation.CheckIndices): warn if the user has
8748         more nested levels of expressions, but there are no more
8749         dimensions specified.  Avoids crash on bug 41906.
8750
8751 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8752
8753         * statement.cs (Block): replace Implicit bool, for a generic
8754         flags.   
8755         New flag: `Unchecked'.  This is used during the EmitMeta phase
8756         (which is out-of-line with the regular Resolve/Emit process for a
8757         statement, as this is done ahead of time, but still gets a chance
8758         to call constant resolve).
8759
8760         (Block.Flags): new enum for adding a new flag.
8761
8762         (Block.EmitMeta): track the state of unchecked.
8763
8764         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8765         to enable constant resolution to work there as well.
8766
8767 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8768
8769         * typemanager.cs (ienumerable_type): Also look up
8770         System.Collections.IEnumerable. 
8771
8772 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8773
8774         TODO: Test more than one conditional per method.
8775
8776         * class.cs (Indexer.Define): Report the location where the user is
8777         referencing the unsupported feature.
8778
8779         (MethodData): Overload the use of `conditionals' to
8780         minimize the creation of needless ArrayLists.   This saves roughly
8781         212kb on my machine.
8782
8783         (Method): Implement the new IIteratorContainer interface.
8784         (Method.SetYields): Implement the method by setting the ModFlags
8785         to contain METHOD_YIELDS.
8786
8787         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8788         which just got set to null.
8789
8790         * iterators.cs: New file.
8791
8792         (Yield, YieldBreak): New statements.
8793
8794         * statement.cs (Return.Resolve): Flag an error if we are used in
8795         an iterator method.
8796
8797         * codegen.cs (InIterator): New flag set if the code is being
8798         compiled in an iterator method.
8799
8800         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8801         internal modifier, and we just use it to avoid adding extra
8802         fields, as this is seldom used.  
8803
8804         * cs-parser.jay: Add yield_statement (yield and yield break).
8805
8806         * driver.cs: New flag -v2 to turn on version 2 features. 
8807
8808         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8809         hashtable when v2 is enabled.
8810
8811 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8812
8813         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8814         there is already a namespace defined with this name.
8815
8816         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8817         people upgraded their corlibs.
8818
8819         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8820         always use fully qualified types, no need to use the compiler
8821         front end.
8822
8823         (TypeManager.IsNamespace): Use binarysearch.
8824
8825         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8826         AddDelegate): I did not quite use the new IsValid API properly: I
8827         have to pass the short-name and the fullname.  I was passing only
8828         the basename instead of the fullname sometimes. 
8829
8830         (TypeContainer.DefineType): call NamespaceClash.
8831
8832         * interface.cs (Interface.DefineType): use NamespaceClash before
8833         defining the type.
8834
8835         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8836         defining the type.
8837
8838         * enum.cs: (Enum.DefineType): use NamespaceClash before
8839         defining the type.
8840
8841         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8842         speed increase.  First, use the negative_hits cache when we get a
8843         negative.  Second, add the type with its full original name
8844         instead of the new . and + encoded name (reflection uses + to
8845         separate type from a nested type).  Use LookupTypeReflection
8846         directly which bypasses the type->name hashtable (that we already
8847         know does not contain the type.
8848
8849         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8850         location/container type. 
8851
8852         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8853
8854 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8855
8856         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8857
8858         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8859         method is being referenced in the method group from a static
8860         context, and report error 120 if so.
8861
8862         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8863         Error118. 
8864
8865         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8866         is created, we create the A namespace).
8867
8868         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8869         Fixes #41591
8870
8871 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
8872
8873         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8874         invocation to ModuleBuilder.GetType with the same values will
8875         return a new type instance, so we need to cache its return
8876         values. 
8877
8878         * expression.cs (Binary.ResolveOperator): Only allow the compare
8879         operators on enums if they are of the same type.
8880
8881         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8882         types of ValueType on their own case.  Before we were giving them
8883         the same treatment as objects.
8884
8885         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
8886         fullname.  Short name is used to compare against container name.
8887         Fullname is used to check against defined namespace names.
8888
8889         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
8890         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
8891
8892         (Method.CheckBase): Call parent.
8893         (MemberBase.CheckBase): Check for protected members on sealed
8894         classes.
8895         (PropertyBase.CheckBase): Call parent.
8896         (Field.Define): Call parent.
8897
8898         * report.cs: Negative error codes are now mapped to 8000 - code,
8899         so that the display is render more nicely.
8900
8901         * typemanager.cs: Do not use try/catch, instead report a regular
8902         error. 
8903
8904         (GetPointerType, GetReferenceType): These methods provide
8905         mechanisms to obtain the T* and T& from a T.  We had the code
8906         previously scattered around the code base, and it also used
8907         TypeManager.LookupType that would go through plenty of caches.
8908         This one goes directly to the type source.
8909
8910         In some places we did the Type.GetType followed by
8911         ModuleBuilder.GetType, but not in others, so this unifies the
8912         processing as well.
8913
8914         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
8915         statements now that we have namespace information.
8916
8917         * typemanager.cs (IsNamespace): New method, returns whether the
8918         string presented is a namespace or not.
8919
8920         (ComputeNamespaces): New public entry point, computes the list of
8921         available namespaces, using the GetNamespaces API call in Mono, or
8922         the slower version in MS.NET.   
8923
8924         Now before we start the semantic analysis phase, we have a
8925         complete list of namespaces including everything that the user has
8926         provided.
8927
8928         Deleted old code to cache namespaces in .nsc files.
8929
8930 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
8931
8932         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
8933         class/struct location definition Location for the implicit
8934         constructor location.
8935
8936         (Operator.Define): Use the location of the operator for the
8937         implicit Method definition.
8938
8939         (Constructor.Emit): use the constructor location for the implicit
8940         base initializer constructor.
8941
8942         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
8943         and the Expression class now contains two new methods:
8944
8945         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
8946         isolate type lookup from the rest of the resolution process.
8947
8948         Since we use Expressions to hold type definitions due to the way
8949         we parse the input we have historically overloaded Resolve to
8950         perform the Type lookups if a special flag is passed.  Now this is
8951         eliminated and two methods take their place. 
8952
8953         The differences in the two methods between xStep and xTerminal is
8954         that xStep is involved in our current lookup system that uses
8955         SimpleNames to compose a name, while xTerminal is used just to
8956         catch the case where the simplename lookup failed.
8957
8958 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
8959
8960         * expression.cs (ResolveMemberAccess): Remove redundant code.
8961         TypeExpr expressions are always born fully resolved.
8962
8963         * interface.cs (PopulateMethod): Do not lookup the types twice.
8964         We were doing it once during SemanticAnalysis and once during
8965         PopulateMethod.
8966
8967         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
8968         in local variable type definitions, were being returned as a
8969         SimpleName (we decomposed everything into a string), that is
8970         because primary_expression was being used instead of a type in the
8971         grammar (reduce/reduce conflicts).
8972
8973         The part that was wrong is that we converted the expression into a
8974         string (an oversimplification in one hand, compounded with primary
8975         expressions doing string concatenation).
8976
8977         So things like:
8978
8979         A.B.C [] x;
8980
8981         Would return "A.B.C[]" as a SimpleName.  This stopped things like
8982         using clauses from working on this particular context.  And a type
8983         was being matched directly against "A.B.C[]".
8984
8985         We now use the correct approach, and allow for ComposedCast to be
8986         part of the unary expression.  So the "A.B.C []" become a composed
8987         cast of "A.B.C" (as a nested group of MemberAccess with a
8988         SimpleName at the end) plus the rank composition "[]". 
8989
8990         Also fixes 35567
8991
8992 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
8993
8994         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
8995         for the access level checking.
8996
8997         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
8998         `TypeContainer container', because I kept getting confused when I
8999         was debugging this code.
9000
9001         * expression.cs (Indexers): Instead of tracking getters/setters,
9002         we now track them in parallel.  We create one arraylist less, but
9003         most importantly it is possible now for the LValue code to find a
9004         matching get for a set.
9005
9006         (IndexerAccess.DoResolveLValue): Update the code.
9007         GetIndexersForType has been modified already to extract all the
9008         indexers from a type.  The code assumed it did not.
9009
9010         Also make the code set the correct return type for the indexer.
9011         This was fixed a long time ago for properties, but was missing for
9012         indexers.  It used to be void_type.
9013
9014         (Binary.Emit): Test first for doubles instead of
9015         floats, as they are more common.
9016
9017         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9018         when dealing with floats and the <=, >= operators.  This fixes bug
9019         #39314 
9020
9021         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9022         to load the array value by emitting a load on the foreach variable
9023         type.  This was incorrect.  
9024
9025         We now emit the code to load an element using the the array
9026         variable type, and then we emit the conversion operator.
9027
9028         Fixed #40176
9029
9030 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9031
9032         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9033
9034 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9035
9036         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9037         test for protection before we test for signatures. 
9038
9039         (MethodSignature.ToString): implement.
9040
9041         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9042         to the case where we reduced into a LongConstant.
9043
9044         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9045         depend on whether the information is acurrate, because the
9046         Microsoft runtime will always claim that the array type is public,
9047         regardless of the real state.
9048
9049         If the type is a pointer, another problem happens: the type is
9050         reported as non-public in Microsoft.  
9051
9052         In both cases we have to call CheckAccessLevel recursively with
9053         the underlying type as the argument to be tested.
9054
9055 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9056
9057         * assign.cs (Assign.Emit): If we are dealing with a compound
9058         assignment expression, we should use the code path that stores the
9059         intermediate result in a temporary value.  This fixes #40903.
9060
9061         *expression.cs (Indirection.ToString): Provide ToString method for
9062         debugging. 
9063
9064 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9065
9066         * class.cs: Null out fields holding references to Block objects so
9067         they can be garbage collected.
9068
9069         * expression.cs (OverloadResolve): Remove unused local.
9070
9071 2003-04-07  Martin Baulig  <martin@ximian.com>
9072
9073         * codegen.cs (EmitContext.CurrentFile): New public field.
9074         (EmitContext.Mark): Use the CurrentFile to check whether the
9075         location is in the correct file.
9076         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9077
9078 2003-04-07  Martin Baulig  <martin@ximian.com>
9079
9080         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9081
9082         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9083         location.  [FIXME: The location argument which gets passed to this
9084         method is sometimes wrong!]
9085
9086 2003-04-07  Nick Drochak <ndrochak@gol.com>
9087
9088         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9089
9090 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9091
9092         * expression.cs (Indirection.EmitAssign): We were using the
9093         temporary, but returning immediately instead of continuing the
9094         EmitAssing flow.
9095
9096 2003-04-06  Martin Baulig  <martin@ximian.com>
9097
9098         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9099         if it's a nested child, but also deriving from the outer class.
9100         See test 190.cs.
9101
9102         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9103         nested child, but also deriving from the outer class.  See
9104         test-190.cs.
9105         (FilterWithClosure): We may access private members of the outer
9106         class if we're a nested child and deriving from the outer class.
9107         (RealMemberLookup): Only set `closure_private_ok' if the
9108         `original_bf' contained BindingFlags.NonPublic.
9109
9110 2003-04-05  Martin Baulig  <martin@ximian.com>
9111
9112         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
9113         probe if its a type parameter, and if so, flag an error.
9114
9115         * decl.cs: Move here the SetParameterInfo code from class.cs.
9116         Handle IsGeneric here.
9117
9118         Handle a variety of errors in the parameter info definition.
9119
9120         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
9121         type parameters here.
9122
9123         * cs-parser.jay (class_declaration): report errors for parameters
9124         here as well.
9125
9126 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
9127
9128         * generic.cs: New file, contains support code for generics.
9129
9130         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
9131         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
9132
9133         Update parser for the above removals.
9134
9135         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
9136         now taken care of in the parser.
9137
9138 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9139
9140         * class.cs (Event.Define): Do not allow abstract events to have
9141         initializers. 
9142
9143 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9144
9145         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9146         block in event declarations.
9147
9148         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9149         value type, get its address.
9150
9151         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9152         leaving a class on the stack instead of a boolean value (int
9153         0/1).  Change the code so we compare against null, and then the
9154         result against zero.
9155
9156         * class.cs (TypeContainer.GetClassBases): We were checking for the
9157         parent class being sealed too late.
9158
9159         * expression.cs (Binary.Emit): For <= and >= when dealing with
9160         floating point values, use cgt.un and clt.un instead of cgt and
9161         clt alone.
9162
9163 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9164
9165         * statement.cs: Apply the same optimization as MS: skip the 
9166         GetEnumerator returning an IEnumerator, and use the one returning a 
9167         CharEnumerator instead. This allows us to avoid the try-finally block 
9168         and the boxing.
9169
9170 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9171
9172         * cs-parser.jay: Attributes cannot be applied to
9173                          namespaces. Fixes #40473
9174
9175 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9176
9177         * class.cs:
9178         (Add*): check if the name is valid using the full name for constants,
9179         fields, properties and events.
9180
9181 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9182
9183         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9184         char constants to be part of the enumeration.
9185
9186         * expression.cs (Conditional.DoResolve): Add support for operator
9187         true. Implements the missing functionality from 14.12
9188
9189         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9190         operator true/false as required by the spec.
9191
9192         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9193         implicit conversion to boolean.
9194
9195         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9196         also one where the type implements `operator true'. 
9197
9198         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9199         get an expression that will invoke operator true based on an
9200         expression.  
9201
9202         (GetConversionOperators): Removed the hack that called op_True
9203         here.  
9204
9205         (Expression.ResolveBoolean): Move this from Statement.
9206
9207 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9208
9209         * ecore.cs (FieldExpr): do not allow initialization of initonly
9210         fields on derived classes
9211
9212 2003-03-13  Martin Baulig  <martin@ximian.com>
9213
9214         * statement.cs (Block.Emit): Call ig.BeginScope() and
9215         ig.EndScope() when compiling with debugging info; call
9216         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9217
9218 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9219
9220         * expression.cs (Indexers): Do not construct immediately, allow
9221         for new members to be appended as we go.  Fixes 38143
9222
9223 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9224
9225         * expression.cs: save/restore context when resolving an unchecked
9226         expression.
9227
9228 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9229
9230         * cfold.cs: Catch division by zero in modulus operator during
9231         constant folding.
9232
9233 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9234
9235         * interface.cs (Interface.DefineMembers): Avoid defining members
9236         twice. 
9237
9238 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9239
9240         * driver.cs: handle the +/- options for -noconfig
9241
9242         * statement.cs (Unckeched.Resolve): Also track the state of
9243         unchecked in the Resolve phase.
9244
9245 2003-02-27  Martin Baulig  <martin@ximian.com>
9246
9247         * ecore.cs (Expression.MemberLookup): Don't create a
9248         MethodGroupExpr for something which is not a method.  Fixes #38291.
9249
9250 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9251
9252         * class.cs (MemberBase.CheckParameters): Also check that the type
9253         is unmanaged if it is a pointer.
9254
9255         * expression.cs (SizeOf.Resolve): Add location information.
9256
9257         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9258         a managed type is declared.
9259
9260         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9261         parameter modifiers as well.  Fixes bug 38606
9262
9263         * class.cs: Very sad.  Am backing out the speed up changes
9264         introduced by the ArrayList -> Array in the TypeContainer, as they
9265         were not actually that much faster, and introduced a bug (no error
9266         reports on duplicated methods).
9267
9268         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9269         source first, this will guarantee that we have a valid expression
9270         before calling in lower levels functions that will require a
9271         resolved object.  Then use this original_source in the
9272         target.ResolveLValue instead of the original source that was
9273         passed to us.
9274
9275         Another change.  Use target.Resolve instead of LValueResolve.
9276         Although we are resolving for LValues, we will let the Assign code
9277         take care of that (it will be called again from Resolve).  This
9278         basically allows code like this:
9279
9280         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9281         class Y { void A (X x) { x [0] += o; }
9282
9283         The problem was that the indexer was trying to resolve for
9284         set_Item (idx, object o) and never finding one.  The real set_Item
9285         was set_Item (idx, X).  By delaying the process we get the right
9286         semantics. 
9287
9288         Fixes bug 36505
9289
9290 2003-02-23  Martin Baulig  <martin@ximian.com>
9291
9292         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9293         while calling DoEmit ().
9294
9295         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9296         source files; if you use the #line directive inside a method, the
9297         compiler stops emitting line numbers for the debugger until it
9298         reaches the end of the method or another #line directive which
9299         restores the original file.
9300
9301 2003-02-23  Martin Baulig  <martin@ximian.com>
9302
9303         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9304
9305 2003-02-23  Martin Baulig  <martin@ximian.com>
9306
9307         * statement.cs (Block.AddChildVariableNames): We need to call this
9308         recursively, not just for our immediate children.
9309
9310 2003-02-23  Martin Baulig  <martin@ximian.com>
9311
9312         * class.cs (Event.Define): Always make the field private, like csc does.
9313
9314         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9315         actually work, fixes bug #37521.
9316
9317 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9318
9319         * delegate.cs: When creating the various temporary "Parameters"
9320         classes, make sure that we call the ComputeAndDefineParameterTypes
9321         on those new parameters (just like we do with the formal ones), to
9322         allow them to be resolved in the context of the DeclSpace.
9323
9324         This fixes the bug that Dick observed in Bugzilla #38530.
9325
9326 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9327
9328         * expression.cs (ResolveMemberAccess): When resolving a constant,
9329         do not attempt to pull a constant if the value was not able to
9330         generate a valid constant.
9331
9332         * const.cs (LookupConstantValue): Do not report more errors than required.
9333
9334 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9335
9336         * expression.cs: fixes bug #38328.
9337
9338 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9339
9340         * class.cs: Changed all the various members that can be part of a
9341         class from being an ArrayList to be an Array of the right type.
9342         During the DefineType type_list, interface_list, delegate_list and
9343         enum_list are turned into types, interfaces, delegates and enums
9344         arrays.  
9345
9346         And during the member population, indexer_list, event_list,
9347         constant_list, field_list, instance_constructor_list, method_list,
9348         operator_list and property_list are turned into their real arrays.
9349
9350         Although we could probably perform this operation earlier, for
9351         good error reporting we need to keep the lists and remove the
9352         lists for longer than required.
9353
9354         This optimization was triggered by Paolo profiling the compiler
9355         speed on the output of `gen-sample-program.pl' perl script. 
9356
9357         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9358         not crash in methods like MemberLookupFailed that use this field.  
9359
9360         This problem arises when the compiler fails to resolve a type
9361         during interface type definition for example.
9362
9363 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9364
9365         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9366         inherit from System.Object, so we have to stop at null, not only
9367         when reaching System.Object.
9368
9369 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9370
9371         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9372         DeclaredOnly because the parent indexer might have had a different
9373         name, but did not loop until the top of the hierarchy was reached.
9374
9375         The problem this one fixes is 35492: when a class implemented an
9376         indexer from an interface, we were getting the interface method
9377         (which was abstract) and we were flagging an error (can not invoke
9378         abstract method).
9379
9380         This also keeps bug 33089 functioning, and test-148 functioning.
9381
9382         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9383         out if a method is special is to see if it is declared in a
9384         property or event, or whether it is one of the predefined operator
9385         names.   This should fix correctly #36804.
9386
9387 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9388
9389         The goal here is to remove the dependency on EmptyCast.Peel ().
9390         Killing it completely.
9391
9392         The problem is that currently in a number of places where
9393         constants are expected, we have to "probe" for an EmptyCast, and
9394         Peel, which is not the correct thing to do, as this will be
9395         repetitive and will likely lead to errors. 
9396
9397         The idea is to remove any EmptyCasts that are used in casts that
9398         can be reduced to constants, so we only have to cope with
9399         constants. 
9400
9401         This bug hunt was triggered by Bug 37363 and the desire to remove
9402         the duplicate pattern where we were "peeling" emptycasts to check
9403         whether they were constants.  Now constants will always be
9404         constants.
9405
9406         * ecore.cs: Use an enumconstant here instead of wrapping with
9407         EmptyCast.  
9408
9409         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9410         throwing me off.  By handling this we can get rid of a few hacks.
9411
9412         * statement.cs (Switch): Removed Peel() code.
9413
9414 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9415
9416         * class.cs: Location information for error 508
9417
9418         * expression.cs (New.DoResolve): Add a guard against double
9419         resolution of an expression.  
9420
9421         The New DoResolve might be called twice when initializing field
9422         expressions (see EmitFieldInitializers, the call to
9423         GetInitializerExpression will perform a resolve on the expression,
9424         and later the assign will trigger another resolution
9425
9426         This leads to bugs (#37014)
9427
9428         * delegate.cs: The signature for EndInvoke should contain any ref
9429         or out parameters as well.  We were not doing this in the past. 
9430
9431         * class.cs (Field.Define): Do not overwrite the type definition
9432         inside the `volatile' group.  Turns out that volatile enumerations
9433         were changing the type here to perform a validity test, which
9434         broke conversions. 
9435
9436 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9437
9438         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9439         and structs, we do not want to load the instance variable
9440
9441         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9442         enum_type has to be handled like an object reference (implicit
9443         conversions exists from this to object), but the regular IsClass
9444         and IsValueType tests will never return true for this one.
9445
9446         Also we use TypeManager.IsValueType instead of type.IsValueType,
9447         just for consistency with the rest of the code (this is only
9448         needed if we ever use the construct exposed by test-180.cs inside
9449         corlib, which we dont today).
9450
9451 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9452
9453         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9454         just InternalCall.
9455
9456 2003-02-09  Martin Baulig  <martin@ximian.com>
9457
9458         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9459         (Namespace.DefineNamespaces): New static public method; this is
9460         called when we're compiling with debugging to add all namespaces
9461         to the symbol file.
9462
9463         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9464         pass it to the Namespace's .ctor.
9465
9466         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9467         and MethodBase arguments; pass the namespace ID to the symwriter;
9468         pass the MethodBase instead of the token to the symwriter.
9469         (SymbolWriter.DefineNamespace): New method to add a namespace to
9470         the symbol file.
9471
9472 2003-02-09  Martin Baulig  <martin@ximian.com>
9473
9474         * symbolwriter.cs: New file.  This is a wrapper around
9475         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9476         methods here in near future.
9477
9478 2003-02-09  Martin Baulig  <martin@ximian.com>
9479
9480         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9481         ILGenerator.MarkSequencePoint() which are actually used by the
9482         symbol writer.
9483
9484 2003-02-09  Martin Baulig  <martin@ximian.com>
9485
9486         * location.cs (SourceFile): New public sealed class.  This
9487         contains the name and an index which is used in the location's token.
9488         (Location): Reserve an appropriate number of bits in the token for
9489         the source file instead of walking over that list, this gives us a
9490         really huge performance improvement when compiling with debugging.
9491
9492         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9493         `SourceFile' argument instead of a string.
9494         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9495         but don't parse/tokenize here, we need to generate the list of all
9496         source files before we do that.
9497         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9498         the files.
9499
9500         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9501         instead of a string.
9502
9503         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9504         of a string.
9505
9506 2003-02-09  Martin Baulig  <martin@ximian.com>
9507
9508         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9509         filename on `#line default'.
9510
9511 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9512
9513         * statement.cs: don't clear the pinned var when the fixed statement
9514         returns from the method (fixes bug#37752).
9515
9516 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9517
9518         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9519         to IsValueType.
9520
9521 2003-02-07  Martin Baulig  <martin@ximian.com>
9522
9523         * driver.cs: Removed the `--debug-args' command line argument.
9524
9525         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9526         automatically by the AsssemblyBuilder.
9527         (CodeGen.InitializeSymbolWriter): We don't need to call any
9528         initialization function on the symbol writer anymore.  This method
9529         doesn't take any arguments.
9530
9531 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9532
9533         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9534         from referenced assemblies as well.
9535
9536 2003-02-02  Martin Baulig  <martin@ximian.com>
9537
9538         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9539
9540 2003-02-02  Martin Baulig  <martin@ximian.com>
9541
9542         * class.cs (Constructor.Emit): Open the symbol writer before
9543         emitting the constructor initializer.
9544         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9545         single-stepping through constructor initializers.
9546
9547 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9548
9549         * class.cs: Handle error 549: do not allow virtual methods in
9550         sealed classes. 
9551
9552 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9553
9554         * decl.cs: Check access levels when resolving types
9555
9556 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9557
9558         * statement.cs: Add parameters and locals set in catch blocks that might 
9559         return to set vector
9560
9561 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9562
9563         * class.cs (Operator): Set the SpecialName flags for operators.
9564
9565         * expression.cs (Invocation.DoResolve): Only block calls to
9566         accessors and operators on SpecialName methods.
9567
9568         (Cast.TryReduce): Handle conversions from char constants.
9569
9570
9571 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9572
9573         * statement.cs: small memory and time optimization in FlowBranching.
9574
9575 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9576
9577         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9578         problem that the last fix but in the other sid (Set).
9579
9580         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9581         access when there is no indexer in the hierarchy.
9582
9583 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9584
9585         * class.cs: Combine some if statements.
9586
9587 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9588
9589         * driver.cs: fixed bug #37187.
9590
9591 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9592
9593         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9594         any indexer, it's needed to build a list with all the indexers in the
9595         hierarchy (AllGetters), else we have problems. Fixes #35653.
9596
9597 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9598
9599         * class.cs (MethodData.Define): It is wrong for an interface
9600         implementation to be static in both cases: explicit and implicit.
9601         We were only handling this in one case.
9602
9603         Improve the if situation there to not have negations.
9604
9605         * class.cs (Field.Define): Turns out that we do not need to check
9606         the unsafe bit on field definition, only on usage.  Remove the test.
9607
9608 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9609
9610         * driver.cs: use assembly.Location instead of Codebase (the latest
9611         patch made mcs fail when using MS assemblies).
9612
9613 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9614
9615         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9616         get the path to *corlib.dll.
9617
9618 2003-01-21  Nick Drochak <ndrochak@gol.com>
9619
9620         * cs-tokenizer.cs:
9621         * pending.cs:
9622         * typemanager.cs: Remove compiler warnings
9623
9624 2003-01-20  Duncan Mak  <duncan@ximian.com>
9625
9626         * AssemblyInfo.cs: Bump the version number to 0.19.
9627
9628 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9629
9630         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9631
9632 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9633
9634         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9635
9636 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9637
9638         * cs-parser.jay: Small fix: we were not comparing the constructor
9639         name correctly.   Thanks to Zoltan for the initial pointer.
9640
9641 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9642
9643         * cs-tokenizer.cs: Set file name when specified with #line
9644
9645 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9646
9647         * cs-parser.jay: Only perform the constructor checks here if we
9648         are named like the class;  This will help provider a better
9649         error.  The constructor path is taken when a type definition is
9650         not found, but most likely the user forgot to add the type, so
9651         report that rather than the constructor error.
9652
9653 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9654
9655         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9656         allocations.
9657
9658 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9659
9660         * cs-parser.jay: Add cleanup call.
9661
9662 2003-01-13  Duncan Mak  <duncan@ximian.com>
9663
9664         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9665         consistent with other methods.
9666
9667 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9668
9669         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9670
9671 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9672
9673         * attribute.cs: only set GuidAttr to true when we have a
9674         GuidAttribute.
9675
9676 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9677
9678         * ecore.cs:
9679         * expression.cs:
9680         * typemanager.cs: fixes to allow mcs compile corlib with the new
9681         Type.IsSubclassOf fix.
9682
9683 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9684
9685         * expression.cs (LocalVariableReference.DoResolve): Classify a
9686         constant as a value, not as a variable.   Also, set the type for
9687         the variable.
9688
9689         * cs-parser.jay (fixed_statement): take a type instead of a
9690         pointer_type, so we can produce a better error message later.
9691
9692         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9693         as an error.  
9694
9695         (For.DoEmit): Make inifinite loops have a
9696         non-conditional branch back.
9697
9698         (Fixed.DoEmit): First populate the pinned variables, then emit the
9699         statement, then clear the variables.  Before I was emitting the
9700         code once for each fixed piece.
9701
9702
9703 2003-01-08  Martin Baulig  <martin@ximian.com>
9704
9705         * statement.cs (FlowBranching.MergeChild): A break in a
9706         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9707
9708 2003-01-08  Martin Baulig  <martin@ximian.com>
9709
9710         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9711         lives in the same number space than `param_map'.  Fixes #36154.
9712
9713 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9714
9715         * cs-parser.jay (constructor_declaration): Set the
9716         Constructor.ModFlags before probing for it.  This makes the
9717         compiler report 514, 515 and 132 (the code was there, but got
9718         broken). 
9719
9720         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9721         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9722         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9723
9724 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9725
9726         * enum.cs: create the enum static fields using the enum type.
9727
9728 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9729
9730         * class.cs: don't try to create the ParamBuilder for the return
9731         type if it's not needed (and handle it breaking for the ms runtime
9732         anyway).
9733
9734 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9735
9736         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9737
9738 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9739
9740         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9741         the command.   This showed up while compiling the JANET source
9742         code, which used \r as its only newline separator.
9743
9744 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9745
9746         * class.cs (Method.Define): If we are an operator (because it
9747         reuses our code), then set the SpecialName and HideBySig.  #36128
9748
9749 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9750
9751         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9752         exception, report error 120 `object reference required'.
9753
9754         * driver.cs: Add --pause option, used during to measure the size
9755         of the process as it goes with --timestamp.
9756
9757         * expression.cs (Invocation.DoResolve): Do not allow methods with
9758         SpecialName to be invoked.
9759
9760 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9761
9762         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9763         number before adding it.
9764
9765 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9766
9767         * ecore.cs (StandardImplicitConversion): When in an unsafe
9768         context, we allow conversion between void * to any other pointer
9769         type. This fixes bug #35973.
9770
9771 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9772
9773         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9774         is not thrown when extensionless outputs are used 
9775
9776 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9777
9778         * rootcontext.cs: fixed compilation of corlib.
9779
9780 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9781
9782         * attribute.cs (Attributes.Contains): Add new method.
9783
9784         * class.cs (MethodCore.LabelParameters): if the parameter is an
9785         `out' parameter, check that no attribute `[In]' has been passed.
9786
9787         * enum.cs: Handle the `value__' name in an enumeration.
9788
9789 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9790
9791         * decl.cs: Added special case to allow overrides on "protected
9792         internal" methods
9793
9794 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9795
9796         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9797         since it makes much more sense.
9798
9799         (Attributes.ctor): Don't require a Location parameter.
9800
9801         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9802
9803         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9804         since we already have that information per attribute.
9805
9806         * everywhere : make appropriate changes.
9807
9808         * class.cs (LabelParameters): Write the code which actually
9809         applies attributes to the return type. We can't do this on the MS
9810         .NET runtime so we flag a warning in the case an exception is
9811         thrown.
9812
9813 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9814
9815         * const.cs: Handle implicit null conversions here too.
9816
9817 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9818
9819         * class.cs (MethodCore.LabelParameters): Remove the extra
9820         Type [] parameter since it is completely unnecessary. Instead
9821         pass in the method's attributes so that we can extract
9822         the "return" attribute.
9823
9824 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9825
9826         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9827         of ignoring it and letting the compile continue.
9828
9829         * typemanager.cs (ChangeType): use an extra argument to return an
9830         error condition instead of throwing an exception.
9831
9832 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9833
9834         * expression.cs (Unary.TryReduce): mimic the code for the regular
9835         code path.  Perform an implicit cast in the cases where we can
9836         implicitly convert to one of the integral types, and then reduce
9837         based on that constant.   This fixes bug #35483.
9838
9839 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9840
9841         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9842
9843 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9844
9845         * namespace.cs: fixed bug #35489.
9846
9847 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9848
9849         * class.cs: Remove some dead code.
9850
9851         * cs-parser.jay: Estimate the number of methods needed
9852         (RootContext.MethodCount);
9853
9854         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9855         numbers instead of StringBuilders.
9856
9857         * support.cs (PtrHashtable): Add constructor with initial size;
9858         We can now reduce reallocations of the method table.
9859
9860 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9861
9862         * attribute.cs (ApplyAttributes): Keep track of the emitted
9863         attributes on a per-target basis. This fixes bug #35413.
9864
9865 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9866
9867         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9868         default to the Windows 1252 encoding.
9869
9870         (UnixParseOption): Support version, thanks to Alp for the missing
9871         pointer. 
9872
9873         * AssemblyInfo.cs: Add nice assembly information.
9874
9875         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9876         (bug 35169).
9877
9878         * cs-parser.jay: Allow a trailing comma before the close bracked
9879         in the attribute_section production.
9880
9881         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9882         address of the instance was being taken, I will take this out,
9883         because we take the address of the object immediately here.
9884
9885 2002-12-09  Ravi Pratap  <ravi@ximian.com>
9886
9887         * typemanager.cs (AreMultipleAllowed): Take care of the most
9888         obvious case where attribute type is not in the current assembly -
9889         stupid me ;-)
9890
9891 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
9892
9893         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
9894         definitions, instead of doing that afterwards.  
9895
9896         Also we use a nice little hack, depending on the constructor, we
9897         know if we are a "composed" name or a simple name.  Hence, we
9898         avoid the IndexOf test, and we avoid 
9899
9900         * codegen.cs: Add code to assist in a bug reporter to track down
9901         the source of a compiler crash. 
9902
9903 2002-12-07  Ravi Pratap  <ravi@ximian.com>
9904
9905         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
9906         types have been emitted for a given element and flag an error
9907         if something which does not have AllowMultiple set is used more
9908         than once.
9909
9910         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
9911         attribute types and their corresponding AllowMultiple properties
9912
9913         (AreMultipleAllowed): Check the property for a given type.
9914
9915         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
9916         property in the case we have a TypeContainer.
9917
9918         (Attributes.AddAttribute): Detect duplicates and just skip on
9919         adding them. This trivial fix catches a pretty gross error in our
9920         attribute emission - global attributes were being emitted twice!
9921
9922         Bugzilla bug #33187 is now fixed.
9923
9924 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
9925
9926         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
9927         instead of pp_and).
9928
9929         * expression.cs (Binary.ResolveOperator): I can only use the
9930         Concat (string, string, string) and Concat (string, string,
9931         string, string) if the child is actually a concatenation of
9932         strings. 
9933
9934 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
9935
9936         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
9937         context where we need a 2-character lookahead.
9938
9939         * pending.cs (PendingImplementation): Rework so we can keep track
9940         of interface types all the time, and flag those which were
9941         implemented by parents as optional.
9942
9943 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
9944
9945         * expression.cs (Binary.ResolveOperator): Use
9946         String.Concat(string,string,string) or
9947         String.Concat(string,string,string,string) when possible. 
9948
9949         * typemanager: More helper methods.
9950
9951
9952 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
9953
9954         * pending.cs: remove the bogus return from GetMissingInterfaces()
9955         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
9956
9957 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9958
9959         * namespace.cs: avoid duplicated 'using xxx' being added to
9960         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
9961         when we get more than one 'using' statement for the same namespace.
9962         Report a CS0105 warning for it.
9963
9964 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
9965
9966         * cs-tokenizer.cs (consume_identifier): use read directly, instead
9967         of calling getChar/putback, uses internal knowledge of it.    
9968
9969         (xtoken): Reorder tokenizer so most common patterns are checked
9970         first.  This reduces the compilation time in another 5% (from 8.11s
9971         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
9972
9973         The parsing time is 22% of the compilation in mcs, and from that
9974         64% is spent on the tokenization process.  
9975
9976         I tried using a binary search for keywords, but this is slower
9977         than the hashtable.  Another option would be to do a couple of
9978         things:
9979
9980                 * Not use a StringBuilder, instead use an array of chars,
9981                   with a set value.  Notice that this way we could catch
9982                   the 645 error without having to do it *afterwards*.
9983
9984                 * We could write a hand-parser to avoid the hashtable
9985                   compares altogether.
9986
9987         The identifier consumption process takes 37% of the tokenization
9988         time.  Another 15% is spent on is_number.  56% of the time spent
9989         on is_number is spent on Int64.Parse:
9990
9991                 * We could probably choose based on the string length to
9992                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
9993                   computations. 
9994
9995         Another 3% is spend on wrapping `xtoken' in the `token' function.
9996
9997         Handle 0xa0 as whitespace (#34752)
9998
9999 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10000
10001         * typemanager.cs (IsCLRType): New routine to tell whether a type
10002         is one of the builtin types.  
10003
10004         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10005         typecode in more places instead of doing pointer comparissions.
10006         We could leverage some knowledge about the way the typecodes are
10007         laid out.
10008
10009         New code to cache namespaces in assemblies, it is currently not
10010         invoked, to be used soon.
10011
10012         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10013
10014         * expression.cs (Binary.ResolveOperator): specially handle
10015         strings, and do not perform user-defined operator overloading for
10016         built-in types.
10017
10018 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10019
10020         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10021         internalcall as it is a pretty simple operation;  Avoid whenever
10022         possible to call Char.IsLetter.
10023
10024         (consume_identifier): Cut by half the number of
10025         hashtable calls by merging the is_keyword and GetKeyword behavior.
10026
10027         Do not short-circuit, because if we do, we
10028         report errors (ie, #if false && true would produce an invalid
10029         directive error);
10030
10031
10032 2002-11-24  Martin Baulig  <martin@ximian.com>
10033
10034         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10035         check constant ranges and report a CS0221.  Fixes #33186.
10036
10037 2002-11-24  Martin Baulig  <martin@ximian.com>
10038
10039         * cs-parser.jay: Make this work for uninitialized variable
10040         declarations in the `for' initializer.  Fixes #32416.
10041
10042 2002-11-24  Martin Baulig  <martin@ximian.com>
10043
10044         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10045         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10046
10047 2002-11-24  Martin Baulig  <martin@ximian.com>
10048
10049         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10050         argument; if true, we also check for user-defined conversions.
10051         This is only needed if both arguments are of a user-defined type.
10052         Fixes #30443, added test-175.cs.
10053         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10054
10055         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10056
10057 2002-11-24  Martin Baulig  <martin@ximian.com>
10058
10059         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10060         function to get the store opcode.
10061         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10062         only emit the Ldelema if the store opcode is Stobj.  You must run
10063         both test-34 and test-167 to test this.  Fixes #34529.
10064
10065 2002-11-23  Martin Baulig  <martin@ximian.com>
10066
10067         * ecore.cs (Expression.MemberLookup): Added additional
10068         `qualifier_type' argument which is used when we're being called
10069         from MemberAccess.DoResolve() and null if we're called from a
10070         SimpleName lookup.
10071         (Expression.MemberLookupFailed): New method to report errors; this
10072         does the CS1540 check and reports the correct error message.
10073
10074         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10075         argument for the CS1540 check and redone the way how we're dealing
10076         with private members.  See the comment in the source code for details.
10077         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10078         `closure_start_type' to `closure_qualifier_type' and check whether
10079         it's not null.  It was not this filter being broken, it was just
10080         being called with the wrong arguments.
10081
10082         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10083         and pass it the correct `qualifier_type'; this also does the error
10084         handling for us.
10085
10086 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10087
10088         * expression.cs (Invocation.EmitParams): If the we are dealing
10089         with a non-built-in value type, load its address as well.
10090
10091         (ArrayCreation): Use a a pretty constant instead
10092         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10093         static initializers.  
10094
10095         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10096         because they are not really value types, just glorified integers. 
10097
10098         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10099
10100         * ecore.cs: Remove redundant code for enumerations, make them use
10101         the same code path as everything else, fixes the casting issue
10102         with enumerations in Windows.Forms.
10103
10104         * attribute.cs: Do only cast to string if it is a string, the
10105         validation happens later.
10106
10107         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10108         people upgrade their corlibs.
10109
10110         * ecore.cs: Oops, enumerations were not following the entire code path
10111
10112 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10113
10114         * typemanager.cs (FilterWithClosure): Commented out the test for
10115         1540 in typemanager.cs, as it has problems when accessing
10116         protected methods from a parent class (see test-174.cs). 
10117
10118         * attribute.cs (Attribute.ValidateGuid): new method.
10119         (Attribute.Resolve): Use above.
10120
10121 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10122
10123         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10124
10125         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10126         handling for enumerations, as we only needed the TypeContainer
10127         functionality to begin with (this is required for the fix below to
10128         work for enums that reference constants in a container class for
10129         example). 
10130
10131         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10132
10133         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10134         a valid TypeBuilder to perform lookups on.o
10135
10136         * class.cs (InheritableMemberSignatureCompare): Use true in the
10137         call to GetGetMethod and GetSetMethod, because we are comparing
10138         the signature, and we need to get the methods *even* if they are
10139         private. 
10140
10141         (PropertyBase.CheckBase): ditto.
10142
10143         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10144         GotoCase.Resolve): Use Peel on EmpytCasts.
10145
10146         * ecore.cs (EmptyCast): drop child, add Peel method.
10147
10148 2002-11-17  Martin Baulig  <martin@ximian.com>
10149
10150         * ecore.cs (EmptyCast.Child): New public property.
10151
10152         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10153         label resolved to an EmptyCast.  Fixes #34162.
10154         (GotoCase.Resolve): Likewise.
10155         (Block.EmitMeta): Likewise.
10156
10157 2002-11-17  Martin Baulig  <martin@ximian.com>
10158
10159         * expression.cs (Invocation.BetterConversion): Prefer int over
10160         uint; short over ushort; long over ulong for integer literals.
10161         Use ImplicitConversionExists instead of StandardConversionExists
10162         since we also need to check for user-defined implicit conversions.
10163         Fixes #34165.  Added test-173.cs.
10164
10165 2002-11-16  Martin Baulig  <martin@ximian.com>
10166
10167         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10168         with the `true' and `false' literals.  Fixes #33151.
10169
10170 2002-11-16  Martin Baulig  <martin@ximian.com>
10171
10172         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10173         October 22nd; don't do the cs1540 check for static members.
10174
10175         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10176         now using our own filter here and doing the cs1540 check again.
10177
10178 2002-11-16  Martin Baulig  <martin@ximian.com>
10179
10180         * support.cs (InternalParameters): Don't crash if we don't have
10181         any fixed parameters.  Fixes #33532.
10182
10183 2002-11-16  Martin Baulig  <martin@ximian.com>
10184
10185         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10186         when looking up static methods to make this work on Windows.
10187         Fixes #33773.
10188
10189 2002-11-16  Martin Baulig  <martin@ximian.com>
10190
10191         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10192         a setter rather than using PropertyInfo.CanWrite.
10193
10194 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10195
10196         * class.cs: Allow acces to block member by subclasses. Fixes build
10197         breaker.
10198
10199 2002-11-14  Martin Baulig  <martin@ximian.com>
10200
10201         * class.cs (Constructor.Emit): Added the extern/block check.
10202         Fixes bug #33678.
10203
10204 2002-11-14  Martin Baulig  <martin@ximian.com>
10205
10206         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10207         iteration while looking for indexers, this is needed because the
10208         indexer may have a different name in our base classes.  Fixed the
10209         error reporting (no indexers at all, not get accessor, no
10210         overloaded match).  Fixes bug #33089.
10211         (IndexerAccess.DoResolveLValue): Likewise.
10212
10213 2002-11-14  Martin Baulig  <martin@ximian.com>
10214
10215         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10216         indexers.  Fixes the first part of bug #33089.
10217         (MethodSignature.InheritableMemberSignatureCompare): Added support
10218         for properties.
10219
10220 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10221
10222         * attribute.cs (Attribute.Resolve): Catch the
10223         NullReferenceException and report it since it isn't supposed to
10224         happen. 
10225
10226 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10227
10228         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10229         LogicalOr and LogicalAnd that can benefit from recursively
10230         handling EmitBranchable.  The code now should be nice for Paolo.
10231
10232 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10233
10234         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10235         the Type lookups, as we perform quite a number of lookups on
10236         non-Types.  This can be removed once we can deterministically tell
10237         whether we have a type or a namespace in advance.
10238
10239         But this might require special hacks from our corlib.
10240
10241         * TODO: updated.
10242
10243         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10244         and double which avoids a conversion from an integer to a double.
10245
10246         * expression.cs: tiny optimization, avoid calling IsConstant,
10247         because it effectively performs the lookup twice.
10248
10249 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10250
10251         But a bogus return here to keep the semantics of the old code
10252         until the Mono runtime is fixed.
10253
10254         * pending.cs (GetMissingInterfaces): New method used to remove all
10255         the interfaces that are already implemented by our parent
10256         classes from the list of pending methods. 
10257
10258         * interface.cs: Add checks for calls after ResolveTypeExpr.
10259
10260 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10261
10262         * class.cs (Class.Emit): Report warning 67: event not used if the
10263         warning level is beyond 3.
10264
10265         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10266         being a NullLiteral.
10267
10268         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10269         specifiers. 
10270
10271         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10272         path that might fail if a type can not be resolved.
10273
10274         * expression.cs (Binary.Emit): Emit unsigned versions of the
10275         operators. 
10276
10277         * driver.cs: use error 5.
10278
10279 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10280
10281         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10282
10283 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10284
10285         * cs-parser.jay (switch_section): A beautiful patch from Martin
10286         Baulig that fixed 33094.
10287
10288 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10289
10290         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10291         Check whether the base is abstract and report an error if so.
10292
10293         * expression.cs (IndexerAccess.DoResolveLValue,
10294         IndexerAccess.DoResolve): ditto. 
10295
10296         (Invocation.DoResolve): ditto.
10297
10298         (Invocation.FullMethodDesc): Improve the report string.
10299
10300         * statement.cs (Block): Eliminate IsVariableDefined as it is
10301         basically just a wrapper for GetVariableInfo.
10302
10303         * ecore.cs (SimpleName): Use new 
10304
10305         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10306         type, as we return the actual parameter ref/unref state on a
10307         different call.
10308
10309 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10310
10311         * support.cs: Return proper flags REF/OUT fixing the previous
10312         commit.  
10313
10314         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10315         not used to mean `ref' but `ref or out' in ParameterReference
10316
10317         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10318         full type signature instead of calling TypeManger.CSharpName
10319         ourselves. 
10320
10321         * support.cs (InternalParameters.ParameterDesc): Do not compare
10322         directly to the modflags, because REF/OUT will actually be bitsets
10323         if set. 
10324
10325         * delegate.cs (VerifyMethod): Check also the modifiers.
10326
10327         * cs-tokenizer.cs: Fix bug where floating point values with an
10328         exponent where a sign was missing was ignored.
10329
10330         * driver.cs: Allow multiple assemblies to be specified in a single
10331         /r: argument
10332
10333 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10334
10335         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10336         because identifiers after a parenthesis would end up in this kind
10337         of production, and we needed to desamiguate it for having casts
10338         like:
10339
10340                 (UserDefinedType *) xxx
10341
10342 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10343
10344         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10345         we should set on the Bindingflags.NonPublic, but not turn on
10346         private_ok.  private_ok controls whether a Private member is
10347         returned (this is chekced on the filter routine), while the
10348         BindingFlags.NonPublic just controls whether private/protected
10349         will be allowed.   This fixes the problem part of the problem of
10350         private properties being allowed to be used in derived classes.
10351
10352         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10353         so we can call the children DoResolveLValue method (this will
10354         properly signal errors on lvalue assignments to base properties)
10355
10356         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10357         getter are null, and we have a property info, we know that this
10358         happened because the lookup failed, so we report an error 122 for
10359         protection level violation.
10360
10361         We also silently return if setter and getter are null in the
10362         resolve functions, this condition only happens if we have flagged
10363         the error before.  This is the other half of the problem. 
10364
10365         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10366         not have accessibility information, that is why we were returning
10367         true in the filter function in typemanager.cs.
10368
10369         To properly report 122 (property is inaccessible because of its
10370         protection level) correctly, we report this error in ResolveAccess
10371         by failing if both the setter and the getter are lacking (ie, the
10372         lookup failed). 
10373
10374         DoResolve and DoLResolve have been modified to check for both
10375         setter/getter being null and returning silently, the reason being
10376         that I did not want to put the knowledge about this error in upper
10377         layers, like:
10378
10379         int old = Report.Errors;
10380         x = new PropertyExpr (...);
10381         if (old != Report.Errors)
10382                 return null;
10383         else
10384                 return x;
10385
10386         So the property expr is returned, but it is invalid, so the error
10387         will be flagged during the resolve process. 
10388
10389         * class.cs: Remove InheritablePropertySignatureCompare from the
10390         class, as we no longer depend on the property signature to compute
10391         whether it is possible to implement a method or not.
10392
10393         The reason is that calling PropertyInfo.GetGetMethod will return
10394         null (in .NET, in Mono it works, and we should change this), in
10395         cases where the Get Method does not exist in that particular
10396         class.
10397
10398         So this code:
10399
10400         class X { public virtual int A { get { return 1; } } }
10401         class Y : X { }
10402         class Z : Y { public override int A { get { return 2; } } }
10403
10404         Would fail in Z because the parent (Y) would not have the property
10405         defined.  So we avoid this completely now (because the alternative
10406         fix was ugly and slow), and we now depend exclusively on the
10407         method names.
10408
10409         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10410         reference method, instead of using the property.
10411
10412         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10413         routines are gone now.
10414
10415         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10416         names, they were incorrectly named.
10417
10418         * cs-tokenizer.cs: Return are more gentle token on failure. 
10419
10420         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10421         had an out-of-sync index variable, which caused it to remove from
10422         the list of pending methods the wrong method sometimes.
10423
10424 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10425
10426         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10427         CanWrite, because those refer to this particular instance of the
10428         property, and do not take into account the fact that we can
10429         override single members of a property.
10430
10431         Constructor requires an EmitContext.  The resolution process does
10432         not happen here, but we need to compute the accessors before,
10433         because the resolution does not always happen for properties.
10434
10435         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10436         subclass, before we did not update this flag, but we did update
10437         bindingflags. 
10438
10439         (GetAccessors): Drop this routine, as it did not work in the
10440         presence of partially overwritten set/get methods. 
10441
10442         Notice that this broke the cs1540 detection, but that will require
10443         more thinking. 
10444
10445 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10446
10447         * class.cs:
10448         * codegen.cs:
10449         * driver.cs: issue a warning instead of an error if we don't support
10450         debugging for the platform. Also ignore a couple of errors that may
10451         arise when trying to write the symbols. Undo my previous patch.
10452
10453 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10454
10455         * driver.cs: ignore /debug switch except for Unix platforms.
10456
10457 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10458
10459         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10460
10461 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10462
10463         * driver.cs: Do not make mcs-debug conditional, so we do not break
10464         builds that use it.
10465
10466         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10467         review this patch.  But basically after all the children variables
10468         have been merged, the value of "Breaks" was not being set to
10469         new_breaks for Switch blocks.  I think that it should be set after
10470         it has executed.  Currently I set this to the value of new_breaks,
10471         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10472         conservative, but I do not understand this code very well.
10473
10474         I did not break anything in the build, so that is good ;-)
10475
10476         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10477
10478 2002-10-20  Mark Crichton  <crichton@gimp.org>
10479
10480         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10481
10482 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10483
10484         * cfold.cs: Fixed compile blocker.
10485
10486 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10487
10488         * driver.cs: I was chekcing the key, not the file.
10489
10490 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10491
10492         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10493         message that we were generating - we just need to silently return
10494         a null.
10495
10496 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10497
10498         * class.cs (Event.Define): Change my previous commit, as this
10499         breaks the debugger.  This is a temporary hack, as it seems like
10500         the compiler is generating events incorrectly to begin with.
10501
10502         * expression.cs (Binary.ResolveOperator): Added support for 
10503         "U operator - (E x, E y)"
10504
10505         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10506         y)".
10507
10508         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10509         init-only variables, but this path did not take into account that
10510         there might be also instance readonly variables.  Correct this
10511         problem. 
10512
10513         This fixes bug 32253
10514
10515         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10516         delegates as well.
10517
10518         * driver.cs: Change the extension for modules to `netmodule'
10519
10520         * cs-parser.jay: Improved slightly the location tracking for
10521         the debugger symbols.
10522
10523         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10524         modifiers that were specified instead of the hardcoded value
10525         (FamAndAssem).  This was basically ignoring the static modifier,
10526         and others.  Fixes 32429.
10527
10528         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10529         fixed a bug in the process (32476)
10530
10531         * expression.cs (ArrayAccess.EmitAssign): Patch from
10532         hwang_rob@yahoo.ca that fixes bug 31834.3
10533
10534 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10535
10536         * driver.cs: Make the module extension .netmodule.
10537
10538 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10539
10540         * driver.cs: Report an error if the resource file is not found
10541         instead of crashing.
10542
10543         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10544         false, like Emit does.
10545
10546 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10547
10548         * typemanager.cs: Remove unused private member.  Also reported mcs
10549         bug to report this as a warning like csc.
10550
10551 2002-10-15  Martin Baulig  <martin@gnome.org>
10552
10553         * statement.cs (Statement.Emit): Made this a virtual method; emits
10554         the line number info and calls DoEmit().
10555         (Statement.DoEmit): New protected abstract method, formerly knows
10556         as Statement.Emit().
10557
10558         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10559
10560 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10561
10562         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10563         have fixed a remaining problem: not every AddXXXX was adding a
10564         fully qualified name.  
10565
10566         Now everyone registers a fully qualified name in the DeclSpace as
10567         being defined instead of the partial name.  
10568
10569         Downsides: we are slower than we need to be due to the excess
10570         copies and the names being registered this way.  
10571
10572         The reason for this is that we currently depend (on the corlib
10573         bootstrap for instance) that types are fully qualified, because
10574         we dump all the types in the namespace, and we should really have
10575         types inserted into the proper namespace, so we can only store the
10576         basenames in the defined_names array.
10577
10578 2002-10-10  Martin Baulig  <martin@gnome.org>
10579
10580         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10581         from bug #31834, see the bug report for a testcase which is
10582         miscompiled.
10583
10584 2002-10-10  Martin Baulig  <martin@gnome.org>
10585
10586         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10587         flow analysis code for this.
10588
10589         * statement.cs (Do, While, For): Tell the flow analysis code about
10590         infinite loops.
10591         (FlowBranching.UsageVector): Added support for infinite loops.
10592         (Block.Resolve): Moved the dead code elimination here and use flow
10593         analysis to do it.
10594
10595 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10596
10597         * class.cs (Field.Define): Catch cycles on struct type
10598         definitions. 
10599
10600         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10601         fields if the fields are static.  We only need to check instance
10602         fields. 
10603
10604         * expression.cs (As.DoResolve): Test for reference type.
10605
10606         * statement.cs (Using.ResolveExpression): Use
10607         ConvertImplicitRequired, not ConvertImplicit which reports an
10608         error on failture
10609         (Using.ResolveLocalVariableDecls): ditto.
10610
10611         * expression.cs (Binary.ResolveOperator): Report errors in a few
10612         places where we had to.
10613
10614         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10615
10616 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10617
10618         * expression.cs: Use StoreFromPtr instead of extracting the type
10619         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10620
10621         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10622         an enumeration value to a System.Enum, but System.Enum is not a
10623         value type, but an class type, so we need to box.
10624
10625         (Expression.ConvertExplicit): One codepath could return
10626         errors but not flag them.  Fix this.  Fixes #31853
10627
10628         * parameter.cs (Resolve): Do not allow void as a parameter type.
10629
10630 2002-10-06  Martin Baulig  <martin@gnome.org>
10631
10632         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10633         if it's a class type and not a struct.  Fixes #31815.
10634
10635 2002-10-06  Martin Baulig  <martin@gnome.org>
10636
10637         * statement.cs: Reworked the flow analysis code a bit to make it
10638         usable for dead code elimination.
10639
10640 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10641
10642         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10643
10644 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10645
10646         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10647         to fix the test 165, will investigate deeper.
10648
10649 2002-10-04  Martin Baulig  <martin@gnome.org>
10650
10651         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10652         finally blocks actually work.
10653         (Try.Resolve): We don't need to create a sibling for `finally' if
10654         there is no finally block.
10655
10656 2002-10-04  Martin Baulig  <martin@gnome.org>
10657
10658         * class.cs (Constructor.Define): The default accessibility for a
10659         non-default constructor is private, not public.
10660
10661 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10662
10663         * class.cs (Constructor): Make AllowedModifiers public, add
10664         EXTERN.
10665
10666         * cs-parser.jay: Perform the modifiers test here, as the
10667         constructor for the Constructor class usually receives a zero
10668         because of the way we create it (first we create, later we
10669         customize, and we were never checking the modifiers).
10670
10671         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10672         is a version of LookupTypeReflection that includes the type-name
10673         cache.  This can be used as a fast path for functions that know
10674         the fully qualified name and are only calling into *.GetType() to
10675         obtain a composed type.
10676
10677         This is also used by TypeManager.LookupType during its type
10678         composition.
10679
10680         (LookupType): We now also track the real type name, as sometimes
10681         we can get a quey for the real type name from things like
10682         ComposedCast.  This fixes bug 31422.
10683
10684         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10685         complete type fullname, it does not have to go through the type
10686         resolution system to obtain the composed version of the type (for
10687         obtaining arrays or pointers).
10688
10689         (Conditional.Emit): Use the EmitBoolExpression to
10690         generate nicer code, as requested by Paolo.
10691
10692         (ArrayCreation.CheckIndices): Use the patch from
10693         hwang_rob@yahoo.ca to validate the array initializers. 
10694
10695 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10696
10697         * class.cs (ConstructorInitializer.Emit): simplify code by using
10698         Invocation.EmitCall, and at the same time, fix the bugs in calling
10699         parent constructors that took variable arguments. 
10700
10701         * ecore.cs (Expression.ConvertNumericExplicit,
10702         Expression.ImplicitNumericConversion): Remove the code that
10703         manually wrapped decimal (InternalTypeConstructor call is now gone
10704         as well).
10705
10706         * expression.cs (Cast.TryReduce): Also handle decimal types when
10707         trying to perform a constant fold on the type.
10708
10709         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10710
10711         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10712         that only turned off an error report, and did nothing else. 
10713
10714 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10715
10716         * driver.cs: Handle and ignore /fullpaths
10717
10718 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10719
10720         * expression.cs (Binary.ResolveOperator): Catch the case where
10721         DoNumericPromotions returns true, 
10722
10723         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10724
10725 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10726
10727         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10728         report error 70.
10729
10730 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10731
10732         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10733         conversion exists, but it is also required that the conversion be
10734         performed.  This manifested in "(Type64Enum) 2".  
10735
10736         * class.cs (TypeManager.AddMethod): The fix is not to change
10737         AddEnum, because that one was using a fully qualified name (every
10738         DeclSpace derivative does), but to change the AddMethod routine
10739         that was using an un-namespaced name.  This now correctly reports
10740         the duplicated name.
10741
10742         Revert patch until I can properly fix it.  The issue
10743         is that we have a shared Type space across all namespaces
10744         currently, which is wrong.
10745
10746         Options include making the Namespace a DeclSpace, and merge
10747         current_namespace/current_container in the parser.
10748
10749 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10750
10751         * cs-parser.jay: Improve error reporting when we get a different
10752         kind of expression in local_variable_type and
10753         local_variable_pointer_type. 
10754
10755         Propagate this to avoid missleading errors being reported.
10756
10757         * ecore.cs (ImplicitReferenceConversion): treat
10758         TypeManager.value_type as a target just like object_type.   As
10759         code like this:
10760
10761         ValueType v = 1;
10762
10763         Is valid, and needs to result in the int 1 being boxed before it
10764         is assigned to the value type v.
10765
10766         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10767         to validate the enumeration name.
10768
10769         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10770         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10771         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10772
10773         * ecore.cs (TryImplicitIntConversion): When doing an
10774         implicit-enumeration-conversion, check if the type is 64-bits and
10775         perform a conversion before passing to EnumConstant.
10776
10777 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10778
10779         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10780         report ambiguous type references.  Unlike the MS version, we
10781         report what the ambiguity is.   Innovation at work ;-)
10782
10783         (DeclSpace.FindType): Require a location argument to
10784         display when we display an ambiguous error.
10785
10786         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10787
10788         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10789
10790         * expression.cs (EmitDynamicInitializers): Apply patch from
10791         hwang_rob@yahoo.ca that fixes the order in which we emit our
10792         initializers. 
10793
10794 2002-09-21  Martin Baulig  <martin@gnome.org>
10795
10796         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10797         delegate takes no arguments.
10798
10799 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10800
10801         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10802         from integers.
10803
10804         * expression.cs: Extract the underlying type.
10805
10806         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10807
10808         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10809
10810 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10811
10812         * class.cs (TypeContainer.DefineType): We can not use the nice
10813         PackingSize with the size set to 1 DefineType method, because it
10814         will not allow us to define the interfaces that the struct
10815         implements.
10816
10817         This completes the fixing of bug 27287
10818
10819         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10820         means also structs.  This fixes part of the problem. 
10821         (Expresion.ImplicitReferenceConversionExists): ditto.
10822
10823         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10824         error if there were no errors reported during the type lookup
10825         process, to avoid duplicates or redundant errors.  Without this
10826         you would get an ambiguous errors plus a type not found.  We have
10827         beaten the user enough with the first error.  
10828
10829         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10830         reference. 
10831
10832         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10833         during the resolution process, stop the lookup, this avoids
10834         repeated error reports (same error twice).
10835
10836         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10837
10838         * typemanager.cs (LookupType): Redo the type lookup code to match
10839         the needs of System.Reflection.  
10840
10841         The issue is that System.Reflection requires references to nested
10842         types to begin with a "+" sign instead of a dot.  So toplevel
10843         types look like: "NameSpace.TopLevelClass", and nested ones look
10844         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10845         levels. 
10846
10847 2002-09-19  Martin Baulig  <martin@gnome.org>
10848
10849         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10850         says that a method always returns or always throws an exception,
10851         don't report the CS0161.
10852
10853         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10854         set `Returns = new_returns'.
10855
10856 2002-09-19  Martin Baulig  <martin@gnome.org>
10857
10858         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10859         to an enum constant, check for a CS0176.
10860
10861 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10862
10863         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10864         for operators that must be in pairs and report errors.
10865
10866         * ecore.cs (SimpleName.DoResolveType): During the initial type
10867         resolution process, when we define types recursively, we must
10868         check first for types in our current scope before we perform
10869         lookups in the enclosing scopes.
10870
10871         * expression.cs (MakeByteBlob): Handle Decimal blobs.
10872
10873         (Invocation.VerifyArgumentsCompat): Call
10874         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10875         I thought we were supposed to always call this, but there are a
10876         few places in the code where we dont do it.
10877
10878 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
10879
10880         * driver.cs: Add support in -linkres and -resource to specify the
10881         name of the identifier.
10882
10883 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10884
10885         * ecore.cs (StandardConversionExists): Sync with the conversion
10886         code: allow anything-* to void* conversions.
10887
10888         (FindMostSpecificSource): Use an Expression argument
10889         instead of a Type, because we might be handed over a Literal which
10890         gets a few more implicit conversions that plain types do not.  So
10891         this information was being lost.
10892
10893         Also, we drop the temporary type-holder expression when not
10894         required.
10895
10896 2002-09-17  Martin Baulig  <martin@gnome.org>
10897
10898         * class.cs (PropertyBase.CheckBase): Don't check the base class if
10899         this is an explicit interface implementation.
10900
10901 2002-09-17  Martin Baulig  <martin@gnome.org>
10902
10903         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
10904         different `IndexerName' attributes.
10905
10906         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
10907         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
10908         virtual CommonResolve().
10909
10910 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10911
10912         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
10913         and convert that to the UnderlyingType.
10914
10915         * statement.cs (Foreach.Resolve): Indexers are just like variables
10916         or PropertyAccesses.
10917
10918         * cs-tokenizer.cs (consume_string): Track line numbers and columns
10919         inside quoted strings, we were not doing this before.
10920
10921 2002-09-16  Martin Baulig  <martin@gnome.org>
10922
10923         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
10924         resolve it.  This is needed for the definite assignment check of the
10925         instance expression, fixes bug #29846.
10926         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
10927
10928 2002-09-16  Nick Drochak  <ndrochak@gol.com>
10929
10930         * parameter.cs: Fix compile error.  Cannot reference static member
10931         from an instance object.  Is this an mcs bug?
10932
10933 2002-09-14  Martin Baulig  <martin@gnome.org>
10934
10935         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
10936         multiple times.  Fixes bug #30295, added test-166.cs.
10937
10938 2002-09-14  Martin Baulig  <martin@gnome.org>
10939
10940         * statement.cs (Block.Emit): Don't emit unreachable code.
10941         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
10942         `break' statements.
10943         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
10944
10945 2002-09-14  Martin Baulig  <martin@gnome.org>
10946
10947         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
10948         is set.
10949
10950 2002-09-14  Martin Baulig  <martin@gnome.org>
10951
10952         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
10953         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
10954         be false on the ms runtime.
10955
10956 2002-09-13  Martin Baulig  <martin@gnome.org>
10957
10958         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
10959         the CS0038 error message.
10960
10961 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
10962
10963         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
10964         constant inside, return it.
10965
10966 2002-09-12  Martin Baulig  <martin@gnome.org>
10967
10968         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
10969         implicit conversion can be done between enum types.
10970
10971         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
10972         check whether an implicit conversion to the current enum's UnderlyingType
10973         exists and report an error if not.
10974
10975         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
10976         without debugging support.
10977
10978         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
10979         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
10980
10981 2002-09-12  Martin Baulig  <martin@gnome.org>
10982
10983         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
10984
10985         * ecore.cs (IMemberExpr.DeclaringType): New property.
10986         (SimpleName.SimpleNameResolve): Check whether we're accessing a
10987         nonstatic member of an outer type (CS0038).
10988
10989 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
10990
10991         * driver.cs: Activate the using-error detector at warning level
10992         4 (at least for MS-compatible APIs).
10993
10994         * namespace.cs (VerifyUsing): Small buglett fix.
10995
10996         * pending.cs (PendingImplementation): pass the container pointer. 
10997
10998         * interface.cs (GetMethods): Allow for recursive definition.  Long
10999         term, I would like to move every type to support recursive
11000         definitions, not the current ordering mechanism that we have right
11001         now.
11002
11003         The situation is this: Attributes are handled before interfaces,
11004         so we can apply attributes to interfaces.  But some attributes
11005         implement interfaces, we will now handle the simple cases
11006         (recursive definitions will just get an error).  
11007
11008         * parameter.cs: Only invalidate types at the end if we fail to
11009         lookup all types.  
11010
11011 2002-09-09  Martin Baulig  <martin@gnome.org>
11012
11013         * ecore.cs (PropertyExpr.Emit): Also check for
11014         TypeManager.system_int_array_get_length so this'll also work when
11015         compiling corlib.  Fixes #30003.
11016
11017 2002-09-09  Martin Baulig  <martin@gnome.org>
11018
11019         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11020         and throw an exception if we can't get the type's size.  Fixed #30040,
11021         added test-165.cs.
11022
11023 2002-09-09  Martin Baulig  <martin@gnome.org>
11024
11025         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11026
11027         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11028         context.  Fixes bug #30027.
11029
11030         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11031         virtual functions.  Fixes bug #30043, added test-164.cs.
11032
11033 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11034
11035         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11036
11037 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11038
11039         * driver.cs: Use an object to get the windows codepage since it's not a
11040         static property.
11041
11042 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * statement.cs (For.Emit): for infinite loops (test == null)
11045         return whether there is a break inside, not always "true".
11046
11047         * namespace.cs (UsingEntry): New struct to hold the name of the
11048         using definition, the location where it is defined, and whether it
11049         has been used in a successful type lookup.
11050
11051         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11052         strings.
11053
11054         * decl.cs: ditto.
11055
11056 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11057
11058         * attribute.cs : Fix incorrect code which relied on catching
11059         a NullReferenceException to detect a null being passed in
11060         where an object was expected.
11061
11062 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11063
11064         * statement.cs (Try): flag the catch variable as assigned
11065
11066         * expression.cs (Cast): Simplified by using ResolveType instead of
11067         manually resolving.
11068
11069         * statement.cs (Catch): Fix bug by using ResolveType.
11070
11071 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11072
11073         * expression.cs (BetterConversion): Special case for when we have
11074         a NullLiteral as the argument and we have to choose between string
11075         and object types - we choose string the way csc does.
11076
11077         * attribute.cs (Attribute.Resolve): Catch the
11078         NullReferenceException and report error #182 since the Mono
11079         runtime no more has the bug and having this exception raised means
11080         we tried to select a constructor which takes an object and is
11081         passed a null.
11082
11083 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11084
11085         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11086         message (1502, 1503) when we can't locate a method after overload
11087         resolution. This is much more informative and closes the bug
11088         Miguel reported.
11089
11090         * interface.cs (PopulateMethod): Return if there are no argument
11091         types. Fixes a NullReferenceException bug.
11092
11093         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11094         expressions too. Previously we were checking only in one place for
11095         positional arguments leaving out named arguments.
11096
11097         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11098         type to the enum type is not allowed. Remove code corresponding to
11099         that.
11100
11101         (ConvertNumericExplicit): Allow explicit conversions from
11102         the underlying type to enum type. This precisely follows the spec
11103         and closes a bug filed by Gonzalo.
11104
11105 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11106
11107         * compiler.csproj:
11108         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11109
11110 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11111
11112         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11113         it was important that we stored the right value after the
11114         reduction in `converted'.
11115
11116 2002-09-04  Martin Baulig  <martin@gnome.org>
11117
11118         * location.cs (Location.SymbolDocument): Use full pathnames for the
11119         source files.
11120
11121 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11122
11123         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11124         of the expression resolve mechanism, because that will catch the
11125         SimpleName error failures.
11126
11127         (Conditional): If we can not resolve the
11128         expression, return, do not crash.
11129
11130 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11131
11132         * cs-tokenizer.cs:
11133         (location): display token name instead of its number.
11134
11135 2002-08-28  Martin Baulig  <martin@gnome.org>
11136
11137         * expression.cs (Binary.ResolveOperator): Don't silently return
11138         but return an error if an operator cannot be applied between two
11139         enum types.
11140
11141 2002-08-28  Martin Baulig  <martin@gnome.org>
11142
11143         * class.cs (Constructor.Define): Set the permission attributes
11144         correctly instead of making all constructors public.
11145
11146 2002-08-28  Martin Baulig  <martin@gnome.org>
11147
11148         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11149         for private members before reporting a CS0103; if we find anything,
11150         it's a CS0122.
11151
11152 2002-08-28  Martin Baulig  <martin@gnome.org>
11153
11154         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11155         to check whether `closure_start_type == closure_invocation_type',
11156         we also need to check whether `m.DeclaringType == closure_invocation_type'
11157         before bypassing the permission checks.  We might be accessing
11158         protected/private members from the base class.
11159         (TypeManager.RealMemberLookup): Only set private_ok if private
11160         members were requested via BindingFlags.NonPublic.
11161
11162         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11163
11164         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11165         MethodGroupExpr.IsExplicitImpl if appropriate.
11166         (Invocation.DoResolve): Don't report the CS0120 for explicit
11167         interface implementations.
11168
11169 2002-08-27  Martin Baulig  <martin@gnome.org>
11170
11171         * expression.cs (Invocation.DoResolve): If this is a static
11172         method and we don't have an InstanceExpression, we must report
11173         a CS0120.
11174
11175 2002-08-25  Martin Baulig  <martin@gnome.org>
11176
11177         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11178         `==' between a valuetype and an object.
11179
11180 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11181
11182         * ecore.cs (TypeExpr): Provide a ToString method.
11183
11184 2002-08-24  Martin Baulig  <martin@gnome.org>
11185
11186         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11187         now called proggie.dbg and it's a binary file.
11188
11189 2002-08-23  Martin Baulig  <martin@gnome.org>
11190
11191         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11192
11193 2002-08-23  Martin Baulig  <martin@gnome.org>
11194
11195         * struct.cs (MyStructInfo.ctor): Make this work with empty
11196         structs; it's not allowed to use foreach() on null.
11197
11198 2002-08-23  Martin Baulig  <martin@gnome.org>
11199
11200         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11201         writer the full pathname of the generated assembly.
11202
11203 2002-08-23  Martin Baulig  <martin@gnome.org>
11204
11205         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11206         A `finally' block never returns or breaks; improved handling of
11207         unreachable code.
11208
11209 2002-08-23  Martin Baulig  <martin@gnome.org>
11210
11211         * statement.cs (Throw.Resolve): Allow `throw null'.
11212
11213 2002-08-23  Martin Baulig  <martin@gnome.org>
11214
11215         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11216         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11217         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11218         MemberLookup would return a wrong event if this is an explicit
11219         interface implementation and the class has an event with the same
11220         name.
11221
11222 2002-08-23  Martin Baulig  <martin@gnome.org>
11223
11224         * statement.cs (Block.AddChildVariableNames): New public method.
11225         (Block.AddChildVariableName): Likewise.
11226         (Block.IsVariableNameUsedInChildBlock): Likewise.
11227         (Block.AddVariable): Check whether a variable name has already
11228         been used in a child block.
11229
11230         * cs-parser.jay (declare_local_variables): Mark all variable names
11231         from the current block as being used in a child block in the
11232         implicit block.
11233
11234 2002-08-23  Martin Baulig  <martin@gnome.org>
11235
11236         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11237         find the symbol writer.
11238
11239         * driver.cs: csc also allows the arguments to /define being
11240         separated by commas, not only by semicolons.
11241
11242 2002-08-23  Martin Baulig  <martin@gnome.org>
11243
11244         * interface.cs (Interface.GetMembers): Added static check for events.
11245
11246 2002-08-15  Martin Baulig  <martin@gnome.org>
11247
11248         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11249         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11250
11251         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11252         why the MethodData.EmitDestructor() change was necessary.
11253
11254 2002-08-20  Martin Baulig  <martin@gnome.org>
11255
11256         * class.cs (TypeContainer.FindMembers): Added static check for events.
11257
11258         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11259
11260         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11261         use Type.GetEvents(), not Type.FindMembers().
11262
11263 2002-08-20  Martin Baulig  <martin@gnome.org>
11264
11265         * decl.cs (MemberCache): Added a special method cache which will
11266         be used for method-only searched.  This ensures that a method
11267         search will return a MethodInfo with the correct ReflectedType for
11268         inherited methods.      
11269
11270 2002-08-20  Martin Baulig  <martin@gnome.org>
11271
11272         * decl.cs (DeclSpace.FindMembers): Made this public.
11273
11274 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11275
11276         * delegate.cs: fixed build on windows.
11277         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11278
11279 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11280
11281         * ecore.cs (StandardConversionExists): Return a false
11282         if we are trying to convert the void type to anything else
11283         since that is not allowed.
11284
11285         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11286         we flag error 70 in the event an event is trying to be accessed
11287         directly from outside the declaring type.
11288
11289 2002-08-20  Martin Baulig  <martin@gnome.org>
11290
11291         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11292         MemberCache from typemanager.cs to decl.cs.
11293
11294 2002-08-19  Martin Baulig  <martin@gnome.org>
11295
11296         * class.cs (TypeContainer): Implement IMemberContainer.
11297         (TypeContainer.DefineMembers): Create the MemberCache.
11298         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11299         return public members if BindingFlags.Public was given, check
11300         whether members are static.
11301
11302 2002-08-16  Martin Baulig  <martin@gnome.org>
11303
11304         * decl.cs (DeclSpace.Define): Splitted this in Define and
11305         DefineMembers.  DefineMembers is called first and initializes the
11306         MemberCache.
11307
11308         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11309         DefineMembers() on all our DeclSpaces.
11310
11311         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11312         but call DefineMembers() on all nested interfaces.  We call their
11313         Define() in our new Define() function.
11314
11315         * interface.cs (Interface): Implement IMemberContainer.
11316         (Interface.Define): Moved all code except the attribute stuf to
11317         DefineMembers().
11318         (Interface.DefineMembers): Initialize the member cache.
11319
11320         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11321         need this anymore since we can use MemberCache.FindMembers directly.
11322
11323 2002-08-19  Martin Baulig  <martin@gnome.org>
11324
11325         * typemanager.cs (MemberCache): When creating the cache for an
11326         interface type, add all inherited members.
11327         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11328         to `out bool used_cache' and documented it.
11329         (TypeManager.MemberLookup): If we already used the cache in the first
11330         iteration, we don't need to do the interfaces check.
11331
11332 2002-08-19  Martin Baulig  <martin@gnome.org>
11333
11334         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11335         here from IMemberFinder and don't implement this interface anymore.
11336         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11337
11338         * typemanager.cs (IMemberFinder): This interface is now only used by
11339         classes which actually support the member cache.
11340         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11341         since we only put DeclSpaces into this Hashtable.
11342         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11343         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11344
11345 2002-08-16  Martin Baulig  <martin@gnome.org>
11346
11347         * typemanager.cs (ICachingMemberFinder): Removed.
11348         (IMemberFinder.MemberCache): New property.
11349         (TypeManager.FindMembers): Merged this with RealFindMembers().
11350         This function will never be called from TypeManager.MemberLookup()
11351         so we can't use the cache here, just the IMemberFinder.
11352         (TypeManager.MemberLookup_FindMembers): Check whether the
11353         IMemberFinder has a MemberCache and call the cache's FindMembers
11354         function.
11355         (MemberCache): Rewrote larger parts of this yet another time and
11356         cleaned it up a bit.
11357
11358 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11359
11360         * driver.cs (LoadArgs): Support quoting.
11361
11362         (Usage): Show the CSC-like command line arguments.
11363
11364         Improved a few error messages.
11365
11366 2002-08-15  Martin Baulig  <martin@gnome.org>
11367
11368         * typemanager.cs (IMemberContainer.Type): New property.
11369         (IMemberContainer.IsInterface): New property.
11370
11371         The following changes are conditional to BROKEN_RUNTIME, which is
11372         defined at the top of the file.
11373
11374         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11375         class'es members, but add all members from TypeHandle.ObjectType
11376         if we're an interface.
11377         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11378         is the current type.
11379         (MemberCache.CacheEntry.Container): Removed this field.
11380         (TypeHandle.GetMembers): Include inherited members.
11381
11382 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11383
11384         * typemanager.cs: fixed compilation and added a comment on a field that
11385         is never used.
11386
11387 2002-08-15  Martin Baulig  <martin@gnome.org>
11388
11389         * class.cs (ConstructorInitializer.Resolve): In the
11390         Expression.MemberLookup call, use the queried_type as
11391         invocation_type.
11392
11393         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11394         declared' attribute, it's always true.
11395         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11396         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11397         temporary wrapper for FindMembers which tells MemberLookup whether
11398         members from the base classes are included in the return value.
11399         This will go away soon.
11400         (TypeManager.MemberLookup): Use this temporary hack here; once the
11401         new MemberCache is completed, we don't need to do the DeclaredOnly
11402         looping here anymore since the MemberCache will take care of this.
11403         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11404         (MemberCache): When creating the MemberCache for a class, get
11405         members from the current class and all its base classes.
11406         (MemberCache.CacheEntry.Container): New field.  This is a
11407         temporary hack until the Mono runtime is fixed to distinguish
11408         between ReflectedType and DeclaringType.  It allows us to use MCS
11409         with both the MS runtime and the unfixed Mono runtime without
11410         problems and without accecting performance.
11411         (MemberCache.SearchMembers): The DeclaredOnly looping from
11412         TypeManager.MemberLookup is now done here.      
11413
11414 2002-08-14  Martin Baulig  <martin@gnome.org>
11415
11416         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11417         Type.GetFields on dynamic types but get the fields from the
11418         corresponding TypeContainer.
11419         (MyStructInfo.GetStructInfo): Added check for enum types.
11420
11421         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11422         (MemberList.SyncRoot): Implemented.
11423         (TypeManager.FilterWithClosure): No need to check permissions if
11424         closure_start_type == closure_invocation_type, don't crash if
11425         closure_invocation_type is null.
11426
11427 2002-08-13  Martin Baulig  <martin@gnome.org>
11428
11429         Rewrote TypeContainer.FindMembers to use a member cache.  This
11430         gives us a speed increase of about 35% for the self-hosting MCS
11431         build and of about 15-20% for the class libs (both on GNU/Linux).
11432
11433         * report.cs (Timer): New class to get enhanced profiling.  This
11434         whole class is "TIMER" conditional since it remarkably slows down
11435         compilation speed.
11436
11437         * class.cs (MemberList): New class.  This is an IList wrapper
11438         which we're now using instead of passing MemberInfo[]'s around to
11439         avoid copying this array unnecessarily.
11440         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11441         (ICachingMemberFinder, IMemberContainer): New interface.
11442         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11443         has already been checked, otherwise use it for the name comparision.
11444         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11445         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11446         if possible.  Returns a MemberList, not a MemberInfo [].
11447         (TypeHandle): New class, implements IMemberContainer.  We create
11448         one instance of this class per type, it contains a MemberCache
11449         which is used to do the member lookups.
11450         (MemberCache): New class.  Each instance of this class contains
11451         all members of a type and a name-based hash table.
11452         (MemberCache.FindMembers): This is our new member lookup
11453         function.  First, it looks up all members of the requested name in
11454         the hash table.  Then, it walks this list and sorts out all
11455         applicable members and returns them.
11456
11457 2002-08-13  Martin Baulig  <martin@gnome.org>
11458
11459         In addition to a nice code cleanup, this gives us a performance
11460         increase of about 1.4% on GNU/Linux - not much, but it's already
11461         half a second for the self-hosting MCS compilation.
11462
11463         * typemanager.cs (IMemberFinder): New interface.  It is used by
11464         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11465         Enum, Delegate or Interface.
11466         (TypeManager.finder_to_member_finder): New PtrHashtable.
11467         (TypeManager.finder_to_container): Removed.
11468         (TypeManager.finder_to_delegate): Removed.
11469         (TypeManager.finder_to_interface): Removed.
11470         (TypeManager.finder_to_enum): Removed.
11471
11472         * interface.cs (Interface): Implement IMemberFinder.
11473
11474         * delegate.cs (Delegate): Implement IMemberFinder.
11475
11476         * enum.cs (Enum): Implement IMemberFinder.
11477
11478         * class.cs (TypeContainer): Implement IMemberFinder.
11479
11480 2002-08-12  Martin Baulig  <martin@gnome.org>
11481
11482         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11483
11484 2002-08-12  Martin Baulig  <martin@gnome.org>
11485
11486         * ecore.cs (ITypeExpression): New interface for expressions which
11487         resolve to a type.
11488         (TypeExpression): Renamed to TypeLookupExpression.
11489         (Expression.DoResolve): If we're doing a types-only lookup, the
11490         expression must implement the ITypeExpression interface and we
11491         call DoResolveType() on it.
11492         (SimpleName): Implement the new ITypeExpression interface.
11493         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11494         hack, the situation that we're only looking up types can't happen
11495         anymore when this method is called.  Moved the type lookup code to
11496         DoResolveType() and call it.
11497         (SimpleName.DoResolveType): This ITypeExpression interface method
11498         is now doing the types-only lookup.
11499         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11500         (ResolveFlags): Added MaskExprClass.
11501
11502         * expression.cs (MemberAccess): Implement the ITypeExpression
11503         interface.
11504         (MemberAccess.DoResolve): Added support for a types-only lookup
11505         when we're called via ITypeExpression.DoResolveType().
11506         (ComposedCast): Implement the ITypeExpression interface.
11507
11508         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11509         Expression.Resolve() with ResolveFlags.Type instead.
11510
11511 2002-08-12  Martin Baulig  <martin@gnome.org>
11512
11513         * interface.cs (Interface.Define): Apply attributes.
11514
11515         * attribute.cs (Attribute.ApplyAttributes): Added support for
11516         interface attributes.
11517
11518 2002-08-11  Martin Baulig  <martin@gnome.org>
11519
11520         * statement.cs (Block.Emit): Only check the "this" variable if we
11521         do not always throw an exception.
11522
11523         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11524         whether the property has a set accessor.
11525
11526 2002-08-11  Martin Baulig  <martin@gnome.org>
11527
11528         Added control flow analysis support for structs.
11529
11530         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11531         with control flow analysis turned off.
11532         (IVariable): New interface.
11533         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11534         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11535         (FieldExpr.DoResolve): Resolve the instance expression with flow
11536         analysis turned off and do the definite assignment check after the
11537         resolving when we know what the expression will resolve to.
11538
11539         * expression.cs (LocalVariableReference, ParameterReference):
11540         Implement the new IVariable interface, only call the flow analysis
11541         code if ec.DoFlowAnalysis is true.
11542         (This): Added constructor which takes a Block argument.  Implement
11543         the new IVariable interface.
11544         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11545         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11546         This does the definite assignment checks for struct members.
11547
11548         * class.cs (Constructor.Emit): If this is a non-static `struct'
11549         constructor which doesn't have any initializer, call
11550         Block.AddThisVariable() to tell the flow analysis code that all
11551         struct elements must be initialized before control returns from
11552         the constructor.
11553
11554         * statement.cs (MyStructInfo): New public class.
11555         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11556         argument to this indexer.  If non-zero, check an individual struct
11557         member, not the whole struct.
11558         (FlowBranching.CheckOutParameters): Check struct members.
11559         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11560         overloaded versions of these methods which take an additional
11561         `int field_idx' argument to check struct members.
11562         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11563         overloaded versions of these methods which take an additional
11564         `string field_name' argument to check struct member.s
11565         (VariableInfo): Implement the IVariable interface.
11566         (VariableInfo.StructInfo): New public property.  Returns the
11567         MyStructInfo instance of the variable if it's a struct or null.
11568         (Block.AddThisVariable): New public method.  This is called from
11569         Constructor.Emit() for non-static `struct' constructor which do
11570         not have any initializer.  It creates a special variable for the
11571         "this" instance variable which will be checked by the flow
11572         analysis code to ensure that all of the struct's fields are
11573         initialized before control returns from the constructor.
11574         (UsageVector): Added support for struct members.  If a
11575         variable/parameter is a struct with N members, we reserve a slot
11576         in the usage vector for each member.  A struct is considered fully
11577         initialized if either the struct itself (slot 0) or all its
11578         members are initialized.
11579
11580 2002-08-08  Martin Baulig  <martin@gnome.org>
11581
11582         * driver.cs (Driver.MainDriver): Only report an error CS5001
11583         if there were no compilation errors.
11584
11585         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11586         `UnsafeContext' property to determine whether the parent is in
11587         unsafe context rather than checking the parent's ModFlags:
11588         classes nested in an unsafe class are unsafe as well.
11589
11590 2002-08-08  Martin Baulig  <martin@gnome.org>
11591
11592         * statement.cs (UsageVector.MergeChildren): Distinguish between
11593         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11594         we return.  Added test17() and test18() to test-154.cs.
11595
11596 2002-08-08  Martin Baulig  <martin@gnome.org>
11597
11598         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11599         Family access, make sure the invoking type isn't a subclass of the
11600         queried type (that'd be a CS1540).
11601
11602         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11603         this method which takes an additional `Type invocation_type'.
11604
11605         * expression.cs (BaseAccess.DoResolve): Use the base type as
11606         invocation and query type.
11607         (MemberAccess.DoResolve): If the lookup failed and we're about to
11608         report a CS0122, try a lookup with the ec.ContainerType - if this
11609         succeeds, we must report a CS1540.
11610
11611 2002-08-08  Martin Baulig  <martin@gnome.org>
11612
11613         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11614         (MethodGroupExpr): Implement the IMemberExpr interface.
11615
11616         * expression (MemberAccess.ResolveMemberAccess): No need to have
11617         any special code for MethodGroupExprs anymore, they're now
11618         IMemberExprs.   
11619
11620 2002-08-08  Martin Baulig  <martin@gnome.org>
11621
11622         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11623         Family, FamANDAssem and FamORAssem permissions.
11624         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11625
11626 2002-08-08  Martin Baulig  <martin@gnome.org>
11627
11628         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11629         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11630         or loop block.
11631
11632 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11633
11634         * driver.cs: implemented /resource option to embed managed resources.
11635
11636 2002-08-07  Martin Baulig  <martin@gnome.org>
11637
11638         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11639         (FieldBase.HasFieldInitializer): New public property.
11640         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11641         returns the field initializer and makes sure it is only resolved once.
11642         (TypeContainer.EmitFieldInitializers): Call
11643         FieldBase.GetInitializerExpression to get the initializer, this ensures
11644         that it isn't resolved multiple times.
11645
11646         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11647         the resolving process (SimpleName/MemberLookup) that we're currently
11648         emitting a field initializer (which must not access any instance members,
11649         this is an error CS0236).
11650
11651         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11652         argument, if the `IsFieldInitializer' flag is set, we must report and
11653         error CS0236 and not an error CS0120.   
11654
11655 2002-08-07  Martin Baulig  <martin@gnome.org>
11656
11657         * ecore.cs (IMemberExpr): New public interface.
11658         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11659         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11660         if the expression is an IMemberExpr.
11661
11662         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11663         to be null, implicitly default to `this' if we're non-static in
11664         this case.  Simplified the code a lot by using the new IMemberExpr
11665         interface.  Also fixed bug #28176 here.
11666
11667 2002-08-06  Martin Baulig  <martin@gnome.org>
11668
11669         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11670         ParameterReferences during semantic analysis so that we can do a
11671         type-only search when resolving Cast, TypeOf and SizeOf.
11672         (block): Pass the `current_local_parameters' to the Block's
11673         constructor.
11674
11675         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11676         argument to the constructor.
11677         (ConstructorInitializer.Resolve): Create a temporary implicit
11678         block with the parameters.
11679
11680         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11681         references here if we aren't doing a type-only search.
11682
11683         * statement.cs (Block): Added constructor which takes a
11684         `Parameters parameters' argument.
11685         (Block.Parameters): New public property.
11686
11687         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11688         to `Parameters' and made it public readonly.
11689
11690 2002-08-06  Martin Baulig  <martin@gnome.org>
11691
11692         * ecore.cs (Expression.Warning): Made this public as well.
11693
11694         * report.cs (Report.Debug): Print the contents of collections.
11695
11696 2002-08-06  Martin Baulig  <martin@gnome.org>
11697
11698         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11699         used to tell Resolve() which kinds of expressions it may return.
11700         (Expression.Resolve): Added overloaded version of this method which
11701         takes a `ResolveFlags flags' argument.  This can be used to tell
11702         Resolve() which kinds of expressions it may return.  Reports a
11703         CS0118 on error.
11704         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11705         ResolveFlags.SimpleName.
11706         (Expression.Error118): Added overloaded version of this method which
11707         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11708         which kinds of expressions are allowed.
11709
11710         * expression.cs (Argument.ResolveMethodGroup): New public method.
11711         Resolves an argument, but allows a MethodGroup to be returned.
11712         This is used when invoking a delegate.
11713
11714         * TODO: Updated a bit.
11715
11716 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11717
11718         Fixed compilation with csc.
11719
11720         * ecore.cs: Expression.Error made public. Is this correct? Should
11721         Warning be made public too?
11722
11723         * expression.cs: use ea.Location instead of ea.loc.
11724         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11725
11726 2002-08-06  Martin Baulig  <martin@gnome.org>
11727
11728         * ecore.cs (Expression.loc): Moved the location here instead of
11729         duplicating it in all derived classes.
11730         (Expression.Location): New public property.
11731         (Expression.Error, Expression.Warning): Made them non-static and
11732         removed the location argument.
11733         (Expression.Warning): Added overloaded version which takes an
11734         `int level' argument.
11735         (Expression.Error118): Make this non-static and removed the
11736         expression and location arguments.
11737         (TypeExpr): Added location argument to the constructor.
11738
11739         * expression.cs (StaticCallExpr): Added location argument to
11740         the constructor.
11741         (Indirection, PointerArithmetic): Likewise.
11742         (CheckedExpr, UnCheckedExpr): Likewise.
11743         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11744         (StringPtr): Likewise.
11745
11746
11747 2002-08-05  Martin Baulig  <martin@gnome.org>
11748
11749         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11750
11751         * assign.cs (Assign.DoResolve): Check whether the source
11752         expression is a value or variable.
11753
11754         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11755         while resolving the corresponding blocks.
11756
11757         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11758         an error, don't silently return null.
11759
11760         * statement.cs (Block.AddVariable): Do the error reporting here
11761         and distinguish between CS0128 and CS0136.
11762         (Block.DoResolve): Report all unused labels (warning CS0164).
11763         (LabeledStatement): Pass the location to the constructor.
11764         (LabeledStatement.HasBeenReferenced): New property.
11765         (LabeledStatement.Resolve): Set it to true here.
11766
11767         * statement.cs (Return.Emit): Return success even after reporting
11768         a type mismatch error (CS0126 or CS0127), this is what csc does and
11769         it avoids confusing the users with any consecutive errors.
11770
11771 2002-08-05  Martin Baulig  <martin@gnome.org>
11772
11773         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11774
11775         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11776
11777         * expression.cs (MemberAccess.DoResolve): Silently return if an
11778         error has already been reported.
11779
11780         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11781         error has already been reported.
11782
11783 2002-08-05  Martin Baulig  <martin@gnome.org>
11784
11785         * statement.cs (UsageVector): Only initialize the `parameters'
11786         vector if we actually have any "out" parameters.
11787
11788 2002-08-05  Martin Baulig  <martin@gnome.org>
11789
11790         * expression.cs (Binary.ResolveOperator): When combining delegates,
11791         they must have the same type.
11792
11793 2002-08-05  Martin Baulig  <martin@gnome.org>
11794
11795         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11796         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11797         work with the ms runtime and we also don't need it: if we're a
11798         PropertyBuilder and not in the `indexer_arguments' hash, then we
11799         are a property and not an indexer.
11800
11801         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11802         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11803         since the latter one doesn't work with the ms runtime.
11804
11805 2002-08-03  Martin Baulig  <martin@gnome.org>
11806
11807         Fixed bugs #27998 and #22735.
11808
11809         * class.cs (Method.IsOperator): New public field.
11810         (Method.CheckBase): Report CS0111 if there's already a method
11811         with the same parameters in the current class.  Report CS0508 when
11812         attempting to change the return type of an inherited method.
11813         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11814         and it's not marked abstract or extern.
11815         (PropertyBase): New abstract base class for Property and Indexer.
11816         (PropertyBase.CheckBase): Moved here from Property and made it work
11817         for indexers.
11818         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11819         the same so we can reuse it there.
11820         (Property, Indexer): Derive from PropertyBase.
11821         (MethodSignature.inheritable_property_signature_filter): New delegate
11822         to find properties and indexers.
11823
11824         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11825         argument and improved error reporting.
11826
11827         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11828         EmptyReadOnlyParameters and made it a property.
11829
11830         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11831         version of this method which takes a `PropertyInfo indexer'.
11832         (TypeManager.RegisterIndexer): New method.
11833
11834         * class.cs: Added myself as author of this file :-)
11835
11836 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11837
11838         * class.cs: fixed compilation on windoze.
11839
11840 2002-08-03  Martin Baulig  <martin@gnome.org>
11841
11842         * interface.cs (Interface.GetInterfaceBases): Check whether all
11843         base interfaces are at least as accessible than the current one.
11844
11845         * class.cs (TypeContainer.GetClassBases): Check whether base types
11846         are at least as accessible than the current type.
11847         (TypeContainer.AsAccessible): Implemented and made non-static.
11848         (MemberBase.CheckParameters): Report errors if the accessibility
11849         checks fail.
11850
11851         * delegate.cs (Delegate.Delegate): The default visibility is
11852         internal for top-level types and private for nested types.
11853         (Delegate.Define): Report errors if the accessibility checks fail.
11854
11855         * enum.cs (Enum.Enum): The default visibility is internal for
11856         top-level types and private for nested types.
11857         (Enum.DefineType): Compute the correct visibility.
11858
11859         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11860         function which takes a `bool is_toplevel' instead of a TypeContainer.
11861
11862         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11863         builtin type.
11864
11865 2002-08-02  Martin Baulig  <martin@gnome.org>
11866
11867         * expression.cs (LocalVariableReferenc): Added constructor which
11868         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11869         (LocalVariableReference.IsReadOnly): New property.
11870         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11871         variable is readonly, use our own readonly flag to do this; you can
11872         use the new constructor to get a writable reference to a read-only
11873         variable.
11874
11875         * cs-parser.jay (foreach_statement, using_statement): Get a writable
11876         reference to the local variable.
11877
11878 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
11879
11880         * rootcontext.cs (ResolveCore): Also include System.Exception
11881
11882         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11883         we reach an EmptyStatement.
11884
11885         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
11886         is also fine.
11887
11888         * expression.cs (Binary.ResolveOperator): Check error result in
11889         two places.
11890
11891         use brtrue/brfalse directly and avoid compares to null.
11892
11893 2002-08-02  Martin Baulig  <martin@gnome.org>
11894
11895         * class.cs (TypeContainer.Define): Define all nested interfaces here.
11896         Fixes bug #28407, added test-155.cs.
11897
11898 2002-08-01  Martin Baulig  <martin@gnome.org>
11899
11900         * class.cs (Event.EmitDefaultMethod): Make this work with static
11901         events.  Fixes #28311, added verify-3.cs.
11902
11903 2002-08-01  Martin Baulig  <martin@gnome.org>
11904
11905         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
11906         `is_disposable' fields.
11907         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
11908         `hm.is_disposable' if we're using the collection pattern.
11909         (Foreach.EmitCollectionForeach): Use the correct type for the
11910         enumerator's local variable, only emit the try/finally block if
11911         necessary (fixes #27713).
11912
11913 2002-08-01  Martin Baulig  <martin@gnome.org>
11914
11915         * ecore.cs (Expression.report118): Renamed to Error118 and made
11916         it public static.
11917
11918         * statement.cs (Throw.Resolve): Check whether the expression is of
11919         the correct type (CS0118) and whether the type derives from
11920         System.Exception (CS0155).
11921         (Catch.Resolve): New method.  Do the type lookup here and check
11922         whether it derives from System.Exception (CS0155).
11923         (Catch.CatchType, Catch.IsGeneral): New public properties.
11924
11925         * typemanager.cs (TypeManager.exception_type): Added.
11926
11927 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
11928
11929         * driver.cs: Updated About function.
11930
11931 2002-07-31  Martin Baulig  <martin@gnome.org>
11932
11933         Implemented Control Flow Analysis.
11934
11935         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
11936         (EmitContext.CurrentBranching): Added.
11937         (EmitContext.StartFlowBranching): Added.
11938         (EmitContext.EndFlowBranching): Added.
11939         (EmitContext.KillFlowBranching): Added.
11940         (EmitContext.IsVariableAssigned): Added.
11941         (EmitContext.SetVariableAssigned): Added.
11942         (EmitContext.IsParameterAssigned): Added.
11943         (EmitContext.SetParameterAssigned): Added.
11944         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
11945         Added control flow analysis stuff here.
11946
11947         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
11948         resolve the expression as lvalue.
11949         (LocalVariableReference.DoResolve): Check whether the variable has
11950         already been assigned.
11951         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
11952         the parameter as assigned here.
11953         (ParameterReference.DoResolve): Check whether the parameter has already
11954         been assigned.
11955         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
11956         expression as lvalue.
11957
11958         * statement.cs (FlowBranching): New class for the flow analysis code.
11959         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
11960         (LabeledStatement.IsDefined): New public property.
11961         (LabeledStatement.AddUsageVector): New public method to tell flow
11962         analyis that the label may be reached via a forward jump.
11963         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
11964         flow analysis.
11965         (VariableInfo.Number): New public field.  This is used by flow analysis
11966         to number all locals of a block.
11967         (Block.CountVariables): New public property.  This is the number of
11968         local variables in this block (including the locals from all parent
11969         blocks).
11970         (Block.EmitMeta): Number all the variables.
11971
11972         * statement.cs: Added flow analysis support to all classes.
11973
11974 2002-07-31  Martin Baulig  <martin@gnome.org>
11975
11976         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
11977         To get debugging messages, compile mcs with /define:MCS_DEBUG and
11978         then use this argument.
11979
11980         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
11981
11982         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
11983         use this to specify /define options.
11984
11985 2002-07-29  Martin Baulig  <martin@gnome.org>
11986
11987         * statement.cs (Fixed): Moved all code that does variable lookups
11988         and resolvings from Emit to Resolve.
11989
11990         * statement.cs (For): Moved all code that does variable lookups
11991         and resolvings from Emit to Resolve.
11992
11993         * statement.cs (Using): Moved all code that does variable lookups
11994         and resolvings from Emit to Resolve.
11995
11996 2002-07-29  Martin Baulig  <martin@gnome.org>
11997
11998         * attribute.cs (Attribute.Resolve): Explicitly catch a
11999         System.NullReferenceException when creating the
12000         CustromAttributeBuilder and report a different warning message.
12001
12002 2002-07-29  Martin Baulig  <martin@gnome.org>
12003
12004         * support.cs (ParameterData.ParameterName): Added method to
12005         get the name of a parameter.
12006
12007         * typemanager.cs (TypeManager.IsValueType): New public method.
12008
12009 2002-07-29  Martin Baulig  <martin@gnome.org>
12010
12011         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12012         is a flag which specifies that it's either ref or out.
12013         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12014         the out parameter to `out Parameter.Modifier mod', also set the
12015         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12016
12017         * support.cs (InternalParameters.ParameterModifier): Distinguish
12018         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12019         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12020
12021         * expression.cs (Argument.GetParameterModifier): Distinguish
12022         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12023         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12024
12025 2002-07-29  Martin Baulig  <martin@gnome.org>
12026
12027         * expression.cs (ParameterReference.ParameterReference): Added
12028         `Location loc' argument to the constructor.
12029
12030         * cs-parser.jay: Pass location to ParameterReference.
12031
12032 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12033
12034         * statement.cs (Try): Initialize the location.
12035
12036         * cs-parser.jay: pass location to Try.
12037
12038         * expression.cs (Unary.Reduce): Change the prototype to return
12039         whether a constant fold could be performed or not.  The result is
12040         returned in an out parameters.  In the case of Indirection and
12041         AddressOf, we want to perform the full tests.
12042
12043 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12044
12045         * statement.cs (Statement.Emit): Flag dead code.
12046
12047 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12048
12049         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12050
12051 2002-07-27  Martin Baulig  <martin@gnome.org>
12052
12053         * class.cs (MethodData.Define): Put back call to
12054         TypeManager.AddMethod(), accidentally commented this out.
12055
12056         * report.cs (Debug): New public method to print debugging information,
12057         this is `[Conditional ("DEBUG")]'.
12058
12059 2002-07-26  Martin Baulig  <martin@gnome.org>
12060
12061         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12062         (switch_statement): Push the current_block to the switch_stack and
12063         pop it again when we're done with the switch.
12064         (switch_section): The new block is a child of the current_block.
12065         Fixes bug #24007, added test-152.cs.
12066
12067 2002-07-27  Martin Baulig  <martin@gnome.org>
12068
12069         * expression.cs (Invocation.EmitArguments): When calling a varargs
12070         function with only its fixed arguments, we need to pass an empty
12071         array.
12072
12073 2002-07-27  Martin Baulig  <martin@gnome.org>
12074
12075         Mono 0.13 has been released.
12076
12077 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12078
12079         * driver.cs: Rename --resource to --linkres, because that is what
12080         we do currently, we dont support --resource yet.
12081
12082         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12083
12084 2002-07-25  Martin Baulig  <martin@gnome.org>
12085
12086         * class.cs (MethodData): New public class.  This is a `method builder'
12087         class for a method or one accessor of a Property/Indexer/Event.
12088         (MethodData.GetMethodFlags): Moved here from MemberBase.
12089         (MethodData.ApplyAttributes): Likewise.
12090         (MethodData.ApplyObsoleteAttribute): Likewise.
12091         (MethodData.ApplyConditionalAttribute): Likewise.
12092         (MethodData.ApplyDllImportAttribute): Likewise.
12093         (MethodData.CheckAbstractAndExternal): Likewise.
12094         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12095         (MethodData.Emit): Formerly known as Method.Emit().
12096         (MemberBase): Moved everything which was specific to a single
12097         accessor/method to MethodData.
12098         (Method): Create a new MethodData and call Define() and Emit() on it.
12099         (Property, Indexer, Event): Create a new MethodData objects for each
12100         accessor and call Define() and Emit() on them.
12101
12102 2002-07-25  Martin Baulig  <martin@gnome.org>
12103
12104         Made MethodCore derive from MemberBase to reuse the code from there.
12105         MemberBase now also checks for attributes.
12106
12107         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12108         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12109         as virtual.
12110         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12111         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12112         (MemberBase.ApplyAttributes): New virtual method; applies the
12113         attributes to a method or accessor.
12114         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12115         (MemberBase.ApplyConditionalAttribute): Likewise.
12116         (MemberBase.ApplyDllImportAttribute): Likewise.
12117         (MemberBase.CheckAbstractAndExternal): Likewise.
12118         (MethodCore.ParameterTypes): This is now a property instead of a
12119         method, it's initialized from DoDefineParameters().
12120         (MethodCore.ParameterInfo): Removed the set accessor.
12121         (MethodCore.DoDefineParameters): New protected virtual method to
12122         initialize ParameterTypes and ParameterInfo.
12123         (Method.GetReturnType): We can now simply return the MemberType.
12124         (Method.GetMethodFlags): Override the MemberBase version and add
12125         the conditional flags.
12126         (Method.CheckBase): Moved some code from Define() here, call
12127         DoDefineParameters() here.
12128         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12129         here to avoid some larger code duplication.
12130         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12131         ensure that abstract and external accessors don't declare a body.
12132
12133         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12134         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12135         lookup in the attribute's parent classes, so we need to abort as soon
12136         as we found the first match.
12137         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12138         the attribute has no arguments.
12139
12140         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12141         of a Method.
12142
12143 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12144
12145         * cs-parser.jay: reverted previous patch.
12146
12147 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12148
12149         * cs-parser.jay: fixed bug #22119.
12150
12151 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12152
12153         * attribute.cs: fixed compilation. The error was:
12154         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12155         be assigned to before control leaves the current method."
12156         [FIXME:  Filed as bug #28186: MCS must report this error.]
12157
12158 2002-07-25  Martin Baulig  <martin@gnome.org>
12159
12160         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12161         method to pull the condition name ouf of a Conditional attribute.
12162         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12163         the obsolete message and error flag out of an Obsolete attribute.
12164
12165         * class.cs (Method.GetMethodFlags): New public method to get the
12166         TypeManager.MethodFlags for this method.
12167         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12168         private methods.
12169         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12170         if we're overriding a virtual function, set the new private variable
12171         `parent_method'; call the new TypeManager.AddMethod().
12172
12173         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12174         the MethodBuilder and the Method in a PtrHashtable.
12175         (TypeManager.builder_to_method): Added for this purpose.
12176         (TypeManager.MethodFlags): Added IsObsoleteError.
12177         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12178         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12179         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12180         the message from the attribute.
12181
12182 2002-07-24  Martin Baulig  <martin@gnome.org>
12183
12184         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12185         preprocessor directives, ensure that the argument to #define/#undef is
12186         exactly one identifier and that it's actually an identifier.
12187
12188         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12189         did not work ....
12190
12191 2002-07-24  Martin Baulig  <martin@gnome.org>
12192
12193         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12194         initialize it to TypeManager.object_type in the constructor.
12195         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12196         of the `hm.get_current' method if we're using the collection pattern.
12197         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12198         for the explicit conversion to make it work when we're using the collection
12199         pattern and the `Current' property has a different return type than `object'.
12200         Fixes #27713.
12201
12202 2002-07-24  Martin Baulig  <martin@gnome.org>
12203
12204         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12205         does not match, but don't report any errors.  This method is called in
12206         order for all methods in a MethodGroupExpr until a matching method is
12207         found, so we don't want to bail out if the first method doesn't match.
12208         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12209         matches, report the 123.  Fixes #28070.
12210
12211 2002-07-24  Martin Baulig  <martin@gnome.org>
12212
12213         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12214         TypeManager.TypeToCoreType() to the top of the method so the
12215         following equality checks will work.  Fixes #28107.
12216
12217 2002-07-24  Martin Baulig  <martin@gnome.org>
12218
12219         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12220         operand is of type uint, and the other operand is of type sbyte,
12221         short or int, the operands are converted to type long." -
12222         Actually do what this comment already told us.  Fixes bug #28106,
12223         added test-150.cs.
12224
12225 2002-07-24  Martin Baulig  <martin@gnome.org>
12226
12227         * class.cs (MethodBase): New abstract class.  This is now a base
12228         class for Property, Indexer and Event to avoid some code duplication
12229         in their Define() and DefineMethods() methods.
12230         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12231         generic methods for Define() and DefineMethods().
12232         (FieldBase): Derive from MemberBase, not MemberCore.
12233         (Property): Derive from MemberBase, not MemberCore.
12234         (Property.DefineMethod): Moved all the code from this method to the
12235         new MethodBase.DefineAccessor(), just call it with appropriate
12236         argumetnts.
12237         (Property.Define): Call the new Property.DoDefine(), this does some
12238         sanity checks and we don't need to duplicate the code everywhere.
12239         (Event): Derive from MemberBase, not MemberCore.
12240         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12241         accessors, this will also make them work with interface events.
12242         (Indexer): Derive from MemberBase, not MemberCore.
12243         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12244         (Indexer.Define): Use the new MethodBase functions.
12245
12246         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12247         argument to the constructor.
12248         (Interface.FindMembers): Added support for interface events.
12249         (Interface.PopluateEvent): Implemented.
12250
12251         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12252
12253 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12254
12255         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12256         but this is required to check for a method name being the same as
12257         the containing class.  
12258
12259         Handle this now.
12260
12261 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12262
12263         * interface.cs: initialize variable.
12264
12265 2002-07-23  Martin Baulig  <martin@gnome.org>
12266
12267         Implemented the IndexerName attribute in interfaces.
12268
12269         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12270         name if this is an explicit interface implementation.
12271         (Indexer.InterfaceIndexerName): New public variable.  If we're
12272         implementing an interface indexer, this is the IndexerName in that
12273         interface.  Otherwise, it's the IndexerName.
12274         (Indexer.DefineMethod): If we're implementing interface indexer,
12275         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12276         and Pending.ImplementIndexer methods.
12277         (Indexer.Define): Also define the PropertyBuilder if we're
12278         implementing an interface indexer and this is neither an explicit
12279         interface implementation nor do the IndexerName match the one in
12280         the interface.
12281
12282         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12283         If a method is defined here, then we always need to create a proxy
12284         for it.  This is used when implementing interface indexers.
12285         (Pending.IsInterfaceIndexer): New public method.
12286         (Pending.ImplementIndexer): New public method.
12287         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12288         This is used when implementing interface indexers to define a proxy
12289         if necessary.
12290         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12291         define a proxy if necessary.
12292
12293         * interface.cs (Interface.IndexerName): New public variable.
12294         (Interface.PopulateIndexer): Set the IndexerName.
12295         (Interface.DefineIndexers): New private method.  Populate all the
12296         indexers and make sure their IndexerNames match.
12297
12298         * typemanager.cs (IndexerPropertyName): Added support for interface
12299         indexers.
12300
12301 2002-07-22  Martin Baulig  <martin@gnome.org>
12302
12303         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12304         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12305         ret if HasReturnLabel.
12306         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12307         variables.
12308
12309         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12310         and set the ec.LoopBeginTryCatchLevel.
12311         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12312         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12313         the current ec.TryCatchLevel, the branch goes out of an exception
12314         block.  In this case, we need to use Leave and not Br.
12315
12316 2002-07-22  Martin Baulig  <martin@gnome.org>
12317
12318         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12319         block unless the block does not always return or it is contained in
12320         another try { ... } catch { ... } block.  Fixes bug #26506.
12321         Added verify-1.cs to the test suite.
12322
12323 2002-07-22  Martin Baulig  <martin@gnome.org>
12324
12325         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12326         then we do not always return.  Fixes bug #24985.
12327
12328 2002-07-22  Martin Baulig  <martin@gnome.org>
12329
12330         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12331         lookup on a per-class level; ie. walk up the class hierarchy until we
12332         found at least one applicable method, then choose the best among them.
12333         Fixes bug #24463 and test-29.cs.
12334
12335 2002-07-22  Martin Baulig  <martin@gnome.org>
12336
12337         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12338         return types of the methods.  The return type is not part of the
12339         signature and we must not check it to make the `new' modifier work.
12340         Fixes bug #27999, also added test-147.cs.
12341         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12342
12343         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12344         on the method's return type.
12345
12346 2002-07-21  Martin Baulig  <martin@gnome.org>
12347
12348         * assign.cs: Make this work if the rightmost source is a constant and
12349         we need to do an implicit type conversion.  Also adding a few more tests
12350         to test-38.cs which should have caught this.
12351
12352         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12353         target in the makefile for this.  The makefile.gnu is primarily intended
12354         for end-users who don't want to debug the compiler.
12355
12356 2002-07-21  Martin Baulig  <martin@gnome.org>
12357
12358         * assign.cs: Improved the Assign class so it can now handle embedded
12359         assignments (X = Y = Z = something).  As a side-effect this'll now also
12360         consume less local variables.  test-38.cs now passes with MCS, added
12361         a few new test cases to that test.
12362
12363 2002-07-20  Martin Baulig  <martin@gnome.org>
12364
12365         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12366         instructions.  Fixes bug #27977, also added test-146.cs.
12367
12368 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12369
12370         * cs-tokenizer.cs: fixed getHex ().
12371
12372 2002-07-19  Martin Baulig  <martin@gnome.org>
12373
12374         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12375         not Type.GetType() to lookup the array type.  This is needed when
12376         we're constructing an array of a user-defined type.
12377         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12378         single-dimensional arrays, but also for single-dimensial arrays of
12379         type decimal.
12380
12381 2002-07-19  Martin Baulig  <martin@gnome.org>
12382
12383         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12384         this function is called, it's not allowed to share LocalBuilders
12385         among ILGenerators.
12386
12387 2002-07-19  Martin Baulig  <martin@gnome.org>
12388
12389         * expression.cs (Argument.Resolve): Report an error 118 when trying
12390         to pass a type as argument.
12391
12392 2002-07-18  Martin Baulig  <martin@gnome.org>
12393
12394         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12395         Conv_R_Un for the signed `long' type.
12396
12397 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12398
12399         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12400         `expr' for the temporary result, as that will fail if we do
12401         multiple resolves on the same expression.
12402
12403 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12404
12405         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12406         ec.TypeContainer for looking up aliases. 
12407
12408         * class.cs (TypeContainer): Remove LookupAlias from here.
12409
12410         * decl.cs (DeclSpace); Move here.
12411
12412 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12413
12414         * class.cs (FindMembers): Only call filter if the constructor
12415         bulider is not null.
12416
12417         Also handle delegates in `NestedTypes' now.  Now we will perform
12418         type lookups using the standard resolution process.  This also
12419         fixes a bug.
12420
12421         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12422         This uses Expressions (the limited kind that can be parsed by the
12423         tree) instead of strings.
12424
12425         * expression.cs (ComposedCast.ToString): Implement, used to flag
12426         errors since now we have to render expressions.
12427
12428         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12429         FormArrayType. 
12430
12431         * ecore.cs (SimpleName.ToString): ditto.
12432
12433         * cs-parser.jay: Instead of using strings to assemble types, use
12434         Expressions to assemble the type (using SimpleName, ComposedCast,
12435         MemberAccess).  This should fix the type lookups in declarations,
12436         because we were using a different code path for this.
12437
12438         * statement.cs (Block.Resolve): Continue processing statements
12439         even when there is an error.
12440
12441 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12442
12443         * class.cs (Event.Define): Also remove the `remove' method from
12444         the list of pending items.
12445
12446         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12447         generate more compact code. 
12448
12449 2002-07-17  Martin Baulig  <martin@gnome.org>
12450
12451         * const.cs (Const.LookupConstantValue): Add support for constant
12452         `unchecked' and `checked' expressions.
12453         Also adding test case test-140.cs for this.
12454
12455 2002-07-17  Martin Baulig  <martin@gnome.org>
12456
12457         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12458         check whether mi.ReturnType implements the IEnumerator interface; the
12459         `==' and the IsAssignableFrom() will fail in this situation.
12460
12461 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12462
12463         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12464         here too.
12465
12466 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12467
12468         * expression.cs: fixed bug #27811.
12469
12470 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12471
12472         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12473         Molaro: when we are a ref, the value already contains a pointer
12474         value, do not take the address of it.
12475
12476 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12477         * removed mb-parser.jay and mb-tokenizer.cs
12478
12479 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12480
12481         * expression.cs: check against the building corlib void type.
12482
12483 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12484
12485         * ecore.cs: fix for valuetype static readonly fields: when 
12486         initializing them, we need their address, not the address of a copy.
12487
12488 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12489
12490         * typemanager.cs: register also enum_type in corlib.
12491
12492 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12493
12494         * class.cs: allow calling this (but not base) initializers in structs.
12495
12496 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12497
12498         * ecore.cs: make sure we compare against the building base types
12499         in GetTypeSize ().
12500
12501 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12502
12503         * typemanager.cs: fix TypeToCoreType() to handle void and object
12504         (corlib gets no more typerefs after this change).
12505
12506 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12507
12508         * expression.cs (ArrayCreation.EmitArrayArguments): use
12509         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12510
12511         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12512         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12513         array indexes, the runtime actually forbids them.
12514
12515         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12516         for array arguments here.
12517
12518         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12519         instead of the default for ValueTypes.
12520
12521         (New.DoEmit): Use IsValueType instead of
12522         IsSubclassOf (value_type)
12523         (New.DoResolve): ditto.
12524         (Invocation.EmitCall): ditto.
12525
12526         * assign.cs (Assign): ditto.
12527
12528         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12529         Statements *are* currently doing part of their resolution during
12530         Emit.  
12531
12532         Expressions do always resolve during resolve, but statements are
12533         only required to propagate resolution to their children.
12534
12535 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12536
12537         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12538
12539         (LoadAssembly): Do not add the dll if it is already specified
12540
12541         (MainDriver): Add the System directory to the link path at the end,
12542         after all the other -L arguments. 
12543
12544         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12545         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12546         ldelem.u1) and using the opposite for sbytes.
12547
12548         This fixes Digger, and we can finally run it.
12549
12550         * driver.cs (UnixParseOption): Move the option parsing here.  
12551         (CSCParseOption): Implement CSC-like parsing of options.
12552
12553         We now support both modes of operation, the old Unix way, and the
12554         new CSC-like way.  This should help those who wanted to make cross
12555         platform makefiles.
12556
12557         The only thing broken is that /r:, /reference: and /lib: are not
12558         implemented, because I want to make those have the same semantics
12559         as the CSC compiler has, and kill once and for all the confussion
12560         around this.   Will be doing this tomorrow.
12561
12562         * statement.cs (Unsafe.Resolve): The state is checked during
12563         resolve, not emit, so we have to set the flags for IsUnsfe here.
12564
12565 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12566
12567         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12568         not catch the Error_ObjectRefRequired in SimpleName (as it is
12569         possible to have a class/instance variable name that later gets
12570         deambiguated), we have to check this here.      
12571
12572 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12573
12574         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12575         make static and put into Expression.
12576
12577         (Event.Define): Register the private field of the event with the 
12578         TypeManager so that GetFieldFromEvent can get at it.
12579
12580         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12581         keep track of the private field associated with an event which
12582         has no accessors.
12583
12584         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12585         private field.
12586
12587         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12588
12589 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12590
12591         * expression.cs (Binary.EmitBranchable): this routine emits the
12592         Binary expression in a branchable context.  This basically means:
12593         we need to branch somewhere, not just get the value on the stack.
12594
12595         This works together with Statement.EmitBoolExpression.
12596
12597         * statement.cs (Statement.EmitBoolExpression): Use
12598         EmitBranchable. 
12599
12600 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12601
12602         * statement.cs (For): Reduce the number of jumps in loops.
12603
12604         (For): Implement loop inversion for the For statement.
12605
12606         (Break): We can be breaking out of a Try/Catch controlled section
12607         (foreach might have an implicit try/catch clause), so we need to
12608         use Leave instead of Br.
12609
12610         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12611         now).  If the instace expression supports IMemoryLocation, we use
12612         the AddressOf method from the IMemoryLocation to extract the
12613         address instead of emitting the instance.
12614
12615         This showed up with `This', as we were emitting the instance
12616         always (Emit) instead of the Address of This.  Particularly
12617         interesting when This is a value type, as we dont want the Emit
12618         effect (which was to load the object).
12619
12620 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12621
12622         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12623
12624         * statement.cs (Checked): Set the CheckedState during the resolve
12625         process too, as the ConvCast operations track the checked state on
12626         the resolve process, and not emit.
12627
12628         * cs-parser.jay (namespace_member_declaration): Flag that we have
12629         found a declaration when we do.  This is used to flag error 1529
12630
12631         * driver.cs: Report ok when we display the help only.
12632
12633 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12634
12635         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12636
12637 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12638
12639         * cs-tokenizer.cs (define): We also have to track locally the
12640         defines.  AllDefines is just used for the Conditional Attribute,
12641         but we also need the local defines for the current source code. 
12642
12643 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12644
12645         * statement.cs (While, For, Do): These loops can exit through a
12646         Break statement, use this information to tell whether the
12647         statement is the last piece of code.
12648
12649         (Break): Flag that we break.
12650
12651         * codegen.cs (EmitContexts): New `Breaks' state variable.
12652
12653 2002-07-03  Martin Baulig  <martin@gnome.org>
12654
12655         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12656         modifiers in method declarations in structs.  Otherwise, you won't
12657         be able to override things like Object.Equals().
12658
12659 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12660
12661         * class.cs (Method, Property, Indexer): Do not allow the public
12662         modifier to be used in explicit interface implementations.
12663
12664         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12665         override modifiers in method declarations in structs
12666
12667 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12668
12669         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12670         integer or real overflow, report an error
12671
12672 2002-07-02  Martin Baulig  <martin@gnome.org>
12673
12674         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12675         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12676         to tell the runtime about our newly created System.Object and
12677         System.ValueType types.
12678
12679 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12680
12681         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12682         struct instead of Ldarg/Starg.
12683
12684 2002-07-02  Martin Baulig  <martin@gnome.org>
12685
12686         * expression.cs (Indirection.Indirection): Call
12687         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12688
12689 2002-07-02  Martin Baulig  <martin@gnome.org>
12690
12691         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12692         ValueType, call TypeManager.TypeToCoreType() on it.
12693         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12694         the OpCodes.Newarr argument.
12695
12696 2002-07-02  Martin Baulig  <martin@gnome.org>
12697
12698         * expression.cs (Invocation.EmitCall): When compiling corlib,
12699         replace all calls to the system's System.Array type to calls to
12700         the newly created one.
12701
12702         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12703         System.Array methods.
12704         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12705         from the system's System.Array type which must be replaced.
12706
12707 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12708
12709         * typemanager.cs: load unverifiable_code_ctor so we can build
12710         corlib using the correct type. Avoid using GetTypeCode() with
12711         TypeBuilders.
12712         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12713         TypeManager.object_type to allow building corlib.
12714
12715 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12716
12717         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12718
12719 2002-07-01  Martin Baulig  <martin@gnome.org>
12720
12721         * class.cs: Make the last change actually work, we need to check
12722         whether `ifaces != null' to avoid a crash.
12723
12724 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12725
12726         * class.cs: when we build structs without fields that implement
12727         interfaces, we need to add the interfaces separately, since there is
12728         no API to both set the size and add the interfaces at type creation
12729         time.
12730
12731 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12732
12733         * expression.cs: the dimension arguments to the array constructors
12734         need to be converted if they are a long.
12735
12736 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12737
12738         * class.cs: don't emit ldarg.0 if there is no parent constructor
12739         (fixes showstopper for corlib).
12740
12741 2002-06-29  Martin Baulig  <martin@gnome.org>
12742
12743         MCS now compiles corlib on GNU/Linux :-)
12744
12745         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12746         ie. check for MethodImplOptions.InternalCall.
12747
12748         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12749         and TypeManager.attribute_type are null, so we must explicitly check
12750         whether parent is not null to find out whether it's an attribute type.
12751         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12752         and SetBuilder, not only if the property is neither abstract nor external.
12753         This is necessary to set the MethodImplOptions on the accessor methods.
12754         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12755         SetBuilder, see Property.Emit().
12756
12757         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12758         populate "System.Object", "System.ValueType" and "System.Attribute" since
12759         they've already been populated from BootCorlib_PopulateCoreTypes().
12760
12761 2002-06-29  Martin Baulig  <martin@gnome.org>
12762
12763         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12764         is the NullLiteral, we also need to make sure that target_type is not
12765         an enum type.   
12766
12767 2002-06-29  Martin Baulig  <martin@gnome.org>
12768
12769         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12770         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12771         before calling BootstrapCorlib_ResolveDelegate ().
12772
12773 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12774
12775         * statement.cs: fixed build-breaker. All tests passed ok.
12776
12777 2002-06-27  Martin Baulig  <martin@gnome.org>
12778
12779         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12780         for System.Decimal when compiling corlib.
12781
12782 2002-06-27  Martin Baulig  <martin@gnome.org>
12783
12784         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12785         switch blocks which contain nothing but a default clause.
12786
12787 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12788
12789        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12790
12791 2002-06-27  Martin Baulig  <martin@gnome.org>
12792
12793         * ecore.cs (PropertyExpr.PropertyExpr): Call
12794         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12795
12796         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12797         is already a TypeBuilder.
12798
12799 2002-06-27  Martin Baulig  <martin@gnome.org>
12800
12801         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12802         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12803         the "from an array-type to System.Array" case.  This makes it work
12804         when compiling corlib.
12805
12806 2002-06-27  Martin Baulig  <martin@gnome.org>
12807
12808         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12809         non-static PropertyExpr, set its InstanceExpression.  This makes
12810         the `ICollection.Count' property work in System/Array.cs.
12811
12812 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12813
12814         * driver.cs: Made error handling more consistent.  Errors now
12815         tracked by Report class, so many methods which used to return int
12816         now return void.  Main() now prints success/failure and 
12817         errors/warnings message.
12818
12819         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12820         the magic number return values (123 and 124).  Now, if the
12821         expected error occurs, the compiler exits with success (exit value
12822         0).  If the compilation completes without seeing that particular
12823         error, the compiler exits with failure (exit value 1).  The
12824         makefile in mcs/errors has been changed to handle the new behaviour.
12825
12826         * report.cs: Made 'expected error' number a property and renamed
12827         it from 'Probe' to 'ExpectedError'.
12828
12829         * genericparser.cs: Removed error handling support, since it is
12830         now all done by Report class.
12831
12832         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12833         class, so parse() no longer returns an int.
12834
12835         * namespace.cs: Use Report.Error instead of GenericParser.error
12836
12837 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12838
12839         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12840         TypeContainer.AddOperator): At the front of the list put the
12841         explicit implementations, so they get resolved/defined first. 
12842
12843 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
12844
12845         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12846         interface type is implemented by this TypeContainer.  Used during
12847         explicit interface implementation.
12848
12849         (Property.Define, Indexer.Define, Method.Define): Validate that
12850         the given interface in the explicit implementation is one of the
12851         base classes for the containing type.
12852
12853         Also if we are explicitly implementing an interface, but there is
12854         no match in the pending implementation table, report an error.
12855
12856         (Property.Define): Only define the property if we are
12857         not explicitly implementing a property from an interface.  Use the
12858         correct name also for those properties (the same CSC uses,
12859         although that is really not needed).
12860
12861         (Property.Emit): Do not emit attributes for explicitly implemented
12862         properties, as there is no TypeBuilder.
12863
12864         (Indexer.Emit): ditto.
12865
12866         Hiding then means that we do not really *implement* a pending
12867         implementation, which makes code fail.
12868
12869 2002-06-22  Martin Baulig  <martin@gnome.org>
12870
12871         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12872         the return value of Object.GetType().  [FIXME: we need to do this whenever
12873         we get a type back from the reflection library].
12874
12875 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12876
12877         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12878
12879 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
12880
12881         * attribute.cs: Return null if we can not look up the type.
12882
12883         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12884         the interface types found.
12885
12886         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
12887         interface types found.
12888
12889         * typemanager.cs (GetInterfaces): Make this routine returns alll
12890         the interfaces and work around the lame differences between
12891         System.Type and System.Reflection.Emit.TypeBuilder in the results
12892         result for GetInterfaces.
12893
12894         (ExpandInterfaces): Given an array of interface types, expand and
12895         eliminate repeated ocurrences of an interface.  This expands in
12896         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
12897         be IA, IB, IC.
12898
12899 2002-06-21  Martin Baulig  <martin@gnome.org>
12900
12901         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
12902         on System.Enum.
12903
12904 2002-06-21  Martin Baulig  <martin@gnome.org>
12905
12906         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
12907         and called with one of the core types, return the corresponding typebuilder for
12908         that type.
12909
12910         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
12911         element type.
12912
12913 2002-06-21  Martin Baulig  <martin@gnome.org>
12914
12915         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
12916         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
12917         (Expression.ConvertReferenceExplicit): Likewise.
12918
12919         * expression.cs (ElementAccess.DoResolve): Likewise.
12920         (ElementAccess.DoResolveLValue): Likewise.
12921
12922 2002-06-10  Martin Baulig  <martin@gnome.org>
12923
12924         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
12925         add the "value" parameter to the parameter list.
12926
12927         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
12928         to our caller.
12929
12930 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
12931
12932         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
12933         the argument to an int, uint, long or ulong, per the spec.  Also
12934         catch negative constants in array creation.
12935
12936 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
12937
12938         * class.cs: do not allow the same interface to appear twice in
12939         the definition list.
12940
12941 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
12942
12943         * ecore.cs: don't use ldlen with System.Array.
12944
12945 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
12946
12947         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
12948
12949 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
12950
12951         * modifiers.cs: produce correct field attributes for protected
12952         internal. Easy fix so miguel can work on ther harder stuff:-)
12953
12954 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
12955
12956         * pending.cs: New file.  Move the code from class.cs here.
12957         Support clearning the pending flag for all methods (when not doing
12958         explicit interface implementation).
12959
12960 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
12961
12962         * rootcontext.cs: added a couple more types needed to bootstrap.
12963
12964 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
12965
12966         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
12967         constructor in the type, instead of any constructor in the type
12968         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
12969         a bug in the Mono runtime when applying the params attribute). 
12970
12971 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
12972         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
12973
12974 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
12975
12976         * expression.cs (Unary.ResolveOperator): Use TypeManager
12977         to resolve the type.
12978
12979 2002-06-13  Ravi Pratap  <ravi@ximian.com>
12980
12981         * cs-parser.jay (enum_member_declaration): Pass in the attributes
12982         attached.
12983
12984         * enum.cs (AddEnumMember): Add support to store the attributes associated 
12985         with each member too.
12986
12987         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
12988         field builders too - this takes care of the enum member case.
12989
12990 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
12991
12992         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
12993         address-of operator on both value types and pointers.
12994
12995 2002-06-10  Martin Baulig  <martin@gnome.org>
12996
12997         * interface.cs (Interface.PopulateIndexer): Add the indexer's
12998         PropertyBuilder to the `property_builders' list.
12999
13000         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13001         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13002         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13003         find any indexers which are inherited from an interface.
13004
13005 2002-06-09  Martin Baulig  <martin@gnome.org>
13006
13007         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13008         the same type as the constant if necessary.  There's also a test-130.cs
13009         for this.
13010
13011         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13012
13013         * typemanager.cs (TypeManager.ChangeType): Previously known as
13014         Enum.ChangeEnumType().
13015
13016 2002-06-09  Martin Baulig  <martin@gnome.org>
13017
13018         * expression.cs (Cast.TryReduce): Added support for consts.
13019
13020 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13021
13022         * class.cs (Accessor): Hold attributes information so we can pass
13023         it along.
13024
13025         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13026         Modify to pass in attributes attached to the methods.
13027
13028         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13029
13030         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13031         to handle the Accessor kind :-)
13032
13033         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13034
13035 2002-06-08  Martin Baulig  <martin@gnome.org>
13036
13037         * expression.cs (Unary.TryReduceNegative): Added support for
13038         ULongConstants.
13039
13040 2002-06-08  Martin Baulig  <martin@gnome.org>
13041
13042         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13043         name can't be found in the `defined_names' - the caller will do a
13044         MemberLookup in this case and thus find methods in System.Enum
13045         such as Enum.IsDefined().
13046
13047 2002-06-08  Martin Baulig  <martin@gnome.org>
13048
13049         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13050         Convert.ChangeType() which works with TypeBuilder created types.
13051         (Enum.LookupEnumValue, Enum.Define): Use it here.
13052
13053         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13054         `TypeBuilder.BaseType != null' check.
13055         (TypeContainer.FindMembers): Only lookup parent members if we
13056         actually have a parent.
13057         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13058         (ConstructorInitializer.Resolve): Likewise.
13059
13060         * interface.cs (Interface.FindMembers): Added
13061         `TypeBuilder.BaseType != null' check.
13062
13063         * rootcontext.cs (RootContext.ResolveCore): Added
13064         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13065         classes_second_stage.
13066
13067         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13068         debug_type and trace_type when compiling with --nostdlib.       
13069
13070 2002-06-07  Martin Baulig  <martin@gnome.org>
13071
13072         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13073         (AddField): Set it to true when adding a non-static field.
13074         (DefineType): Use `have_nonstatic_fields' to find out whether we
13075         have non-static fields, not `Fields != null'.
13076
13077 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13078
13079         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13080         dereferencing a null on the static-field code path)
13081
13082 2002-05-30  Martin Baulig  <martin@gnome.org>
13083
13084         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13085         to take command line arguments.  Use reflection to call the new
13086         custom `Initialize' function on the symbol writer and pass it the
13087         command line arguments.
13088
13089         * driver.cs (--debug-args): New command line argument to pass command
13090         line arguments to the symbol writer.
13091
13092 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13093
13094         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13095         the target type for indexers and properties.  Thanks to Joe for
13096         catching this.
13097
13098 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13099
13100         * typemanager.cs (MethodFlags): returns the method flags
13101         (Obsolete/ShouldIgnore) that control warning emission and whether
13102         the invocation should be made, or ignored. 
13103
13104         * expression.cs (Invocation.Emit): Remove previous hack, we should
13105         not do this on matching a base type, we should do this based on an attribute
13106
13107         Only emit calls to System.Diagnostics.Debug and
13108         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13109         on the command line.
13110
13111         * rootcontext.cs: Global settings for tracing and debugging.
13112
13113         * cs-tokenizer.cs (define): New utility function to track
13114         defines.   Set the global settings for TRACE and DEBUG if found.
13115
13116 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13117
13118         * interface.cs (Populate*): Pass in the TypeContainer as well as
13119         the DeclSpace as parameters so that we can create EmitContexts and
13120         then use that to apply attributes etc.
13121
13122         (PopulateMethod, PopulateEvent, PopulateProperty)
13123         (PopulateIndexer): Apply attributes everywhere.
13124
13125         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13126         etc.
13127
13128         (ApplyAttributes): Update accordingly.
13129
13130         We now apply interface attributes for all members too.
13131
13132 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13133
13134         * class.cs (Indexer.Define); Correctly check if we are explicit
13135         implementation (instead of checking the Name for a ".", we
13136         directly look up if the InterfaceType was specified).
13137
13138         Delay the creation of the PropertyBuilder.
13139
13140         Only create the PropertyBuilder if we are not an explicit
13141         interface implementation.   This means that explicit interface
13142         implementation members do not participate in regular function
13143         lookups, and hence fixes another major ambiguity problem in
13144         overload resolution (that was the visible effect).
13145
13146         (DefineMethod): Return whether we are doing an interface
13147         implementation. 
13148
13149         * typemanager.cs: Temporary hack until we get attributes in
13150         interfaces (Ravi is working on that) and we get IndexerName
13151         support in interfaces.
13152
13153         * interface.cs: Register the indexers as properties.
13154
13155         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13156         warning, I have verified that this is a bug in the .NET runtime
13157         (JavaScript suffers of the same problem).
13158
13159         * typemanager.cs (MemberLookup): When looking up members for
13160         interfaces, the parent of an interface is the implicit
13161         System.Object (so we succeed in searches of Object methods in an
13162         interface method invocation.  Example:  IEnumerable x;  x.ToString
13163         ()) 
13164
13165 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13166
13167         * class.cs (Event): Events should also register if they do
13168         implement the methods that an interface requires.
13169
13170         * typemanager.cs (MemberLookup); use the new GetInterfaces
13171         method. 
13172
13173         (GetInterfaces): The code used to lookup interfaces for a type is
13174         used in more than one place, factor it here. 
13175
13176         * driver.cs: Track the errors at the bottom of the file, we kept
13177         on going.
13178
13179         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13180         instance if the method we are calling is static!
13181
13182 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13183
13184         * attribute.cs (ApplyAttributes): Make this function filter out
13185         the IndexerName attribute (as that attribute in reality is never
13186         applied) and return the string constant for the IndexerName
13187         attribute. 
13188
13189         * class.cs (TypeContainer.Emit): Validate that all the indexers
13190         have the same IndexerName attribute, and if so, set the
13191         DefaultName attribute on the class. 
13192
13193         * typemanager.cs: The return value might contain other stuff (not
13194         only methods).  For instance, consider a method with an "Item"
13195         property and an Item method.
13196
13197         * class.cs: If there is a problem with the parameter types,
13198         return. 
13199
13200 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13201
13202         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13203         looks at user defined conversion after making a call to 
13204         StandardConversionExists - we need this for overload resolution.
13205
13206         * expression.cs : Update accordingly the various method calls.
13207
13208         This fixes 2 bugs filed against implicit user defined conversions 
13209
13210 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13211
13212         * statement.cs: Track the result of the assignment.
13213
13214 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13215
13216         * expression.cs (MemberAccess): Improved error reporting for
13217         inaccessible members.
13218
13219 2002-05-22  Martin Baulig  <martin@gnome.org>
13220
13221         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13222         itself with debugging support.
13223
13224 2002-05-22  Martin Baulig  <martin@gnome.org>
13225
13226         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13227         Removed, this isn't needed anymore.
13228
13229 2002-05-20  Martin Baulig  <martin@gnome.org>
13230
13231         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13232         be underlying type for an enum.
13233
13234 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13235
13236         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13237         that splits out the loading of just the core types.
13238
13239         * rootcontext.cs (ResolveCore): Split the struct resolution in
13240         two, so we can load the enumeration underlying types before any
13241         enums are used.
13242
13243         * expression.cs (Is): Bandaid until we fix properly Switch (see
13244         bug #24985 for details).
13245
13246         * typemanager.cs (ImplementsInterface): The hashtable will contain
13247         a null if there are no interfaces implemented.
13248
13249 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13250
13251         * cs-parser.jay (indexer_declarator): It is fine to have array
13252         parameters
13253
13254 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13255
13256         * typemanager.cs: (RegisterBuilder): New function used to register
13257         TypeBuilders that implement interfaces.  Since
13258         TypeBuilder.GetInterfaces (as usual) does not work with lame
13259         Reflection.Emit. 
13260         (AddUserType): register interfaces.
13261
13262         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13263         dealing with TypeBuilder.  Also, arrays are showing up as
13264         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13265         methods can not be invoked on them!
13266
13267         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13268         (ImplicitReferenceConversionExists): Split out from
13269         StandardConversionExists. 
13270
13271         * expression.cs (As): We were only implementing one of the three
13272         cases for the as operator.  We now implement them all.
13273         (Is): Implement the various other cases for Is as well.
13274
13275         * typemanager.cs (CACHE): New define used to control if we want or
13276         not the FindMembers cache.  Seems to have a negative impact on
13277         performance currently
13278
13279         (MemberLookup): Nested types have full acess to
13280         enclosing type members
13281
13282         Remove code that coped with instance/static returns for events, we
13283         now catch this in RealFindMembers.
13284
13285         (RealFindMembers): only perform static lookup if the instance
13286         lookup did not return a type or an event.  
13287
13288 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13289
13290         * assign.cs (CompoundAssign): We pass more semantic information
13291         now to Compound Assignments than we did before: now we have all
13292         the information at hand, and now we resolve the target *before* we
13293         do the expression expansion, which allows the "CacheValue" method
13294         to have the effect we intended (before, a [x] += 1 would generate
13295         two differen ArrayAccess expressions from the ElementAccess,
13296         during the resolution process).
13297
13298         (CompoundAssign.DoResolve): Resolve target and original_source here.
13299
13300 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13301
13302         * expression.cs (ArrayAccess): dropped debugging information. 
13303
13304         * typemanager.cs: Small bug fix: I was always returning i_members,
13305         instead of one of i_members or s_members (depending on which had
13306         the content).
13307
13308         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13309         method is invoked before any code generation takes place, and it
13310         is a mechanism to inform that the expression will be invoked more
13311         than once, and that the method should use temporary values to
13312         avoid having side effects
13313
13314         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13315
13316         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13317         implementation.
13318
13319         * expression.cs (Indirection, ArrayAccess): Add support for
13320         CacheTemporaries in these two bad boys. 
13321
13322         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13323         ldobj or ldind_ref.  
13324         (StoreFromPtr): Handle stobj as well.
13325
13326         * expression.cs (UnaryMutator): Share more code.
13327
13328         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13329         down: I was not tracking the Filter function as well, which
13330         was affecting the results of the cache.
13331
13332 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13333
13334         * attribute.cs: Remove the hack to handle the CharSet property on
13335         StructLayouts. 
13336
13337 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13338
13339         * attribute.cs (DoResolve): More uglyness, we now only try to
13340         resolve the attribute partially, to extract the CharSet
13341         information (only if we are a StructLayout attribute).  Otherwise 
13342
13343         (GetExtraTypeInfo): Add some code to conditionally kill in the
13344         future this.   I am more and more convinced that the .NET
13345         framework has special code to handle the attribute setting on
13346         certain elements.
13347
13348         * expression.cs (IsParamsMethodApplicable): Revert my previous
13349         foreach change here, it was wrong.
13350
13351 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13352
13353         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13354         (pp_expr): do not abort on unknown input, just return.
13355         (eval): abort if there are pending chars.
13356
13357         * attribute.cs (Attribute.Resolve): Positional parameters are
13358         optional.  Deal with that case.
13359
13360         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13361         the Ansi/Unicode/Auto information for the type.
13362
13363         (TypeContainer.DefineType): instantiate the EmitContext here, as
13364         we will be using it during the type definition (to resolve
13365         attributes) and during the emit phase.
13366
13367         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13368         to pull type information out of the attributes
13369
13370         (Attribute.Resolve): track the constructor builder, and allow for
13371         multiple invocations (structs and classes will use this).
13372
13373         * ecore.cs (MemberLookupFinal): new version with all the
13374         parameters customizable.
13375
13376         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13377         constructors.  Return if the result value is null (as the error
13378         would have been flagged already by MemberLookupFinal)
13379
13380         Do not allow instances of abstract classes or interfaces to be
13381         created.
13382
13383         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13384         We have to compare the assembly property here when dealing with
13385         FamANDAssem and Assembly access modifiers, because we might be
13386         creating an assembly from *modules* (that means that we are not
13387         getting TypeBuilders for types defined in other modules that are
13388         part of this assembly).
13389
13390         (Method.Emit): If the method is marked abstract and has a body,
13391         emit an error. 
13392
13393         (TypeContainer.DefineMembers): If both the defined member and the
13394         parent name match are methods, then do not emit any warnings: let
13395         the Method.Define routine take care of flagging warnings.  But if
13396         there is a mismatch (method overrides something else, or method is
13397         overriwritten by something, then emit warning).
13398
13399         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13400         set to null, this means `do not check for the return type on the
13401         signature'. 
13402
13403         (Method.Define): set the return type for the method signature to
13404         null, so that we get methods with the same name and parameters and
13405         different return types.  This is used to flag warning 114 (you are
13406         hiding a method, and you probably want to use the new/override
13407         keywords instead).
13408
13409         * typemanager.cs (MemberLookup): Implemented proper access
13410         control, closing a long standing set of bug reports.  The problem
13411         was that the Framework only has two bits: Public and NonPublic,
13412         and NonPublic includes private and protected methods, but we need
13413         to enforce the FamANDAssem, FamOrAssem and Family. 
13414
13415 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13416
13417         * statement.cs (GotoCase): Return true: Ammounts to giving up
13418         knowledge on whether we return or not, and letting the other case
13419         be responsible for it.
13420
13421 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13422
13423         * driver.cs: Do not load directories for each file processed, only
13424         do it if there is a pattern.
13425
13426         * ecore.cs: Report readonly assigns here as well, as we might have
13427         been resolved only by MemberAccess.
13428
13429         (SimpleName.SimpleNameResolve): Also be useful for LValue
13430         resolution.   We need this to propagate assign to local readonly variables
13431
13432         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13433         do not want to reuse potential criteria memory.
13434
13435         * class.cs (MyEventBuilder): Set reflected_type;
13436
13437         * ecore.cs (Constantify): Added support for constifying bools.
13438
13439         (RootContext.LookupType): Added a cache for values looked up in
13440         the declaration space.
13441
13442         * typemanager.cs (FindMembers): Now is a front-end to
13443         RealFindMembers, and provides a two-level hashtable-based cache to
13444         the request.  
13445
13446         15% performance improvement: from 22.5 to 19.2 seconds.
13447
13448         * expression.cs (IsParamsMethodApplicable): use foreach.
13449         (Invocation.DoResolve): ditto.
13450         (New.DoResolve): ditto.
13451         (ArrayCreation.DoResolve): ditto.
13452
13453         * ecore.cs (FindMostEncompassingType): use foreach.
13454
13455         * delegate.cs (NewDelegate.DoResolve): Use foreach
13456
13457         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13458         (RemoveMethods): use foreach.
13459
13460         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13461         nested foreach statements instead of for, and also break out of
13462         the inner loop once a match is found.
13463
13464         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13465
13466 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13467
13468         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13469         we actually unwrap the expression to allow for extra information
13470         to be extracted. 
13471
13472         * expression.cs: Use Shr_Un on unsigned operations. 
13473
13474 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13475
13476         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13477         applicable operators was not being considered correctly. This closes
13478         the bug Miguel reported.
13479
13480 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13481
13482         * attribute.cs: check that the type derives from System.Attribute
13483         and report the correct error in that case (moved the duplicate code to
13484         its own method, too).
13485
13486 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13487
13488         * attribute.cs: lookup attribute type name as the spec says: first the
13489         bare attribute name and then name + "Attribute" (nant compiles with
13490         mcs after this fix).
13491
13492 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13493
13494         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13495         Because of the way we parse things, we should try to see if a
13496         UIntConstant can fit in an integer.
13497
13498 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13499
13500         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13501         when we are in an explicit context.
13502
13503         (ConvertReferenceExplicit): When converting from Iface type S to Class
13504         T make sure the rules are implemented as an OR.
13505
13506         * parameter.cs (ParameterType): Make it a property for now although the
13507         purpose really isn't anything immediate.
13508
13509         * expression.cs (Is*Applicable): Do better checking on the parameter type
13510         of a ref/out parameter. The ones from the system assemblies are already 
13511         marked with the correct type so we don't need to do any correction.
13512
13513         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13514         the object type is standard too so include that.
13515
13516 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13517
13518         * ecore.cs (StandardConversionExists): Augment with missing code:
13519         deal with IntConstant, LongConstants and Enumerations.
13520
13521         * assign.cs: Report the error, instead of failing silently
13522
13523         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13524         typecontainer that they are declared, because the
13525         typecontainer/namespace will have the list of using clauses that
13526         need to be applied.
13527
13528         Assembly Attributes were escaping the normal registration
13529         mechanism. 
13530
13531         (EmitCode): Apply attributes within an EmitContext that represents
13532         the container they were declared on.
13533
13534         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13535
13536 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13537
13538         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13539         Revamp completely - make much cleaner as we now operate only
13540         on a set of Types.
13541
13542         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13543         to implement the logic detailed in the spec more correctly.
13544
13545         (UserDefinedConversion): Update accordingly.
13546
13547 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13548
13549         * statement.cs: Return flow analysis information up.
13550
13551         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13552         and the default.
13553
13554         (token): Do not consume an extra character before calling
13555         decimal_digits.
13556
13557 2002-05-06  Piers Haken <piersh@friskit.com>
13558
13559         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13560
13561 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13562
13563         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13564         EmitContext during the instance constructor initializer
13565         resolution, to stop access to instance variables.
13566
13567         This is mandated by the spec, last paragraph of the `constructor
13568         initializers' section. 
13569
13570 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13571
13572         * cs-parser.jay, class.cs (Accessor): new class used to represent
13573         an accessor (get or set).  In the past we used `null' to represent
13574         a missing accessor.  But this is ambiguous because there was no
13575         way to tell in abstract indexers/properties if one of them was
13576         specified.
13577
13578         Now there is a way of addressing that.
13579
13580         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13581         instead of FindMembers.
13582
13583         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13584         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13585
13586         * attribute.cs: Treat indexers and properties as the same in terms
13587         of applying attributes
13588
13589         * ecore.cs (FindMostEncompassedType): Use statically initialized
13590         EmptyExpressions()s like we do elsewhere to avoid creating useless
13591         objects (and we take this out of the tight loop).
13592
13593         (GetConversionOperators): Move the code to extract the actual
13594         operators to a separate routine to clean things up.
13595
13596 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13597
13598         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13599         events are always registered FieldBuilders.
13600
13601         * class.cs (FieldBase): New class shared by Fields 
13602
13603         * delegate.cs: If we are a toplevel delegate, use our full name.
13604         If we are a nested delegate, then only use our tail name.
13605
13606 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13607
13608         * expression.cs (IsApplicable): Ensure that we add the "&" to
13609         ref/out types before comparing it with the type of the argument.
13610
13611         (IsParamsMethodApplicable): Ditto.
13612
13613         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13614         silly me ;-)
13615
13616         * delegate.cs : Handle the case when we have more than one applicable
13617         method. Flag an error only when we finish checking all.
13618
13619 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13620
13621         * expression.cs: Add support for boolean static initializers.
13622
13623 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13624
13625         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13626
13627         * parameter.cs (ComputeParameterTypes,
13628         ComputeAndDefineParameterTypes): Better error handling: now we
13629         clear the `types' cache if we fail during any of the type lookups.
13630         We also return the status code correctly to our caller
13631
13632         * delegate.cs: If we fail to define a delegate, abort the extra
13633         steps. 
13634
13635         * expression.cs (Binary.ResolveOperator): for
13636         operator==(object,object) and operator !=(object, object) we also
13637         have to verify that there is an implicit conversion from one to
13638         the other.
13639
13640         (ArrayAccess.DoResolve): Array Access can operate on
13641         non-variables. 
13642
13643 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13644
13645         * assign.cs (CompoundAssign): A new class used as a "flag" that
13646         the assignment actually is happening as part of a compound
13647         assignment operator.
13648
13649         During compound assignment, a few new rules exist to enable things
13650         like:
13651
13652         byte b |= 1 + 2
13653
13654         From the spec:
13655
13656         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13657         to the type of x) if y is implicitly convertible to the type of x,
13658         and the operator is a builtin operator and the return type of the
13659         operator is explicitly convertible to the type of x. 
13660
13661         * rootcontext.cs: Reset warning level to 2.  4 catches various
13662         "interesting" features in mcs, we must clean this up at some
13663         point, but currently am trying to kill other bugs ;-)
13664
13665         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13666         in container classes as well.  
13667
13668         * expression.cs (Binary.ResolveOperator): Handle string case
13669         before anything else (as operator overloading does emit an error
13670         before doing anything else).
13671
13672         This code could go away when we move to a table driven model, but
13673         i could not come up with a good plan last night.
13674
13675 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13676
13677         * typemanager.cs (CSharpName): reimplementation using regex.
13678         * class.cs: added null check for fields in Emit
13679         * rootcontext.cs: set warninglevel to 4
13680
13681 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13682
13683         * typemanager.cs (CSharpName): reimplemented with Lupus
13684         suggestion.
13685
13686 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13687
13688         * statement.cs (If): correclty implement Resolve, because we were
13689         not catching sem errors in there.  The same process is needed
13690         everywhere else. 
13691         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13692
13693
13694         (Statement.Warning_DeadCodeFound): Factorize code.
13695         (While): Report dead code here too.
13696
13697         (Statement): Added Resolve virtual method to allow
13698         for resolution split from the emit code.
13699
13700 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13701
13702         * statement.cs (EmitBoolExpression): No longer try to resolve the
13703         expression here.    
13704         (MakeBoolean): New utility function that resolve, implicitly
13705         converts to boolean and tags the expression. 
13706
13707
13708         (If, Do): Implement dead code elimination.
13709         (While): Implement loop inversion
13710
13711         (Do, While, For, If): Resolve the expression prior to calling our
13712         code generation.
13713
13714 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13715
13716         * class.cs:
13717           - added method Report28 (warning: program has more than one entry point)
13718           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13719           - modified method Method.Define, the part at the end of the method
13720
13721         * rootcontext.cs: added static public Location EntryPointLocation;
13722           
13723         * ../errors/cs0028.cs : Add test case for the above warning.              
13724
13725         * typemanager.cs:
13726           - modified method CSharpName to allow arrays of primitive type to
13727             be printed nicely (e.g. instead of System.Int32[][] it now prints
13728             int[][])
13729           - added method CSharpSignature: returns the signature of a method
13730             in string format to be used in reporting errors, warnings, etc.
13731
13732         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13733         with String.Empty.
13734
13735 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13736
13737         * delegate.cs (Define): Fix extremely silly bug where I was
13738         setting the type of the 'object' parameter of the BeginInvoke
13739         method to System.IAsyncResult instead of System.Object ;-)
13740
13741 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13742
13743         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13744         here. 
13745
13746         (Constructor.Emit): return if we fail to initialize the
13747         constructor.  Another door closed!  
13748
13749         * expression.cs (New.DoResolve): Improve error message (from -6 to
13750         1501).  Use DeclaredOnly lookup to find the exact constructor.
13751
13752         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13753         loop.  This is useful.
13754
13755         * cs-parser.jay: Adjust the default parameters so that destructors
13756         have the proper signature.
13757
13758 2002-04-26  Martin Baulig  <martin@gnome.org>
13759
13760         * driver.cs (LoadAssembly): If `assembly' contains any characters
13761         which are only valid in path names and not in assembly names
13762         (currently slash, backslash and point), use Assembly.LoadFrom ()
13763         instead of Assembly.Load () on the `assembly' (before iteration
13764         over the link_paths).
13765
13766 2002-04-26  Martin Baulig  <martin@gnome.org>
13767
13768         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13769
13770 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13771
13772         * class.cs (Property): use the new typemanager.MemberLookup
13773
13774         (TypeContainer.MemberLookup): Implement using the
13775         TypeManager.MemberLookup now. 
13776
13777         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13778         and return MemberInfos, so that these can be used without an
13779         EmitContext (what we had before).
13780
13781 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13782
13783         * expression.cs: Fix the case where the argument to params if the
13784         type of the params.  I omitted handling this before.   Fixed
13785
13786 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13787
13788         * driver.cs: Call BootCorlib_PopulateCoreType
13789
13790         * class.cs (Property.CheckBase): Check for properties only, not
13791         for all members. 
13792
13793         * interface.cs: Temporary hack: try/catch around the
13794         CustomAttributeBuilder, because I am getting an exception that I
13795         do not understand.
13796
13797         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13798         types whose definitions are required to be there (attributes are
13799         defined before standard types).
13800
13801         Compute definitions as we boot the various types, as they are used
13802         immediately (value_type class will need object_type, but if we do
13803         not initialize object_type, we will pass a null, which will let
13804         the runtime pick the System.Object from the existing corlib, which
13805         is not what we want).
13806
13807 2002-04-22  Patrik Torstensson <totte@labs2.com>
13808
13809         * cs-tokenizer.cs: fixed a number of trim() issues.
13810
13811 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13812
13813         * expression.cs (Argument.Type): Ensure that we return the correct
13814         type when we have out or ref parameters [in which case we 
13815         append a "&"].
13816
13817 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13818
13819         * class.cs (Property, Indexer): Allow extern modifier in there. 
13820
13821         * typemanager.cs (InitBaseTypes): Initializes object_type and
13822         value_type, since those will be used early on during the bootstrap
13823         process to compile corlib.
13824
13825         (InitCoreTypes): Move code from here to InitBaseTypes.
13826
13827 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13828
13829         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13830         single-dimension arrays as using the ldlen opcode.  
13831
13832         Daniel Lewis discovered this optimization.  
13833
13834         * typemanager.cs: Add signature for System.Array::get_Length
13835
13836 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13837
13838         * statement.cs: report the error when the foreach does not apply to an
13839         array nor a collection.
13840
13841 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
13842
13843         * expression.cs: Add implicit conversions to the operator ~.
13844
13845         * constant.cs (DecimalConstant.Emit): Emit decimal value.
13846
13847         * typemanager.cs: Locate the decimal constructor.
13848
13849 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13850
13851         * attribute.cs: use the new property of TypeOf.
13852         * expression.cs: added 'get' property around typearg.
13853
13854         These changes fix a build breaker reported by NickD. Is this the
13855         correct way to fix?  If not, please, revert my changes and make it
13856         work :-).
13857
13858 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13859
13860         * attribute.cs: Add support for typeof in attribute invocations.
13861         I am not sure that this is right though.
13862
13863 2002-04-14  Duncan Mak  <duncan@ximian.com>
13864
13865         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13866         Binary.Operator.Division case.
13867
13868 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13869
13870         * class.cs (DefineType): Ensure that we do a proper check on
13871         attribute types and also register it with the TypeManager.
13872
13873         (TypeContainer.Targets): The default for attribute types is
13874         AttributeTargets.All.
13875
13876         * attribute.cs (ApplyAttributes): Registering the attribute type
13877         is done elsewhere, not when we discover we have a Usage attribute.
13878
13879 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13880
13881         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13882         and get rid of is_delegate parameter.
13883
13884         * everywhere : update.
13885
13886 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13887
13888         * cs-parser.jay (compilation_unit): Revamp completely to use
13889         some new ideas that I got from Rhys' grammar to solve the problems
13890         with assembly level attributes.
13891
13892         (outer_declaration): New grammar production.
13893
13894         (attribute_sections): Add.
13895
13896         (opt_attributes): Base on attribute_sections
13897
13898         (namespace_declaration): Allow opt_attributes to tackle the case
13899         when we have assembly level attributes - we are clever in this
13900         regard now ;-)
13901
13902         * attribute.cs (ApplyAttributes): Do not worry about assembly 
13903         attributes in the non-global context.
13904
13905         * rootcontext.cs (AddGlobalAttributes): Go back to using this
13906         instead of SetGlobalAttributes.
13907
13908         * class.cs, rootcontext.cs : Ensure we define and generate 
13909         attribute types before anything else.
13910
13911         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
13912         and flag the new error -20 for the case when the attribute type
13913         does not have valid targets specified. csc does not catch this.
13914
13915         * ../errors/errors.txt : update for error # -20
13916
13917 2002-04-11  Ravi Pratap  <ravi@ximian.com>
13918
13919         * support.cs (InternalParameters.ParameterModifier): Do some null
13920         checking and return sane values.
13921
13922         * class.cs (Method.Define): If we are a PInvoke method, ensure
13923         that we are static and extern. Report error # 601
13924
13925         * ../errors/cs0601.cs : Add test case for the above error.
13926
13927 2002-04-07  Ravi Pratap  <ravi@ximian.com>
13928
13929         * rootcontext.cs (attribute_types): We need to keep type of
13930         all attribute types separately and emit code for them first.
13931
13932         (RegisterAttribute) : Implement.
13933
13934         * class.cs (DefineType): Check if the current Type is a custom
13935         attribute type and register it accordingly.
13936
13937         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
13938         adding the first attribute twice and rename to
13939
13940         (SetGlobalAttributes): this.
13941
13942         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
13943         lookups.
13944
13945         * attribute.cs (ApplyAttributes): Take an additional argument telling us
13946         if we are processing global arguments. Hmm, I am unsure of this.
13947
13948 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13949
13950         * expression.cs: added static array of strings to avoid calling
13951         Enum.ToString () for Operator in Binary. Significant recover of
13952         performance.
13953
13954 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
13955
13956         * class.cs (FindMembers): Allow the Builders of the various
13957         members to be null.  If they are skip them.  This only happens
13958         during the PInvoke declaration.
13959
13960 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
13961
13962         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
13963         failure, so we do not keep going afterwards.
13964
13965         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
13966         wanted to pass `false' as the `is_delegate' argument.  If this is
13967         the case, why not use delegate_type == null to mean `is_delegate =
13968         false' and anything else as is_delegate = true.
13969
13970 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
13971
13972         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
13973         code for the section, not the beginning of the tests.
13974
13975 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
13976
13977         * cfold.cs: Handle operator + (Enum x, Underlying x) 
13978
13979         * expression.cs (Binary): same.  Warn about errors where we have
13980         Enum/Enum in operator + as well.
13981
13982 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
13983
13984         * statement.cs:
13985                 - added support for switch(bool)
13986                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
13987                 - add TableSwitchEmit() to handle table-based switch statements
13988
13989 2002-04-05  Ravi Pratap  <ravi@ximian.com>
13990
13991         * expression.cs (Invocation.OverloadResolve): Factor out code which
13992         does parameter compatibility checking with arguments so that we can 
13993         re-use the code even from Delegate.VerifyApplicability
13994
13995         (VerifyArgumentsCompat): Move above code here.
13996
13997         * delegate.cs (VerifyApplicability): Get rid of duplicate code
13998         and instead make a call to the above method.
13999
14000 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14001
14002         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14003         We use it to keep track of classes which are attribute types.
14004
14005 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14006
14007         * delegate.cs (Delegate.Define): Correctly define the types in the
14008         presence of fixed and array parameters.
14009
14010         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14011         doing FindMembers.
14012
14013         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14014         include NonPublic after the first iteration.
14015
14016         * class.cs (Indexer.CheckBase): Only check if both parents are
14017         non-null. 
14018
14019         * cs-parser.jay (accessor_body): If empty, set to null.
14020
14021         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14022         same code path here to resolve constants names that we did have in
14023         MemberAccess.DoResolve.  There is too much code duplicated here.
14024
14025 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14026
14027         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14028
14029         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14030         to MakeUnionSet.
14031
14032         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14033         tokens, numbers and strings.
14034
14035         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14036         parenthesis.
14037
14038         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14039         asyncronous parameters and the regular parameters.  
14040
14041         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14042         specify the target directory.
14043
14044         * expression.cs: (This.DoResolve): Simplify
14045         (As.Emit): Optimize, do not generate IsInst if the expression is
14046         always of the given type.
14047
14048         (Is.DoResolve): Bug fix, we were reporting both always/never for
14049         the is expression.
14050
14051         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14052         creating too many unnecessary arrays.
14053
14054 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14055
14056         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14057         fields instead of rolling our own initializer.   Takes care of all
14058         implicit conversions, and drops unnecessary static checks/argument.
14059
14060 2002-03-31  Dick Porter  <dick@ximian.com>
14061
14062         * driver.cs: use the GetDirectories() return values properly, and
14063         use "/" as path separator.
14064
14065 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14066
14067         * expression.cs (Unary): Optimize - - expr into expr.
14068         (Binary): Optimize a + (-b) into a -b.
14069
14070         * codegen.cs (CodeGen): Made all methods static.
14071
14072 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14073
14074         * rootcontext.cs: 
14075
14076         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14077         TypeBuilder property.
14078
14079         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14080         instead. 
14081
14082         * tree.cs: Removed the various RecordXXXX, and replaced with a
14083         single RecordDecl.  Removed all the accessor methods, and just
14084         left a single access point Type 
14085
14086         * enum.cs: Rename DefineEnum to DefineType.
14087
14088         * decl.cs: New abstract method `DefineType' used to unify the
14089         Defines for Enumerations, Interfaces, TypeContainers and
14090         Delegates.
14091
14092         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14093         LookupBaseClasses method that used to live in class.cs and
14094         interface.cs here, and renamed to FindType.
14095
14096         * delegate.cs: Implement DefineType.  Take advantage of the
14097         refactored pattern for locating the parent builder without taking
14098         the parent_builder argument (which we know does not work if we are
14099         nested, and triggering a toplevel definition).
14100
14101 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14102
14103         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14104         accessibility of a member has changed during override and report
14105         an error if so.
14106
14107         * class.cs (Method.Define, Property.Define): Only complain on
14108         overrides if the method is private, any other accessibility is
14109         fine (and since we just checked the permission is the same, we are
14110         good to go).
14111
14112         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14113         and elif are processed always.  The other pre-processing
14114         directives are only processed if we are "taking" the path
14115
14116 2002-03-29  Martin Baulig  <martin@gnome.org>
14117
14118         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14119         current location is not Null.
14120
14121         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14122         a separate method so we can profile it.
14123
14124         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14125         `span.Seconds' are just seconds, but no minutes or hours.
14126         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14127
14128 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14129
14130         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14131         Remove the gratuitous set of Final:
14132
14133                                 // If an interface implementation, then we can set Final.
14134                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14135                                     implementing.DeclaringType.IsInterface)
14136                                         flags |= MethodAttributes.Final;
14137
14138         I do not know what I was smoking when I used that.
14139
14140
14141         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14142         step into fixing the name resolution issues for delegates and
14143         unifying the toplevel name resolution.
14144
14145 2002-03-28  Martin Baulig  <martin@gnome.org>
14146
14147         * class.cs (Method.Emit): If we have a symbol writer, call its
14148         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14149         tell it about the current method.
14150
14151         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14152         writer that we're going to emit the first byte of IL code for a new
14153         statement (a new source line).
14154         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14155         EmitContext.Mark() before emitting any code.
14156
14157         * location.cs (SymbolDocument): Return null when we're Null.
14158
14159         * statement.cs (Statement): Moved the `Location loc' variable here.
14160         (Statement.EmitBoolExpression): If we have a symbol writer, call
14161         ec.Mark() before emitting any code to tell it that we're at the
14162         beginning of a new statement.
14163         (StatementExpression): Added `Location' argument to the constructor.
14164         (Block): Added public readonly variable `StartLocation' and public
14165         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14166         (Block): Added constructor which takes a start and end location.
14167         (Block.SetEndLocation): New method. This sets the end location.
14168         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14169         local variables we create.
14170         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14171         each statement and do also mark the begin and end of the block.
14172
14173         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14174         tell it the current lexer.Location, use Location.Null for the end of the
14175         block.
14176         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14177         current block, set its end location using SetEndLocation().
14178         (statement_expression): StatementExpression constructor now takes the
14179         lexer.Location as additional argument.
14180         (for_statement, declare_local_variables): Likewise.
14181         (declare_local_variables): When creating a new implicit block, use the
14182         new Block constructor and pass it the lexer.Location.
14183
14184 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14185
14186         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14187         members also on the parent interfaces recursively.
14188
14189 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14190
14191         * report.cs: Use new formats, since Gonzalo finished the missing
14192         bits. 
14193
14194         * expression.cs (Binary.ResolveOperator): added missing operator|
14195         operator& and operator^ for bool/bool.
14196
14197         * cs-parser.jay: CheckDef now takes a Location argument that is
14198         used to report errors more precisly (instead of reporting the end
14199         of a definition, we try to track something which is a lot closer
14200         to the source of the problem).
14201
14202         * cs-tokenizer.cs: Track global token use, so we can properly flag
14203         the use of #define/#undef after the first token has been seen.
14204
14205         Also, rename the reportXXXX to Error_DescriptiveName
14206
14207         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14208         TypeContainer, so that Enum and Interface can use this too.
14209
14210         * class.cs (TypeContainer.LookupInterfaceOrClass,
14211         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14212         `builder' argument.  Typically this was used to pass the parent
14213         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14214         the definition).  
14215
14216         The problem is that a nested class could trigger the definition of
14217         a toplevel class, and the builder would be obviously wrong in that
14218         case. 
14219
14220         So we drop this argument, and we compute dynamically the
14221         TypeBuilder/ModuleBuilder (the correct information was available
14222         to us anyways from DeclSpace.Parent)
14223
14224         * interface.cs (Interface.DefineInterface): Drop builder
14225         parameter cleanup like class.cs
14226
14227         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14228         like class.cs
14229
14230         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14231         values. 
14232
14233         (Try.Emit): Propagate the returns value from the statement.
14234
14235         (Return.Emit): Even if we are leavning 
14236
14237         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14238
14239         * modifiers.cs: Fix the computation of MethodAttributes flags.
14240
14241 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14242
14243         * driver.cs: allow compilation of files that start with '/'.
14244         Add a default case when checking the argument of --target.
14245
14246 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14247
14248         * interface.cs: Implement the same search algorithm for types in
14249         the interface code.
14250
14251         * delegate.cs: Do not allow multiple definition.
14252
14253         * Recovered ChangeLog that got accidentally amputated
14254
14255         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14256
14257         * rootcontext.cs: Load manually enum to allow core classes to
14258         contain enumerations.
14259
14260         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14261         Update to new static methods in TypeManager.
14262
14263         * typemanager.cs (GetMethod, GetConstructor): Use our
14264         implementation of FindMembers to find the members, since during
14265         corlib compilation, the types are TypeBuilders and GetMethod and
14266         GetConstructor do not work.
14267
14268         Make all methods in TypeManager static.
14269
14270         (InitCodeHelpers): Split the functionality from
14271         the InitCodeTypes function.
14272
14273         * driver.cs: Call InitCodeHelpers after we have populated the
14274         types. 
14275
14276         * cs-parser.jay (delegate_declaration): we did not used to compute
14277         the delegate name correctly for void delegates.
14278
14279 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14280
14281         * rootcontext.cs (RootContext): Init the interface_resolve_order
14282         and type_container_resolve_order always.
14283
14284         (ResolveCore, BootstrapCorlib_ResolveClass,
14285         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14286         compiler when compiling with --nostdlib
14287
14288         * class.cs (TypeContainer.DefineType): Check that our parent is
14289         not null.  This test is most important when we are bootstraping
14290         the core types.
14291
14292         * codegen.cs: Split out the symbol writing code.
14293
14294 2002-03-25  Martin Baulig  <martin@gnome.org>
14295
14296         * driver.cs (-g): Made -g an alias for --debug.
14297
14298 2002-03-24  Martin Baulig  <martin@gnome.org>
14299
14300         * codegen.cs (SymbolWriter): New public variable. Returns the
14301         current symbol writer.
14302         (CodeGen): Added `bool want_debugging_support' argument to the
14303          constructor. If true, tell the ModuleBuild that we want debugging
14304         support and ask it for the ISymbolWriter.
14305         (Save): If we have a symbol writer, call it's Close() method after
14306         saving the assembly.
14307
14308         * driver.c (--debug): New command line argument to create a
14309         debugger information file.
14310
14311         * location.cs (SymbolDocument): New public property. Returns an
14312         ISymbolDocumentWriter object for the current source file or null
14313         if we don't have a symbol writer.
14314
14315 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14316
14317         * driver.cs (LoadAssembly): Correctly return when all the paths
14318         have been tried and not before.
14319
14320         * statement.cs (Switch.Emit): return the actual coverage for this
14321         statement (returns/not-returns)
14322
14323         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14324         switch of the statement if we are the last switch section.  That
14325         kills two problems: try/catch problems (we used to emit an empty
14326         nop at the end) and switch statements where all branches would
14327         return. 
14328
14329 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14330
14331         * driver.cs: Add default assemblies (the equivalent to the
14332         Microsoft CSC.RSP file)
14333
14334         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14335         also update tokens_seen and set it to false.
14336
14337         * driver.cs: Implement --recurse for Mike.
14338
14339         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14340         correctly splitting out the paths.
14341
14342 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14343
14344         * interface.cs (Interface.PopulateProperty): Instead of using
14345         `parent' as the declaration space for the set parameters, use
14346         `this' 
14347
14348         * support.cs (InternalParameters): InternalParameters constructor
14349         takes a DeclSpace instead of a TypeContainer.
14350
14351         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14352         types are being initialized, load the address of it before calling
14353         the function.  
14354
14355         (New): Provide a mechanism to disable the generation of local
14356         value type temporaries when the caller will be providing us with
14357         an address to store it.
14358
14359         (ArrayCreation.EmitDynamicInitializers): Use it.
14360
14361 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14362
14363         * expression.cs (Invocation.EmitArguments): Only probe for array
14364         property if there is more than one argument.  Sorry about that.
14365
14366         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14367         empty param arrays.
14368
14369         * class.cs (Method.LabelParameters): Fix incorrect code path that
14370         prevented the `ParamArrayAttribute' from being applied to the
14371         params attribute.
14372
14373 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14374
14375         * support.cs (ReflectionParameters): Correctly compute whether the
14376         last argument is a params array.  Fixes the problem with
14377         string.Split ('a')
14378
14379         * typemanager.cs: Make the assemblies array always be non-null
14380         (empty, but non-null)
14381
14382         * tree.cs (RecordDecl): New function that abstracts the recording
14383         of names.  This reports error 101, and provides a pointer to the
14384         previous declaration.  Fixes a crash in the compiler.
14385
14386         * cs-parser.jay (constructor_declaration): Update to new grammar,
14387         and provide a constructor_body that can be empty.
14388
14389 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14390
14391         * driver.cs: Add support for --resources.
14392
14393         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14394         Make all types for the various array helper methods be integer.
14395
14396         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14397         CheckState to ConvCast.
14398
14399         (ConvCast): Now it takes a `checked' state argument, to avoid
14400         depending on the emit context for the conversion, and just using
14401         the resolve time setting.
14402
14403         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14404         instead of Invocation.EmitArguments.  We do not emit the original
14405         arguments, instead we emit those which have been converted to
14406         unsigned int expressions.
14407
14408         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14409
14410         * codegen.cs: ditto.
14411
14412         * expression.cs (LocalVariableReference): Drop the use of the
14413         Store function that depended on the variable index.
14414
14415         * statement.cs (VariableInfo): Drop the `Idx' property from this
14416         class, as this is not taking into account the indexes for
14417         temporaries tat we generate during the execution, getting the
14418         indexes wrong.
14419
14420         * class.cs: First emit class initializers, then call the parent
14421         constructor. 
14422
14423         * expression.cs (Binary): Fix opcode emision.
14424         (UnaryMutator.EmitCode): Support checked code generation
14425
14426         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14427         matches for events for both the Static and Instance scans,
14428         pointing to the same element.   Fix that.
14429
14430 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14431
14432         * rootcontext.cs (ResolveTree): Always set the
14433         interface_resolve_order, because nested interfaces will be calling
14434         into us.
14435
14436         * class.cs (GetInterfaceOrClass): Track the same resolution
14437         process used by TypeManager.LookupType.  This fixes the nested
14438         type lookups in class declarations (separate path from
14439         LookupType). 
14440
14441         (TypeContainer.DefineType): Also define nested interfaces.
14442         (TypeContainer.RegisterOrder): New public function used to
14443         register the order in which child interfaces need to be closed.
14444
14445         Nested interfaces need to be closed after their parents have been
14446         created. 
14447
14448         * interface.cs (InterfaceAttr): Put all the logic for computing
14449         the interface attribute here. 
14450
14451         (DefineInterface): Register our interface order with the
14452         RootContext or with the TypeContainer depending on the case.
14453
14454 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14455
14456         * cs-parser.jay: rework foreach statement to work with the new
14457         changes to the policy on SimpleNames.
14458
14459         * report.cs: support Stacktrace on warnings as well.
14460
14461         * makefile: drop --unsafe and /unsafe from the compile.
14462
14463 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14464
14465         * ecore.cs (StandardConversionExists): Modify to take an Expression
14466         as the first parameter. Ensure we do null -> reference type conversion
14467         checking.
14468
14469         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14470         temporary Expression objects.
14471
14472 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14473
14474         * interface.cs: workaround bug in method overloading resolution
14475         (there is already a bugzilla bug for it).
14476
14477 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14478
14479         We could also solve this problem by having a separate path for
14480         performing type lookups, instead of DoResolve, we could have a
14481         ResolveType entry point, and only participating pieces of the
14482         production (simplename, deref, array) would implement this. 
14483
14484         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14485         signal SimpleName to only resolve type names and not attempt to
14486         resolve anything else.
14487
14488         * expression.cs (Cast): Set the flag.
14489
14490         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14491
14492         * class.cs: Only report 108 if there is no `new' modifier.
14493
14494         * cs-parser.jay: rework foreach statement to work with the new
14495         changes to the policy on SimpleNames.
14496         
14497         * report.cs: support Stacktrace on warnings as well.
14498
14499         * makefile: drop --unsafe and /unsafe from the compile.
14500
14501 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14502
14503         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14504         lookups here, instead of doing that at parse time.  This means
14505         that our grammar will not introduce `LocalVariableReferences' as
14506         expressions at this point.  That solves the problem of code like
14507         this:
14508
14509         class X {
14510            static void Main ()
14511            { int X = 1;
14512             { X x = null }}}
14513
14514         This is only half the fix.  The full fix requires parameters to
14515         also be handled in this way.
14516
14517         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14518         makes the use more obvious of the DeclSpace.  The
14519         ec.TypeContainer.TypeBuilder is now only used to pull the
14520         TypeBuilder for it.
14521
14522         My theory is that I can get rid of the TypeBuilder completely from
14523         the EmitContext, and have typecasts where it is used (from
14524         DeclSpace to where it matters).  
14525
14526         The only pending problem is that the code that implements Aliases
14527         is on TypeContainer, and probably should go in DeclSpace.
14528
14529         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14530         lookups here, instead of doing that at parse time.  This means
14531         that our grammar will not introduce `LocalVariableReferences' as
14532         expressions at this point.  That solves the problem of code like
14533         this:
14534
14535         class X {
14536            static void Main ()
14537            { int X = 1;
14538             { X x = null }}}
14539
14540         This is only half the fix.  The full fix requires parameters to
14541         also be handled in this way.
14542
14543         * class.cs (Property.DefineMethod): When implementing an interface
14544         method, set newslot, when implementing an abstract method, do not
14545         set the flag (before we tried never setting it, or always setting
14546         it, which is the difference).
14547         (Indexer.DefineMethod): same.
14548         (Method.DefineMethod): same.
14549
14550         * ecore.cs: Only set the status used flag if we get back a Field.
14551
14552         * attribute.cs: Temporary hack, so Paolo can keep working.
14553
14554 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14555
14556         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14557         the unmanaged type in the case we have a MarshalAs attribute.
14558
14559         (Resolve): Handle the case when we are parsing the special MarshalAs
14560         attribute [we need to store the unmanaged type to use later]
14561
14562         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14563         MarshalAs Attribute.
14564
14565         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14566         on parameters and accordingly set the marshalling info.
14567
14568 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14569
14570         * class.cs: Optimizing slightly by removing redundant code after
14571         we switched to the `NoTypes' return value.
14572         (Property.DefineMethod): use NoTypes here too.
14573
14574         This fixes the bug I introduced in my last batch of changes.
14575
14576 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14577
14578         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14579
14580         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14581         Enums since those are types too. 
14582
14583         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14584
14585         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14586         thanks to a call during the lookup process.
14587
14588 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14589
14590         * statement.cs (Foreach): Lots of work to accomodate a particular
14591         kind of foreach statement that I had not kept in mind.  It is
14592         possible to have foreachs on classes that provide a GetEnumerator
14593         method that return objects that implement the "pattern" for using
14594         a foreach, there is no need to support GetEnumerator
14595         specifically. 
14596
14597         This is needed to compile nant.
14598
14599         * decl.cs: Only report 114 if the member is not `Finalize' and if
14600         the warning level is at least 2.
14601
14602         * class.cs: Moved the compare function from Method to
14603         MethodSignature. 
14604
14605         (MethodSignature.InheritableMemberSignatureCompare): Add new
14606         filter function that is used to extract inheritable methods from a
14607         class. 
14608
14609         (Method.Define): Use the new `inheritable_method_signature_filter'
14610         delegate
14611
14612         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14613         command. 
14614
14615 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14616
14617         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14618
14619         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14620
14621         * expression.cs: Pass location information to
14622         ConvertImplicitStandard. 
14623
14624         * class.cs: Added debugging code to track return values from
14625         interfaces. 
14626
14627 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14628
14629         * expression.cs (Is.DoResolve): If either side of the `is' is an
14630         interface, do not flag the warning.
14631
14632         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14633         for interfaces
14634
14635         * report.cs: Allow for --fatal to be used with --probe.
14636
14637         * typemanager.cs (NoTypes): Move the definition for the empty Type
14638         array here. 
14639
14640         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14641         properties. 
14642         (TypeContainer.DefineProxy): New function used to proxy to parent
14643         implementations when implementing interfaces.
14644         (TypeContainer.ParentImplements): used to lookup if our parent
14645         implements a public function that is required by an interface.
14646         (TypeContainer.VerifyPendingMethods): Hook this up.
14647
14648         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14649         `modules' and `assemblies' arraylists into arrays.  We only grow
14650         these are the very early start up of the program, so this improves
14651         the speedof LookupType (nicely measured).
14652
14653         * expression.cs (MakeByteBlob): Replaced unsafe code with
14654         BitConverter, as suggested by Paolo.
14655
14656         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14657         folding of string concatenation, but if either side is a string,
14658         and the other is not, then return null, and let the runtime use
14659         the concatenation on the string plus the object (using
14660         `Object.ToString'). 
14661
14662 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14663
14664         Constant Folding has been implemented now.
14665
14666         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14667         the error instead on types that are not supported in one's
14668         complement. 
14669
14670         * constant.cs (Constant and all children): New set of functions to
14671         perform implict and explicit conversions.
14672
14673         * ecore.cs (EnumConstant): Implement the new functions to perform
14674         conversion by proxying to the child expression.
14675
14676         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14677         own separate setting that can not be turned off from the command
14678         line using --unchecked or --checked and is only controlled using
14679         the checked/unchecked statements and expressions.  This setting is
14680         used by the constant folder to flag errors.
14681
14682         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14683         ConstantCheckState as well.   
14684
14685         During Resolve, they also have to flag the state, because the
14686         constant folder runs completely in the Resolve phase.
14687
14688         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14689         well.
14690
14691 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14692
14693         * cfold.cs: New file, this file contains the constant folder.
14694
14695         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14696         argument to track whether we are using the resulting address to
14697         load or store a value and provide better error messages. 
14698
14699         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14700         new AddressOf arguments.
14701
14702         * statement.cs (Foreach.EmitCollectionForeach): Update
14703
14704         * expression.cs (Argument.Emit): Call AddressOf with proper
14705         arguments to track usage.
14706
14707         (New.DoEmit): Call AddressOf with new arguments.
14708
14709         (Unary.Emit): Adjust AddressOf call.
14710
14711 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14712
14713         * cs-parser.jay (member_access): Change the case for pre-defined types
14714         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14715         this suggestion.
14716
14717         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14718         a method body.
14719
14720         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14721         essentially like methods and apply attributes like MethodImplOptions to them too.
14722
14723         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14724         not being null.
14725
14726         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14727         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14728         is the DeclSpace.
14729
14730         * Update code everywhere accordingly.
14731
14732         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14733
14734         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14735
14736 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14737
14738         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14739         try performing lookups against those instead of jumping straight into using
14740         the 'using' clauses.
14741
14742         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14743
14744         (LookupType): Perform lookups in implicit parents too.
14745
14746         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14747         sequence as RootContext.LookupType. 
14748
14749         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14750         the various cases of namespace lookups into this method.
14751
14752 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14753
14754         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14755         in positional arguments)
14756
14757         * class.cs (Operator): Update the AllowedModifiers to contain
14758         extern. 
14759
14760         * cs-parser.jay: Update operator declaration to allow for the
14761         operator body to be empty.
14762
14763         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14764         values. 
14765
14766 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14767
14768         * class.cs (Method.Emit): Label parameters.
14769
14770         * driver.cs: Return 1 or 0 as the program exit code.
14771
14772 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14773
14774         * expression.cs: Special case the `null' object when trying to
14775         auto-compute the type, as anything can be explicitly converted to
14776         that. 
14777
14778         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14779         spotting this Paolo.
14780
14781         (Expression.ImplicitNumericConversion): Perform comparissions of
14782         the type using the underlying type in the case of an enumeration
14783         rather than using the enumeration type for the compare.
14784
14785         Cope with the underlying == type case, which is not possible to
14786         catch before. 
14787
14788         (Expression.ConvertNumericExplicit): Perform comparissions of
14789         the type using the underlying type in the case of an enumeration
14790         rather than using the enumeration type for the compare.
14791
14792         * driver.cs: If the user does not supply an extension, assume .exe
14793
14794         * cs-parser.jay (if_statement): Rewrote so that we can track the
14795         location for the if statement.
14796
14797         * expression.cs (Binary.ConstantFold): Only concat strings when
14798         the operation is "+", not everything ;-)
14799
14800         * statement.cs (Statement.EmitBoolExpression): Take a location
14801         argument. 
14802         (If, While, Do): Track location.
14803
14804         * expression.cs (Binary.ResolveOperator): In the object + string
14805         case, I was missing a call to ConvertImplicit
14806
14807 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14808
14809         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14810         Location arguments. Ensure we use RootContext.LookupType to do our work
14811         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14812
14813         * interface.cs (PopulateMethod): Handle the type of the parameter being
14814         null gracefully.
14815
14816         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14817         have a params method with no fixed arguments and a call is made with no
14818         arguments.
14819
14820 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14821
14822         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14823         the verbatim-string-literal
14824
14825         * support.cs (InternalParameters.ParameterModifier): handle null
14826         fixed parameters.
14827         (InternalParameters.ParameterType): ditto.
14828
14829         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14830         duplicating the name of the variable parameter.
14831         (GetParameterByName): Fix bug where we were not looking up array
14832         paramters if they were the only present (thanks Paolo!).
14833         (GetParameterInfo): We only have an empty set of types if both
14834         fixed and array are set to null.
14835         (GetParameterInfo-idx): Handle FixedParameter == null
14836
14837         * cs-parser.jay: Handle the case where there is no catch
14838         statements (missing null test).
14839
14840 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
14841
14842         * driver.cs (MainDriver): Be conservative on our command line
14843         handling.
14844
14845         Catch DirectoryNotFoundException when calling GetFiles.
14846
14847         (SplitPathAndPattern): Used to split the input specification into
14848         a path and a pattern that we can feed to Directory.GetFiles.
14849
14850 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14851
14852         * statement.cs (Fixed): Implement the last case of the Fixed
14853         statement (string handling).
14854
14855         * expression.cs (StringPtr): New class used to return a char * to
14856         a string;  Used by the Fixed statement.
14857
14858         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14859
14860         * expression.cs (Binary.ResolveOperator): Remove redundant
14861         MemberLookup pn parent type.
14862         Optimize union call, we do not need a union if the types are the same.
14863         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14864         type.
14865
14866         Specialize the use of MemberLookup everywhere, instead of using
14867         the default settings. 
14868
14869         (StackAlloc): Implement stackalloc keyword.
14870
14871         * cs-parser.jay: Add rule to parse stackalloc.
14872
14873         * driver.cs: Handle /h, /help, /?
14874
14875         * expression.cs (MakeByteBlob): Removed the hacks we had in place
14876         before we supported unsafe code.
14877
14878         * makefile: add --unsafe to the self compilation of mcs.
14879
14880 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
14881
14882         * expression.cs (PointerArithmetic): New class that is used to
14883         perform pointer arithmetic.
14884         (Binary.Resolve): Handle pointer arithmetic
14885         Handle pointer comparission.
14886         (ArrayPtr): Utility expression class that is used to take the
14887         address of an array.
14888
14889         (ElementAccess): Implement array access for pointers
14890
14891         * statement.cs (Fixed): Implement fixed statement for arrays, we
14892         are missing one more case before we are done.
14893
14894         * expression.cs (Indirection): Implement EmitAssign and set the
14895         ExprClass to Variable.  This allows pointer dereferences to be
14896         treated as variables, and to have values assigned to them.
14897
14898         * ecore.cs (Expression.StoreFromPtr): New utility function to
14899         store values dereferencing.
14900
14901 2002-02-20  Ravi Pratap  <ravi@ximian.com>
14902
14903         * expression.cs (Binary.ResolveOperator): Ensure that we are
14904         not trying to operate on a void type - this fixes the reported
14905         bug.
14906
14907         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
14908         the parent implementation is sealed.
14909
14910         * ../errors/cs0239.cs : Add.
14911
14912         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
14913
14914         * typemanager.cs (unverifiable_code_type): Corresponds to 
14915         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
14916         which have unsafe code in them.
14917
14918         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
14919         unsafe context.
14920
14921 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
14922
14923         * cs-tokenizer.cs: Add support for @"litreal strings"
14924
14925         Make tokenizer accept pre-processor directives
14926         on any column (remove the old C-like limitation). 
14927
14928         * rootcontext.cs (EmitCode): Emit any global attributes.
14929         (AddGlobalAttributes): Used to keep track of assembly attributes. 
14930
14931         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
14932
14933         * cs-parser.jay: Add support for global attributes.  
14934
14935 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
14936
14937         * expression.cs (Indirection): New helper class.  Unary will
14938         create Indirection classes to be able to implement the
14939         IMemoryLocation interface on it.
14940
14941 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
14942
14943         * cs-parser.jay (fixed_statement): reference the right statement.
14944
14945         * statement.cs (Fixed.Emit): Finish implementing the fixed
14946         statement for the &x case.
14947
14948 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
14949
14950         * class.cs (Property.Define, Method.Define): Remove newslot when
14951         `implementing'.  
14952
14953         * modifiers.cs: My use of NewSlot when `Abstract' was set was
14954         wrong.  NewSlot should only be used if the `new' keyword is present.
14955
14956         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
14957         locating our system dir.  Sorry about this.
14958
14959 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14960
14961         * driver.cs (GetSystemDir): Compute correctly the location of our
14962         system assemblies.  I was using the compiler directory instead of
14963         the library directory.
14964
14965 2002-02-13  Ravi Pratap  <ravi@ximian.com>
14966
14967         * expression.cs (BetterFunction): Put back in what Miguel commented out
14968         since it is the correct fix. The problem is elsewhere ;-)
14969
14970         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
14971         parameters of the parms method are themselves compatible or not !
14972
14973         (StandardConversionExists): Fix very dangerous bug where we were forgetting
14974         to check that a class implements an interface before saying that an implicit
14975         conversion was allowed. Use ImplementsInterface to do the checking.
14976
14977 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14978
14979         * class.cs (Method.Define): Track whether we are an explicit
14980         implementation or not.  And only call DefineMethodOverride if we
14981         are an explicit implementation.
14982
14983         (Property.DefineMethod): Ditto.
14984
14985 2002-02-11  Ravi Pratap  <ravi@ximian.com>
14986
14987         * expression.cs (BetterFunction): Catch hideous bug which was
14988          preventing us from detecting ambiguous calls due to implicit casts i.e
14989         cs0121.
14990
14991 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
14992
14993         * support.cs (Pair): Remove un-needed method.  I figured why I was
14994         getting the error in cs-parser.jay, the variable in a foreach loop
14995         is readonly, and the compiler does not really treat this as a variable.
14996
14997         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
14998         instead of EQUALS in grammar.  
14999
15000         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15001
15002         * expression.cs (Unary.DoResolve): Check whether the argument is
15003         managed or not.
15004
15005 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * support.cs: Api for Pair to set a value.  Despite the fact that
15008         the variables are public the MS C# compiler refuses to compile
15009         code that accesses the field if the variable is part of a foreach
15010         statement. 
15011
15012         * statement.cs (Fixed): Begin implementation of the fixed
15013         statement.
15014
15015         (Block.AddVariable): Return the VariableInfo on success and null
15016         on failure instead of true/false. 
15017
15018         * cs-parser.jay (foreach): Catch errors on variables already
15019         defined (we were ignoring this value before) and properly unwind
15020         the block hierarchy
15021
15022         (fixed_statement): grammar for the fixed statement.
15023
15024 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15025
15026         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15027         pointer types to be incretemented.
15028
15029         (SizeOf): Implement.
15030
15031         * cs-parser.jay (pointer_member_access): Implement
15032         expr->IDENTIFIER production.
15033
15034         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15035         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15036         on safe contexts.
15037
15038         (Unary): Implement indirection.
15039
15040         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15041         use in non-unsafe context).
15042
15043         (SimpleName.DoResolve): Check for pointers in field access on safe
15044         contexts. 
15045
15046         (Expression.LoadFromPtr): Factor the load-indirect code in this
15047         function.  This was duplicated in UnboxCast and ParameterReference
15048
15049 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15050
15051         * expression.cs (ComposedCast): report an error if a pointer cast
15052         is used in a safe region.
15053
15054         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15055         pointer type casts in unsafe context.
15056
15057         * codegen.cs (EmitContext): Set up IsUnsafe.
15058
15059         * cs-parser.jay (non_expression_type): Add productions for pointer
15060         casts. 
15061
15062         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15063         code.  We should not use force into static mode if the method is
15064         not virtual.  Fixes bug in MIS
15065
15066         * statement.cs (Do.Emit, While.Emit, For.Emit,
15067         Statement.EmitBoolExpression): Add support to Do and While to
15068         propagate infinite loop as `I do return' semantics.
15069
15070         Improve the For case to also test for boolean constants.
15071
15072         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15073         to the list of attributes we can add.
15074
15075         Remove `EmitContext' argument.
15076
15077         * class.cs (Method.Define): Apply parameter attributes.
15078         (Constructor.Define): Apply parameter attributes.
15079         (MethodCore.LabelParameters): Move here the core of labeling
15080         parameters. 
15081
15082         * support.cs (ReflectionParameters.ParameterModifier,
15083         InternalParameters.ParameterModifier): Use IsByRef on the type and
15084         only return the OUT bit for these parameters instead of in/out/ref
15085         flags.
15086
15087         This is because I miss-understood things.  The ParameterInfo.IsIn
15088         and IsOut represent whether the parameter has the [In] and [Out]
15089         attributes set.  
15090
15091 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15092
15093         * ecore.cs (FieldExpr.Emit): Release temporaries.
15094
15095         * assign.cs (LocalTemporary.Release): new function.
15096
15097         * codegen.cs (EmitContext.GetTemporaryStorage,
15098         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15099         temporary storage.  Now we can "put back" localbuilders when we
15100         are done with them
15101
15102 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15103
15104         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15105         need to make a copy of the variable to generate verifiable code.
15106
15107 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15108
15109         * driver.cs: Compute dynamically the system directory.
15110
15111         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15112         Slower, but more generally useful.  Used by the abstract
15113         registering implementation. 
15114
15115         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15116         the rules for the special rule on Type/instances.  First check if
15117         we have the same name, and if so, try that special static path
15118         rather than the instance path.
15119
15120 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15121
15122         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15123         for, while and if.
15124
15125         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15126         Enum, ValueType, Delegate or Array for non-corlib compiles.
15127
15128         * cs-tokenizer.cs: Catch long identifiers (645)
15129
15130         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15131         piece of code.
15132
15133         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15134         fix, we were returning too early, so we were not registering
15135         pending methods from abstract classes.
15136
15137         Do not register pending methods if the class is abstract.
15138
15139         * expression.cs (Conditional.DoResolve): Report circular implicit
15140         conversions when we neecd to compute it for conditional
15141         expressions. 
15142
15143         (Is.DoResolve): If the expression is always of the provided type,
15144         flag warning 183.  If the expression can not ever be of the
15145         provided type flag warning 184.
15146
15147         * class.cs: Catch 169 as well.
15148
15149         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15150         read. 
15151
15152 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15153
15154         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15155
15156 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15157
15158         * interface.cs: (PopulateMethod): Check for pointers being defined
15159         only if the unsafe context is active.
15160         (PopulateProperty): ditto.
15161         (PopulateIndexer): ditto.
15162
15163         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15164         specified.  If pointers are present, make sure that they are
15165         present in an unsafe context.
15166         (Constructor, Constructor.Define): ditto.
15167         (Field, Field.Define): ditto.
15168         (Property, Property.Define): ditto.
15169         (Event, Event.Define): ditto.
15170
15171         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15172         hashtable if there are classes or structs defined.
15173
15174         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15175         code, as the constant resolution moved.
15176
15177         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15178         the metadata, so we can flag error 133. 
15179
15180         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15181         pointer is being declared in an unsafe context.
15182
15183 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15184
15185         * modifiers.cs (Modifiers.Check): Require a Location argument.
15186         Report error 227 for Unsafe use.
15187
15188         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15189
15190         * statement.cs (For.Emit): If the test is null, then report that
15191         we do `return', as we wont reach anything afterwards.
15192
15193         (Switch.SwitchGoverningType): Track the expression that matched
15194         the conversion.
15195
15196         * driver.cs: Allow negative numbers as an error code to flag.
15197
15198         * cs-parser.jay: Handle 1551.
15199
15200         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15201
15202 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15203
15204         * cs-parser.jay: Report 1518 (type declaration can only contain
15205         class, struct, interface, enum or delegate)
15206
15207         (switch_label): Report 1523 (keywords `case' or `default' must
15208         preced code)
15209
15210         (opt_switch_sections): Report 1522 (empty switch)
15211
15212         * driver.cs: Report 1515 (response file specified multiple times)
15213         Report 1516 (Source file specified multiple times).
15214
15215         * expression.cs (Argument.Resolve): Signal 1510
15216
15217         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15218         access not allowed in static code)
15219
15220 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15221
15222         * typemanager.cs (IsPointerType): Utility method which we are going
15223         to need a lot.
15224
15225         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15226         the object type, so we take care of that.
15227
15228         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15229
15230         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15231         added to non-params parameters :-)
15232
15233         * typemanager.cs (CSharpName): Include 'void' type too. 
15234
15235         (void_ptr_type): Include in the set of core types.
15236
15237         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15238         duplicating code.
15239
15240         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15241         an unsafe context.
15242
15243         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15244         completely forgotten about it.
15245
15246 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15247
15248         * cs-parser.jay (pointer_type): Add. This begins our implementation
15249         of parsing rules for unsafe code.
15250
15251         (unsafe_statement): Implement.
15252
15253         (embedded_statement): Modify to include the above.
15254
15255         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15256
15257         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15258         if the current context is an unsafe one.
15259
15260         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15261         are handled differently, we need separate rules for them.
15262
15263         (local_variable_declaration): Update to use local_variable_pointer_type
15264         to allow variable declarations of unmanaged pointer types.
15265
15266         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15267         in unsafe contexts.
15268
15269         * ../errors/cs0214.cs : Add.
15270
15271 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15272
15273         * makefile: remove 'response' file when cleaning.
15274
15275 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15276
15277         * cs-parser.jay: Report 1524.
15278
15279 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15280
15281         * typemanager.cs (RegisterMethod): drop checking if we have
15282         registered this from here
15283
15284 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15285
15286         * class.cs (Method.EmitDestructor): Implement calling our base
15287         destructor. 
15288
15289         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15290         value of InFinally.
15291
15292         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15293         this routine and will wrap the call in a try/catch block.  Deal
15294         with the case.
15295
15296 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15297
15298         * ecore.cs (Expression.MemberLookup): instead of taking a
15299         parameter `same_type' that was used to tell whether we could
15300         access private members we compute our containing type from the
15301         EmitContext.
15302
15303         (FieldExpr): Added partial support for volatile fields.  This does
15304         not work for volatile fields exposed from assemblies, as I can not
15305         figure out how to extract the modreq from it.
15306
15307         Updated all the source files to use this.
15308
15309         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15310         because it is referenced by MemberLookup very often. 
15311
15312 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15313
15314         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15315         TypeBuilder.GetCustomAttributes to retrieve what we need.
15316
15317         Get rid of redundant default_member_attr_type as this is the same as
15318         default_member_type which already exists.
15319
15320         * interface.cs, attribute.cs : Update accordingly.
15321
15322 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15323
15324         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15325         work for TYpeBuilders though.  Ravi, can you please fix this?
15326
15327         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15328
15329         * expression.cs (Argument.Emit): Handle the case of ref objects
15330         being passed to ref functions;  
15331
15332         (ParameterReference.EmitLoad): Loads the content of the pointer
15333         without dereferencing.
15334
15335 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15336
15337         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15338
15339 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15340
15341         * class.cs (Indexer.DefineMethod): Incorporate the interface
15342         type in the name of the method if we are doing explicit interface
15343         implementation.
15344
15345         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15346
15347         (BetterConversion): Fix extremely trivial bug where we were referring to
15348         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15349         again !
15350
15351         * ../errors/bug16.cs : Add although we have fixed it.
15352
15353 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15354
15355         * expression.cs (BaseIndexer): Begin implementation.
15356
15357         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15358
15359         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15360         production directly to remove a shift/reduce, and implement
15361         explicit interface implementation.
15362
15363         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15364         after a floating point suffix.
15365
15366         * expression.cs (DoNumericPromotions): Improved the conversion for
15367         uint/uint.  If we have a constant, we avoid doing a typecast to a
15368         larger type.
15369
15370         * class.cs (Indexer): Implement explicit interface implementation
15371         for indexers.
15372
15373 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15374
15375         * class.cs: make the default instance constructor public and hidebysig.
15376
15377 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15378
15379         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15380         so we can call it from elsewhere.
15381
15382         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15383         we emit it internally if the class has a defined indexer; otherwise the user
15384         emits it by decorating the class definition with the DefaultMemberAttribute.
15385
15386         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15387         attribute is not used on a type which defines an indexer.
15388
15389         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15390         character when we skip whitespace.
15391
15392         * ../errors/cs0646.cs : Add.
15393
15394 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15395
15396         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15397         again. 
15398
15399         * makefile: Add practical target `mcs3.exe' which builds the third
15400         generation compiler. 
15401
15402         * expression.cs (New): Fix structures constructor calling.
15403
15404         * class.cs (Property, Method, Indexer): Emit Final flag on the
15405         method if we are an interface implementation and we are not
15406         abstract. 
15407
15408         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15409         whether this property is referencing a `base' method.
15410
15411         * expression.cs (Invocation.EmitCall): take an extra argument:
15412         is_base, this is used to determine whether the `call' or
15413         `callvirt' opcode should be used.
15414
15415
15416         * delegate.cs: update EmitCall.
15417
15418         * class.cs (Method.Define): Set NewSlot for the cases where we are
15419         not implementing an interface method.
15420
15421         (Property.Define): ditto.
15422
15423 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15424
15425         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15426         'r'.  Allows mcs to parse itself fully.
15427
15428 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15429
15430         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15431         of the number of initializers that require the InitializeArray method.
15432
15433         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15434         update the above field where necessary.
15435
15436         (MakeByteBlob): Update accordingly.
15437
15438         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15439         greater than 2.
15440
15441         (EmitDynamicInitializers): Update in accordance with the new optimization.
15442
15443         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15444         same OpCode applies.
15445
15446         * cs-parser.jay : Fix some glaring errors I introduced.
15447
15448 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15449
15450         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15451         so that we can check for name clashes there too.
15452
15453         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15454         for interface indexers.
15455
15456         * interfaces.cs (Define): Emit the default member attribute.
15457
15458         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15459         variable was being referred to while setting the value ;-)
15460
15461 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15462
15463         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15464         byte-by-byte information when we know the data is zero.
15465
15466         Make the block always a multiple of 4, because
15467         DefineInitializedData has a bug.
15468
15469         * assign.cs: Fix, we should assign from the temporary, not from
15470         the source. 
15471
15472         * expression.cs (MakeByteBlob): Fix my incorrect code.
15473
15474 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15475
15476         * typemanager.cs (EnumToUnderlying): This function is used to get
15477         the underlying type from an enumeration, because it does not
15478         always work. 
15479
15480         * constant.cs: Use the I4_S form for values between -128 and 127.
15481
15482         * statement.cs (Block.LookupLabel): Looks up a label.
15483         (Block): Drop support for labeled blocks.
15484
15485         (LabeledStatement): New kind of statement that represents a label
15486         only.
15487
15488         (Goto): Finally implement this bad boy.
15489
15490         * cs-parser.jay: Update to reflect new mechanism to implement
15491         labels.
15492
15493 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15494
15495         * codegen.cs (EmitContext.This): a codegen property that keeps the
15496         a single instance of this instead of creating many different this
15497         instances. 
15498
15499         * delegate.cs (Delegate.DoResolve): Update to use the property;
15500
15501         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15502
15503         * expression.cs (BaseAccess.DoResolve): Ditto.
15504
15505 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15506
15507         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15508         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15509
15510         (InitCoreTypes): Update accordingly.
15511
15512         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15513         so we can quickly store the state.
15514
15515         (ApplyAttributes): Set the correct implementation flags
15516         for InternalCall methods.
15517
15518 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15519
15520         * expression.cs (EmitCall): if a method is not virtual, then do
15521         not use callvirt on it.
15522
15523         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15524         user defined stuff) requires the use of stobj, which takes an
15525         address on the stack instead of an array and an index.  So emit
15526         the Ldelema operation for it.
15527
15528         (EmitStoreOpcode): Use stobj for valuetypes.
15529
15530         (UnaryMutator.EmitCode): Use the right 1 value depending on
15531         whether we are dealing with int64/uint64, float or doubles.
15532
15533         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15534         constructors that I implemented last night.
15535
15536         (Constructor.IsDefault): Fix to work properly for static
15537         constructors.
15538
15539         * cs-parser.jay (CheckDef): report method signature errors.
15540         Update error number 103 to be 132.
15541
15542         * decl.cs: New AdditionResult enumeration value: MethodExists.
15543         Although we do this check for methods later on in the semantic
15544         analysis, catching repeated default constructors is so easy that
15545         we catch these here. 
15546
15547         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15548         promotions code.
15549
15550         (ParameterReference.EmitAssign, Emit): handle
15551         bools as bytes.
15552
15553         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15554         (ArrayAccess.EmitStoreOpcode): ditto.
15555
15556         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15557
15558         * expression.cs (MakeByteBlob): Complete all the missing types
15559         (uint, short, ushort, byte, sbyte)
15560
15561         * class.cs: Only init instance field initializers on instance
15562         constructors. 
15563
15564         Rename `constructors' to instance_constructors. 
15565
15566         (TypeContainer.AddConstructor): Only add constructors to the list
15567         if it is not static.
15568
15569         Make sure that we handle default_static_constructor independently
15570         everywhere where we handle instance_constructors
15571
15572 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15573
15574         * class.cs: Do not lookup or create a base initializer for a
15575         static constructor.
15576
15577         (ConstructorInitializer.Resolve): use the proper type to lookup
15578         for constructors.
15579
15580         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15581
15582         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15583         in DeclSpace. 
15584
15585         * decl.cs: CloseType is now an virtual method, the default
15586         implementation just closes this type.
15587
15588 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15589
15590         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15591         to PreserveSig by default. Also emit HideBySig on such methods.
15592
15593         Basically, set the defaults to standard values.
15594
15595         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15596         argument, if candidate is better, it can't be worse than the best !
15597
15598         (Invocation): Re-write bits to differentiate between methods being
15599         applicable in their expanded form and their normal form - for params
15600         methods of course.
15601
15602         Get rid of use_standard everywhere as only standard conversions are allowed
15603         in overload resolution. 
15604
15605         More spec conformance.
15606
15607 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15608
15609         * driver.cs: Add --timestamp, to see where the compiler spends
15610         most of its time.
15611
15612         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15613         `this' in static code.
15614
15615         (SimpleName.DoResolve): Implement in terms of a helper function
15616         that allows static-references to be passed upstream to
15617         MemberAccess.
15618
15619         (Expression.ResolveWithSimpleName): Resolve specially simple
15620         names when called by MemberAccess to implement the special
15621         semantics. 
15622
15623         (Expression.ImplicitReferenceConversion): Handle conversions from
15624         Null to reference types before others, as Null's type is
15625         System.Object. 
15626
15627         * expression.cs (Invocation.EmitCall): Handle the special case of
15628         calling methods declared on a reference type from a ValueType
15629         (Base classes System.Object and System.Enum)
15630
15631         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15632         the left hand side is a TypeExpr, not on every enumeration. 
15633
15634         (Binary.Resolve): If types are reference types, then do a cast to
15635         object on operators != and == of both arguments.
15636
15637         * typemanager.cs (FindMembers): Extract instance and static
15638         members if requested.
15639
15640         * interface.cs (PopulateProperty): Use void_type instead of null
15641         as the return type for the setter method.
15642
15643         (PopulateIndexer): ditto.
15644
15645 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15646
15647         * support.cs (ReflectionParameters): Fix minor bug where we
15648         were examining the wrong parameter for the ParamArray attribute.
15649
15650         Cope with requests for the type of the parameter at position
15651         greater than the params parameter's. We now return the element
15652         type of the params array as that makes more sense.
15653
15654         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15655         accordingly as we no longer have to extract the element type
15656         ourselves.
15657
15658         (Invocation.OverloadResolve): Update.
15659
15660 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15661
15662         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15663         against IEnumerator, test whether the return value is a descendant
15664         of the IEnumerator interface.
15665
15666         * class.cs (Indexer.Define): Use an auxiliary method to implement
15667         the other bits of the method definition.  Begin support for
15668         explicit interface implementation.
15669
15670         (Property.DefineMethod): Use TypeManager.void_type instead of null
15671         for an empty return value.
15672
15673 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15674
15675         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15676         dealing with a FieldExpr which is composed of a FieldBuilder, in
15677         the code path we did extract the constant, but we should have
15678         obtained the underlying value to be able to cast it (otherwise we
15679         end up in an infinite loop, this is what Ravi was running into).
15680
15681         (ArrayCreation.UpdateIndices): Arrays might be empty.
15682
15683         (MemberAccess.ResolveMemberAccess): Add support for section
15684         14.5.4.1 that deals with the special case of E.I when E is a type
15685         and something else, that I can be a reference to a static member.
15686
15687         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15688         handle a particular array type to create byte blobs, it is just
15689         something we dont generate byteblobs for.
15690
15691         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15692         arguments. 
15693
15694         * location.cs (Push): remove the key from the hashtable that we
15695         are about to add.   This happens for empty files.
15696
15697         * driver.cs: Dispose files after we have parsed them.
15698
15699         (tokenize): new function that only runs the tokenizer on its
15700         input, for speed testing.
15701
15702 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15703
15704         * class.cs (Event.Define): Define the private field only if there
15705         are no accessors defined.
15706
15707         * expression.cs (ResolveMemberAccess): If there is no associated
15708         field with the event, that means we have an event defined with its
15709         own accessors and we should flag error cs0070 since transforming
15710         ourselves into a field is not valid in that case.
15711
15712         * ecore.cs (SimpleName.DoResolve): Same as above.
15713
15714         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15715         and charset to sane values.
15716
15717 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15718
15719         * assign.cs (DoResolve): Perform check on events only if they 
15720         are being accessed outside the declaring type.
15721
15722         * cs-parser.jay (event_declarations): Update rules to correctly
15723         set the type of the implicit parameter etc.
15724
15725         (add_accessor, remove_accessor): Set current local parameters.
15726
15727         * expression.cs (Binary): For delegate addition and subtraction,
15728         cast the return value from the method into the appropriate delegate
15729         type.
15730
15731 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15732
15733         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15734         of these as the workaround is unnecessary.
15735
15736         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15737         delegate data - none of that is needed at all.
15738
15739         Re-write bits to extract the instance expression and the delegate method
15740         correctly.
15741
15742         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15743         on delegates too.
15744
15745         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15746         of attaching attributes instead of duplicating code everywhere.
15747
15748         * everywhere : Update code to do attribute emission using the above method.
15749
15750 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15751
15752         * expression.cs (IsParamsMethodApplicable): if there are not
15753         parameters, return immediately.
15754
15755         * ecore.cs: The 0 literal can be implicity converted to an enum
15756         type. 
15757
15758         (SimpleName.DoResolve): First lookup the type, then lookup the
15759         members. 
15760
15761         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15762         want to get its address.  If the InstanceExpression is not
15763         addressable, store the result in a temporary variable, then get
15764         the address of it.
15765
15766         * codegen.cs: Only display 219 errors on warning level or above. 
15767
15768         * expression.cs (ArrayAccess): Make it implement the
15769         IMemoryLocation interface.
15770
15771         (Binary.DoResolve): handle the operator == (object a, object b)
15772         and operator != (object a, object b) without incurring into a
15773         BoxedCast (because 5 != o should never be performed).
15774
15775         Handle binary enumerator operators.
15776
15777         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15778         value type, otherwise use Ldelem_ref.
15779
15780         Use precomputed names;
15781
15782         (AddressOf): Implement address of
15783
15784         * cs-parser.jay (labeled_statement): Fix recursive block
15785         addition by reworking the production.
15786
15787         * expression.cs (New.DoEmit): New has a special case:
15788                 
15789                  If we are dealing with a ValueType, we have a few
15790                  situations to deal with:
15791                 
15792                     * The target of New is a ValueType variable, that is
15793                       easy, we just pass this as the variable reference
15794                 
15795                     * The target of New is being passed as an argument,
15796                       to a boxing operation or a function that takes a
15797                       ValueType.
15798                 
15799                       In this case, we need to create a temporary variable
15800                       that is the argument of New.
15801
15802
15803 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15804
15805         * rootcontext.cs (LookupType): Check that current_type is not null before
15806         going about looking at nested types.
15807
15808         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15809         not implement the IAssignMethod interface any more.
15810
15811         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15812         where we tranform them into FieldExprs if they are being resolved from within
15813         the declaring type.
15814
15815         * ecore.cs (SimpleName.DoResolve): Do the same here.
15816
15817         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15818
15819         * ../errors/bug10.cs : Add.
15820
15821         * ../errors/cs0070.cs : Add.
15822
15823         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15824
15825         * assign.cs : Get rid of EventIsLocal everywhere.
15826
15827 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15828
15829         * ecore.cs (ConvertIntLiteral): finished the implementation.
15830
15831         * statement.cs (SwitchLabel): Convert the value we are using as a
15832         key before looking up the table.
15833
15834 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15835
15836         * codegen.cs (EmitTopBlock): Require a Location argument now.
15837
15838         * cs-parser.jay (constructor_declarator): We need to setup
15839         current_local_parameters before we parse the
15840         opt_constructor_initializer, to allow the variables to be bound
15841         to the constructor arguments.
15842
15843         * rootcontext.cs (LookupType): First lookup nested classes in our
15844         class and our parents before we go looking outside our class.
15845
15846         * expression.cs (ConstantFold): Extract/debox the values at the
15847         beginnning. 
15848
15849         * rootcontext.cs (EmitCode): Resolve the constants first before we
15850         resolve the types.  This is not really needed, but it helps debugging.
15851
15852         * statement.cs: report location.
15853
15854         * cs-parser.jay: pass location to throw statement.
15855
15856         * driver.cs: Small bug fix.
15857
15858         * report.cs: Updated format to be 4-zero filled digits.
15859
15860 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15861
15862         * expression.cs (CheckIndices): Fix minor bug where the wrong
15863         variable was being referred to ;-)
15864
15865         (DoEmit): Do not call EmitStaticInitializers when the 
15866         underlying type is System.Object.
15867
15868 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15869
15870         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15871         and do the usual workaround for SRE.
15872
15873         * class.cs (MyEventBuilder.EventType): New member to get at the type
15874         of the event, quickly.
15875
15876         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15877
15878         * assign.cs (Assign.DoResolve): Handle the case when the target
15879         is an EventExpr and perform the necessary checks.
15880
15881         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15882         interface.
15883
15884         (SimpleName.MemberStaticCheck): Include check for EventExpr.
15885
15886         (EventExpr): Set the type in the constructor itself since we 
15887         are meant to be born fully resolved.
15888
15889         (EventExpr.Define): Revert code I wrote earlier.
15890                 
15891         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
15892         instance expression is null. The instance expression is a This in that case
15893         or a null, depending on whether it is a static method or not.
15894
15895         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
15896         refers to more than one method.
15897
15898         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
15899         and accordingly flag errors.
15900
15901 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15902
15903         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
15904
15905 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15906
15907         * location.cs (ToString): Provide useful rutine.
15908
15909 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15910
15911         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
15912         objects, return the actual integral boxed.
15913
15914         * statement.cs (SwitchLabel): define an ILLabel for each
15915         SwitchLabel. 
15916
15917         (Switch.CheckSwitch): If the value is a Literal, extract
15918         the underlying literal.
15919
15920         Also in the unused hashtable we had, add the SwitchLabel so we can
15921         quickly look this value up.
15922
15923         * constant.cs: Implement a bunch of new constants.  Rewrite
15924         Literal based on this.  Made changes everywhere to adapt to this.
15925
15926         * expression.cs (Expression.MakeByteBlob): Optimize routine by
15927         dereferencing array only once, and also copes with enumrations.
15928
15929         bytes are two bytes wide, not one.
15930
15931         (Cast): Perform constant conversions.
15932
15933         * ecore.cs (TryImplicitIntConversion): Return literals instead of
15934         wrappers to the literals here.
15935
15936         * expression.cs (DoNumericPromotions): long literals can converted
15937         to ulong implicity (this is taken care of elsewhere, but I was
15938         missing this spot).
15939
15940         * ecore.cs (Expression.Literalize): Make the return type Literal,
15941         to improve type checking.
15942
15943         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
15944
15945 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15946
15947         * literal.cs: Revert code from ravi that checked the bounds.  The
15948         bounds are sane by the definition of the type itself. 
15949
15950         * typemanager.cs: Fix implementation of ImplementsInterface.  We
15951         need to actually look up in our parent hierarchy for interfaces
15952         implemented. 
15953
15954         * const.cs: Use the underlying type for enumerations
15955
15956         * delegate.cs: Compute the basename for the delegate creation,
15957         that should fix the delegate test case, and restore the correct
15958         Type Lookup semantics in rootcontext
15959
15960         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
15961         referencing a nested type with the Reflection API is using the "+"
15962         sign. 
15963
15964         * cs-parser.jay: Do not require EOF token at the end.
15965
15966 2001-12-20  Ravi Pratap  <ravi@ximian.com>
15967
15968         * rootcontext.cs (LookupType): Concatenate type names with
15969         a '.' instead of a '+' The test suite passes again.
15970
15971         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
15972         field of the enumeration.
15973
15974         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
15975         the case when the member is an EventExpr.
15976
15977         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
15978         static has an associated instance expression.
15979
15980         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
15981
15982         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
15983
15984         * class.cs (Event.Define): Register event and perform appropriate checks
15985         for error #111.
15986
15987         We define the Add and Remove methods even if the use provides none because
15988         in that case, we provide default implementations ourselves.
15989
15990         Define a private field of the type of the event. This is done by the CSC compiler
15991         and we should be doing it too ;-)
15992
15993         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
15994         More methods we use in code we generate.
15995
15996         (multicast_delegate_type, delegate_type): Two separate types since the distinction
15997         is important.
15998
15999         (InitCoreTypes): Update accordingly for the above.
16000
16001         * class.cs (Event.Emit): Generate code for default accessors that we provide
16002
16003         (EmitDefaultMethod): Do the job in the above.
16004
16005         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16006         appropriate place.
16007
16008 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16009
16010         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16011         builders even if we were missing one.
16012
16013         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16014         pass the Basename as our class name instead of the Name.  The
16015         basename will be correctly composed for us.
16016
16017         * parameter.cs (Paramters): Now takes a Location argument.
16018
16019         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16020         make all the code call directly LookupType in RootContext and take
16021         this chance to pass the Location information everywhere.
16022
16023         * Everywhere: pass Location information.
16024
16025 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16026
16027         * class.cs (Constructor.Define): Updated way of detecting the
16028         length of the parameters.
16029
16030         (TypeContainer.DefineType): Use basename as the type name for
16031         nested types.
16032
16033         (TypeContainer.Define): Do not recursively define types here, as
16034         definition is taken care in order by the RootContext.
16035
16036         * tree.cs: Keep track of namespaces in a per-file basis.
16037
16038         * parameter.cs (Parameter.ComputeSignature): Update to use
16039         DeclSpace. 
16040
16041         (Parameters.GetSignature): ditto.
16042
16043         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16044         instead of a TypeContainer.
16045
16046         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16047         resolve names.  Because we need to be resolve in our context, not
16048         our parents.
16049
16050         * driver.cs: Implement response files.
16051
16052         * class.cs (TypeContainer.DefineType): If we are defined, do not
16053         redefine ourselves.
16054
16055         (Event.Emit): Emit the code for add/remove handlers.
16056         (Event.Define): Save the MethodBuilders for add/remove.
16057
16058         * typemanager.cs: Use pair here too.
16059
16060         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16061         DictionaryEntry requires the first argument to be non-null.  
16062
16063         (enum_declaration): Compute full name for registering the
16064         enumeration.
16065
16066         (delegate_declaration): Instead of using
16067         formal_parameter_list, use opt_formal_parameter_list as the list
16068         can be empty.
16069
16070         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16071         (EventParsing): New property that controls whether `add' and
16072         `remove' are returned as tokens or identifiers (for events);
16073
16074 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16075
16076         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16077         use MyEventBuilder only and let it wrap the real builder for us.
16078
16079         (MyEventBuilder): Revamp constructor etc.
16080
16081         Implement all operations that we perform on EventBuilder in precisely the same
16082         way here too.
16083
16084         (FindMembers): Update to use the EventBuilder member.
16085
16086         (Event.Emit): Update accordingly.
16087
16088 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16089
16090         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16091         by calling the appropriate methods.
16092
16093         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16094         useful.
16095
16096         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16097
16098 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16099
16100         * delegate.cs (Delegate.Populate): Check that the return type
16101         and various parameters types are indeed accessible.
16102
16103         * class.cs (Constructor.Define): Same here.
16104
16105         (Field.Define): Ditto.
16106
16107         (Event.Define): Ditto.
16108
16109         (Operator.Define): Check that the underlying Method defined itself
16110         correctly - so it's MethodBuilder should not be null.
16111
16112         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16113         expression happens to be null.
16114
16115         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16116         members but as of now we don't seem to be able to do anything really useful with it.
16117
16118         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16119         not the EventBuilder.
16120
16121 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16122
16123         * cs-tokenizer.cs: Add support for defines.
16124         Add support for #if, #elif, #else, #endif
16125
16126         (eval_var): evaluates a variable.
16127         (eval): stubbed for evaluating functions.
16128
16129         * cs-parser.jay: Pass the defines information
16130
16131         * driver.cs: Add --define command line option.
16132
16133         * decl.cs: Move MemberCore here.
16134
16135         Make it the base class for DeclSpace.  This allows us to catch and
16136         report 108 and 109 for everything now.
16137
16138         * class.cs (TypeContainer.Define): Extract all the members
16139         before populating and emit the warning 108 (new keyword required
16140         to override) instead of having each member implement this.
16141
16142         (MemberCore.Define): New abstract method, we will be using this in
16143         the warning reporting engine in Populate.
16144
16145         (Operator.Define): Adjust to new MemberCore protocol. 
16146
16147         * const.cs (Const): This does not derive from Expression, it is a
16148         temporary object we use to create fields, it is a MemberCore. 
16149
16150         * class.cs (Method.Define): Allow the entry point to be in a
16151         specific class.
16152
16153         * driver.cs: Rewrite the argument handler to clean it up a bit.
16154
16155         * rootcontext.cs: Made it just an auxiliary namespace feature by
16156         making everything static.
16157
16158         * driver.cs: Adapt code to use RootContext type name instead of
16159         instance variable.
16160
16161         * delegate.cs: Remove RootContext argument.
16162
16163         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16164         argument. 
16165
16166         * class.cs (Event.Define): The lookup can fail.
16167
16168         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16169
16170         * expression.cs: Resolve the this instance before invoking the code.
16171
16172 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16173
16174         * cs-parser.jay: Add a production in element_access that allows
16175         the thing to become a "type" reference.  This way we can parse
16176         things like "(string [])" as a type.
16177
16178         Note that this still does not handle the more complex rules of
16179         casts. 
16180
16181
16182         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16183
16184         * ecore.cs: (CopyNewMethods): new utility function used to
16185         assemble the list of methods from running FindMembers.
16186
16187         (MemberLookup): Rework FindMembers so that 
16188
16189 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16190
16191         * class.cs (TypeContainer): Remove Delegates who fail to be
16192         defined.
16193
16194         * delegate.cs (Populate): Verify that we dont get null return
16195         values.   TODO: Check for AsAccessible.
16196
16197         * cs-parser.jay: Use basename to emit error 574 (destructor should
16198         have the same name as container class), not the full name.
16199
16200         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16201         possible representation.  
16202
16203         Also implements integer type suffixes U and L.
16204
16205 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16206
16207         * expression.cs (ArrayCreation.DoResolve): We need to do the
16208         argument resolution *always*.
16209
16210         * decl.cs: Make this hold the namespace.  Hold the root context as
16211         well.
16212         (LookupType): Move here.
16213
16214         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16215
16216         * location.cs (Row, Name): Fixed the code, it was always returning
16217         references to the first file.
16218
16219         * interface.cs: Register properties defined through interfaces.
16220
16221         * driver.cs: Add support for globbing on the command line
16222
16223         * class.cs (Field): Make it derive from MemberCore as well.
16224         (Event): ditto.
16225
16226 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16227
16228         * class.cs (Event::Define): Check that the type of the event is a delegate
16229         type else flag error #66.
16230
16231         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16232         same.
16233
16234         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16235         values of EntryPoint, CharSet etc etc.
16236
16237         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16238
16239         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16240         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16241         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16242         which needs this to do its work.
16243
16244         * ../errors/cs0066.cs : Add.
16245
16246 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16247
16248         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16249         helper functions.
16250
16251         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16252         clears out the parameters field.
16253         (MemberSignatureCompare): Cleanup
16254
16255         (MemberCore): New base class used to share code between MethodCore
16256         and Property.
16257
16258         (RegisterRequiredImplementations) BindingFlags.Public requires
16259         either BindingFlags.Instace or Static.  Use instance here.
16260
16261         (Property): Refactored code to cope better with the full spec.
16262
16263         * parameter.cs (GetParameterInfo): Return an empty array instead
16264         of null on error.
16265
16266         * class.cs (Property): Abstract or extern properties have no bodies.
16267
16268         * parameter.cs (GetParameterInfo): return a zero-sized array.
16269
16270         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16271         method modifier validation to the typecontainer so we can reuse
16272         this on properties.
16273
16274         (MethodCore.ParameterTypes): return an empty sized array of types.
16275
16276         (Property.Define): Test property modifier validity.
16277
16278         Add tests for sealed/override too.
16279
16280         (Method.Emit): abstract or extern methods have no bodies.
16281
16282 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16283
16284         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16285         thing.
16286
16287         (Method::Define, ::Emit): Modify accordingly.
16288
16289         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16290
16291         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16292
16293         * makefile: Pass in /unsafe.
16294
16295 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16296
16297         * class.cs (MakeKey): Kill routine.
16298
16299         * class.cs (TypeContainer.Define): Correctly define explicit
16300         method implementations (they require the full interface name plus
16301         the method name).
16302
16303         * typemanager.cs: Deply the PtrHashtable here and stop using the
16304         lame keys.  Things work so much better.
16305
16306         This of course broke everyone who depended on `RegisterMethod' to
16307         do the `test for existance' test.  This has to be done elsewhere.
16308
16309         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16310         the object stupid Equals method (because, that like fails all over
16311         the place).  We still do not use it.
16312
16313         * class.cs (TypeContainer.SetRequiredInterface,
16314         TypeContainer.RequireMethods): Killed these two routines and moved
16315         all the functionality to RegisterRequiredImplementations.
16316
16317         (TypeContainer.RegisterRequiredImplementations): This routine now
16318         registers all the implementations required in an array for the
16319         interfaces and abstract methods.  We use an array of structures
16320         which can be computed ahead of time to reduce memory usage and we
16321         also assume that lookups are cheap as most classes will not
16322         implement too many interfaces.
16323
16324         We also avoid creating too many MethodSignatures.
16325
16326         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16327         clear the "pending" bit if we find that there are problems with
16328         the declaration.
16329
16330         (TypeContainer.VerifyPendingMethods): Update to report errors of
16331         methods that look like implementations but are not.
16332
16333         (TypeContainer.Define): Add support for explicit interface method
16334         implementation. 
16335
16336 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16337
16338         * typemanager.cs: Keep track of the parameters here instead of
16339         being a feature of the TypeContainer.
16340
16341         * class.cs: Drop the registration of parameters here, as
16342         InterfaceMethods are also interface declarations.
16343
16344         * delegate.cs: Register methods with the TypeManager not only with
16345         the TypeContainer.  This code was buggy.
16346
16347         * interface.cs: Full registation here.
16348
16349 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16350
16351         * expression.cs: Remove reducer for binary expressions, it can not
16352         be done this way.
16353
16354         * const.cs: Put here the code that used to go into constant.cs
16355
16356         * constant.cs: Put here the code for constants, this is a new base
16357         class for Literals.
16358
16359         * literal.cs: Make Literal derive from Constant.
16360
16361 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16362
16363         * statement.cs (Return.Emit): Report error 157 if the user
16364         attempts to return from a finally block.
16365
16366         (Return.Emit): Instead of emitting a return, jump to the end of
16367         the function.
16368
16369         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16370         LocalBuilder to store the result of the function.  ReturnLabel is
16371         the target where we jump.
16372
16373
16374 2001-12-09  Radek Doulik  <rodo@ximian.com>
16375
16376         * cs-parser.jay: remember alias in current namespace
16377
16378         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16379         namespaces
16380
16381         * class.cs (LookupAlias): lookup alias in my_namespace
16382
16383         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16384         aliases hashtable
16385         (LookupAlias): lookup alias in this and if needed in parent
16386         namespaces
16387
16388 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16389
16390         * support.cs: 
16391
16392         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16393         making things static.  I need this to avoid passing the
16394         TypeContainer when calling ParameterType.
16395
16396         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16397         that did string manipulation to compute the type and then call
16398         GetType.  Use Parameter.ParameterType instead.
16399
16400         * cs-tokenizer.cs: Consume the suffix for floating values.
16401
16402         * expression.cs (ParameterReference): figure out whether this is a
16403         reference parameter or not.  Kill an extra variable by computing
16404         the arg_idx during emission.
16405
16406         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16407         function that returns whether a parameter is an out/ref value or not.
16408
16409         (Parameter.ParameterType): The type of the parameter (base,
16410         without ref/out applied).
16411
16412         (Parameter.Resolve): Perform resolution here.
16413         (Parameter.ExternalType): The full type (with ref/out applied).
16414
16415         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16416         support for expressions on the using statement.
16417
16418 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16419
16420         * statement.cs (Using.EmitLocalVariableDecls): Split the
16421         localvariable handling of the using statement.
16422
16423         (Block.EmitMeta): Keep track of variable count across blocks.  We
16424         were reusing slots on separate branches of blocks.
16425
16426         (Try.Emit): Emit the general code block, we were not emitting it. 
16427
16428         Check the type of the declaration to be an IDisposable or
16429         something that can be implicity converted to it. 
16430
16431         Emit conversions if required.
16432
16433         * ecore.cs (EmptyExpression): New utility class.
16434         (Expression.ImplicitConversionExists): New utility function.
16435
16436 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16437
16438         * statement.cs (Using): Implement.
16439
16440         * expression.cs (LocalVariableReference): Support read only variables.
16441
16442         * statement.cs: Remove the explicit emit for the Leave opcode.
16443         (VariableInfo): Add a readonly field.
16444
16445 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16446
16447         * ecore.cs (ConvCast): new class used to encapsulate the various
16448         explicit integer conversions that works in both checked and
16449         unchecked contexts.
16450
16451         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16452         properly generate the overflow opcodes.
16453
16454 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16455
16456         * statement.cs: The correct type for the EmptyExpression is the
16457         element_type, not the variable type.  Ravi pointed this out.
16458
16459 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16460
16461         * class.cs (Method::Define): Handle PInvoke methods specially
16462         by using DefinePInvokeMethod instead of the usual one.
16463
16464         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16465         above to do the task of extracting information and defining the method.
16466
16467 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16468
16469         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16470         of the condition for string type.
16471
16472         (Emit): Move that here. 
16473
16474         (ArrayCreation::CheckIndices): Keep string literals in their expression
16475         form.
16476
16477         (EmitDynamicInitializers): Handle strings appropriately.
16478
16479 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16480
16481         * codegen.cs (EmitContext): Replace multiple variables with a
16482         single pointer to the current Switch statement.
16483
16484         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16485         EmitContext.
16486
16487 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16488
16489         * statement.cs 
16490
16491         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16492         default'.
16493
16494         (Foreach.Emit): Foreach on arrays was not setting
16495         up the loop variables (for break/continue).
16496
16497         (GotoCase): Semi-implented.
16498
16499 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16500
16501         * attribute.cs (CheckAttribute): Handle system attributes by using
16502         Attribute.GetAttributes to examine information we need.
16503
16504         (GetValidPlaces): Same here.
16505
16506         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16507
16508         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16509
16510         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16511
16512         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16513
16514         (Method::Emit): Handle the case when we are a PInvoke method.
16515
16516 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16517
16518         * expression.cs: Use ResolveWithSimpleName on compound names.
16519
16520 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16521
16522         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16523         before trying to reduce it.
16524
16525         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16526
16527         * constant.cs (LookupConstantValue): Implement.
16528
16529         (EmitConstant): Use the above in emitting the constant.
16530
16531         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16532         that are user-defined by doing a LookupConstantValue on them.
16533
16534         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16535         too, like above.
16536
16537 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16538
16539         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16540
16541         (BaseAccess.DoResolve): Implement.
16542
16543         (MemberAccess.DoResolve): Split this routine into a
16544         ResolveMemberAccess routine that can be used independently
16545
16546 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16547
16548         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16549         As that share bits of the implementation.  Is returns a boolean,
16550         while As returns the Type that is being probed.
16551
16552 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16553
16554         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16555         instead of a Literal - much easier.
16556
16557         (EnumInTransit): Remove - utterly useless :-)
16558
16559         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16560
16561         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16562
16563         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16564         chain when we have no associated expression.
16565
16566 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16567
16568         * constant.cs (Define): Use Location while reporting the errror.
16569
16570         Also emit a warning when 'new' is used and there is no inherited
16571         member to hide.
16572
16573         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16574         populated.
16575
16576         (LookupEnumValue): Implement to lookup an enum member's value and define it
16577         if necessary.
16578
16579         (Populate): Re-write accordingly to use the above routine.
16580
16581 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16582
16583         * expression.cs (This): Fix prototype for DoResolveLValue to
16584         override the base class DoResolveLValue.
16585
16586         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16587         declarations) 
16588
16589         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16590         (we need to load the address of the field here).  This fixes
16591         test-22. 
16592
16593         (FieldExpr.DoResolveLValue): Call the DoResolve
16594         function to initialize the Instance expression.
16595
16596         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16597         correctly the GetEnumerator operation on a value type.
16598
16599         * cs-parser.jay: Add more simple parsing error catches.
16600
16601         * statement.cs (Switch): Add support for string switches.
16602         Handle null specially.
16603
16604         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16605
16606 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16607
16608         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16609
16610         (declare_local_constant): New helper function.
16611
16612         * statement.cs (AddConstant): Keep a separate record of constants
16613
16614         (IsConstant): Implement to determine if a variable is a constant.
16615
16616         (GetConstantExpression): Implement.
16617
16618         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16619
16620         * statement.cs (IsVariableDefined): Re-write.
16621
16622 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16623
16624         * class.cs (TypeContainer::FindMembers): Look for constants
16625         in the case when we are looking for MemberTypes.Field
16626
16627         * expression.cs (MemberAccess::DoResolve): Check that in the
16628         case we are a FieldExpr and a Literal, we are not being accessed
16629         by an instance reference.
16630
16631         * cs-parser.jay (local_constant_declaration): Implement.
16632
16633         (declaration_statement): Implement for constant declarations.
16634
16635 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16636
16637         * statement.cs (Switch): Catch double defaults.
16638
16639         (Switch): More work on the switch() statement
16640         implementation.  It works for integral values now, need to finish
16641         string support.
16642
16643
16644 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16645
16646         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16647         integer literals into other integer literals.  To be used by
16648         switch. 
16649
16650 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16651
16652         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16653         some memory.
16654
16655         (EmitDynamicInitializers): Cope with the above since we extract data
16656         directly from ArrayData now.
16657
16658         (ExpectInitializers): Keep track of whether initializers are mandatory
16659         or not.
16660
16661         (Bounds): Make it a hashtable to prevent the same dimension being 
16662         recorded for every element in that dimension.
16663
16664         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16665         from being found.
16666
16667         Also fix bug which was causing the indices to be emitted in the reverse
16668         order.
16669
16670 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16671
16672         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16673         unfinished.  They do not work, because the underlying code is
16674         sloppy.
16675
16676 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16677
16678         * cs-parser.jay: Remove bogus fixme.
16679
16680         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16681         on Switch statement.
16682
16683 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16684
16685         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16686         the same. 
16687
16688         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16689         parameter. Apparently, any expression is allowed. 
16690
16691         (ValidateInitializers): Update accordingly.
16692
16693         (CheckIndices): Fix some tricky bugs thanks to recursion.
16694
16695         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16696         I was being completely brain-dead.
16697
16698         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16699         and re-write acordingly.
16700
16701         (DelegateInvocation): Re-write accordingly.
16702
16703         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16704
16705         (MakeByteBlob): Handle types more correctly.
16706
16707         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16708         initialization from expressions but it is incomplete because I am a complete
16709         Dodo :-|
16710
16711 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16712
16713         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16714         on If.  Basically, we have to return `true' (ie, we do return to
16715         our caller) only if both branches of the if return.
16716
16717         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16718         short-circuit operators, handle them as short circuit operators. 
16719
16720         (Cast.DoResolve): Resolve type.
16721         (Cast.Cast): Take an expression as the target type.
16722
16723         * cs-parser.jay (cast_expression): Remove old hack that only
16724         allowed a limited set of types to be handled.  Now we take a
16725         unary_expression and we resolve to a type during semantic
16726         analysis.
16727
16728         Use the grammar productions from Rhys to handle casts (this is
16729         not complete like Rhys syntax yet, we fail to handle that corner
16730         case that C# has regarding (-x), but we will get there.
16731
16732 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16733
16734         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16735         field which is an array type.
16736
16737         * cs-parser.jay (declare_local_variables): Support array initialization too.
16738
16739         * typemanager.cs (MakeKey): Implement.
16740
16741         (everywhere): Use the above appropriately.
16742
16743         * cs-parser.jay (for_statement): Update for array initialization while
16744         declaring variables.
16745
16746         * ecore.cs : The error message was correct, it's the variable's names that
16747         were misleading ;-) Make the code more readable.
16748
16749         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16750         the correct type etc.
16751
16752         (ConvertExplicit): Handle Enum types by examining the underlying type.
16753
16754 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16755
16756         * parameter.cs (GetCallingConvention): Always return
16757         CallingConventions.Standard for now.
16758
16759 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16760
16761         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16762         and `r' after calling DoNumericPromotions.
16763
16764         * ecore.cs: Fix error message (the types were in the wrong order).
16765
16766         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16767         BindingFlags.Instance as well 
16768
16769         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16770         implicit int literal conversion in an empty cast so that we
16771         propagate the right type upstream.
16772
16773         (UnboxCast): new class used to unbox value types.
16774         (Expression.ConvertExplicit): Add explicit type conversions done
16775         by unboxing.
16776
16777         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16778         the target type before applying the implicit LongLiterals to ULong
16779         literal cast.
16780
16781 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16782
16783         * cs-parser.jay (for_statement): Reworked the way For works: now
16784         we declare manually any variables that are introduced in
16785         for_initializer to solve the problem of having out-of-band code
16786         emition (that is what got for broken).
16787
16788         (declaration_statement): Perform the actual variable declaration
16789         that used to be done in local_variable_declaration here.
16790
16791         (local_variable_declaration): Do not declare anything, just pass
16792         the information on a DictionaryEntry
16793
16794 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16795
16796         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16797         re-write of the logic to now make it recursive.
16798
16799         (UpdateIndices): Re-write accordingly.
16800
16801         Store element data in a separate ArrayData list in the above methods.
16802
16803         (MakeByteBlob): Implement to dump the array data into a byte array.
16804
16805 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16806
16807         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16808         into CheckIndices.
16809
16810         * constant.cs (Define): Implement.
16811
16812         (EmitConstant): Re-write fully.
16813
16814         Pass in location info.
16815
16816         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16817         respectively.
16818
16819         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16820         DictionaryEntry since we need location info too.
16821
16822         (constant_declaration): Update accordingly.
16823
16824         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16825         code into another method : UpdateIndices.
16826
16827 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16828
16829         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16830         some type checking etc.
16831
16832 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16833
16834         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16835         bits to provide dimension info if the user skips doing that.
16836
16837         Update second constructor to store the rank correctly.
16838
16839 2001-11-16  Ravi Pratap  <ravi@ximian.com>
16840
16841         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16842         and try to implement.
16843
16844         * ../errors/cs0150.cs : Add.
16845
16846         * ../errors/cs0178.cs : Add.
16847
16848 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16849
16850         * statement.cs: Implement foreach on multi-dimensional arrays. 
16851
16852         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16853         name of the params argument.
16854
16855         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16856         initializing the array.
16857
16858         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16859         we can use this elsewhere.
16860
16861         * statement.cs: Finish implementation of foreach for single
16862         dimension arrays.
16863
16864         * cs-parser.jay: Use an out-of-band stack to pass information
16865         around, I wonder why I need this.
16866
16867         foreach_block: Make the new foreach_block the current_block.
16868
16869         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16870         function used to return a static Parameters structure.  Used for
16871         empty parameters, as those are created very frequently.
16872
16873         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16874
16875 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16876
16877         * interface.cs : Default modifier is private, not public. The
16878         make verify test passes again.
16879
16880 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16881
16882         * support.cs (ReflectionParameters): Fix logic to determine
16883         whether the last parameter is a params one. Test 9 passes again.
16884
16885         * delegate.cs (Populate): Register the builders we define with
16886         RegisterParameterForBuilder. Test 19 passes again.
16887
16888         * cs-parser.jay (property_declaration): Reference $6 instead
16889         of $$ to get at the location.
16890
16891         (indexer_declaration): Similar stuff.
16892
16893         (attribute): Ditto.
16894
16895         * class.cs (Property): Register parameters for the Get and Set methods
16896         if they exist. Test 23 passes again.
16897
16898         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
16899         call to EmitArguments as we are sure there aren't any params arguments. 
16900         Test 32 passes again.
16901
16902         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
16903         IndexOutOfRangeException. 
16904
16905         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
16906         Test 33 now passes again.
16907
16908 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
16909
16910         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
16911         broke a bunch of things.  Will have to come up with a better way
16912         of tracking locations.
16913
16914         * statement.cs: Implemented foreach for single dimension arrays.
16915
16916 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16917
16918         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
16919         an error.  This removes the lookup from the critical path.
16920
16921         * cs-parser.jay: Removed use of temporary_loc, which is completely
16922         broken. 
16923
16924 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
16925
16926         * support.cs (ReflectionParameters.ParameterModifier): Report
16927         whether the argument is a PARAMS argument or not.
16928
16929         * class.cs: Set the attribute `ParamArrayAttribute' on the
16930         parameter argument.
16931
16932         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
16933         and cons_param_array_attribute (ConstructorInfo for
16934         ParamArrayAttribute)., 
16935
16936         * codegen.cs: Emit the return using the `Return' statement, that
16937         way we can report the error correctly for missing return values. 
16938
16939         * class.cs (Method.Emit): Clean up.
16940
16941         * expression.cs (Argument.Resolve): Take another argument: the
16942         location where this argument is used.  Notice that this is not
16943         part of the "Argument" class as to reduce the size of the
16944         structure (we know the approximate location anyways).
16945
16946         Test if the argument is a variable-reference, if not, then
16947         complain with a 206.
16948
16949         (Argument.Emit): Emit addresses of variables.
16950
16951         (Argument.FullDesc): Simplify.
16952
16953         (Invocation.DoResolve): Update for Argument.Resolve.
16954
16955         (ElementAccess.DoResolve): ditto.
16956
16957         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
16958         method should be virtual, as this method is always virtual.
16959
16960         (NewDelegate.DoResolve): Update for Argument.Resolve.
16961
16962         * class.cs (ConstructorInitializer.DoResolve): ditto.
16963
16964         * attribute.cs (Attribute.Resolve): ditto.
16965
16966 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
16967
16968         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
16969
16970         * expression.cs (ParameterReference): Drop IStackStorage and implement
16971         IAssignMethod instead. 
16972
16973         (LocalVariableReference): ditto.
16974
16975         * ecore.cs (FieldExpr): Drop IStackStorage and implement
16976         IAssignMethod instead. 
16977
16978 2001-11-13  Miguel de Icaza <miguel@ximian.com>
16979
16980         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
16981         enumerations that are used in heavily used structures derive from
16982         byte in a laughable and pathetic attempt to reduce memory usage.
16983         This is the kind of pre-optimzations that you should not do at
16984         home without adult supervision.
16985
16986         * expression.cs (UnaryMutator): New class, used to handle ++ and
16987         -- separatedly from the other unary operators.  Cleans up the
16988         code, and kills the ExpressionStatement dependency in Unary.
16989
16990         (Unary): Removed `method' and `Arguments' from this class, making
16991         it smaller, and moving it all to SimpleCall, so I can reuse this
16992         code in other locations and avoid creating a lot of transient data
16993         strucutres when not required.
16994
16995         * cs-parser.jay: Adjust for new changes.
16996
16997 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
16998
16999         * enum.cs (Enum.Populate): If there is a failure during
17000         definition, return
17001
17002         * cs-parser.jay (opt_enum_base): we used to catch type errors
17003         here, but this is really incorrect.  The type error should be
17004         catched during semantic analysis.
17005
17006 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17007
17008         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17009         current_local_parameters as expected since I, in my stupidity, had forgotten
17010         to do this :-)
17011
17012         * attribute.cs (GetValidPlaces): Fix stupid bug.
17013
17014         * class.cs (Method::Emit): Perform check on applicability of attributes.
17015
17016         (Constructor::Emit): Ditto.
17017
17018         (Field::Emit): Ditto.
17019
17020         (Field.Location): Store location information.
17021
17022         (Property, Event, Indexer, Operator): Ditto.
17023
17024         * cs-parser.jay (field_declaration): Pass in location for each field.
17025
17026         * ../errors/cs0592.cs : Add.
17027
17028 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17029
17030         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17031
17032         (InitCoreTypes): Update accordingly.
17033
17034         (RegisterAttrType, LookupAttr): Implement.
17035
17036         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17037         info about the same.
17038
17039         (Resolve): Update to populate the above as necessary.
17040
17041         (Error592): Helper.
17042
17043         (GetValidPlaces): Helper to the above.
17044
17045         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17046
17047         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17048
17049 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17050
17051         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17052
17053         * ../errors/cs0617.cs : Add.
17054
17055 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17056
17057         * enum.cs (Emit): Rename to Populate to be more consistent with what
17058         we expect it to do and when exactly it is called.
17059
17060         * class.cs, rootcontext.cs : Update accordingly.
17061
17062         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17063         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17064
17065         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17066
17067         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17068         of a fieldinfo using the above, when dealing with a FieldBuilder.
17069
17070 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17071
17072         * ../errors/cs0031.cs : Add.
17073
17074         * ../errors/cs1008.cs : Add.
17075
17076         * ../errrors/cs0543.cs : Add.
17077
17078         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17079         enum type.
17080
17081         (FindMembers): Implement.
17082
17083         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17084         enums and delegates too.
17085
17086         (enum_types): Rename to builder_to_enum.
17087
17088         (delegate_types): Rename to builder_to_delegate.
17089
17090         * delegate.cs (FindMembers): Implement.
17091
17092 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17093
17094         * typemanager.cs (IsEnumType): Implement.
17095
17096         * enum.cs (Emit): Re-write parts to account for the underlying type
17097         better and perform checking etc.
17098
17099         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17100         of the underlying type.
17101
17102         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17103         value
17104
17105         * enum.cs (error31): Helper to report error #31.
17106
17107         * cs-parser.jay (enum_declaration): Store location of each member too.
17108
17109         * enum.cs (member_to_location): New hashtable. 
17110
17111         (AddEnumMember): Update location hashtable.
17112
17113         (Emit): Use the location of each member while reporting errors.
17114
17115 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17116
17117         * cs-parser.jay: A for_initializer if is a
17118         local_variable_declaration really ammount to have an implicit
17119         block with the variable declaration and no initializer for for.
17120
17121         * statement.cs (For.Emit): Cope with null initializers.
17122
17123         This fixes the infinite loop on for initializers.
17124
17125 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17126
17127         * enum.cs: More cleanup.
17128
17129         * ecore.cs: Remove dead code.
17130
17131         * class.cs (Property.Emit): More simplification.
17132         (Event.Emit): ditto.
17133
17134         Reworked to have less levels of indentation.
17135
17136 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17137
17138         * class.cs (Property): Emit attributes.
17139
17140         (Field): Ditto.
17141
17142         (Event): Ditto.
17143
17144         (Indexer): Ditto.
17145
17146         (Operator): Ditto.
17147
17148         * enum.cs (Emit): Ditto.
17149
17150         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17151         Enums too.
17152
17153         * class.cs (Field, Event, etc.): Move attribute generation into the
17154         Emit method everywhere.
17155
17156         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17157         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17158         as we had no way of defining nested enums !
17159
17160         * rootcontext.cs : Adjust code accordingly.
17161
17162         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17163
17164 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17165
17166         * expression.cs (EvalConstantExpression): Move into ecore.cs
17167
17168         * enum.cs (Enum): Rename some members and make them public and readonly
17169         according to our convention.
17170
17171         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17172         nothing else.
17173
17174         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17175
17176         (Enum::Emit): Write a simple version for now which doesn't try to compute
17177         expressions. I shall modify this to be more robust in just a while.
17178
17179         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17180
17181         (TypeContainer::CloseType): Create the Enum types too.
17182
17183         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17184
17185         * expression.cs (EvalConstantExpression): Get rid of completely.
17186
17187         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17188         user-defined values and other cases.
17189
17190         (IsValidEnumLiteral): Helper function.
17191
17192         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17193         out there in the case we had a literal FieldExpr.
17194
17195         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17196
17197         (Literalize): Revamp a bit to take two arguments.
17198
17199         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17200
17201 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17202
17203         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17204
17205         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17206
17207         (Resolve): Use the above to ensure we have proper initializers.
17208
17209 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17210
17211         * expression.cs (Expression::EvalConstantExpression): New method to 
17212         evaluate constant expressions.
17213
17214         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17215
17216 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17217
17218         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17219         in an array.
17220
17221         (Binary.ResolveOperator): Handle operator != (object a, object b)
17222         and operator == (object a, object b);
17223
17224         (Binary.DoNumericPromotions): Indicate whether the numeric
17225         promotion was possible.
17226
17227         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17228         Implement.  
17229
17230         Made the ArrayAccess implement interface IAssignMethod instead of
17231         IStackStore as the order in which arguments are passed reflects
17232         this.
17233
17234         * assign.cs: Instead of using expr.ExprClass to select the way of
17235         assinging, probe for the IStackStore/IAssignMethod interfaces.
17236
17237         * typemanager.cs: Load InitializeArray definition.
17238
17239         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17240         static data that can be used to initialize arrays. 
17241
17242 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17243
17244         * expression.cs: Handle operator== and operator!= for booleans.
17245
17246         (Conditioal.Reduce): Implement reducer for the ?: operator.
17247
17248         (Conditional.Resolve): Implement dead code elimination.
17249
17250         (Binary.Resolve): Catch string literals and return a new
17251         concatenated string.
17252
17253         (Unary.Reduce): Implement reduction of unary expressions.
17254
17255         * ecore.cs: Split out the expression core handling here.
17256
17257         (Expression.Reduce): New method used to perform constant folding
17258         and CSE.  This is needed to support constant-expressions. 
17259
17260         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17261         targets, and optimize for !x.
17262
17263 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17264
17265         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17266         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17267         set custom atttributes.
17268
17269         * literal.cs (Literal::GetValue): New abstract method to return the actual
17270         value of the literal, cast as an object.
17271
17272         (*Literal): Implement GetValue method.
17273
17274         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17275         expressions to the arraylist but objects of type Argument.
17276
17277         * class.cs (TypeContainer::Emit): Emit our attributes too.
17278
17279         (Method::Emit, Constructor::Emit): Ditto.
17280
17281         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17282         to be ignoring earlier.
17283
17284 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17285
17286         * attribute.cs (AttributeSection::Define): Implement to do the business
17287         of constructing a CustomAttributeBuilder.
17288
17289         (Attribute): New trivial class. Increases readability of code.  
17290
17291         * cs-parser.jay : Update accordingly.
17292
17293         (positional_argument_list, named_argument_list, named_argument): New rules
17294
17295         (attribute_arguments): Use the above so that we are more correct.
17296
17297 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17298
17299         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17300         to perform all checks for a method with a params parameter.
17301
17302         (Invocation::OverloadResolve): Update to use the above method and therefore
17303         cope correctly with params method invocations.
17304
17305         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17306         params too.
17307
17308         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17309         constructors in our parent too because we can't afford to miss out on 
17310         protected ones ;-)
17311
17312         * attribute.cs (AttributeSection): New name for the class Attribute
17313
17314         Other trivial changes to improve readability.
17315
17316         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17317         use the new class names.
17318
17319 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17320
17321         * class.cs (Method::Define): Complete definition for params types too
17322
17323         (Indexer::Define): Ditto.
17324
17325         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17326         Cope everywhere with a request for info about the array parameter.
17327
17328 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17329
17330         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17331
17332         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17333         local_variable_type to extract the string corresponding to the type.
17334
17335         (local_variable_type): Fixup the action to use the new helper method.
17336
17337         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17338         go.
17339
17340         * expression.cs : Clean out code which uses the above.
17341
17342 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17343
17344         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17345         and bale out if necessary by returning a false.
17346
17347         (RegisterProperty): Ditto.
17348
17349         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17350         and print out appropriate error messages.
17351
17352         * interface.cs (everywhere): Ditto.
17353
17354         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17355         location to constructor.
17356
17357         * class.cs (Property, Event, Indexer): Update accordingly.
17358
17359         * ../errors/cs111.cs : Added.
17360
17361         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17362         of a method, as laid down by the spec.
17363
17364         (Invocation::OverloadResolve): Use the above method.
17365
17366 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17367
17368         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17369         now take a TypeContainer and a Parameters object.
17370
17371         (ParameterData): Modify return type of ParameterModifier method to be 
17372         Parameter.Modifier and not a string.
17373
17374         (ReflectionParameters, InternalParameters): Update accordingly.
17375
17376         * expression.cs (Argument::GetParameterModifier): Same here.
17377
17378         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17379         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17380         symbol in it at all so maybe this is only for now.
17381
17382 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17383
17384         * support.cs (InternalParameters): Constructor now takes an extra argument 
17385         which is the actual Parameters class.
17386
17387         (ParameterDesc): Update to provide info on ref/out modifiers.
17388
17389         * class.cs (everywhere): Update call to InternalParameters to pass in
17390         the second argument too.
17391
17392         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17393         to return the modifier info [ref/out etc]
17394
17395         (InternalParameters, ReflectionParameters): Implement the above.
17396
17397         * expression.cs (Argument::ParameterModifier): Similar function to return
17398         info about the argument's modifiers.
17399
17400         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17401         too.
17402
17403         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17404         a new SetFormalParameters object which we pass to InternalParameters.
17405
17406 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17407
17408         * expression.cs (NewArray): Merge into the ArrayCreation class.
17409
17410 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17411
17412         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17413         NewUserdefinedArray into one as there wasn't much of a use in having
17414         two separate ones.
17415
17416         * expression.cs (Argument): Change field's name to ArgType from Type.
17417
17418         (Type): New readonly property which returns the proper type, taking into 
17419         account ref/out modifiers.
17420
17421         (everywhere): Adjust code accordingly for the above.
17422
17423         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17424         whether we are emitting for a ref or out parameter.
17425
17426         * expression.cs (Argument::Emit): Use the above field to set the state.
17427
17428         (LocalVariableReference::Emit): Update to honour the flag and emit the
17429         right stuff.
17430
17431         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17432
17433         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17434
17435         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17436
17437         (ReflectionParameters, InternalParameters): Implement the above method.
17438
17439         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17440         reporting errors.
17441
17442         (Invocation::FullMethodDesc): Ditto. 
17443
17444 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * cs-parser.jay: Add extra production for the second form of array
17447         creation. 
17448
17449         * expression.cs (ArrayCreation): Update to reflect the above
17450         change. 
17451
17452         * Small changes to prepare for Array initialization.
17453
17454 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17455
17456         * typemanager.cs (ImplementsInterface): interface might be null;
17457         Deal with this problem;
17458
17459         Also, we do store negative hits on the cache (null values), so use
17460         this instead of calling t.GetInterfaces on the type everytime.
17461
17462 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17463
17464         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17465
17466         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17467         split functionality out into different classes.
17468
17469         (New::FormArrayType): Move into NewBuiltinArray.
17470
17471         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17472         quite useless.
17473
17474         (NewBuiltinArray): New class to handle creation of built-in arrays.
17475
17476         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17477         account creation of one-dimensional arrays.
17478
17479         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17480
17481         (NewUserdefinedArray::DoResolve): Implement.
17482
17483         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17484
17485         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17486         we maintain inside the TypeManager. This is necessary to perform lookups on the
17487         module builder.
17488
17489         (LookupType): Update to perform GetType on the module builders too.     
17490
17491         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17492
17493         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17494
17495 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17496
17497         * expression.cs (New::DoResolve): Implement guts of array creation.
17498
17499         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17500
17501 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17502
17503         * expression.cs: Fix bug I introduced lsat night that broke
17504         Delegates. 
17505
17506         (Expression.Resolve): Report a 246 error (can not resolve name)
17507         if we find a SimpleName in the stream.
17508
17509         (Expression.ResolveLValue): Ditto.
17510
17511         (Expression.ResolveWithSimpleName): This function is a variant of
17512         ResolveName, this one allows SimpleNames to be returned without a
17513         warning.  The only consumer of SimpleNames is MemberAccess
17514
17515 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17516
17517         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17518         might arrive here.  I have my doubts that this is correct.
17519
17520         * statement.cs (Lock): Implement lock statement.
17521
17522         * cs-parser.jay: Small fixes to support `lock' and `using'
17523
17524         * cs-tokenizer.cs: Remove extra space
17525
17526         * driver.cs: New flag --checked, allows to turn on integer math
17527         checking. 
17528
17529         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17530         Threading.Monitor.Exit 
17531
17532 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17533
17534         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17535         Expression Class to be IndexerAccess.
17536
17537         Notice that Indexer::DoResolve sets the eclass to Value.
17538
17539 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17540
17541         * class.cs (TypeContainer::Emit): Emit code for indexers.
17542
17543         * assign.cs (IAssignMethod): New interface implemented by Indexers
17544         and Properties for handling assignment.
17545
17546         (Assign::Emit): Simplify and reuse code. 
17547
17548         * expression.cs (IndexerAccess, PropertyExpr): Implement
17549         IAssignMethod, clean up old code. 
17550
17551 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17552
17553         * typemanager.cs (ImplementsInterface): New method to determine if a type
17554         implements a given interface. Provides a nice cache too.
17555
17556         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17557         method.
17558
17559         (ConvertReferenceExplicit): Ditto.
17560
17561         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17562         various methods, with correct names etc.
17563
17564         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17565         Operator.UnaryNegation.
17566
17567         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17568         we have a unary plus or minus operator.
17569
17570         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17571         UnaryMinus.
17572
17573         * everywhere : update accordingly.
17574
17575         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17576         respectively.
17577
17578         * class.cs (Method::Define): For the case where we are implementing a method
17579         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17580         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17581
17582 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17583
17584         * interface.cs (FindMembers): Implement to work around S.R.E
17585         lameness.
17586
17587         * typemanager.cs (IsInterfaceType): Implement.
17588
17589         (FindMembers): Update to handle interface types too.
17590
17591         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17592         use IsAssignableFrom as that is not correct - it doesn't work.
17593
17594         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17595         and accordingly override EmitStatement.
17596
17597         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17598         using the correct logic :-)
17599
17600 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17601
17602         * ../errors/cs-11.cs : Add to demonstrate error -11 
17603
17604 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17605
17606         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17607         then pass this as a hint to ResolveLValue.
17608
17609         * expression.cs (FieldExpr): Add Location information
17610
17611         (FieldExpr::LValueResolve): Report assignment to readonly
17612         variable. 
17613
17614         (Expression::ExprClassFromMemberInfo): Pass location information.
17615
17616         (Expression::ResolveLValue): Add new method that resolves an
17617         LValue. 
17618
17619         (Expression::DoResolveLValue): Default invocation calls
17620         DoResolve. 
17621
17622         (Indexers): New class used to keep track of indexers in a given
17623         Type. 
17624
17625         (IStackStore): Renamed from LValue, as it did not really describe
17626         what this did.  Also ResolveLValue is gone from this interface and
17627         now is part of Expression.
17628
17629         (ElementAccess): Depending on the element access type
17630
17631         * typemanager.cs: Add `indexer_name_type' as a Core type
17632         (System.Runtime.CompilerServices.IndexerNameAttribute)
17633
17634         * statement.cs (Goto): Take a location.
17635
17636 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17637
17638         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17639         if two delegates are compatible.
17640
17641         (NewDelegate::DoResolve): Update to take care of the case when
17642         we instantiate a delegate from another delegate.
17643
17644         * typemanager.cs (FindMembers): Don't even try to look up members
17645         of Delegate types for now.
17646
17647 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17648
17649         * delegate.cs (NewDelegate): New class to take care of delegate
17650         instantiation.
17651
17652         * expression.cs (New): Split the delegate related code out into 
17653         the NewDelegate class.
17654
17655         * delegate.cs (DelegateInvocation): New class to handle delegate 
17656         invocation.
17657
17658         * expression.cs (Invocation): Split out delegate related code into
17659         the DelegateInvocation class.
17660
17661 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17662
17663         * expression.cs (New::DoResolve): Implement delegate creation fully
17664         and according to the spec.
17665
17666         (New::DoEmit): Update to handle delegates differently.
17667
17668         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17669         because of which we were printing out arguments in reverse order !
17670
17671         * delegate.cs (VerifyMethod): Implement to check if the given method
17672         matches the delegate.
17673
17674         (FullDelegateDesc): Implement.
17675
17676         (VerifyApplicability): Implement.
17677
17678         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17679         delegate invocations too.
17680
17681         (Invocation::Emit): Ditto.
17682
17683         * ../errors/cs1593.cs : Added.
17684
17685         * ../errors/cs1594.cs : Added.
17686
17687         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17688
17689 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17690
17691         * typemanager.cs (intptr_type): Core type for System.IntPtr
17692
17693         (InitCoreTypes): Update for the same.
17694
17695         (iasyncresult_type, asynccallback_type): Ditto.
17696
17697         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17698         correct.
17699
17700         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17701         too.
17702
17703         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17704         the builders for the 4 members of a delegate type :-)
17705
17706         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17707         type.
17708
17709         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17710
17711         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17712
17713 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17714
17715         * statement.cs (Break::Emit): Implement.   
17716         (Continue::Emit): Implement.
17717
17718         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17719         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17720         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17721         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17722         end loop
17723
17724         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17725         properties that track the label for the current loop (begin of the
17726         loop and end of the loop).
17727
17728 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17729
17730         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17731         use of emitting anything at all.
17732
17733         * class.cs, rootcontext.cs : Get rid of calls to the same.
17734
17735         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17736
17737         (Populate): Define the constructor correctly and set the implementation
17738         attributes.
17739
17740         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17741         have been defined.
17742
17743         (AddDelegateType): Implement.
17744
17745         (IsDelegateType): Implement helper method.
17746
17747         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17748
17749         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17750         and accordingly handle it.
17751
17752         * delegate.cs (Populate): Take TypeContainer argument.
17753         Implement bits to define the Invoke method. However, I still haven't figured out
17754         how to take care of the native int bit :-(
17755
17756         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17757         Qualify the name of the delegate, not its return type !
17758
17759         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17760         conversion.
17761
17762         (StandardConversionExists): Checking for array types turns out to be recursive.
17763
17764         (ConvertReferenceExplicit): Implement array conversion.
17765
17766         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17767
17768 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17769
17770         * cs-parser.jay (delegate_declaration): Store the fully qualified
17771         name as it is a type declaration.
17772
17773         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17774         readonly.
17775
17776         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17777         as TypeContainer::DefineType.
17778
17779         (Populate): Method in which all the definition of the various methods (Invoke)
17780         etc is done.
17781
17782         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17783         see.
17784
17785         (CloseDelegate): Finally creates the delegate.
17786
17787         * class.cs (TypeContainer::DefineType): Update to define delegates.
17788         (Populate, Emit and CloseType): Do the same thing here too.
17789
17790         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17791         delegates in all these operations.
17792
17793 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17794
17795         * expression.cs: LocalTemporary: a new expression used to
17796         reference a temporary that has been created.
17797
17798         * assign.cs: Handle PropertyAccess back here, so that we can
17799         provide the proper semantic access to properties.
17800
17801         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17802         a few more explicit conversions. 
17803
17804         * modifiers.cs: `NEW' modifier maps to HideBySig.
17805
17806         * expression.cs (PropertyExpr): Make this into an
17807         ExpressionStatement, and support the EmitStatement code path. 
17808
17809         Perform get/set error checking, clean up the interface.
17810
17811         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17812         them into toplevel access objects.
17813
17814 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17815
17816         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17817         SRE.
17818
17819         * typemanager.cs: Keep track here of our PropertyBuilders again to
17820         work around lameness in SRE.
17821
17822 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17823
17824         * expression.cs (LValue::LValueResolve): New method in the
17825         interface, used to perform a second resolution pass for LValues. 
17826
17827         (This::DoResolve): Catch the use of this in static methods.
17828
17829         (This::LValueResolve): Implement.
17830
17831         (This::Store): Remove warning, assigning to `this' in structures
17832         is 
17833
17834         (Invocation::Emit): Deal with invocation of
17835         methods on value types.  We need to pass the address to structure
17836         methods rather than the object itself.  (The equivalent code to
17837         emit "this" for structures leaves the entire structure on the
17838         stack instead of a pointer to it). 
17839
17840         (ParameterReference::DoResolve): Compute the real index for the
17841         argument based on whether the method takes or not a `this' pointer
17842         (ie, the method is static).
17843
17844         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17845         value types returned from functions when we need to invoke a
17846         method on the sturcture.
17847
17848
17849 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17850
17851         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17852         defining the type in the Modulebuilder or Typebuilder. This is to take
17853         care of nested types which need to be defined on the TypeBuilder using
17854         DefineNestedMethod.
17855
17856         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17857         methods in RootContext, only ported to be part of TypeContainer.
17858
17859         (TypeContainer::GetInterfaceOrClass): Ditto.
17860
17861         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17862
17863         * interface.cs (Interface::DefineInterface): New method. Does exactly
17864         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17865         too.
17866
17867         (Interface::GetInterfaces): Move from RootContext here and port.
17868
17869         (Interface::GetInterfaceByName): Same here.
17870
17871         * rootcontext.cs (ResolveTree): Re-write.
17872
17873         (PopulateTypes): Re-write.
17874
17875         * class.cs (TypeContainer::Populate): Populate nested types too.
17876         (TypeContainer::Emit): Emit nested members too.
17877
17878         * typemanager.cs (AddUserType): Do not make use of the FullName property,
17879         instead just use the name argument passed in as it is already fully
17880         qualified.
17881
17882         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17883         to TypeContainer mapping to see if a type is user-defined.
17884
17885         * class.cs (TypeContainer::CloseType): Implement. 
17886
17887         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
17888         the default constructor.
17889
17890         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
17891         twice.
17892
17893         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
17894
17895         * interface.cs (CloseType): Create the type here.
17896
17897         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
17898         the hierarchy.
17899
17900         Remove all the methods which are now in TypeContainer.
17901
17902 2001-10-10  Ravi Pratap  <ravi@ximian.com>
17903
17904         * delegate.cs (Define): Re-write bits to define the delegate
17905         correctly.
17906
17907 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
17908
17909         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
17910
17911         * expression.cs (ImplicitReferenceConversion): handle null as well
17912         as a source to convert to any reference type.
17913
17914         * statement.cs (Return): Perform any implicit conversions to
17915         expected return type.  
17916
17917         Validate use of return statement.  
17918
17919         * codegen.cs (EmitContext): Pass the expected return type here.
17920
17921         * class.cs (Method, Constructor, Property): Pass expected return
17922         type to EmitContext.
17923
17924 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
17925
17926         * expression.cs: Make DoResolve take an EmitContext instead of a
17927         TypeContainer.
17928
17929         Replaced `l' and `location' for `loc', for consistency.
17930
17931         (Error, Warning): Remove unneeded Tc argument.
17932
17933         * assign.cs, literal.cs, constant.cs: Update to new calling
17934         convention. 
17935
17936         * codegen.cs: EmitContext now contains a flag indicating whether
17937         code is being generated in a static method or not.
17938
17939         * cs-parser.jay: DecomposeQI, new function that replaces the old
17940         QualifiedIdentifier.  Now we always decompose the assembled
17941         strings from qualified_identifier productions into a group of
17942         memberaccesses.
17943
17944 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
17945
17946         * rootcontext.cs: Deal with field-less struct types correctly now
17947         by passing the size option to Define Type.
17948
17949         * class.cs: Removed hack that created one static field. 
17950
17951 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17952
17953         * statement.cs: Moved most of the code generation here. 
17954
17955 2001-10-09  Ravi Pratap  <ravi@ximian.com>
17956
17957         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
17958         seem very right.
17959
17960         (ElementAccess): Remove useless bits for now - keep checks as the spec
17961         says.
17962
17963 2001-10-08  Ravi Pratap  <ravi@ximian.com>
17964
17965         * expression.cs (ElementAccess::DoResolve): Remove my crap code
17966         and start performing checks according to the spec.
17967
17968 2001-10-07  Ravi Pratap  <ravi@ximian.com>
17969
17970         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
17971         rank_specifiers instead.
17972
17973         (rank_specifiers): Change the order in which the rank specifiers are stored
17974
17975         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
17976
17977         * expression.cs (ElementAccess): Implement the LValue interface too.
17978
17979 2001-10-06  Ravi Pratap  <ravi@ximian.com>
17980
17981         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
17982         except that user defined conversions are not included.
17983
17984         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
17985         perform the conversion of the return type, if necessary.
17986
17987         (New::DoResolve): Check whether we are creating an array or an object
17988         and accordingly do the needful.
17989
17990         (New::Emit): Same here.
17991
17992         (New::DoResolve): Implement guts of array creation.
17993
17994         (New::FormLookupType): Helper function.
17995
17996 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17997
17998         * codegen.cs: Removed most of the code generation here, and move the
17999         corresponding code generation bits to the statement classes. 
18000
18001         Added support for try/catch/finalize and throw.
18002
18003         * cs-parser.jay: Added support for try/catch/finalize.
18004
18005         * class.cs: Catch static methods having the flags override,
18006         virtual or abstract.
18007
18008         * expression.cs (UserCast): This user cast was not really doing
18009         what it was supposed to do.  Which is to be born in fully resolved
18010         state.  Parts of the resolution were being performed at Emit time! 
18011
18012         Fixed this code.
18013
18014 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18015
18016         * expression.cs: Implicity convert the result from UserCast.
18017
18018 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18019
18020         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18021         prevented it from working correctly. 
18022
18023         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18024         merely ConvertImplicit.
18025
18026 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18027
18028         * typemanager.cs: Make the LookupTypeContainer function static,
18029         and not per-instance.  
18030
18031         * class.cs: Make static FindMembers (the one that takes a Type
18032         argument). 
18033
18034         * codegen.cs: Add EmitForeach here.
18035
18036         * cs-parser.jay: Make foreach a toplevel object instead of the
18037         inline expansion, as we need to perform semantic analysis on it. 
18038
18039 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18040
18041         * expression.cs (Expression::ImplicitUserConversion): Rename to
18042         UserDefinedConversion.
18043
18044         (Expression::UserDefinedConversion): Take an extra argument specifying 
18045         whether we look for explicit user conversions too.
18046
18047         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18048
18049         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18050
18051         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18052         with the appropriate arguments.
18053
18054         * cs-parser.jay (cast_expression): Record location too.
18055
18056         * expression.cs (Cast): Record location info.
18057
18058         (Expression::ConvertExplicit): Take location argument.
18059
18060         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18061         to determine if we are doing explicit conversions.
18062
18063         (UserCast::Emit): Update accordingly.
18064
18065         (Expression::ConvertExplicit): Report an error if everything fails.
18066
18067         * ../errors/cs0030.cs : Add.
18068
18069 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18070
18071         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18072         virtual and newslot bits. 
18073
18074         * class.cs (TypeContainer::RegisterRequiredImplementations):
18075         Record methods we need.
18076
18077         (TypeContainer::MakeKey): Helper function to make keys for
18078         MethodBases, since the Methodbase key is useless.
18079
18080         (TypeContainer::Populate): Call RegisterRequiredImplementations
18081         before defining the methods.   
18082
18083         Create a mapping for method_builders_to_methods ahead of time
18084         instead of inside a tight loop.
18085
18086         (::RequireMethods):  Accept an object as the data to set into the
18087         hashtable so we can report interface vs abstract method mismatch.
18088
18089 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18090
18091         * report.cs: Make all of it static.
18092
18093         * rootcontext.cs: Drop object_type and value_type computations, as
18094         we have those in the TypeManager anyways.
18095
18096         Drop report instance variable too, now it is a global.
18097
18098         * driver.cs: Use try/catch on command line handling.
18099
18100         Add --probe option to debug the error reporting system with a test
18101         suite. 
18102
18103         * report.cs: Add support for exiting program when a probe
18104         condition is reached.
18105
18106 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18107
18108         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18109         we do a forcible conversion regardless of type, to check if 
18110         ForceConversion returns a null.
18111
18112         (Binary::error19): Use location to report error.
18113
18114         (Unary::error23): Use location here too.
18115
18116         * ../errors/cs0019.cs : Check in.
18117
18118         * ../errors/cs0023.cs : Check in.
18119
18120         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18121         case of a non-null MethodInfo object with a length of 0 !
18122
18123         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18124         an applicable member - according to the spec :-)
18125         Also fix logic to find members in base types.
18126
18127         (Unary::ResolveOperator): Same here.
18128
18129         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18130         as I was getting thoroughly confused between this and error19 :-)
18131
18132         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18133         (::FindMostEncompassedType): Implement.
18134         (::FindMostEncompassingType): Implement.
18135         (::StandardConversionExists): Implement.
18136
18137         (UserImplicitCast): Re-vamp. We now need info about most specific
18138         source and target types so that we can do the necessary conversions.
18139
18140         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18141         mathematical union with no duplicates.
18142
18143 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18144
18145         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18146         in order from base classes to child classes, so that we can in
18147         child classes look up in our parent for method names and
18148         attributes (required for handling abstract, virtual, new, override
18149         constructs: we need to instrospect our base class, and if we dont
18150         populate the classes in order, the introspection might be
18151         incorrect.  For example, a method could query its parent before
18152         the parent has any methods and would determine that the parent has
18153         no abstract methods (while it could have had them)).
18154
18155         (RootContext::CreateType): Record the order in which we define the
18156         classes.
18157
18158 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18159
18160         * class.cs (TypeContainer::Populate): Also method definitions can
18161         fail now, keep track of this.
18162
18163         (TypeContainer::FindMembers): Implement support for
18164         DeclaredOnly/noDeclaredOnly flag.
18165
18166         (Constructor::Emit) Return the ConstructorBuilder.
18167
18168         (Method::Emit) Return the MethodBuilder. 
18169         Check for abstract or virtual methods to be public.
18170
18171         * rootcontext.cs (RootContext::CreateType): Register all the
18172         abstract methods required for the class to be complete and the
18173         interface methods that must be implemented. 
18174
18175         * cs-parser.jay: Report error 501 (method requires body if it is
18176         not marked abstract or extern).
18177
18178         * expression.cs (TypeOf::Emit): Implement.
18179
18180         * typemanager.cs: runtime_handle_type, new global type.
18181
18182         * class.cs (Property::Emit): Generate code for properties.
18183
18184 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18185
18186         * expression.cs (Unary::ResolveOperator): Find operators on base type
18187         too - we now conform exactly to the spec.
18188
18189         (Binary::ResolveOperator): Same here.
18190
18191         * class.cs (Operator::Define): Fix minor quirk in the tests.
18192
18193         * ../errors/cs0215.cs : Added.
18194
18195         * ../errors/cs0556.cs : Added.
18196
18197         * ../errors/cs0555.cs : Added.
18198
18199 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18200
18201         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18202         single integer which is really efficient
18203
18204 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18205
18206         *  expression.cs (Expression::ImplicitUserConversion): Use location
18207         even in the case when we are examining True operators.
18208  
18209         * class.cs (Operator::Define): Perform extensive checks to conform
18210         with the rules for operator overloading in the spec.
18211
18212         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18213         some of the other conversions mentioned in the spec.
18214
18215         * typemanager.cs (array_type): New static member for the System.Array built-in
18216         type.
18217
18218         (cloneable_interface): For System.ICloneable interface.
18219
18220         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18221         we start resolving the tree and populating types.
18222
18223         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18224  
18225 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18226
18227         * expression.cs (Expression::ExprClassFromMemberInfo,
18228         Expression::Literalize): Create literal expressions from
18229         FieldInfos which are literals.
18230
18231         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18232         type casts, because they were wrong.  The test suite in tests
18233         caught these ones.
18234
18235         (ImplicitNumericConversion): ushort to ulong requires a widening
18236         cast. 
18237
18238         Int32 constant to long requires widening cast as well.
18239
18240         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18241         for integers because the type on the stack is not i4.
18242
18243 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18244
18245         * expression.cs (report118): require location argument. 
18246
18247         * parameter.cs: Do not dereference potential null value.
18248
18249         * class.cs: Catch methods that lack the `new' keyword when
18250         overriding a name.  Report warnings when `new' is used without
18251         anything being there to override.
18252
18253         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18254
18255         * class.cs: Only add constructor to hashtable if it is non-null
18256         (as now constructors can fail on define).
18257
18258         (TypeManager, Class, Struct): Take location arguments.
18259
18260         Catch field instance initialization in structs as errors.
18261
18262         accepting_filter: a new filter for FindMembers that is static so
18263         that we dont create an instance per invocation.
18264
18265         (Constructor::Define): Catch errors where a struct constructor is
18266         parameterless 
18267
18268         * cs-parser.jay: Pass location information for various new
18269         constructs. 
18270
18271         * delegate.cs (Delegate): take a location argument.
18272
18273         * driver.cs: Do not call EmitCode if there were problesm in the
18274         Definition of the types, as many Builders wont be there. 
18275
18276         * decl.cs (Decl::Decl): Require a location argument.
18277
18278         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18279         into integers, and find the most appropiate integer for it.
18280
18281         * literal.cs: Implement ULongLiteral.
18282
18283         * rootcontext.cs: Provide better information about the location of
18284         failure when CreateType fails.
18285
18286 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18287
18288         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18289         as well.
18290
18291         * expression.cs (Binary::CheckShiftArguments): Add missing type
18292         computation.
18293         (Binary::ResolveOperator): Add type to the logical and and logical
18294         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18295         before.
18296
18297         (Binary::DoNumericPromotions): In the case where either argument
18298         is ulong (and most signed types combined with ulong cause an
18299         error) perform implicit integer constant conversions as well.
18300
18301 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18302
18303         * expression.cs (UserImplicitCast): Method should always be
18304         non-null. 
18305         (Invocation::BetterConversion): Simplified test for IntLiteral.
18306
18307         (Expression::ImplicitNumericConversion): Split this routine out.
18308         Put the code that performs implicit constant integer conversions
18309         here. 
18310
18311         (Expression::Resolve): Become a wrapper around DoResolve so we can
18312         check eclass and type being set after resolve.
18313
18314         (Invocation::Badness): Remove this dead function
18315
18316         (Binary::ResolveOperator): Do not compute the expensive argumnets
18317         unless we have a union for it.
18318
18319         (Probe::Emit): Is needs to do an isinst and then
18320         compare against null.
18321
18322         (::CanConvert): Added Location argument.  If the Location argument
18323         is null (Location.Null), then we do not report errors.  This is
18324         used by the `probe' mechanism of the Explicit conversion.  We do
18325         not want to generate an error for something that the user
18326         explicitly requested to be casted.  But the pipeline for an
18327         explicit cast first tests for potential implicit casts.
18328
18329         So for now, if the Location is null, it means `Probe only' to
18330         avoid adding another argument.   Might have to revise this
18331         strategy later.
18332
18333         (ClassCast): New class used to type cast objects into arbitrary
18334         classes (used in Explicit Reference Conversions).
18335
18336         Implement `as' as well.
18337
18338         Reverted all the patches from Ravi below: they were broken:
18339
18340                 * The use of `level' as a mechanism to stop recursive
18341                   invocations is wrong.  That was there just to catch the
18342                   bug with a strack trace but not as a way of addressing
18343                   the problem.
18344
18345                   To fix the problem we have to *understand* what is going
18346                   on and the interactions and come up with a plan, not
18347                   just get things going.
18348
18349                 * The use of the type conversion cache that I proposed
18350                   last night had an open topic: How does this work across
18351                   protection domains.  A user defined conversion might not
18352                   be public in the location where we are applying the
18353                   conversion, a different conversion might be selected
18354                   (ie, private A->B (better) but public B->A (worse),
18355                   inside A, A->B applies, but outside it, B->A will
18356                   apply).
18357
18358                 * On top of that (ie, even if the above is solved),
18359                   conversions in a cache need to be abstract.  Ie, `To
18360                   convert from an Int to a Short use an OpcodeCast', not
18361                   `To convert from an Int to a Short use the OpcodeCast on
18362                   the variable 5' (which is what this patch was doing).
18363
18364 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18365
18366         * expression.cs (Invocation::ConversionExists): Re-write to use
18367         the conversion cache
18368
18369         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18370         cache all conversions done, not just user-defined ones.
18371
18372         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18373         to determine if a conversion exists instead of acutually trying to 
18374         perform the conversion. It's faster too.
18375
18376         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18377         and only then attempt the implicit conversion.
18378
18379 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18380
18381         * expression.cs (ConvertImplicit): Use a cache for conversions
18382         already found. Check level of recursion and bail out if necessary.
18383
18384 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18385
18386         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18387         Export standard methods that we expect for string operations.
18388
18389         * statement.cs (Block::UsageWarning): Track usage of variables and
18390         report the errors for not used variables.
18391
18392         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18393         operator. 
18394
18395 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18396
18397         * codegen.cs: remove unnneded code 
18398
18399         * expression.cs: Removed BuiltinTypeAccess class
18400
18401         Fix the order in which implicit conversions are
18402         done.  
18403
18404         The previous fixed dropped support for boxed conversions (adding a
18405         test to the test suite now)
18406
18407         (UserImplicitCast::CanConvert): Remove test for source being null,
18408         that code is broken.  We should not feed a null to begin with, if
18409         we do, then we should track the bug where the problem originates
18410         and not try to cover it up here.
18411
18412         Return a resolved expression of type UserImplicitCast on success
18413         rather than true/false.  Ravi: this is what I was talking about,
18414         the pattern is to use a static method as a "constructor" for
18415         objects. 
18416
18417         Also, do not create arguments until the very last minute,
18418         otherwise we always create the arguments even for lookups that
18419         will never be performed. 
18420
18421         (UserImplicitCast::Resolve): Eliminate, objects of type
18422         UserImplicitCast are born in a fully resolved state. 
18423
18424         * typemanager.cs (InitCoreTypes): Init also value_type
18425         (System.ValueType). 
18426
18427         * expression.cs (Cast::Resolve): First resolve the child expression.
18428
18429         (LValue): Add new method AddressOf to be used by
18430         the `&' operator.  
18431
18432         Change the argument of Store to take an EmitContext instead of an
18433         ILGenerator, because things like FieldExpr need to be able to call
18434         their children expression to generate the instance code. 
18435
18436         (Expression::Error, Expression::Warning): Sugar functions for
18437         reporting errors.
18438
18439         (Expression::MemberLookup): Accept a TypeContainer instead of a
18440         Report as the first argument.
18441
18442         (Expression::ResolvePrimary): Killed.  I still want to improve
18443         this as currently the code is just not right.
18444
18445         (Expression::ResolveMemberAccess): Simplify, but it is still
18446         wrong. 
18447
18448         (Unary::Resolve): Catch errors in AddressOf operators.
18449
18450         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18451         index to a byte for the short-version, or the compiler will choose
18452         the wrong Emit call, which generates the wrong data.
18453
18454         (ParameterReference::Emit, ::Store): same.
18455
18456         (FieldExpr::AddressOf): Implement.
18457
18458         * typemanager.cs: TypeManager: made public variable instead of
18459         property.
18460
18461         * driver.cs: document --fatal.
18462
18463         * report.cs (ErrorMessage, WarningMessage): new names for the old
18464         Error and Warning classes.
18465
18466         * cs-parser.jay (member_access): Turn built-in access to types
18467         into a normal simplename
18468
18469 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18470
18471         * expression.cs (Invocation::BetterConversion): Fix to cope
18472         with q being null, since this was introducing a bug.
18473
18474         * expression.cs (ConvertImplicit): Do built-in conversions first.
18475
18476 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18477
18478         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18479
18480 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18481
18482         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18483         I had introduced long ago (what's new ?).
18484
18485         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18486         the work of all the checking. 
18487         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18488         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18489
18490         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18491         that is the right way. 
18492
18493         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18494         overloading resolution. Use everywhere instead of cutting and pasting code.
18495
18496         (Binary::ResolveOperator): Use MakeUnionSet.
18497
18498         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18499         we have to convert to bool types. Not complete yet.
18500
18501 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18502
18503         * typemanager.cs (TypeManager::CSharpName): support ushort.
18504
18505         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18506         to provide an expression that performsn an implicit constant int
18507         conversion (section 6.1.6).
18508         (Expression::ConvertImplicitRequired): Reworked to include
18509         implicit constant expression conversions.
18510
18511         (Expression::ConvertNumericExplicit): Finished.
18512
18513         (Invocation::Emit): If InstanceExpression is null, then it means
18514         that we perform a call on this.
18515
18516 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18517
18518         * expression.cs (Unary::Emit): Remove some dead code.
18519         (Probe): Implement Resolve and Emit for `is'.
18520         (Expression::ConvertImplicitRequired): Attempt to do constant
18521         expression conversions here.  Maybe should be moved to
18522         ConvertImplicit, but I am not sure.
18523         (Expression::ImplicitLongConstantConversionPossible,
18524         Expression::ImplicitIntConstantConversionPossible): New functions
18525         that tell whether is it possible to apply an implicit constant
18526         expression conversion.
18527
18528         (ConvertNumericExplicit): Started work on explicit numeric
18529         conversions.
18530
18531         * cs-parser.jay: Update operator constants.
18532
18533         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18534         (Parameters::GetSignature): Hook up VerifyArgs here.
18535         (Parameters::VerifyArgs): Verifies that no two arguments have the
18536         same name. 
18537
18538         * class.cs (Operator): Update the operator names to reflect the
18539         ones that the spec expects (as we are just stringizing the
18540         operator names).
18541
18542         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18543         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18544         previous usage did only work for our methods.
18545         (Expression::ConvertImplicit): Handle decimal implicit numeric
18546         conversions as well.
18547         (Expression::InternalTypeConstructor): Used to invoke constructors
18548         on internal types for default promotions.
18549
18550         (Unary::Emit): Implement special handling for the pre/post
18551         increment/decrement for overloaded operators, as they need to have
18552         the same semantics as the other operators.
18553
18554         (Binary::ResolveOperator): ditto.
18555         (Invocation::ConversionExists): ditto.
18556         (UserImplicitCast::Resolve): ditto.
18557
18558 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18559
18560         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18561         operator, return after emitting body. Regression tests pass again !
18562
18563         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18564         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18565         (Invocation::OverloadResolve): Ditto.
18566         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18567
18568         * everywhere : update calls to the above methods accordingly.
18569
18570 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18571
18572         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18573
18574         * expression.cs (ExpressionStatement): New base class used for
18575         expressions that can appear in statements, so that we can provide
18576         an alternate path to generate expression that do not leave a value
18577         on the stack.
18578
18579         (Expression::Emit, and all the derivatives): We no longer return
18580         whether a value is left on the stack or not.  Every expression
18581         after being emitted leaves a single value on the stack.
18582
18583         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18584         facilties of ExpressionStatement if possible.
18585
18586         * cs-parser.jay: Update statement_expression.
18587
18588 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18589
18590         * driver.cs: Change the wording of message
18591
18592 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18593
18594         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18595         the type of the expression to the return type of the method if
18596         we have an overloaded operator match ! The regression tests pass again !
18597         (Unary::ResolveOperator): Ditto.
18598
18599         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18600         to find "op_Implicit", not "implicit" ;-)
18601         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18602         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18603
18604         * everywhere : Correct calls to the above accordingly.
18605
18606         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18607         (ConvertImplicit): Do user-defined conversion if it exists.
18608
18609 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18610
18611         * assign.cs: track location.
18612         (Resolve): Use implicit conversions on assignment.
18613
18614         * literal.cs: Oops.  Not good, Emit of short access values should
18615         pass (Bytes) or the wrong argument will be selected.
18616
18617         * expression.cs (Unary::Emit): Emit code for -expr.
18618
18619         (Unary::ResolveOperator): Handle `Substract' for non-constants
18620         (substract from zero from the non-constants).
18621         Deal with Doubles as well. 
18622
18623         (Expression::ConvertImplicitRequired): New routine that reports an
18624         error if no implicit conversion exists. 
18625
18626         (Invocation::OverloadResolve): Store the converted implicit
18627         expressions if we make them
18628
18629 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18630
18631         * class.cs (ConstructorInitializer): Take a Location argument.
18632         (ConstructorBaseInitializer): Same here.
18633         (ConstructorThisInitializer): Same here.
18634
18635         * cs-parser.jay : Update all calls accordingly.
18636
18637         * expression.cs (Unary, Binary, New): Take location argument.
18638         Update accordingly everywhere.
18639
18640         * cs-parser.jay : Update all calls to the above to take a location
18641         argument.
18642
18643         * class.cs : Ditto.
18644
18645 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18646
18647         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18648         (Invocation::BetterConversion): Same here
18649         (Invocation::ConversionExists): Ditto.
18650
18651         (Invocation::ConversionExists): Implement.
18652
18653 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18654
18655         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18656         Also take an additional TypeContainer argument.
18657
18658         * All over : Pass in TypeContainer as argument to OverloadResolve.
18659
18660         * typemanager.cs (CSharpName): Update to check for the string type and return
18661         that too.
18662
18663         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18664         a given method.
18665
18666 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18667
18668         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18669         (Invocation::BetterFunction): Implement.
18670         (Invocation::BetterConversion): Implement.
18671         (Invocation::ConversionExists): Skeleton, no implementation yet.
18672
18673         Okay, things work fine !
18674
18675 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18676
18677         * typemanager.cs: declare and load enum_type, delegate_type and
18678         void_type. 
18679
18680         * expression.cs (Expression::Emit): Now emit returns a value that
18681         tells whether a value is left on the stack or not.  This strategy
18682         might be reveted tomorrow with a mechanism that would address
18683         multiple assignments.
18684         (Expression::report118): Utility routine to report mismatches on
18685         the ExprClass.
18686
18687         (Unary::Report23): Report impossible type/operator combination
18688         utility function.
18689
18690         (Unary::IsIncrementableNumber): Whether the type can be
18691         incremented or decremented with add.
18692         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18693         complemented. 
18694         (Unary::ResolveOperator): Implement ++, !, ~,
18695
18696         (Invocation::Emit): Deal with new Emit convetion.
18697
18698         * All Expression derivatives: Updated their Emit method to return
18699         whether they leave values on the stack or not.
18700
18701         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18702         stack for expressions that are statements. 
18703
18704 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18705
18706         * expression.cs (LValue): New interface.  Must be implemented by
18707         LValue objects.
18708         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18709         LValue interface.
18710
18711         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18712         interface for generating code, simplifies the code.
18713
18714 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18715
18716         * expression.cs (everywhere): Comment out return statements in ::Resolve
18717         methods to avoid the warnings.
18718
18719 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18720
18721         * driver.cs (parse): Report error 2001 if we can not open the
18722         source file.
18723
18724         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18725         not resolve it.
18726
18727         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18728         object. 
18729
18730         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18731         otherwise nested blocks end up with the same index.
18732
18733         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18734
18735         * expression.cs:  Instead of having FIXMEs in the Resolve
18736         functions, throw exceptions so it is obvious that we are facing a
18737         bug. 
18738
18739         * cs-parser.jay (invocation_expression): Pass Location information.
18740
18741         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18742         Use a basename for those routines because .NET does not like paths
18743         on them. 
18744
18745         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18746         already defined.
18747
18748 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18749
18750         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18751         are loading the correct data types (throws an exception if not).
18752         (TypeManager::InitCoreTypes): Use CoreLookupType
18753
18754         * expression.cs (Unary::ResolveOperator): return the child
18755         expression for expressions which are just +expr.
18756         (Unary::ResolveOperator): Return negative literals for -LITERAL
18757         expressions (otherwise they are Unary {Literal}).
18758         (Invocation::Badness): Take into account `Implicit constant
18759         expression conversions'.
18760
18761         * literal.cs (LongLiteral): Implement long literal class.
18762         (IntLiteral): export the `Value' of the intliteral. 
18763
18764 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18765
18766         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18767
18768         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18769         instead of 'Operator'
18770
18771         * expression.cs (Binary::ResolveOperator): Update accordingly.
18772         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18773         and 'Minus'
18774
18775         * cs-parser.jay (unary_expression): Update to use the new names.
18776
18777         * gen-treedump.cs (GetUnary): Same here.
18778
18779         * expression.cs (Unary::Resolve): Implement.
18780         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18781         operators are found instead of making noise ;-)
18782         (Unary::ResolveOperator): New method to do precisely the same thing which
18783         Binary::ResolveOperator does for Binary expressions.
18784         (Unary.method, .Arguments): Add.
18785         (Unary::OperName): Implement.   
18786         (Unary::ForceConversion): Copy and Paste !
18787
18788         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18789         a unary operator.
18790
18791         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18792         for the inbuilt operators. Only overloading works for now ;-)
18793
18794 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18795
18796         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18797         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18798
18799         * expression.cs (This::Emit): Implement. 
18800         (This::Resolve): Implement.
18801         (TypeOf:Resolve): Implement.
18802         (Expression::ResolveSimpleName): Add an implicit this to instance
18803         field references. 
18804         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18805         Bind instance variable to Field expressions.
18806         (FieldExpr::Instance): New field used to track the expression that
18807         represents the object instance.
18808         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18809         binding 
18810         (FieldExpr::Emit): Implement.
18811
18812         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18813         the last instruction contains a return opcode to avoid generating
18814         the last `ret' instruction (this generates correct code, and it is
18815         nice to pass the peverify output).
18816
18817         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18818         initializer for static and instance variables.
18819         (Constructor::Emit): Allow initializer to be null in the case of
18820         static constructors.  Only emit initializer for instance
18821         constructors. 
18822
18823         (TypeContainer::FindMembers): Return a null array if there are no
18824         matches.
18825
18826         Also fix the code for the MemberTypes.Method branch, as it was not
18827         scanning that for operators (or tried to access null variables before).
18828
18829         * assign.cs (Assign::Emit): Handle instance and static fields. 
18830
18831         * TODO: Updated.
18832
18833         * driver.cs: Stop compilation if there are parse errors.
18834
18835         * cs-parser.jay (constructor_declaration): Provide default base
18836         initializer for non-static constructors.
18837         (constructor_declarator): Do not provide a default base
18838         initializers if none was specified.
18839         Catch the fact that constructors should not have parameters.
18840
18841         * class.cs: Do not emit parent class initializers for static
18842         constructors, that should be flagged as an error.
18843
18844 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18845
18846         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18847         Move back code into TypeContainer::Populate.
18848
18849 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18850
18851         * class.cs (TypeContainer::AddConstructor): Fix the check to
18852         compare against Name, not Basename. 
18853         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18854
18855         * cs-parser.jay : Update accordingly.
18856
18857         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18858         for methods, don't forget to look into the operators too.
18859         (RegisterMethodBuilder): Helper method to take care of this for
18860         methods, constructors and operators.
18861         (Operator::Define): Completely revamp.
18862         (Operator.OperatorMethod, MethodName): New fields.
18863         (TypeContainer::Populate): Move the registering of builders into
18864         RegisterMethodBuilder.
18865         (Operator::Emit): Re-write.
18866
18867         * expression.cs (Binary::Emit): Comment out code path to emit method
18868         invocation stuff for the case when we have a user defined operator. I am
18869         just not able to get it right !
18870
18871 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18872
18873         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18874         argument. 
18875
18876         (Expression::MemberLookup): Provide a version that allows to
18877         specify the MemberTypes and BindingFlags. 
18878
18879         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18880         so it was not fetching variable information from outer blocks.
18881
18882         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18883         Beforefieldinit as it was buggy.
18884
18885         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
18886         that Ravi put here.  
18887
18888         * class.cs (Constructor::Emit): Only emit if block is not null.
18889         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
18890         deal with this by semantically definining it as if the user had
18891         done it.
18892
18893         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
18894         constructors as we now "emit" them at a higher level.
18895
18896         (TypeContainer::DefineDefaultConstructor): Used to define the
18897         default constructors if none was provided.
18898
18899         (ConstructorInitializer): Add methods Resolve and Emit. 
18900
18901         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
18902
18903 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18904
18905         * class.cs (TypeContainer::EmitDefaultConstructor): Register
18906         the default constructor builder with our hashtable for methodbuilders
18907         to methodcores.
18908
18909         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
18910         and argument_count is 0 in which case we have a match.
18911         (Binary::ResolveOperator): More null checking and miscellaneous coding
18912         style cleanup.
18913
18914 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18915
18916         * rootcontext.cs (IsNameSpace): Compare against null.
18917
18918         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
18919
18920         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
18921         and Unary::Operator.
18922
18923         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
18924         accordingly.
18925
18926         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
18927         we have overloaded operators.
18928         (Binary::ResolveOperator): Implement the part which does the operator overload
18929         resolution.
18930
18931         * class.cs (Operator::Emit): Implement.
18932         (TypeContainer::Emit): Emit the operators we have too.
18933
18934         * expression.cs (Binary::Emit): Update to emit the appropriate code for
18935         the case when we have a user-defined operator.
18936
18937 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
18940
18941 2001-09-16  Ravi Pratap  <ravi@ximian.com>
18942
18943         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
18944         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
18945         (Constructor::Emit): Implement.
18946         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
18947         if we have no work to do. 
18948         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
18949         Emit method.
18950
18951         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
18952         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
18953
18954         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
18955         of parent.parent.
18956
18957 2001-09-15  Ravi Pratap  <ravi@ximian.com>
18958
18959         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
18960         in the source.
18961         (Tree::RecordNamespace): Method to do what the name says ;-)
18962         (Tree::Namespaces): Property to get at the namespaces hashtable.
18963
18964         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
18965         keep track.
18966
18967         * rootcontext.cs (IsNamespace): Fixed it :-)
18968
18969 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18970
18971         * class.cs (TypeContainer::FindMembers): Add support for
18972         constructors. 
18973         (MethodCore): New class that encapsulates both the shared aspects
18974         of a Constructor and a Method.  
18975         (Method, Constructor): Factored pieces into MethodCore.
18976
18977         * driver.cs: Added --fatal which makes errors throw exceptions.
18978         Load System assembly as well as part of the standard library.
18979
18980         * report.cs: Allow throwing exceptions on errors for debugging.
18981
18982         * modifiers.cs: Do not use `parent', instead use the real type
18983         container to evaluate permission settings.
18984
18985         * class.cs: Put Ravi's patch back in.  He is right, and we will
18986         have to cope with the
18987
18988 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18989
18990         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
18991         FamORAssem, not FamANDAssem.
18992
18993 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18994
18995         * driver.cs: Added --parse option that only parses its input files
18996         and terminates.
18997
18998         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
18999         incorrect.  IsTopLevel is not used to tell whether an object is
19000         root_types or not (that can be achieved by testing this ==
19001         root_types).  But to see if this is a top-level *class* (not
19002         necessarly our "toplevel" container). 
19003
19004 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19005
19006         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19007         parent instead of a direct call to GetType.
19008
19009 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19010
19011         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19012         Modifiers.TypeAttr. This should just be a call to that method.
19013
19014         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19015         object so that we can determine if we are top-level or not.
19016
19017         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19018         TypeContainer too.
19019
19020         * enum.cs (Enum::Define): Ditto.
19021
19022         * modifiers.cs (FieldAttr): Re-write.
19023
19024         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19025         (TypeContainer::HaveStaticConstructor): New property to provide access
19026         to precisely that info.
19027
19028         * modifiers.cs (MethodAttr): Re-write.
19029         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19030
19031         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19032         of top-level types as claimed.
19033
19034 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19035
19036         * expression.cs (MemberLookup): Fruitless attempt to lookup
19037         constructors.  Maybe I need to emit default constructors?  That
19038         might be it (currently .NET emits this for me automatically).
19039         (Invocation::OverloadResolve): Cope with Arguments == null.
19040         (Invocation::EmitArguments): new function, shared by the new
19041         constructor and us.
19042         (Invocation::Emit): Handle static and instance methods.  Emit
19043         proper call instruction for virtual or non-virtual invocations.
19044         (New::Emit): Implement.
19045         (New::Resolve): Implement.
19046         (MemberAccess:Resolve): Implement.
19047         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19048         to track instances.
19049         (FieldExpr::Resolve): Set type.
19050
19051         * support.cs: Handle empty arguments.
19052                 
19053         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19054         SimpleLookup): Auxiliary routines to help parse a qualifier
19055         identifier.  
19056
19057         Update qualifier_identifier rule.
19058
19059         * codegen.cs: Removed debugging messages.
19060
19061         * class.cs: Make this a global thing, this acts just as a "key" to
19062         objects that we might have around.
19063
19064         (Populate): Only initialize method_builders_to_methods once.
19065
19066         * expression.cs (PropertyExpr): Initialize type from the
19067         PropertyType. 
19068
19069         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19070         Resolve pattern.  Attempt to implicitly convert value to boolean.
19071         Emit code.
19072
19073         * expression.cs: Set the type for the int32/int32 argument case.
19074         (Binary::ResolveOperator): Set the return type to boolean for
19075         comparission operators
19076
19077         * typemanager.cs: Remove debugging print code.
19078
19079         (Invocation::Resolve): resolve type.
19080
19081         * class.cs: Allocate a MemberInfo of the correct size, as the code
19082         elsewhere depends on the test to reflect the correct contents.
19083
19084         (Method::) Keep track of parameters, due to System.Reflection holes
19085
19086         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19087         mapping here.
19088
19089         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19090         of the exact size and return that.
19091
19092         (Class::LookupMethodByBuilder): New function that maps
19093         MethodBuilders to its methods.  Required to locate the information
19094         on methods because System.Reflection bit us again.
19095
19096         * support.cs: New file, contains an interface ParameterData and
19097         two implementations: ReflectionParameters and InternalParameters
19098         used to access Parameter information.  We will need to grow this
19099         as required.
19100
19101         * expression.cs (Invocation::GetParameterData): implement a cache
19102         and a wrapper around the ParameterData creation for methods. 
19103         (Invocation::OverloadResolve): Use new code.
19104
19105 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19106
19107         * class.cs (TypeContainer::EmitField): Remove and move into 
19108         (Field::Define): here and modify accordingly.
19109         (Field.FieldBuilder): New member.
19110         (TypeContainer::Populate): Update accordingly.
19111         (TypeContainer::FindMembers): Implement.
19112
19113 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19114
19115         * statement.cs: (VariableInfo::VariableType): New field to be
19116         initialized with the full type once it is resolved. 
19117
19118 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19119
19120         * parameter.cs (GetParameterInfo): Use a type cache to compute
19121         things only once, and to reuse this information
19122
19123         * expression.cs (LocalVariableReference::Emit): Implement.
19124         (OpcodeCast::Emit): fix.
19125
19126         (ParameterReference::Resolve): Implement.
19127         (ParameterReference::Emit): Implement.
19128
19129         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19130         that are expressions need to stay as Expressions.
19131
19132         * typemanager.cs (CSharpName): Returns the C# name of a type if
19133         possible. 
19134
19135         * expression.cs (Expression::ConvertImplicit): New function that
19136         implements implicit type conversions.
19137
19138         (Expression::ImplicitReferenceConversion): Implements implicit
19139         reference conversions.
19140
19141         (EmptyCast): New type for transparent casts.
19142
19143         (OpcodeCast): New type for casts of types that are performed with
19144         a sequence of bytecodes.
19145
19146         (BoxedCast): New type used for casting value types into reference
19147         types.  Emits a box opcode.
19148
19149         (Binary::DoNumericPromotions): Implements numeric promotions of
19150         and computation of the Binary::Type.
19151
19152         (Binary::EmitBranchable): Optimization.
19153
19154         (Binary::Emit): Implement code emission for expressions.
19155
19156         * typemanager.cs (TypeManager): Added two new core types: sbyte
19157         and byte.
19158
19159 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19160
19161         * class.cs (TypeContainer::FindMembers): Method which does exactly
19162         what Type.FindMembers does, only we don't have to use reflection. No
19163         implementation yet.
19164
19165         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19166         typecontainer objects as we need to get at them.
19167         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19168
19169         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19170         typecontainer object.
19171
19172         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19173         of just a Report object.
19174
19175 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19176
19177         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19178         "remove_"
19179         (TypeContainer::Populate): Now define the delegates of the type too.
19180         (TypeContainer.Delegates): Property to access the list of delegates defined
19181         in the type.
19182
19183         * delegates.cs (Delegate::Define): Implement partially.
19184
19185         * modifiers.cs (TypeAttr): Handle more flags.
19186
19187 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19188
19189         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19190         and not <=
19191         (Operator::Define): Re-write logic to get types by using the LookupType method
19192         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19193         (Indexer::Define): Ditto.
19194         (Event::Define): Ditto.
19195         (Property::Define): Ditto.
19196
19197 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19198
19199         * class.cs (TypeContainer::Populate): Now define operators too. 
19200         (TypeContainer.Operators): New property to access the list of operators
19201         in a type.
19202         (Operator.OperatorMethodBuilder): New member to hold the method builder
19203         for the operator we are defining.
19204         (Operator::Define): Implement.
19205
19206 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19207
19208         * class.cs (Event::Define): Make the prefixes of the accessor methods
19209         addOn_ and removeOn_ 
19210
19211         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19212         of the location being passed in too. Ideally, this should go later since all
19213         error reporting should be done through the Report object.
19214
19215         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19216         (Populate): Iterate thru the indexers we have and define them too.
19217         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19218         for the get and set accessors.
19219         (Indexer::Define): Implement.
19220
19221 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19222
19223         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19224         my previous implementation, did not work.
19225
19226         * typemanager.cs: Add a couple of missing types (the longs).
19227
19228         * literal.cs: Use TypeManager.bool_type instead of getting it.
19229
19230         * expression.cs (EventExpr): New kind of expressions.
19231         (Expressio::ExprClassFromMemberInfo): finish
19232
19233 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19234
19235         * assign.cs: Emit stores to static fields differently.
19236
19237 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19238
19239         * Merge in changes and adjust code to tackle conflicts. Backed out my
19240         code in Assign::Resolve ;-) 
19241
19242 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19243
19244         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19245         instead Report.Error and also pass in the location.
19246         (CSharpParser::Lexer): New readonly property to return the reference
19247         to the Tokenizer object.
19248         (declare_local_variables): Use Report.Error with location instead of plain 
19249         old error.
19250         (CheckDef): Ditto.
19251
19252         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19253         (Operator.CheckBinaryOperator): Ditto.
19254
19255         * cs-parser.jay (operator_declarator): Update accordingly.
19256
19257         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19258         (CheckBinaryOperator): Same here.
19259
19260         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19261         on the name without any prefixes of namespace names etc. This is because we
19262         already might have something already fully qualified like 
19263         'System.Console.WriteLine'
19264
19265         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19266
19267 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19268
19269         * cs-tokenizer.cs (location): Return a string which also contains
19270         the file name.
19271
19272         * expression.cs (ElementAccess): New class for expressions of the
19273         type 'element access.'
19274         (BaseAccess): New class for expressions of the type 'base access.'
19275         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19276         respectively.
19277
19278         * cs-parser.jay (element_access): Implement action.
19279         (base_access): Implement actions.
19280         (checked_expression, unchecked_expression): Implement.
19281
19282         * cs-parser.jay (local_variable_type): Correct and implement.
19283         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19284
19285         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19286
19287         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19288         name and the specifiers.
19289
19290         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19291
19292         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19293         making them all public ;-)
19294
19295         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19296         class anyways.
19297
19298 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19299
19300         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19301         PropertyExprs.
19302         (FieldExpr, PropertyExprs): New resolved expressions.
19303         (SimpleName::MemberStaticCheck): Perform static checks for access
19304         to non-static fields on static methods. Maybe this should be
19305         generalized for MemberAccesses. 
19306         (SimpleName::ResolveSimpleName): More work on simple name
19307         resolution. 
19308
19309         * cs-parser.jay (primary_expression/qualified_identifier): track
19310         the parameter index.
19311
19312         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19313         (EmitContext::EmitBoolExpression): Chain to expression generation
19314         instead of temporary hack.
19315         (::EmitStatementExpression): Put generic expression code generation.
19316
19317         * assign.cs (Assign::Emit): Implement variable assignments to
19318         local variables, parameters and fields.
19319
19320 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19321
19322         * statement.cs (Block::GetVariableInfo): New method, returns the
19323         VariableInfo for a variable name in a block.
19324         (Block::GetVariableType): Implement in terms of GetVariableInfo
19325
19326         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19327         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19328
19329 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19330
19331         * cs-parser.jay (operator_declaration): Continue on my quest : update
19332         to take attributes argument.
19333         (event_declaration): Ditto.
19334         (enum_declaration): Ditto.
19335         (indexer_declaration): Ditto.
19336
19337         * class.cs (Operator::Operator): Update constructor accordingly.
19338         (Event::Event): Ditto.
19339
19340         * delegate.cs (Delegate::Delegate): Same here.
19341
19342         * enum.cs (Enum::Enum): Same here.
19343
19344 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19345
19346         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19347
19348         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19349
19350         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19351         being passed around as an arraylist.
19352         (Attributes::AddAttribute): Method to add attribute sections.
19353
19354         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19355         (struct_declaration): Update accordingly.
19356         (constant_declaration): Update.
19357         (field_declaration): Update.
19358         (method_header): Update.
19359         (fixed_parameter): Update.
19360         (parameter_array): Ditto.
19361         (property_declaration): Ditto.
19362         (destructor_declaration): Ditto.
19363
19364         * class.cs (Struct::Struct): Update constructors accordingly.
19365         (Class::Class): Ditto.
19366         (Field::Field): Ditto.
19367         (Method::Method): Ditto.
19368         (Property::Property): Ditto.
19369         (TypeContainer::OptAttribute): update property's return type.
19370
19371         * interface.cs (Interface.opt_attributes): New member.
19372         (Interface::Interface): Update to take the extra Attributes argument.
19373
19374         * parameter.cs (Parameter::Parameter): Ditto.
19375
19376         * constant.cs (Constant::Constant): Ditto.
19377
19378         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19379         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19380         the attributes as a parameter.
19381         (InterfaceProperty): Update constructor call.
19382         (InterfaceEvent): Ditto.
19383         (InterfaceMethod): Ditto.
19384         (InterfaceIndexer): Ditto.
19385
19386         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19387         pass the attributes too.
19388         (interface_event_declaration): Ditto.
19389         (interface_property_declaration): Ditto.
19390         (interface_method_declaration): Ditto.
19391         (interface_declaration): Ditto.
19392
19393 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19394
19395         * class.cs (Method::Define): Track the "static Main" definition to
19396         create an entry point. 
19397
19398         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19399         EntryPoint if we find it. 
19400
19401         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19402         (EmitContext::ig): Make this variable public.
19403
19404         * driver.cs: Make the default output file be the first file name
19405         with the .exe extension.  
19406
19407         Detect empty compilations
19408
19409         Handle various kinds of output targets.  Handle --target and
19410         rename -t to --dumper.
19411
19412         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19413         methods inherited from Expression return now an Expression.  This
19414         will is used during the tree rewriting as we resolve them during
19415         semantic analysis.
19416
19417         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19418         the spec.  Missing entirely is the information about
19419         accessability of elements of it.
19420
19421         (Expression::ExprClassFromMemberInfo): New constructor for
19422         Expressions that creates a fully initialized Expression based on
19423         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19424         a Type.
19425
19426         (Invocation::Resolve): Begin implementing resolution of invocations.
19427
19428         * literal.cs (StringLiteral):  Implement Emit.
19429
19430 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19431
19432         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19433         member.
19434
19435 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19436
19437         * cs-parser.jay (attribute_arguments): Implement actions.
19438         (attribute): Fix bug in production. Implement action.
19439         (attribute_list): Implement.
19440         (attribute_target): Implement.
19441         (attribute_target_specifier, opt_target_specifier): Implement
19442         (CheckAttributeTarget): New method to check if the attribute target
19443         is valid.
19444         (attribute_section): Implement.
19445         (opt_attributes): Implement.
19446
19447         * attribute.cs : New file to handle attributes.
19448         (Attribute): Class to hold attribute info.
19449
19450         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19451         (attribute_section): Modify production to use 2 different rules to 
19452         achieve the same thing. 1 s/r conflict down !
19453         Clean out commented, useless, non-reducing dimension_separator rules.
19454
19455         * class.cs (TypeContainer.attributes): New member to hold list
19456         of attributes for a type.
19457         (Struct::Struct): Modify to take one more argument, the attribute list.
19458         (Class::Class): Ditto.
19459         (Field::Field): Ditto.
19460         (Method::Method): Ditto.
19461         (Property::Property): Ditto.
19462
19463         * cs-parser.jay (struct_declaration): Update constructor call to
19464         pass in the attributes too.
19465         (class_declaration): Ditto.
19466         (constant_declaration): Ditto.
19467         (field_declaration): Ditto.
19468         (method_header): Ditto.
19469         (fixed_parameter): Ditto.
19470         (parameter_array): Ditto.
19471         (property_declaration): Ditto.
19472
19473         * constant.cs (Constant::Constant): Update constructor similarly.
19474         Use System.Collections.
19475
19476         * parameter.cs (Parameter::Parameter): Update as above.
19477
19478 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19479
19480         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19481         (TypeContainer.delegates): New member to hold list of delegates.
19482
19483         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19484         this time as I seem to be on crack ;-)
19485
19486 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19487
19488         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19489         tell whether an identifier represents a namespace.
19490
19491         * expression.cs (NamespaceExpr): A namespace expression, used only
19492         temporarly during expression resolution.
19493         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19494         utility functions to resolve names on expressions.
19495
19496 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19497
19498         * codegen.cs: Add hook for StatementExpressions. 
19499
19500         * class.cs: Fix inverted test for static flag in methods.
19501
19502 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19503
19504         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19505         to make it coincide with MS' number.
19506         (Operator::CheckBinaryOperator): Ditto.
19507
19508         * ../errors/errors.txt : Remove error numbers added earlier.
19509
19510         * ../errors/cs1019.cs : Test case for error # 1019
19511
19512         * ../errros/cs1020.cs : Test case for error # 1020
19513
19514         * cs-parser.jay : Clean out commented cruft.
19515         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19516         used anywhere - non-reducing rule.
19517         (namespace_declarations): Non-reducing rule - comment out.
19518
19519         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19520         with TypeContainer::AddEnum.
19521
19522         * delegate.cs : New file for delegate handling classes.
19523         (Delegate): Class for declaring delegates.
19524
19525         * makefile : Update.
19526
19527         * cs-parser.jay (delegate_declaration): Implement.
19528
19529 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19530
19531         * class.cs (Event::Define): Implement.
19532         (Event.EventBuilder): New member.
19533
19534         * class.cs (TypeContainer::Populate): Update to define all enums and events
19535         we have.
19536         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19537         readonly fields for all these cases ?
19538
19539 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19540
19541         * class.cs (Property): Revamp to use the convention of making fields readonly.
19542         Accordingly modify code elsewhere.
19543
19544         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19545         the Define method of the Property class.
19546
19547         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19548         trivial bug.
19549         (TypeContainer::Populate): Update to define all the properties we have. Also
19550         define all enumerations.
19551
19552         * enum.cs (Define): Implement.
19553
19554 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19555
19556         * cs-parser.jay (overloadable_operator): The semantic value is an
19557         enum of the Operator class.
19558         (operator_declarator): Implement actions.
19559         (operator_declaration): Implement.
19560
19561         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19562         validity of definitions.
19563         (Operator::CheckBinaryOperator): Static method to check for binary operators
19564         (TypeContainer::AddOperator): New method to add an operator to a type.
19565
19566         * cs-parser.jay (indexer_declaration): Added line to actually call the
19567         AddIndexer method so it gets added ;-)
19568
19569         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19570         already taken care of by the MS compiler ?  
19571
19572 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19573
19574         * class.cs (Operator): New class for operator declarations.
19575         (Operator::OpType): Enum for the various operators.
19576
19577 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19578
19579         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19580         ostensibly handle this in semantic analysis.
19581
19582         * cs-parser.jay (general_catch_clause): Comment out
19583         (specific_catch_clauses, specific_catch_clause): Ditto.
19584         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19585         (catch_args, opt_catch_args): New productions.
19586         (catch_clause): Rewrite to use the new productions above
19587         (catch_clauses): Modify accordingly.
19588         (opt_catch_clauses): New production to use in try_statement
19589         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19590         and re-write the code in the actions to extract the specific and
19591         general catch clauses by being a little smart ;-)
19592
19593         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19594         Hooray, try and catch statements parse fine !
19595
19596 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19597
19598         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19599         string from the hashtable of variables.
19600
19601         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19602         I end up making that mistake ;-)
19603         (catch_clauses): Fixed gross error which made Key and Value of the 
19604         DictionaryEntry the same : $1 !!
19605
19606 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19607
19608         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19609
19610         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19611         when the add and remove accessors are specified. 
19612
19613 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19614
19615         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19616         information about indexer_declarator.
19617         (indexer_declarator): Implement actions.
19618         (parsing_indexer): New local boolean used to keep track of whether
19619         we are parsing indexers or properties. This is necessary because 
19620         implicit_parameters come into picture even for the get accessor in the 
19621         case of an indexer.
19622         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19623
19624         * class.cs (Indexer): New class for indexer declarations.
19625         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19626         (TypeContainer::indexers): New member to hold list of indexers for the
19627         type.
19628
19629 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19630
19631         * cs-parser.jay (add_accessor_declaration): Implement action.
19632         (remove_accessor_declaration): Implement action.
19633         (event_accessors_declaration): Implement
19634         (variable_declarators): swap statements for first rule - trivial.
19635
19636         * class.cs (Event): New class to hold information about event
19637         declarations.
19638         (TypeContainer::AddEvent): New method to add an event to a type
19639         (TypeContainer::events): New member to hold list of events.
19640
19641         * cs-parser.jay (event_declaration): Implement actions.
19642
19643 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19644
19645         * cs-parser.jay (dim_separators): Implement. Make it a string
19646         concatenating all the commas together, just as they appear.
19647         (opt_dim_separators): Modify accordingly
19648         (rank_specifiers): Update accordingly. Basically do the same
19649         thing - instead, collect the brackets here.
19650         (opt_rank_sepcifiers): Modify accordingly.
19651         (array_type): Modify to actually return the complete type string
19652         instead of ignoring the rank_specifiers.
19653         (expression_list): Implement to collect the expressions
19654         (variable_initializer): Implement. We make it a list of expressions
19655         essentially so that we can handle the array_initializer case neatly too.
19656         (variable_initializer_list): Implement.
19657         (array_initializer): Make it a list of variable_initializers
19658         (opt_array_initializer): Modify accordingly.
19659
19660         * expression.cs (New::NType): Add enumeration to help us
19661         keep track of whether we have an object/delegate creation
19662         or an array creation.
19663         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19664         members to hold data about array creation.
19665         (New:New): Modify to update NewType
19666         (New:New): New Overloaded contructor for the array creation
19667         case.
19668
19669         * cs-parser.jay (array_creation_expression): Implement to call
19670         the overloaded New constructor.
19671
19672 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19673
19674         * class.cs (TypeContainer::Constructors): Return member
19675         constructors instead of returning null.
19676
19677 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19678
19679         * typemanager.cs (InitCoreTypes): Initialize the various core
19680         types after we have populated the type manager with the user
19681         defined types (this distinction will be important later while
19682         compiling corlib.dll)
19683
19684         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19685         on Expression Classification.  Now all expressions have a method
19686         `Resolve' and a method `Emit'.
19687
19688         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19689         generation from working.     Also add some temporary debugging
19690         code. 
19691
19692 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19693
19694         * codegen.cs: Lots of code generation pieces.  This is only the
19695         beginning, will continue tomorrow with more touches of polish.  We
19696         handle the fundamentals of if, while, do, for, return.  Others are
19697         trickier and I need to start working on invocations soon.
19698
19699         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19700         s.InitStatement. 
19701
19702         * codegen.cs (EmitContext): New struct, used during code
19703         emission to keep a context.   Most of the code generation will be
19704         here. 
19705
19706         * cs-parser.jay: Add embedded blocks to the list of statements of
19707         this block.  So code generation proceeds in a top down fashion.
19708
19709 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19710
19711         * statement.cs: Add support for multiple child blocks.
19712
19713 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19714
19715         * codegen.cs (EmitCode): New function, will emit the code for a
19716         Block of code given a TypeContainer and its ILGenerator. 
19717
19718         * statement.cs (Block): Standard public readonly optimization.
19719         (Block::Block constructors): Link children. 
19720         (Block::Child): Child Linker.
19721         (Block::EmitVariables): Emits IL variable declarations.
19722
19723         * class.cs: Drop support for MethodGroups here, delay until
19724         Semantic Analysis.
19725         (Method::): Applied the same simplification that I did before, and
19726         move from Properties to public readonly fields.
19727         (Method::ParameterTypes): Returns the parameter types for the
19728         function, and implements a cache that will be useful later when I
19729         do error checking and the semantic analysis on the methods is
19730         performed.
19731         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19732         and made a method, optional argument tells whether this is a class
19733         or a structure to apply the `has-this' bit.
19734         (Method::GetCallingConvention): Implement, returns the calling
19735         convention. 
19736         (Method::Define): Defines the type, a second pass is performed
19737         later to populate the methods.
19738
19739         (Constructor::ParameterTypes): implement a cache similar to the
19740         one on Method::ParameterTypes, useful later when we do semantic
19741         analysis. 
19742
19743         (TypeContainer::EmitMethod):  New method.  Emits methods.
19744
19745         * expression.cs: Removed MethodGroup class from here.
19746
19747         * parameter.cs (Parameters::GetCallingConvention): new method.
19748
19749 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19750
19751         * class.cs (TypeContainer::Populate): Drop RootContext from the
19752         argument. 
19753
19754         (Constructor::CallingConvention): Returns the calling convention.
19755         (Constructor::ParameterTypes): Returns the constructor parameter
19756         types. 
19757
19758         (TypeContainer::AddConstructor): Keep track of default constructor
19759         and the default static constructor.
19760
19761         (Constructor::) Another class that starts using `public readonly'
19762         instead of properties. 
19763
19764         (Constructor::IsDefault): Whether this is a default constructor. 
19765
19766         (Field::) use readonly public fields instead of properties also.
19767
19768         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19769         track of static constructors;  If none is used, turn on
19770         BeforeFieldInit in the TypeAttributes. 
19771
19772         * cs-parser.jay (opt_argument_list): now the return can be null
19773         for the cases where there are no arguments. 
19774
19775         (constructor_declarator): If there is no implicit `base' or
19776         `this', then invoke the default parent constructor. 
19777
19778         * modifiers.cs (MethodAttr): New static function maps a set of
19779         modifiers flags into a MethodAttributes enum
19780         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19781         MethodAttr, TypeAttr to represent the various mappings where the
19782         modifiers are used.
19783         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19784
19785 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19786
19787         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19788         method arguments.
19789
19790         * interface.cs (PopulateIndexer): Implemented the code generator
19791         for interface indexers.
19792
19793 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19794
19795         * interface.cs (InterfaceMemberBase): Now we track the new status
19796         here.  
19797
19798         (PopulateProperty): Implement property population.  Woohoo!  Got
19799         Methods and Properties going today. 
19800
19801         Removed all the properties for interfaces, and replaced them with
19802         `public readonly' fields. 
19803
19804 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19805
19806         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19807         initialize their hashtables/arraylists only when they are needed
19808         instead of doing this always.
19809
19810         * parameter.cs: Handle refs and out parameters.
19811
19812         * cs-parser.jay: Use an ArrayList to construct the arguments
19813         instead of the ParameterCollection, and then cast that to a
19814         Parameter[] array.
19815
19816         * parameter.cs: Drop the use of ParameterCollection and use
19817         instead arrays of Parameters.
19818
19819         (GetParameterInfo): Use the Type, not the Name when resolving
19820         types. 
19821
19822 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19823
19824         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19825         and instead use public readonly fields.
19826
19827         * class.cs: Put back walking code for type containers.
19828
19829 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19830
19831         * class.cs (MakeConstant): Code to define constants.
19832
19833         * rootcontext.cs (LookupType): New function.  Used to locate types 
19834
19835
19836 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19837
19838         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
19839         this System.Reflection code is.  Kudos to Microsoft
19840
19841         * typemanager.cs: Implement a type cache and avoid loading all
19842         types at boot time.  Wrap in LookupType the internals.  This made
19843         the compiler so much faster.  Wow.  I rule!
19844
19845         * driver.cs: Make sure we always load mscorlib first (for
19846         debugging purposes, nothing really important).
19847
19848         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19849         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19850
19851         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19852         on namespaces that have been imported using the `using' keyword.
19853
19854         * class.cs (TypeContainer::TypeAttr): Virtualize.
19855         (Class::TypeAttr): Return attributes suitable for this bad boy.
19856         (Struct::TypeAttr): ditto.
19857         Handle nested classes.
19858         (TypeContainer::) Remove all the type visiting code, it is now
19859         replaced with the rootcontext.cs code
19860
19861         * rootcontext.cs (GetClassBases): Added support for structs. 
19862
19863 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19864
19865         * interface.cs, statement.cs, class.cs, parameter.cs,
19866         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19867         Drop use of TypeRefs, and use strings instead.
19868
19869 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
19870
19871         * rootcontext.cs: 
19872
19873         * class.cs (Struct::Struct): set the SEALED flags after
19874         checking the modifiers.
19875         (TypeContainer::TypeAttr): new property, returns the
19876         TypeAttributes for a class.  
19877
19878         * cs-parser.jay (type_list): Oops, list production was creating a
19879         new list of base types.
19880
19881         * rootcontext.cs (StdLib): New property.
19882         (GetInterfaceTypeByName): returns an interface by type name, and
19883         encapsulates error handling here.
19884         (GetInterfaces): simplified.
19885         (ResolveTree): Encapsulated all the tree resolution here.
19886         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
19887         types. 
19888
19889         * driver.cs: Add support for --nostdlib, to avoid loading the
19890         default assemblies.
19891         (Main): Do not put tree resolution here. 
19892
19893         * rootcontext.cs: Beginning of the class resolution.
19894
19895 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
19896
19897         * rootcontext.cs: Provide better error reporting. 
19898
19899         * cs-parser.jay (interface_base): set our $$ to be interfaces.
19900
19901         * rootcontext.cs (CreateInterface): Handle the case where there
19902         are no parent interfaces.
19903
19904         (CloseTypes): Routine to flush types at the end.
19905         (CreateInterface): Track types.
19906         (GetInterfaces): Returns an array of Types from the list of
19907         defined interfaces.
19908
19909         * typemanager.c (AddUserType): Mechanism to track user types (puts
19910         the type on the global type hash, and allows us to close it at the
19911         end). 
19912
19913 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
19914
19915         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
19916         RecordInterface instead.
19917
19918         * cs-parser.jay: Updated to reflect changes above.
19919
19920         * decl.cs (Definition): Keep track of the TypeBuilder type that
19921         represents this type here.  Not sure we will use it in the long
19922         run, but wont hurt for now.
19923
19924         * driver.cs: Smaller changes to accomodate the new code.
19925
19926         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
19927         when done. 
19928
19929         * rootcontext.cs (CreateInterface):  New method, used to create
19930         the System.TypeBuilder type for interfaces.
19931         (ResolveInterfaces): new entry point to resolve the interface
19932         hierarchy. 
19933         (CodeGen): Property, used to keep track of the code generator.
19934
19935 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
19936
19937         * cs-parser.jay: Add a second production for delegate_declaration
19938         with `VOID'.
19939
19940         (enum_body): Put an opt_comma here instead of putting it on
19941         enum_body or enum_member_declarations so we can handle trailing
19942         commas on enumeration members.  Gets rid of a shift/reduce.
19943
19944         (type_list): Need a COMMA in the middle.
19945
19946         (indexer_declaration): Tell tokenizer to recognize get/set
19947
19948         * Remove old targets.
19949
19950         * Re-add the parser target.
19951
19952 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19953
19954         * cs-parser.jay: Add precendence rules for a number of operators
19955         ot reduce the number of shift/reduce conflicts in the grammar.
19956
19957 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
19958
19959         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
19960         and put it here.
19961
19962         Get rid of old crufty code.
19963
19964         * rootcontext.cs: Use this to keep track of the parsed
19965         representation and the defined types available to the program. 
19966
19967         * gen-treedump.cs: adjust for new convention.
19968
19969         * type.cs: Split out the type manager, and the assembly builder
19970         from here. 
19971
19972         * typemanager.cs: the type manager will live here now.
19973
19974         * cil-codegen.cs: And the code generator here. 
19975
19976 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
19977
19978         * makefile: Fixed up for easy making.
19979
19980 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19981
19982         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
19983         the 
19984
19985         (unary_expression): Expand pre_increment_expression and
19986         post_decrement_expression to reduce a shift/reduce.
19987
19988 2001-07-11  Simon Cozens
19989
19990         * cs-tokenizer.cs: Hex numbers should begin with a 0.
19991
19992         Improve allow_keyword_as_indent name.
19993
19994 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
19995
19996         * Adjustments for Beta2. 
19997
19998 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
19999
20000         * decl.cs: Added `Define' abstract method.
20001         (InTransit): new property, used to catch recursive definitions. 
20002
20003         * interface.cs: Implement `Define'. 
20004
20005         * modifiers.cs: Map Modifiers.constants to
20006         System.Reflection.TypeAttribute flags.
20007
20008         * class.cs: Keep track of types and user-defined types.
20009         (BuilderInit): New method for creating an assembly
20010         (ResolveType): New function to launch the resolution process, only
20011         used by interfaces for now.
20012
20013         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20014         that are inserted into the name space. 
20015
20016 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20017
20018         * ARGH.  I have screwed up my tree so many times due to the use of
20019         rsync rather than using CVS.  Going to fix this at once. 
20020
20021         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20022         load types.
20023
20024 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20025
20026         * Experiment successful: Use System.Type rather that our own
20027         version of Type.  
20028
20029 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20030
20031         * cs-parser.jay: Removed nsAliases from here.
20032
20033         Use new namespaces, handle `using XXX;' 
20034
20035         * namespace.cs: Reimplemented namespace handling, use a recursive
20036         definition of the class.  Now we can keep track of using clauses
20037         and catch invalid using clauses.
20038
20039 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20040
20041         * gen-treedump.cs: Adapted for all the renaming.
20042
20043         * expression.cs (Expression): this class now has a Type property
20044         which returns an expression Type.
20045
20046         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20047         `Type', as this has a different meaning now in the base
20048
20049 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20050
20051         * interface.cs, class.cs: Removed from all the sources the
20052         references to signature computation, as we can not do method
20053         signature computation during the parsing time, as we are not
20054         trying to solve at that point distinguishing:
20055
20056         class X {
20057                 void a (Blah x) {}
20058                 void a (NS.Blah x) {}
20059         }
20060
20061         Which depending on the context might be valid or not, as we do not
20062         know if Blah is the same thing as NS.Blah at that point.
20063
20064         * Redid everything so the code uses TypeRefs now instead of
20065         Types.  TypeRefs are just temporary type placeholders, that need
20066         to be resolved.  They initially have a pointer to a string and the
20067         current scope in which they are used.  This is used later by the
20068         compiler to resolve the reference to an actual Type. 
20069
20070         * DeclSpace is no longer a CIR.Type, and neither are
20071         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20072         are all DeclSpaces, but no Types. 
20073
20074         * type.cs (TypeRefManager): This implements the TypeRef manager,
20075         which keeps track of all the types that need to be resolved after
20076         the parsing has finished. 
20077
20078 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20079
20080         * ARGH.  We are going to have to store `foreach' as a class rather
20081         than resolving it, as we need to verify error 1579 after name
20082         resolution.   *OR* we could keep a flag that says `This request to
20083         IEnumerator comes from a foreach statement' which we can then use
20084         to generate the error.
20085
20086 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20087
20088         * class.cs (TypeContainer.AddMethod): we now add methods to the
20089         MethodGroup instead of the method hashtable.  
20090
20091         * expression.cs: Add MethodGroup abstraction, which gets us one
20092         step closer to the specification in the way we handle method
20093         declarations.  
20094
20095         * cs-parser.jay (primary_expression): qualified_identifier now
20096         tried to match up an identifier to a local variable reference or
20097         to a parameter reference.
20098
20099         current_local_parameters is now a parser global variable that
20100         points to the current parameters for the block, used during name
20101         lookup.
20102
20103         (property_declaration): Now creates an implicit `value' argument to
20104         the set accessor.
20105
20106 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20107
20108         * parameter.cs: Do not use `param' arguments as part of the
20109         signature, per the spec.
20110
20111 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20112
20113         * decl.cs: Base class for classes, structs and interfaces.  This
20114         is the "Declaration Space" 
20115
20116         * cs-parser.jay: Use CheckDef for checking declaration errors
20117         instead of having one on each function.
20118
20119         * class.cs: Factor out some code for handling error handling in
20120         accordance to the "Declarations" section in the "Basic Concepts"
20121         chapter in the ECMA C# spec.
20122
20123         * interface.cs: Make all interface member classes derive from
20124         InterfaceMemberBase.
20125
20126 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20127
20128         * Many things: all interfaces are parsed and generated in
20129         gen-treedump.  Support for member variables, constructors,
20130         destructors, properties, constants is there.
20131
20132         Beginning of the IL backend, but very little done, just there for
20133         testing purposes. 
20134
20135 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20136
20137         * cs-parser.jay: Fix labeled statement.
20138
20139         * cs-tokenizer.cs (escape): Escape " and ' always.
20140         ref_line, ref_name: keep track of the line/filename as instructed
20141         by #line by the compiler.
20142         Parse #line.
20143
20144 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20145
20146         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20147         to match the values in System.CodeDOM.
20148
20149         Divid renamed to Divide.
20150
20151         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20152         statements. 
20153         (Statements.set): remove.
20154
20155         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20156         statements. 
20157
20158         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20159         falseStatements always have valid values. 
20160
20161         * cs-parser.jay: Use System.CodeDOM now.
20162