2005-06-06 Lluis Sanchez Gual <lluis@novell.com>
[mono.git] / mcs / bmcs / ChangeLog
1 2005-05-08  Jambunathan K  <kjambunathan.devel@gmail.com>
2
3         * expression.cs (Binary.CheckIsArguments): Added
4         (Binary.Emit, Binary.CheckArguments): Modified to support 'Is'
5         operator.
6         
7 2005-05-08  Jambunathan K  <kjambunathan.devel@gmail.com>
8
9         * convert.cs: 
10         * expression.cs: Miscellaneous fixes relating to
11         type conversions.
12
13 2005-04-10  Jambunathan K  <kjambunathan.devel@gmail.com>
14
15         * First cut changes for suporting Binary Operators. All changes
16         need to be refined and reviewed.
17
18         * expression.cs (Error_OperatorCannotBeAppliedToObjectOperands):
19         (ResolveOperator): Commented out. The method is retained for later
20         reference.
21
22         (ResolveVisualBasicOperator): New method that replaces
23         ResolveOperator. The method takes care of VB.NET semantics for
24         Operator Resolution.
25
26         (DoResolve): Replaced call to ResolveOperator with
27         ResolveVisualBasicOperator.
28
29         (Emit, CheckShiftArguments): Updated to reflect VB.NET semantics
30
31         (HandleObjectOperands, CheckArguments, IsOperatorDefinedForType,
32         ConvertOperatorToDefinedType, GetWiderOfTypes,
33         DoOperandPromotions, IsArithmeticExpression,
34         IsRelationalExpression, IsShiftExpression,
35         IsShortCircuitedLogicalExpression, HelperMethod): New helper
36         routines to support binary operator resolution.
37
38         * mb-parser.jay: Added support for exponentiation operator.
39
40         * typemanager.cs (relative_type_order): Added.
41         (InitCoreTypes, InitCodeHelpers, InitVisualBasicHelperTypes,
42         InitVisualBasicCodeHelpers): Added more helper methods to method
43         cache.
44
45
46 2005-04-09  Jambunathan K  <kjambunathan.devel@gmail.com>
47
48         * convert.cs (ObjectTypeToPrimitiveTypes): Added. Converts an
49         'Object' to a 'Primitive Type'.
50
51         (WideningAndNarrowingConversion): Inserted call to
52         'ObjectTypeToPrimitiveTypes' to convert from 'Object' to a
53         'Primitive Type'.
54
55         * typemanager.cs (InitVisualBasicCodeHelpers): Added helper
56         methods that handles above conversions to the TypeManager's method
57         cache.
58
59 2005-04-02  Jambunathan K  <kjambunathan.devel@gmail.com>
60
61         * Makefile: Added '/r:Microsoft.VisualBasic.dll' to the compile
62         command line.
63
64         * driver.cs (UnixParseOption, CSCParseOption): Added
65         '/optioncompare:[text|binary]' command line option.
66
67         * rootcontext.cs (StringComparisonMode): Added. Keeps track of the
68         '/optioncompare:' command line option.
69
70         * typemanager.cs (InitVisualBasicHelperTypes,
71         InitVisualBasicCodeHelpers): New routines that preload frequently
72         used types and helper methods available in
73         Microsoft.Visualbasic.dll. 
74
75         (IsFixedNumericType, IsFloatingNumericType,IsNumericType): New
76         VB.NET specific helper routines. Added in anticipation of a future
77         use.
78         
79         * ecore.cs (HelperMethodInvocation): Added. Implements the same
80         functionality as the earlier vaguely named class
81         'ImplicitInvocation'. This class uses the 'type cache' of
82         Microsoft.VisualBasic helper methods now available in the
83         TypeManager.
84
85         * convert.cs (WideningConstantConversions): Reimplemented. The
86         earlier implementation was completely topsy-turvy.  Propagated the
87         changes relating to the introduction of 'HelperMethodInvocation'.
88
89         * mb-parser.jay: Added rule and action for 'Like' expression.
90
91         * mb-tokenizer.cs (keywords): Cleaned up the extra space in the
92         'let', 'lib' and 'like' entries.
93
94 2005-03-26  Jambunathan K  <kjambunathan.devel@gmail.com>
95
96         * constant.cs: Added conversions between various constants
97         * literal.cs: Added conversions from Nothing to various primitive constants
98         
99         * convert.cs (NothingToPrimitiveConstants, WideningConstantconversions): Added
100
101         (TryWideningIntConversion): Removed C# specific constant
102         conversions. This functionality is now taken care of by
103         WideningConstantConversions.  
104
105         (WideningReferenceConversion): Added support for conversions from Nothing to ValueTypes
106         (WideningNumericConversion): Call WideningConstantConversions
107
108         * ecore.cs (NullCast.Emit): Conversion from Nothing to ValueType
109
110
111 2005-03-26  Jambunathan K  <kjambunathan.devel@gmail.com>
112
113         * ecore.cs (ImplicitInvocation): Set eclass and type to that of the child
114         
115         * convert.cs (ImplicitVBConversion, ImplicitVBConversionRequired,
116         ExplicitVBConversion): Added
117         (WideningNumericConversion): Added support for converting an enum to
118         it's underlying numeric type or any type that it's underlyinmg
119         type has widening conversion to.
120         
121         * assign.cs (DoAssign): Plugged in ImplicitVBConversionRequired.
122
123 2005-03-26  Jambunathan K  <kjambunathan.devel@gmail.com>
124
125         * expression.cs (Binary.Operator): Added Exponentiation,
126         Concatenation, Like, Is and IntegerDivision opeartors
127
128         * mb-parser.jay: Changes relating to the above changes.
129
130 2005-03-26  Jambunathan K  <kjambunathan.devel@gmail.com>
131
132         * expression.cs (Binary.Operator): Renamed LogicalAnd/LogicalOr to
133         LogicalAndAlso and LogicalOrElse.
134         
135         * cfold.cs, gen-treedump.cs, generic.cs, mb-parser.jay: Changes
136         related to the above renaming.
137
138 2005-03-25  Jambunathan K  <kjambunathan.devel@gmail.com>
139
140         * constant.cs (DateConstant): Added (Borrowed from mbas)
141         * literal.cs (DateLiteral): Added (Borrowed from mbas)
142         * mb-parser.jay: Added support for Date type. (Borrowed from mbas)
143         * typemanager.cs (void_datetime_ctor_ticks_arg):  Added (Borrowed from mbas)
144         * mb-tokenizer.cs (ParseDateLiteral, GobbleWhitespaces): Added afresh
145
146 2005-03-25  Jambunathan K  <kjambunathan.devel@gmail.com>
147         
148         * AssemblyInfo.cs: Set assembly version to 0.1
149
150         * literal.cs (NotDefinedAsPrimitiveType): New class. Unlike C#,
151         VB.NET doesn't understand "signed byte", "unsigned short",
152         "unsigned int" and "unsigned long" as primitive types. This class
153         has been introduced just to "accomodate" this fact. Now we can
154         retain most of the existing gmcs code that test against these
155         types for doing language defined conversions.
156         
157         * typemanager.cs (sbyte_type, short_type, uint32_type,uint64_type): 
158         Converted as static properties that return typeof(NotDefinedAsPrimitiveType). 
159         
160         The existing sbyte_type, short_type, uint32_type, uint64_type are
161         renamed as _sbyte_type, _short_type, _uint32_type,
162         _uint64_type. Their accessibility type is now private.
163
164         * convert.cs (NarrowingNumericConversion, WideningNumericConversion): 
165         Reverted original gmcs code that handle byte type and unsigned
166         numeric types. Remember that all this code is a "nop" because
167         of the introduction of NotDefinedAsPrimitiveType class.
168
169
170 2005-03-23  Jambunathan K  <kjambunathan.devel@gmail.com>
171         * Merged with GMCS trunk 42056
172         
173 2005-02-08  Raja R Harinath  <rharinath@novell.com>
174
175         Fix #72015.
176         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
177         TypeManager.multicast_delegate_type is null, resolve it by looking
178         up "System.MulticastDelegate".
179         * rootcontext.cs (RootContext.ResolveCore): Simplify.
180
181 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
182             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
183             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
184
185         Fix cs0164.cs.
186         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
187         (LabeledStatement.AddReference): New.  Set 'referenced'.
188         (Goto.Resolve): Use it.
189
190 2005-02-05  John Luke  <john.luke@gmail.com>
191
192         * driver.cs: remove duplicate -doc line in Usage ()
193
194 2005-02-04  Raja R Harinath  <rharinath@novell.com>
195
196         * location.cs (Location.AddFile): Fix CS2002 error report.
197
198 2005-02-02  Martin Baulig  <martin@ximian.com>
199
200         * delegate.cs (Delegate.DefineType): Report an internal error if
201         TypeManager.multicast_delegate_type is null.  See bug #72015 for
202         details.        
203
204 2005-02-02  Raja R Harinath  <rharinath@novell.com>
205
206         Fix a crasher in a variant of #31984.
207         * const.cs (Constant.CheckBase): New override that defers the
208         new-or-override check in case the base type hasn't been populated
209         yet.
210         (Constant.Define): Ensure the new-or-override check is performed.
211
212 2005-02-01  Duncan Mak  <duncan@ximian.com>
213
214         * const.cs (LookupConstantValue): Check that `ce' is not null
215         before calling GetValue ().
216
217 2005-02-01  Raja R Harinath  <rharinath@novell.com>
218
219         Fix test-334.cs (#69519).
220         * cs-parser.jay (using_alias_directive): Pass in an expression to
221         NamespaceEntry.UsingAlias.
222         (using_namespace_directive): Pass in an expression to
223         NamespaceEntry.Using.
224         (namespace_name): Don't flatten to a string.
225         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
226         (NamespaceEntry.AliasEntry.Resolve): Lookup using
227         ResolveAsTypeStep.
228         (NamespaceEntry.UsingEntry): Likewise.
229         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
230         changes.
231         (NamespaceEntry.LookupForUsing): Remove.
232         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
233         names.
234         (NamespaceEntry.Lookup): Remove support for dotted names.
235
236 2005-02-01  Raja R Harinath  <rharinath@novell.com>
237
238         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
239         split into two.
240         (NamespaceEntry.ImplicitParent): Compute on demand.
241         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
242         parallels the current.
243         (NamespaceEntry.LookupForUsing): Use it.
244         (NamespaceEntry.Lookup): If the current namespace-entry is
245         implicit, don't search aliases and using tables.
246
247 2005-02-01  Raja R Harinath  <rharinath@novell.com>
248
249         Fix #31984.
250         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
251         BaseCache here.
252         (TypeContainer.BaseCache): Compute on demand.
253         (TypeContainer.FindMembers): Define constants and types if they're
254         not already created.
255         (FieldMember.Define): Move resetting of ec.InUnsafe before error
256         check.
257         * const.cs (Constant.Define): Make idempotent.
258
259 2005-01-29  Miguel de Icaza  <miguel@novell.com>
260
261         * pending.cs: Produce better code (no nops produced by using Ldarg
262         + value).
263         
264         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
265         i - 1' it should be arg + 1.
266
267         Fixes bug #71819.
268
269 2005-01-28  Raja R Harinath  <rharinath@novell.com>
270
271         * attribute.cs (Attribute.CheckAttributeType): Make private
272         non-virtual.
273         (Attribute.ResolveType): Make virtual.
274         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
275         handling of RootContext.Tree.Types.
276
277 2005-01-27  Raja R Harinath  <rharinath@novell.com>
278
279         Update attribute-handling to use the SimpleName/MemberAccess
280         mechanisms.
281         * cs-parser.jay (attribute): Pass in an expression to the
282         constructors of Attribute and GlobalAttribute.
283         * attribute.cs (Attribute): Take an expression for the name.
284         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
285         passed in attribute name expression.
286         (Attribute.CheckAttributeType): Use it.
287         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
288         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
289         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
290         argument to prevent error messages if the lookup fails.
291
292 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
293
294         * expression.cs (Indirection): Implemented IVariable interface
295         to support indirection in AddressOf operator.
296         (PointerArithmetic.Emit): Add optimalization for case where
297         result can be precomputed.
298
299 2005-01-26  Martin Baulig  <martin@ximian.com>
300
301         * class.cs (TypeContainer.AttributeTargets): Return the correct
302         AttributeTargets depending on our `Kind' instead of throwing an
303         exception; fixes #71632.
304
305 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
306
307         Fix #71257
308         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
309         constant members.
310
311 2005-03-17  Martin Baulig  <martin@ximian.com>
312
313         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
314         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
315
316 2005-03-17  Martin Baulig  <martin@ximian.com>
317
318         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
319         to bool so we can return an error condition.
320         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
321         returned an error.
322
323 2005-03-17  Martin Baulig  <martin@ximian.com>
324
325         * generic.cs (TypeMananager.IsIEnumerable): New public method.
326
327         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
328         converting from an array-type of T to `IEnumerable<T>'.
329
330 2005-03-16  Martin Baulig  <martin@ximian.com>
331
332         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
333         (Nullable.LiftedUnaryMutator): New public class.
334
335         * expression.cs (UnaryMutator.DoResolve): Added support for
336         Nullable Types.
337
338 2005-03-14  Martin Baulig  <martin@ximian.com>
339
340         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
341
342 2005-03-14  Martin Baulig  <martin@ximian.com>
343
344         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
345         the comparision operators `<', `>', `<=' and `>='.
346
347 2005-03-13  Martin Baulig  <martin@ximian.com>
348
349         * generic.cs
350         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
351         avoid confusion with the `NullLiteral'.
352         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
353
354 2005-03-13  Martin Baulig  <martin@ximian.com>
355
356         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
357         comparing arbitrary types with the null literal.
358
359 2005-03-13  Martin Baulig  <martin@ximian.com>
360
361         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
362         boolean operators '&&', '||', '&' and '|'.
363         (Nullable.OperatorTrueOrFalse): New public class.
364
365         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
366         instead of a `StaticCallExpr'; added support for nullables.
367
368 2005-03-10  Martin Baulig  <martin@ximian.com>
369
370         * expression.cs
371         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
372         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
373
374 2005-03-07  Martin Baulig  <martin@ximian.com>
375
376         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
377         it work if `expr' is not an IMemoryLocation.
378         (Nullable.Lifted): Implement IMemoryLocation.
379         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
380         target type.
381
382 2005-03-05  Martin Baulig  <martin@ximian.com>
383
384         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
385         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
386         (Nullable): Added support for lifted unary and binary operators.
387
388         * expression.cs (Unary.DoResolve): Added support for nullable types.
389         (Binary.DoResolve): Likewise.
390         (Conditional.DoResolve): Likewise.
391
392 2005-03-02  Martin Baulig  <martin@ximian.com>
393
394         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
395
396         * class.cs (ClassPart.SetParameterInfo): Override this.
397         (PartialContainer.SetParameterInfo): Override this.
398         (TypeContainer.CheckConstraints): New protected method.
399         (PartialContainer.CheckConstraints): Override this and check
400         whether the same contraints were specified in all parts of a
401         partial generic type definition.
402         (PartialContainer.UpdateConstraints): New public method.
403
404         * generic.cs (TypeParameter.UpdateConstraints): New public method.
405
406 2005-03-02  Martin Baulig  <martin@ximian.com>
407
408         Committing a patch from Carlos Alberto Cortez to fix #72887.
409
410         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
411         casts from `T []' to `int []'.
412
413 2005-03-02  Martin Baulig  <martin@ximian.com>
414
415         * generic.cs (TypeManager.IsEqual): Make this symmetric.
416
417         * expression.cs (Binary.ResolveOperator): When resolving a
418         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
419         `=='.  Fixes #71866.  See gen-127.cs.
420
421 2005-03-02  Martin Baulig  <martin@ximian.com>
422
423         * class.cs (TypeContainer.DoDefineMembers): We also need a default
424         static constructor in static classes.
425
426 2005-03-02  Martin Baulig  <martin@ximian.com>
427
428         * generic.cs
429         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
430         (Nullable.LiftedConversion): Added support for user-defined
431         conversions.
432
433         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
434
435         * cs-parser.jay: Use ComposedCast everywhere instead of
436         NullableType, so we don't need to check for NullableType
437         everywhere.
438         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
439         case where we'll be resolved into a `parenthesized_expression_0'
440         afterwards.
441
442         * convert.cs
443         (Convert.UserDefinedConversion): Added nullable conversions.
444
445 2005-02-28  Martin Baulig  <martin@ximian.com>
446
447         * generic.cs (TypeManager.IsNullableType): New static method.
448         (Nullable): New abstract class.
449         (Nullable.NullLiteral): New public class.
450         (Nullable.LiftedConversion): New public class.
451
452         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
453         `builtin_types opt_nullable'.
454
455         * convert.cs
456         (Convert.ImplicitConversionStandard): Added nullable conversions.
457         (Convert.ExplicitConversionStandard): Likewise.
458         (Convert.ExplicitConversion): Likewise.
459
460 2005-02-26  Martin Baulig  <martin@ximian.com>
461
462         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
463         begin with a "?", for instance "?[]".  Don't do a type lookup if
464         `dim' is empty.
465
466 2005-02-25  Martin Baulig  <martin@ximian.com>
467
468         The first part of Nullable Types :-)
469
470         * generic.cs (NullableType): New public class.
471         (NullCoalescingOperator): New public class.
472         (TypeArguments.Resolve): Add a CS0306 check.
473
474         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
475         (opt_nullable): New rule.
476         (type): Added `opt_nullable' to `namespace_or_type_name',
477         `builtin_types' and `pointer_type'.
478         (array_type): Added `opt_nullable'.
479         (opt_rank_specifier_or_nullable): New rule; this is the
480         combination of `opt_rank_specifier' and `opt_nullable'.
481         (opt_error): New rule; catch errors here.
482         (nullable_type_or_conditional): New rule; we use this to check for
483         nullable and still detect the conditional operator.
484         (local_variable_type): Use `opt_rank_specifier_or_nullable'
485         instead `opt_rank_specifier'.
486
487         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
488         for nullables.
489
490 2005-02-24  Martin Baulig  <martin@ximian.com>
491
492         * README, README.Changes: Removed; they're old and obsolete.
493
494 2005-02-22  Martin Baulig  <martin@ximian.com>
495
496         * generic.cs (TypeParameter.Resolve): If resolving the constraints
497         returned an error, set `constraints' to null to avoid a crash
498         later on.
499         (TypeParameter.ResolveType): Likewise.
500
501 2005-02-22  Martin Baulig  <martin@ximian.com>
502
503         * generic.cs
504         (Constraints.ResolveTypes): Protect against being called twice.
505         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
506         (TypeParameter.ResolveType): New public method; calls
507         constraints.ResolveTypes().
508         (TypeParameter.DefineType): Moved constraints.ResolveType() out
509         into the new ResolveType().
510         (GenericMethod.Define): Call ResolveType() on all our
511         TypeParameter's.        
512
513 2005-02-21  Martin Baulig  <martin@ximian.com>
514
515         * generic.cs
516         (TypeManager.generic_nullable_type): New static public field.
517         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
518
519         * rootcontext.cs
520         (RootContext.ResolveCore): Resolve "System.Nullable`1".
521
522 2005-02-15  Martin Baulig  <martin@ximian.com>
523
524         * generic.cs (ConstructedType.Constraints): Correctly check
525         constraints if the argument type is a type parameter; fixes
526         #72326. 
527
528
529 2005-03-01  Jambunathan K  <kjambunathan.devel@gmail.com>
530
531         * ecore.cs (ImplicitInvocation, ImplicitNew, FloatingToFixedCast): Added
532         * expression.cs (ImplicitInvocation, ImplicitNew): Removed
533
534         * driver.cs, rootcontext.cs: Added the 'removeintchecks' and
535         'optionstrict' command line options
536
537         * convert.cs (WideningNumericConversion,
538         NarrowingNumericConversion): Updated to refelct VB.NET semantics.
539
540 2005-03-01  Jambunathan K  <kjambunathan.devel@gmail.com>
541
542         * convert.cs: Added the following conversion routines:
543         BooleanConversions, WideningStringConversions,
544         NarrowingStringConversions.
545
546         * ecore.cs: Added following helper classes: BooleanToNumericCast,
547         NumericToBooleanCast
548         
549         * typemanager.cs: Added System.DateTime to the cached types.
550
551 2005-02-28  Jambunathan K  <kjambunathan.devel@gmail.com>
552
553         * ecore.cs (StringToExpression):
554         * expression.cs (ImplicitInvocation, ImplicitNew): VB.NET specific
555         helper classes and methods.
556
557 2005-02-28  Jambunathan K  <kjambunathan.devel@gmail.com>
558
559         * assign.cs, attribute.cs, cfold.cs, const.cs, constant.cs,
560         * convert.cs, ecore.cs, enum.cs, expression.cs, generic.cs,
561         * iterator.cs, statement.cs : Broadly, what C# spec terms as
562         "Implicit" & "Explicit", VB.NET spec terms as "Widening" &
563         "Narrowing" respectively. So renamed exisiting methods to reflect
564         the VB.NET nomenclature. These are just first renamings.
565         
566 2005-02-28  Jambunathan K  <kjambunathan.devel@gmail.com>
567
568         * convert.cs :
569         * expression.cs :       
570         * statement.cs: VB.NET has no notion of User defined
571         conversions. Assuming that UserDefinedConversion() returns null,
572         propagated the resulting changes upstream. 
573
574 2005-02-02  Martin Baulig  <martin@ximian.com>
575
576         * delegate.cs (Delegate.DefineType): Report an internal error if
577         TypeManager.multicast_delegate_type is null.  See bug #72015 for
578         details.        
579
580 2005-01-29  Miguel de Icaza  <miguel@novell.com>
581
582         * pending.cs: Produce better code (no nops produced by using Ldarg
583         + value).
584         
585         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
586         i - 1' it should be arg + 1.
587
588         Fixes bug #71819.
589         
590 2005-01-26  Martin Baulig  <martin@ximian.com>
591
592         * cs-parser.jay (indexer_declarator): Don't report an error if we
593         have type parameters since we can be an explicit interface
594         implementation; fixes #71449.
595
596 2005-01-26  Martin Baulig  <martin@ximian.com>
597
598         * class.cs (TypeContainer.AttributeTargets): Return the correct
599         AttributeTargets depending on our `Kind' instead of throwing an
600         exception; fixes #71632.
601
602 2005-01-26  Martin Baulig  <martin@ximian.com>
603
604         * delegate.cs (Delegate.DefineType): Correctly define our type
605         parameters.  Fixes #71483.
606
607 2005-01-25  Raja R Harinath  <rharinath@novell.com>
608
609         Fix #71602.
610         * expression.cs (MemberAccess.DoResolve): Don't complain with
611         cs0572 when the LHS of a member access has identical name and type
612         name.
613
614 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
615
616         Fix #71651, #71675
617         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
618         CreatePermission.
619         Create custom PermissionSet only for PermissionSetAttribute.
620
621 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
622
623         Fix #71649
624         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
625         delegates in static class.
626
627 2005-01-24  Martin Baulig  <martin@ximian.com>
628
629         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
630         merging an implicit block, just use its reachability.
631
632         * statement.cs (Block.Resolve): Make the unreachable code check
633         work wrt. implicit blocks; see test-337 from #63842.
634
635 2005-01-21  Alp Toker  <alp@atoker.com>
636  
637         * cs-parser.jay: destructor_declaration's container is PartialContainer
638         not Class when partial types are used, so use Kind prop instead of
639         'is'.
640         
641 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
642
643         * cs-parser.jay: Improve error reporting when an interface
644         declares new types.
645
646 2005-01-20  Dick Porter  <dick@ximian.com>
647
648         * support.cs: SeekableStreamReader fix from Sandor Dobos
649         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
650         chars are read.  Fixes bug 70369.
651
652 2005-01-20  Raja R Harinath  <rharinath@novell.com>
653
654         * cs-parser.jay (catch_clause): Simplify current_block handling
655         somewhat.
656
657 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
658
659         * convert.cs (ImplicitStandardConversionExists): Synchronize the
660         code with ImplicitStandardConversion to handle the implicit
661         conversion of method groups into valid delegate invocations. 
662
663         The problem is that in parameter handling we were using this code
664         path.  Fixes bug #64698
665
666 2005-01-19  Raja R Harinath  <rharinath@novell.com>
667
668         * cs-parser.jay: Fix several infelicities.
669         - Avoid assigning to the parser value stack.  Code like 
670           '$3 = null' is unclean.  Synthesize a value for the code block
671           instead. 
672         - Avoid using oob_stack for storing location information.  Use ...
673         (_mark_): ... this.  New (empty) rule.  Saves the current location
674         in $$.
675         (foreach_statement): Avoid using oob_stack for current_block
676         handling.  Use technique used in for_statement and
677         using_statement.  Synthesize a value for the code block to store
678         additional intermediate information.
679
680 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
681
682         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
683         of a different type is only allowed to private fields of a
684         containing type, not on fields of a base class.
685
686         See test-174.cs and error cs0122-9.cs
687
688 2005-01-13  Raja R Harinath  <rharinath@novell.com>
689
690         Fix test-335.cs (bug #58126).
691         * cs-parser.jay (argument): Split out non-expression parts of the
692         rule into 'non_simple_argument'.
693         (invocation_expression): Support parenthesized invocations with
694         multiple arguments, and with single non-simple arguments.
695
696 2005-01-13  Raja R Harinath  <rharinath@novell.com>
697
698         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
699         places.
700
701 2005-01-12  Raja R Harinath  <rharinath@novell.com>
702
703         Fix cs0038-1.cs, cs1640-6.cs.
704         * ecore.cs (Expression.Resolve): Remove special-case for
705         SimpleName in error-handling.
706         (Expression.almostMatchedMembers): Relax access permission to
707         protected.
708         (Expression.MemberLookupFailed): Handle duplicates in
709         almostMatchedMembers list.
710         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
711         * expression.cs (New.DoResolve): Report CS1540 for more cases.
712         * typemanager.cs (GetFullNameSignature): Use the MethodBase
713         overload if the passed in MemberInfo is a MethodBase.
714
715 2005-01-25  Martin Baulig  <martin@ximian.com>
716
717         * doc.cs
718         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
719
720 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
721
722         Fix #70749
723         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
724         for non-CAS & merge permission sets properly.
725
726 2005-01-11  Raja R Harinath  <rharinath@novell.com>
727
728         Improve standard-compliance of simple name and member access 
729         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
730         * ecore.cs (FullNamedExpression): New abstract base class 
731         for Namespaces and TypeExpressions.
732         (ResolveFlags.SimpleName): Remove.
733         (SimpleName): Remove support for dotted names.
734         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
735         DeclSpace.FindType and DeclSpace.LookupType.
736         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
737         (Expression.ExprClassName): Make member function.
738         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
739         a namespace.  Remove creation of dotted "SimpleName"s.
740         (MemberAccess.DoResolve): Likewise.
741         * decl.cs (DeclSpace.Cache): Make private.
742         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
743         (DeclSpace.FindType): Update.
744         (DeclSpace.LookupType): Move here from RootContext.  Return a 
745         FullNamedExpression.
746         * namespace.cs (Namespace): Derive from FullNamedExpression
747         so that it can be part of expression resolution.
748         (Namespace.Lookup): Return an FullNamedExpression.
749         (NamespaceEntry.LookupAlias): Lookup aliases only in current
750         namespace.
751         * rootcontext.cs (NamespaceLookup): Remove.
752         (LookupType): Move to DeclSpace.
753         * attribute.cs (CheckAttributeType): Update.
754         * doc.cs (FindDocumentedType): Remove allowAlias argument.
755         (FindDocumentedTypeNonArray): Likewise.
756
757 2005-01-11  Raja R Harinath  <rharinath@novell.com>
758
759         Fix cs0509.cs, cs1632.cs.
760         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
761         is the same as IsInterface.
762         (TypeContainer.GetClassBases): Likewise.
763         * statement.cs (LabeledStatement.ig): New field.
764         (LabeledStatement.LabelTarget): Save ILGenerator which created the
765         label.
766         (LabeledStatement.DoEmit): Check that the label was created with
767         the same ILGenerator.
768
769 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
770
771         Fix #71058
772         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
773         accessors to its properties.
774
775         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
776         from accessors to property.
777         
778 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
779
780         Fix #70722
781         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
782         only for overrides.
783         
784 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
785
786         * attribute.cs: Check for null and empty strings.  
787
788         I have lost another battle to Paolo.
789
790 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
791
792         Fix #70942
793         * class.cs (PropertyMethod): Set Parent field in ctors.
794         (SetMethod.InternalParameters): Add unsafe switch hack.
795         Override MarkForDuplicationCheck where it is appropriate.
796
797         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
798         It says whether container allows members with the same name.
799         Base default is no.
800         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
801         Removed is_method parameter.
802
803 2005-01-06  Duncan Mak  <duncan@ximian.com>
804
805         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
806         because the previous change led to incorrect reporting of CS1032
807         ("Cannot define/undefine preprocessor symbols after first token in
808         file"). Instead of using `tokens_seen' as the only flag that
809         triggers CS1040, introduce `comments_seen'. This new flag is used
810         to signify having seen comments on the current line, so it is
811         unset after a newline.
812
813 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
814
815         * doc.cs : When searching for a type, find nested type too.
816           This fixes bug #71040.
817
818 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
819
820         * doc.cs :
821           - Warn missing member comment on those classes which also does not
822             have doc comments. Fixed bug #71041.
823           - Don't warn missing doc comment on default constructor.
824             Fixed bug #71042.
825
826 2005-01-06  Duncan Mak  <duncan@ximian.com>
827
828         * cs-tokenizer.cs (xtoken): After handling traditional C-style
829         comments, set `tokens_seen' to true. This allows us to detect
830         misplaced preprocessor directives (i.e. not at the beginning of
831         the a line, nor after whitespaces). In that case, report error
832         CS1040. This fixes bug #56460.
833
834         * cs-parser.jay (interface_member_declaration): Add checks for
835         IsExplicitImpl, and report CS0541 error if an interface member is
836         defined as an explicit interface declaration.
837
838 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
839
840         Fix #70817
841         * class.cs (PropertyMethod): Set Parent field in ctors.
842         (SetMethod.InternalParameters): Add unsafe switch hack.
843         
844         * decl.cs (MemberCore.Parent): Cannot be readonly.
845
846 2005-01-06  Raja R Harinath  <rharinath@novell.com>
847
848         * decl.cs (DeclSpace.ResolveType): Remove.
849         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
850         Merge in code from ...
851         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
852         * class.cs, enum.cs: Update to changes.
853
854 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
855
856         * anonymous.cs: Ensure that we init the scope of our parent if it
857         has not been initialized yet.
858
859 2004-12-30  Duncan Mak  <duncan@ximian.com>
860
861         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
862         if field.FieldBuilder is null. Fixes #70758.
863
864         * convert.cs: Fixed some typos and updated some of the comments.
865         (ImplicitStandardConversionExists):
866         (TryImplicitIntConversion): If `target_type' is an interface and
867         the type of `ic' implements this interface, return true or a new
868         BoxedCast instead of null. This fixes #70468.
869
870 2004-12-29  Duncan Mak  <duncan@ximian.com>
871
872         * expression.cs (Argument.Emit): Check that Expr is
873         IMemoryLocation before casting to it, and report CS1510 otherwise.
874
875         This fixes #70402.
876
877 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
878
879         * statement.cs (Block.ThisVariable): remove the recursion here, to
880         make the --profile more sane.
881
882 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
883
884         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
885         assembly, by JB Evain.
886
887 2004-12-17  Raja R Harinath  <rharinath@novell.com>
888
889         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
890           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
891         "parent" refers to enclosing type/class.  "base" refers to superclass.
892
893 2004-12-17  Raja R Harinath  <rharinath@novell.com>
894
895         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
896         Ensure that we only have GlobalAttributes.
897         * attribute.cs (Attribute.Emit): Make non-virtual.
898         (GlobalAttribute.Emit): Remove.
899         (Attribute.Resolve): Make virtual.
900         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
901         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
902         the argument. Don't create one.
903         (Attribute.GetObsoleteAttribute): Likewise.
904         (Attribute.GetClsCompliantAttributeValue): Likewise.
905         * class.cs, decl.cs: Update to changes.
906
907 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
908
909         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
910         
911         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
912         
913         * statement.cs (Foreach.Resolve): Add error 186 report.
914
915 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
916
917         * expression.cs (Conditional.DoResolve): Add warning 429.
918         
919         * statement.cs (If.Resolve): Add warning 665.
920
921 2004-12-16  Raja R Harinath  <rharinath@novell.com>
922
923         New invariant: RootContext.Tree.Types.NamespaceEntry == null
924         except when in the parser, and in GlobalAttribute.
925         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
926         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
927         RootContext.Tree.Types.NamespaceEntry once work is done.
928         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
929         and resets RootContext.Tree.Types.NamespaceEntry.
930
931 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
932
933         * cs-parser.jay: Don't create a block for every variable.
934
935 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
936
937         * location.cs: Provide extra information.
938
939         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
940         variables from the captured environment, it is the ldarg_0.
941
942 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
943
944         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
945         find a conclusion.
946         
947         * class.cs: Changed warning level for 169 to avoid developer
948         displeasure from warning flooding. It will be changed back when they
949         fix most of current BCL warnings.
950         
951         * RootContext.cs: Pushed default WarningLevel to 3.
952         
953         * statement.cs: Removed unused variable.
954
955 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
956
957         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
958         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
959         Add error 502 report.
960         (StaticClass.DefineType): Add error 441 report.
961         (Class.AllowedModifiersProp): New virtual property as temporary
962         extension to AllowedModifiers.
963         (Class.DefineType): Add error 418 report. Moved ModFlags check here
964         to share implementation with StaticClass and don't call virtual
965         methods from ctor.
966         
967         * driver.cs (MainDriver): Add error 1558 test.
968
969         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
970         report. Moved error 36 test here.
971
972         * statement.cs (Throw.Resolve): Add error 724 report.
973
974         * typemanager.cs: Add out_attribute_type core type.
975         
976 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
977
978         * class.cs (TypeContainer.VerifyClsCompliance): Add error
979         3018 report.
980         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
981
982         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
983         3017 report.
984         
985         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
986
987         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
988         Add error 3023 report.
989         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
990
991         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
992         implementation.
993
994 2004-12-12  John Luke  <john.luke@gmail.com>
995
996         * driver.cs (AddArgs): take -- into account when
997         adding arguments, fixes bug 65710 
998
999 2004-12-12  Martin Baulig  <martin@ximian.com>
1000
1001         * expression.cs (Unary.TryReduceNegative): Added support for
1002         SByteConstant and ByteConstant.
1003         (Unary.Reduce): Check error values from TryReduceNegative().
1004
1005 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
1006
1007         * attributes.cs (Attribute.Resolve): Avoid multiple error report
1008         and report exception as error 182.
1009
1010 2004-12-10  Raja R Harinath  <rharinath@novell.com>
1011
1012         * driver.cs (Main): Fix message when there are warnings.
1013
1014 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
1015
1016         * delegate.cs: Fixed my fix from yesterday, sorry about that.
1017
1018 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
1019
1020         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
1021         Reduced number of warnings.
1022         
1023         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
1024
1025 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
1026
1027         * driver.cs: Removed message.
1028
1029         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
1030
1031 2004-12-08    <vargaz@freemail.hu>
1032
1033         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1034
1035 2004-12-08  Martin Baulig  <martin@ximian.com>
1036
1037         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1038         instead of a CS3002 for properties and indexer.
1039
1040 2004-12-08  Martin Baulig  <martin@ximian.com>
1041
1042         * decl.cs (MemberName.ToString): Make this work again.
1043
1044 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
1045
1046         * attribute.cs (Resolve): Add error 591 detection.
1047
1048         * class.cs (FieldMember.Define): Add error 1547 detection.
1049         (Indexer.Define): Add error 620 detection.
1050         (Operator.Define): Add error 590 detection.
1051
1052         * ecore.cs: Missing argument for error 79.
1053
1054         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1055         detection.
1056
1057 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1058
1059         Fix #70106
1060         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1061         only.
1062
1063 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1064
1065         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1066           Some operator comments were suppressed.
1067         * doc.cs : Implicit/explicit operator name in doc comments are like
1068           "op_Explicit(type)~returnType", so added suffix handling.
1069
1070 2005-01-21  Alp Toker  <alp@atoker.com>
1071
1072         * cs-parser.jay: destructor_declaration's container is PartialContainer
1073         not Class when partial types are used, so use Kind prop instead of 'is'.
1074
1075 2004-12-12  Martin Baulig  <martin@ximian.com>
1076
1077         * expression.cs (Unary.TryReduceNegative): Added support for
1078         SByteConstant and ByteConstant.
1079         (Unary.Reduce): Check error values from TryReduceNegative().
1080
1081 2004-12-11  Martin Baulig  <martin@ximian.com>
1082
1083         * support.cs (ReflectionParameters.ParameterName): If we have a
1084         `gpd', call `ParameterName' on it.
1085
1086         * parameter.cs (Parameter.GetParameterAttributes): New static method.
1087
1088         * pending.cs (PendingImplementation.DefineProxy): Call
1089         DefineParameter() for all of the MethodBuilder's arguments.
1090
1091 2004-12-09  Martin Baulig  <martin@ximian.com>
1092
1093         * doc.cs (DocUtil): Make this a static class.
1094
1095 2004-12-09  Martin Baulig  <martin@ximian.com>
1096
1097         * expression.cs (Invocation.InferType): Moved the type inference
1098         implementation into TypeManager.
1099
1100         * generics.cs (TypeManager): Moved the type inference
1101         implementation here.
1102
1103 2004-12-09  Martin Baulig  <martin@ximian.com>
1104
1105         * typemanager.cs (TypeManager): Make this a partial class.
1106
1107         * generics.cs
1108         (TypeManager): Move the generics part of `TypeManager' here.
1109
1110 2004-12-08  Martin Baulig  <martin@ximian.com>
1111
1112         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1113         instead of a CS3002 for properties and indexer.  Added CS3024
1114         check for generic interfaces.
1115
1116         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
1117         instances are not CLS-compliant.
1118
1119 2004-12-08  Martin Baulig  <martin@ximian.com>
1120
1121         * cs-parser.jay
1122         (void_pointer_expression): New rule for `void*', `void**' etc.
1123         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
1124
1125 2004-12-08  Martin Baulig  <martin@ximian.com>
1126
1127         * expression.cs (Invocation.InferType): Removed the hack for
1128         MethodCore.MayUnify().  
1129
1130         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
1131         this actually work.
1132
1133         * class.cs (MethodCore.MayUnify): Use
1134         TypeManager.MayBecomeEqualGenericTypes().       
1135
1136 2004-12-08  Martin Baulig  <martin@ximian.com>
1137
1138         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
1139         parameter, box it.  Fixes #69233.
1140
1141 2004-12-08  Martin Baulig  <martin@ximian.com>
1142
1143         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
1144         have the ctor constraint.  Fixes #68326.
1145
1146 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1147
1148         * cs-parser.jay : interface comment was not consumed because of
1149           extra opt_semicolon before doc handling.
1150
1151 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1152
1153         Fix test-327.cs, test-328.cs, and put in early infrastructure
1154         for eventually fixing #52697.
1155         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1156         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1157         from other methods.
1158         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1159         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1160         (VerifyUsing, error246): Update.
1161         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1162         'NamespaceEntry.LookupNamespaceOrType'.
1163
1164 2004-12-07  Martin Baulig  <martin@ximian.com>
1165
1166         * driver.cs: Call it "BETA SOFTWARE" :-)
1167
1168 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1169
1170         Fix crash on cs0657-17.cs.
1171         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1172         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1173         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1174         the case where the NamespaceEntry gets overwritten.
1175
1176 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1177
1178         Fixed #69195, #56821
1179         * ecore.cs (ResolveBoolean): Tiny refactoring.
1180
1181         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1182         of right expression resolving when left is false constant and
1183         operator is LogicalAnd OR true constant and operator is LogicalOr.
1184
1185         * statement.cs (ResolveUnreachable): Always reports warning.
1186
1187 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1188
1189         * class.cs: Distinguish between 1721 and 1722 (just a little help
1190         for the programmer).
1191
1192 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1193
1194         * delegate.cs: Only allow this on new versions of the language. 
1195
1196 2004-12-02  Duncan Mak  <duncan@ximian.com>
1197
1198         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1199         Expression class.
1200         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1201         here as a static method. Take an additional bool out parameter
1202         `must_do_cs1540_check' for signaling to InstanceResolve.
1203         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1204         member field from PropertyExpr class and made it an argument of
1205         the method instead.
1206         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1207         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1208         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1209         and `remove_accessor' as well as InstanceResolve: report CS0122
1210         where applicable.
1211
1212         Fixes #70129.
1213
1214 2004-12-07  Martin Baulig  <martin@ximian.com>
1215
1216         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
1217         and CS0692 where appropriate.
1218
1219 2004-12-06  Martin Baulig  <martin@ximian.com>
1220
1221         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
1222         IsDuplicateImplementation() and improved it.
1223
1224         * expression.cs (Invocation.InferTypeArguments): Added
1225         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
1226         and removed the "ref" modifier from `infered_types'.
1227
1228         * decl.cs (MemberName.ToString): Removed the exception.
1229
1230 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1231
1232         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1233           comments are allowed.
1234
1235 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1236
1237         * delegate.cs: Add checks for subtypes in paramaters and return values
1238         in VerifyMethod () to add support for Covariance/Contravariance
1239         in delegates.
1240         
1241 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1242
1243         * report.cs: Remove extra closing parenthesis.
1244
1245         * convert.cs (Error_CannotImplicitConversion): If the name of the
1246         types are the same, provide some extra information.
1247
1248 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1249
1250         Fix bug #70102
1251         * attribute.cs (Resolve): Improved implementation of params
1252         attribute arguments.
1253
1254         * support.cs (ParameterData): Add HasParams to be faster.
1255
1256 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1257
1258         all things are for /doc support:
1259
1260         * doc.cs: new file that supports XML documentation generation.
1261         * mcs.exe.sources: added doc.cs.
1262         * driver.cs:
1263           Handle /doc command line option.
1264           Report error 2006 instead of 5 for missing file name for /doc.
1265           Generate XML documentation when required, after type resolution.
1266         * cs-tokenizer.cs:
1267           Added support for picking up documentation (/// and /** ... */),
1268           including a new XmlCommentState enumeration.
1269         * cs-parser.jay:
1270           Added lines to fill Documentation element for field, constant,
1271           property, indexer, method, constructor, destructor, operator, event
1272           and class, struct, interface, delegate, enum.
1273           Added lines to warn incorrect comment.
1274         * rootcontext.cs :
1275           Added Documentation field (passed only when /doc was specified).
1276         * decl.cs:
1277           Added DocComment, DocCommentHeader, GenerateDocComment() and
1278           OnGenerateDocComment() and some supporting private members for
1279           /doc feature to MemberCore.
1280         * class.cs:
1281           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1282         * delegate.cs:
1283           Added overriden DocCommentHeader.
1284         * enum.cs:
1285           Added overriden DocCommentHeader and GenerateDocComment().
1286
1287 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1288
1289         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1290         unwrapping the enumeration values, chain to
1291         DoConstantNumericPromotions again, so we can promote things to the
1292         fundamental types (takes care of enums that are bytes, sbytes).
1293
1294         Fixes bug #62054.
1295
1296 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1297
1298         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1299         Fix long-standing bug in type-lookup.  Use FindType instead of
1300         LookupType when ec.ResolvingTypeTree.
1301         (Attribute.ResolveType, Attribute.Resolve)
1302         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1303         Update to changes.
1304         (Attributes.Search): Remove internal version.  Update.
1305         (Attributes.SearchMulti): Update.
1306         (Attributes.GetClsCompliantAttribute): Remove.
1307         (Attributes.GetIndexerNameAttribute): Remove.
1308         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1309         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1310         * class.cs (Indexer.Define): Likewise.
1311
1312 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1313
1314         Fix bug #68790
1315         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1316         MarshallByReference members access.
1317
1318         * expression.cs: Use CheckMarshallByRefAccess;
1319         Better error CS0197 message.
1320
1321         * report.cs: Print whole related error message.
1322
1323 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1324
1325         * class (GetClassBases): Better error 60 report.
1326         (EventProperty): Disabled warning 67 detection.
1327
1328 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1329
1330         Fix bug #60324
1331         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1332
1333         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1334         precise values.
1335
1336 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1337
1338         Fix bug #49488
1339         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1340
1341         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1342
1343 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
1344
1345         * attribute.cs (Attribute.Resolve): Refine error reporting and
1346         report a cs0117 if the identifier does not exist, to distinguish
1347         from 0617 which is a miss-use of the actual identifier.
1348
1349         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1350         between cs0070 and cs0079.
1351
1352         * class.cs (MemberBase.DoDefine): When reporting a wrong
1353         accessibility level, we use MethodCore to compare instead of
1354         Method (this was a regression in some refactoring effort).
1355
1356         So now we correctly report cs0056 again.
1357
1358         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1359         testing the target_type (which was known to be object_type) and
1360         not the source type (which is anonymous_method).
1361
1362         Fixed reporting of error cs1660.
1363
1364         * expression.cs (UserCast.Source): Expose the underlying cast.
1365
1366         * statement.cs (Switch.SwitchGoverningType): Sort the list of
1367         allowed types to find a match to int32 first (most common).
1368
1369         In addition, it ignores any ImplicitUserConversions that did an
1370         internal implicit conversion (as the switch statement allows only
1371         one integral conversion to exist).
1372
1373         * class.cs (PartialContainer.Create): rename `name' to
1374         `member_name' for clarity.  Then replace the string calls with a
1375         call to MemberName.GetPartialName, as now using
1376         MemberName.ToString is an error (this is due to the side effects
1377         it had, that were fixed in the past).
1378
1379         This will restore the error reporting on a number of partial class
1380         errors that were missusing this (and getting an exception as a
1381         results, which is now just a plain textual warning, because
1382         yyparse debug output would crash otherwise).
1383
1384 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1385
1386         * Makefile (PROGRAM_INSTALL_DIR): Remove.
1387
1388 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1389
1390         * rootcontext.cs (LookupType): Make sure to cache lookups that
1391         don't give us a negative result. This saves about 5% of corlib
1392         compilation time.
1393
1394 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1395
1396         * report.cs (AbstractMessage.Print): messages are sent to stderr
1397
1398         * class.cs (TypeContainer.GetClassBases): It is an error to have a
1399         non-interface in the list of interfaces (at this point, either
1400         parent was properly set, or a base class is being listed in the
1401         interfaces section).
1402
1403         This flags error 1722, and resolves the crash from bug 69259.
1404
1405 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1406
1407         * statement.cs (Using.EmitExpressionFinally): make this work right
1408         for valuetypes. Fixes 69926.
1409
1410 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1411
1412         * const.cs (Const.ChangeType): Cope with the "0 literal can be
1413         converted to an enum" here, before we try to change the underlying
1414         type.  This code exists, but it is a different code path than the
1415         one used while encoding constants.
1416
1417         (ImplicitReferenceConversionExists): In addition, resynchronized
1418         the code here, so it matches the same code in
1419         ImplicitReferenceConversionExists for the `from any class-type S
1420         to any interface-type T'.       
1421
1422 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
1423
1424         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1425
1426 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
1427
1428         * cs-parser.jay: Use verbosity accordingly. 
1429
1430 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1431
1432         * expression.cs (Unary.ResolveOperator): Do not report warning;
1433         AddressOf reads from variable.
1434         
1435         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1436
1437 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1438
1439         Fix bug #69462
1440
1441         * attribute.cs (Attributable): Removed CheckTargets.
1442         (Attributes.Emit): Explicit attribute targets are tested here.
1443
1444         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1445         not enabled for interfaces.
1446
1447         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1448         (GetAssemblyName): Ouch next bug there.
1449
1450 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1451
1452         * expression.cs: Error 275 added.
1453         
1454 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1455
1456         Fix bug #69177 (Implemented decimal constant support)
1457
1458         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1459         (BinaryFold): Add DecimalConstant.
1460
1461         * const.cs (Define): Decimal constant 
1462         (is not constant.
1463         (ChangeType): Add decimal type handling.
1464         (LookupConstantValue): Don't set value for decimal type but
1465         emit DecimalConstantAttribute. Needed for constant optimization.
1466
1467         * constant.cs (ToDecimal): New method.
1468         (ConvertToDecimal): New method.
1469         (IntConstant): Implemented ConvertToDecimal.
1470         (DecimalConstant.Emit): Emit optimized version for decimals in
1471         int range.
1472
1473         * expression.cs (ResolveOperator): Changed order of constant
1474         reduction to work correctly with native types which have
1475         overloaded operators.
1476         (ResolveMemberAccess): Extract constant value from attribute
1477         for decimal type.
1478
1479         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1480
1481         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1482         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1483         (ChangeType): Decimal is special.
1484         (TypeToCoreType): Add decimal type.
1485
1486 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1487
1488         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1489         decimal types.
1490
1491 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1492
1493         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1494         test cs1667-5.cs.
1495
1496 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1497
1498         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1499
1500         * pending.cs (PendingImplementation): Grab only interfaces.
1501
1502 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1503
1504         * statement.cs (ForeachHelperMethods): Add location member and
1505         error 202 detection.
1506
1507 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1508
1509         * expression.cs (DoResolveBase): Fixed wrong warning for out
1510         variables.
1511
1512 2004-12-04  Martin Baulig  <martin@ximian.com>
1513
1514         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
1515         to check whether the conversion is ok.
1516
1517         * typemanager.cs (TypeManager.GetTypeArguments): Just return
1518         `Type.EmptyTypes' if we're not a generic TypeContainer.
1519
1520 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1521
1522         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1523         old bug: when converting from the null literal to a pointer,
1524         return an EmptyCast, not the NullLiteral.
1525
1526         This fixes #69921, the recent null_type changes probably made this
1527         bug more prominent.
1528
1529 2004-12-03  Martin Baulig  <martin@ximian.com>
1530
1531         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1532         method as our child, call AnonymousMethod.Compatible() on it.
1533
1534 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1535
1536         * class.cs (FieldBase): Use an unused bit field from the field to
1537         encode the `has_offset' property from the FieldMember.  This saves
1538         a couple of Ks on bootstrap compilation.
1539
1540         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1541         method as our child, return the AnonymousMethod resolved
1542         expression.
1543
1544         * expression.cs (New.DoResolve): Allow return values from
1545         NewDelegate to also include AnonymousMethods.
1546
1547         Fixes #70150.
1548
1549 2004-11-29  Raja R Harinath  <rharinath@novell.com>
1550
1551         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
1552         cs1648 report.
1553         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
1554         System.Runtime.InteropServices._Exception, since it's a base
1555         interface of the core type System.Exception in the net_2_0 profile.
1556
1557 2004-11-27  Martin Baulig  <martin@ximian.com>
1558
1559         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
1560
1561 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1562
1563         * Makefile: Convert to use executable.make.
1564         * gmcs.exe.sources: New.
1565
1566 2004-11-25  Martin Baulig  <martin@ximian.com>
1567
1568         * expression.cs (Invocation.InferType): Added support for byref types.
1569
1570 2004-11-25  Martin Baulig  <martin@ximian.com>
1571
1572         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1573         in TypeManager.TypeToCoreType().
1574
1575 2004-11-25  Martin Baulig  <martin@ximian.com>
1576
1577         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1578         "Dispose" method from the `current_type'.
1579         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1580         DoDefineMembers() instead of using the MethodBuilder; this is
1581         required for generic iterators.
1582
1583         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1584
1585 2004-11-24  Martin Baulig  <martin@ximian.com>
1586
1587         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1588
1589 2004-11-20  Martin Baulig  <martin@ximian.com>
1590
1591         * expression.cs (Invocation.InferType): Correctly infer generic
1592         instances; see gen-103.cs.
1593         (Invocation.InferTypeArguments): If a generic method doesn't have
1594         any unbound type parameters, we don't need to infer anything.
1595
1596 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1597
1598         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1599
1600 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1601
1602         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1603         (TypeHandle.GetMemberCache): New.
1604         (TypeHandle.TypeHandle): Update.
1605         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1606         (TypeManager.LookupParentInterfacesCache):
1607         Rename from LookupInterfaceCache.  Optimize slightly.
1608         (TypeManager.MemberLookup_FindMembers): Update.
1609         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1610         multi-type variant.
1611         (AddCacheContents): Rename from AddHashtable.
1612         * class.cs (TypeContainer.parent_container): Remove.
1613         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1614         (TypeContainer.DoDefineMembers): Don't initialize it.
1615         Update to name changes.
1616         
1617 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1618
1619         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1620         that factors the code to check access modifiers on override.  
1621
1622         (PropertyBase): Use the code here.
1623
1624         Patch from Lluis S'anchez, fixes bug #69361.
1625
1626 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1627
1628         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1629         routine that is used to report the use of a captured variable
1630         whose address has been taken.
1631
1632         There are two checks: one when variables are being captured and
1633         the other check is when the address of a variable is taken. 
1634         
1635         (because an anonymous methods might be resolved before *or* after
1636         the address has been taken) and 
1637
1638         * expression.cs (Conditional.DoResolve): Remove the special
1639         casing that Martin added to trueExpr and falseExpr being both
1640         NullLiteral.  We get the right behavior now just by introducing
1641         the null_type into the compiler. 
1642
1643         * convert.cs (ExplicitConversion): Change the code to use
1644         null_type instead of testing `expr is NullLiteral'.
1645         (ImplicitConversionStandard): use null_type too.
1646         (ImplicitReferenceConversionExists): use null_type too.
1647         (ImplicitReferenceConversion): use null_type too.
1648
1649         * literal.cs: The type of `NullLiteral' is now null_type instead
1650         of object_type. 
1651         (Resolve): Set the type here.
1652
1653         * typemanager.cs: Introduce null_type.
1654
1655 2004-11-18  Martin Baulig  <martin@ximian.com>
1656
1657         * rootcontext.cs
1658         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1659
1660 2004-11-18  Martin Baulig  <martin@ximian.com>
1661
1662         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1663
1664 2004-11-18  Martin Baulig  <martin@ximian.com>
1665
1666         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1667         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1668         call ResolveConstructedType() on it to resolve it without checking
1669         constraints.
1670         (Constraints.ResolveTypes): Check them here.
1671         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1672         but don't check constraints.
1673         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1674         check constraints here.
1675         (ConstructedType.ResolveConstructedType): New public method.  This
1676         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1677         resolve ourselves without checking constraints.
1678
1679         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1680
1681 2004-11-18  Martin Baulig  <martin@ximian.com>
1682
1683         * decl.cs
1684         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1685
1686         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1687
1688 2004-11-18  Martin Baulig  <martin@ximian.com>
1689
1690         * ecore.cs (TypeExpr.ResolveType): Removed.
1691         (Expression.ResolveAsTypeTerminal): We always return a fully
1692         resolved `TypeExpr', so we can just access its `Type'.
1693
1694         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1695
1696 2004-11-17  Martin Baulig  <martin@ximian.com>
1697
1698         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1699         sure we don't return any unresolved TypeExpr's.
1700         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1701         a `TypeExpr'.
1702         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1703
1704         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1705         unresolved `ConstructedType's.
1706
1707 2004-11-17  Martin Baulig  <martin@ximian.com>
1708
1709         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1710
1711 2004-11-17  Martin Baulig  <martin@ximian.com>
1712
1713         * ecore.cs
1714         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1715
1716         * decl.cs (DeclSpace.ResolveType): Removed.
1717         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1718
1719 2004-11-17  Martin Baulig  <martin@ximian.com>
1720
1721         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1722         direction, like FindMembers() does.  Fixes #69546, testcase is in
1723         test-315.cs.    
1724
1725 2004-11-16  Martin Baulig  <martin@ximian.com>
1726
1727         This is based on a patch from Marek Safar, see bug #69082.
1728         Fixes bugs #63705 and #67130.
1729
1730         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1731         method; create a MemberCache for an interface type and cache the
1732         result.
1733
1734         * decl.cs (IMemberContainer.ParentContainer): Removed.
1735         (IMemberContainer.ParentCache): New property.
1736         (MemberCache.SetupCacheForInterface): Removed.
1737         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1738         to create a cache for an interface's "parent".
1739
1740         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1741         interfaces too.
1742
1743 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1744
1745         * statement.cs: Avoid adding bools to a hashtable.
1746
1747 2004-11-15  Martin Baulig  <martin@ximian.com>
1748
1749         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1750
1751 2004-11-11  Martin Baulig  <martin@ximian.com>
1752
1753         * typemanager.cs (TypeManager.GetMethodName): New method.
1754
1755         * class.cs (MethodData.Define): Include the generic arity in the
1756         name of an explicit interface; also add it to the method name.
1757
1758         * pending.cs (PendingImplementation.InterfaceMethod): The method
1759         name now includes the generic arity.
1760
1761 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1762
1763         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1764         calling an unsafe method from a safe location.
1765
1766 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1767
1768         Fix #69167
1769         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1770
1771 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1772
1773         * namespace.cs (VerifyUsing): use GetPartialName instead of
1774         ToString. 
1775
1776 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1777
1778         * statement.cs (Return.Resolve): Fix regression in typo: if
1779         `in_exc', we have to request a NeedReturnLabel, this was a typo
1780         introduced in the anonymous method check-in.  Fixes #69131.
1781
1782         * Indexers were using the ShortName when defining themselves,
1783         causing a regression in the compiler bootstrap when applying the
1784         patch from 2004-11-02 (first part), now they use their full name
1785         and the bug is gone.
1786
1787 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1788
1789         * driver.cs: Strip the path from the names of embedded resources. Fixes
1790         #68519.
1791
1792 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1793
1794         Fix error message regression: cs0104-2.cs.
1795         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1796         (AliasEntry.Resolve): Update.
1797         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1798         'silent' flag.
1799         (RootContext.LookupType): Update.
1800
1801 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1802
1803         * cs-parser.jay: Add support for handling accessor modifiers
1804         * class: Add support port accessor modifiers and error checking,
1805         define PropertyMethod.Define as virtual (not abstract anymore)
1806         * ecore.cs: Add checking for proeprties access with access modifiers
1807         * iterators.cs: Modify Accessor constructor call based in the modified
1808         constructor
1809 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1810
1811         * expression.cs (StringConcat): Handle being called twice,
1812         as when we have a concat in a field init with more than two
1813         ctors in the class
1814
1815 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1816
1817         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1818         special case explicit implementations, we should always produce
1819         the .property or .event declaration.
1820         
1821         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1822         since it will not return correct data if people use this
1823         unresolved in the presence of using statements (see test-313).
1824
1825         * class.cs (MethodData.Define): If we are an explicit interface
1826         implementation, set the method name to the full name of the
1827         interface plus the name of the method.  
1828
1829         Notice that using the method.MethodName.GetFullName() does not
1830         work, as it will only contain the name as declared on the source
1831         file (it can be a shorthand in the presence of using statements)
1832         and not the fully qualifed type name, for example:
1833
1834         using System;
1835
1836         class D : ICloneable {
1837                 object ICloneable.Clone ()  {
1838                 }
1839         }
1840
1841         Would produce a method called `ICloneable.Clone' instead of
1842         `System.ICloneable.Clone'.
1843
1844         * namespace.cs (Alias.Resolve): Use GetPartialName.
1845         
1846 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1847
1848         * cs-parser.jay: Add error 1055 report.
1849
1850 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1851
1852         * assign.cs (Assign.DoResolve): Only do the transform of
1853         assignment into a New if the types are compatible, if not, fall
1854         through and let the implicit code deal with the errors and with
1855         the necessary conversions. 
1856
1857 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1858
1859         * cs-parser.jay: Add error 1031 report.
1860
1861         * cs-tokenizer.cs: Add location for error 1038.
1862
1863 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1864
1865         * cs-parser.jay: Add error 1016 report.
1866
1867 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1868
1869         * cs-parser.jay: Add errors 1575,1611 report.
1870
1871 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1872
1873         * cs-parser.jay: Add error 1001 report.
1874
1875 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1876
1877         Fix #68850
1878         * attribute.cs (GetMarshal): Add method argument for
1879         caller identification.
1880
1881         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1882         agument for GetMarshal and RuntimeMissingSupport.
1883
1884 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1885
1886         * attribute.cs (ExtractSecurityPermissionSet): Removed
1887         TypeManager.code_access_permission_type.
1888
1889         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1890
1891 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1892
1893         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1894         for obsolete use of a variable here.   Fixes regression on errors
1895         cs0619-25 and cs0619-26.
1896
1897 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1898
1899         Fix #62358, implemented security attribute encoding.
1900
1901         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1902         Tests permitted SecurityAction for assembly or other types.
1903         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1904         data from SecurityPermissionAttribute to PermisionSet class.
1905
1906         * class.cs (ApplyAttributeBuilder): Added special handling
1907         for System.Security.Permissions.SecurityAttribute based types.
1908
1909         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1910         special handling for System.Security.Permissions.SecurityAttribute
1911         based types.
1912
1913         * enum.cs (ApplyAttributeBuilder): Added special handling
1914         for System.Security.Permissions.SecurityAttribute based types.
1915
1916         * parameter.cs (ApplyAttributeBuilder): Added special handling
1917         for System.Security.Permissions.SecurityAttribute based types.
1918
1919         * rootcontext.cs: Next 2 core types.
1920
1921         * typemanager.cs (TypeManager.security_permission_attr_type):
1922         Built in type for the SecurityPermission Attribute.
1923         (code_access_permission_type): Build in type.
1924
1925 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1926
1927         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1928         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1929         all of this information into
1930         EmitContext.EmitCapturedVariableInstance.
1931         
1932         * codegen.cs (EmitCapturedVariableInstance): move here the
1933         funcionality of emitting an ldarg.0 in the presence of a
1934         remapping.   This centralizes the instance emit code.
1935
1936         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1937         then emit a load of this: it means that we have reached the
1938         topmost ScopeInfo: the one that contains the pointer to the
1939         instance of the class hosting the anonymous method.
1940
1941         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1942         captures to the topmost CaptureContext.
1943
1944 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1945
1946         * expression.cs (LocalVariableReference): Move the knowledge about
1947         the iterators into codegen's EmitCapturedVariableInstance.
1948
1949 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1950
1951         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1952         all code paths return a value from an anonymous method (it is the
1953         same as the 161 error, but for anonymous methods).
1954
1955 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1956
1957         The introduction of anonymous methods in the compiler changed
1958         various ways of doing things in the compiler.  The most
1959         significant one is the hard split between the resolution phase
1960         and the emission phases of the compiler.
1961
1962         For instance, routines that referenced local variables no
1963         longer can safely create temporary variables during the
1964         resolution phase: they must do so from the emission phase,
1965         since the variable might have been "captured", hence access to
1966         it can not be done with the local-variable operations from the runtime.
1967         
1968         * statement.cs 
1969
1970         (Block.Flags): New flag `IsTopLevel' to indicate that this block
1971         is a toplevel block.
1972
1973         (ToplevelBlock): A new kind of Block, these are the blocks that
1974         are created by the parser for all toplevel method bodies.  These
1975         include methods, accessors and anonymous methods.
1976
1977         These contain some extra information not found in regular blocks:
1978         A pointer to an optional CaptureContext (for tracking captured
1979         local variables and parameters).  A pointer to the parent
1980         ToplevelBlock.
1981         
1982         (Return.Resolve): Catch missmatches when returning a value from an
1983         anonymous method (error 1662).
1984         Invoke NeedReturnLabel from the Resolve phase instead of the emit
1985         phase.
1986
1987         (Break.Resolve): ditto.
1988
1989         (SwitchLabel): instead of defining the labels during the
1990         resolution phase, we now turned the public ILLabel and ILLabelCode
1991         labels into methods called GetILLabelCode() and GetILLabel() that
1992         only define the label during the Emit phase.
1993
1994         (GotoCase): Track the SwitchLabel instead of the computed label
1995         (its contained therein).  Emit the code by using
1996         SwitchLabel.GetILLabelCode ().
1997
1998         (LocalInfo.Flags.Captured): A new flag has been introduce to track
1999         whether the Local has been captured or not.
2000
2001         (LocalInfo.IsCaptured): New property, used to tell whether the
2002         local has been captured.
2003         
2004         * anonymous.cs: Vastly updated to contain the anonymous method
2005         support.
2006
2007         The main classes here are: CaptureContext which tracks any
2008         captured information for a toplevel block and ScopeInfo used to
2009         track the activation frames for various local variables.   
2010
2011         Each toplevel block has an optional capture context associated
2012         with it.  When a method contains an anonymous method both the
2013         toplevel method and the anonymous method will create a capture
2014         context.   When variables or parameters are captured, they are
2015         recorded on the CaptureContext that owns them, for example:
2016
2017         void Demo () {
2018              int a;
2019              MyDelegate d = delegate {
2020                  a = 1;
2021              }
2022         }
2023
2024         Here `a' will be recorded as captured on the toplevel
2025         CapturedContext, the inner captured context will not have anything
2026         (it will only have data if local variables or parameters from it
2027         are captured in a nested anonymous method.
2028
2029         The ScopeInfo is used to track the activation frames for local
2030         variables, for example:
2031
2032         for (int i = 0; i < 10; i++)
2033                 for (int j = 0; j < 10; j++){
2034                    MyDelegate d = delegate {
2035                         call (i, j);
2036                    }
2037                 }
2038
2039         At runtime this captures a single captured variable `i', but it
2040         captures 10 different versions of the variable `j'.  The variable
2041         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2042         recorded on a child.  
2043
2044         The toplevel ScopeInfo will also track information like the `this'
2045         pointer if instance variables were referenced (this is necessary
2046         as the anonymous method lives inside a nested class in the host
2047         type of the method). 
2048
2049         (AnonymousMethod): Expanded to track the Toplevel, implement
2050         `AnonymousMethod.Compatible' to tell whether an anonymous method
2051         can be converted to a target delegate type. 
2052
2053         The routine now also produces the anonymous method content
2054
2055         (AnonymousDelegate): A helper class that derives from
2056         DelegateCreation, this is used to generate the code necessary to
2057         produce the delegate for the anonymous method that was created. 
2058
2059         * assign.cs: API adjustments for new changes in
2060         Convert.ImplicitStandardConversionExists.
2061
2062         * class.cs: Adjustments to cope with the fact that now toplevel
2063         blocks are of type `ToplevelBlock'. 
2064
2065         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2066         insteda of standard blocks.
2067
2068         Flag errors if params arguments are passed to anonymous methods.
2069
2070         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2071         `CurrentAnonymousMethod' which points to the current Anonymous
2072         Method.  The variable points to the AnonymousMethod class that
2073         holds the code being compiled.  It is set in the new EmitContext
2074         created for the anonymous method.
2075
2076         (EmitContext.Phase): Introduce a variable and an enumeration to
2077         assist in enforcing some rules about when and where we are allowed
2078         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2079         only one that enfonces this right now).
2080
2081         (EmitContext.HaveCaptureInfo): new helper method that returns
2082         whether we have a CapturedContext initialized.
2083
2084         (EmitContext.CaptureVariable): New method used to register that a
2085         LocalInfo must be flagged for capturing. 
2086
2087         (EmitContext.CapturedParameter): New method used to register that a
2088         parameters must be flagged for capturing. 
2089         
2090         (EmitContext.CapturedField): New method used to register that a
2091         field must be flagged for capturing. 
2092
2093         (EmitContext.HaveCapturedVariables,
2094         EmitContext.HaveCapturedFields): Return whether there are captured
2095         variables or fields. 
2096
2097         (EmitContext.EmitMethodHostInstance): This is used to emit the
2098         instance for the anonymous method.  The instance might be null
2099         (static methods), this (for anonymous methods that capture nothing
2100         and happen to live side-by-side with the current method body) or a
2101         more complicated expression if the method has a CaptureContext.
2102
2103         (EmitContext.EmitTopBlock): Routine that drives the emission of
2104         code: it will first resolve the top block, then emit any metadata
2105         and then emit the code.  The split is done so that we can extract
2106         any anonymous methods and flag any captured variables/parameters.
2107         
2108         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2109         during this phase, the ILGenerator should not be used as labels
2110         and local variables declared here might not be accessible to any
2111         code that is part of an anonymous method.  
2112
2113         Exceptions to this include the temporary variables that are
2114         created by some statements internally for holding temporary
2115         variables. 
2116         
2117         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2118         metadata for a cb
2119
2120         (EmitContext.TemporaryReturn): This method is typically called
2121         from the Emit phase, and its the only place where we allow the
2122         ReturnLabel to be defined other than the EmitMeta.  The reason is
2123         that otherwise we would have to duplicate a lot of logic in the
2124         Resolve phases of various methods that today is on the Emit
2125         phase. 
2126
2127         (EmitContext.NeedReturnLabel): This no longer creates the label,
2128         as the ILGenerator is not valid during the resolve phase.
2129
2130         (EmitContext.EmitThis): Extended the knowledge in this class to
2131         work in anonymous methods in addition to iterators. 
2132
2133         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2134         code is necessary on the stack to access the instance to a local
2135         variable (the variable will be accessed as a field).
2136
2137         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2138         EmitContext.EmitAddressOfParameter): Routines to support
2139         parameters (not completed at this point). 
2140         
2141         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2142         will also remove the parameters.
2143
2144         * convert.cs (Convert): Define a `ConstantEC' which points to a
2145         null.  This is just to prefity some code that uses
2146         ImplicitStandardConversion code and do not have an EmitContext
2147         handy.
2148
2149         The idea is to flag explicitly that at that point in time, it is
2150         known that the conversion will not trigger the delegate checking
2151         code in implicit conversions (which requires a valid
2152         EmitContext). 
2153
2154         Everywhere: pass new EmitContext parameter since
2155         ImplicitStandardConversionExists now requires it to check for
2156         anonymous method conversions. 
2157
2158         (Convert.ImplicitStandardConversionExists): If the type of an
2159         expression is the anonymous_method_type, and the type is a
2160         delegate, we invoke the AnonymousMethod.Compatible method to check
2161         whether an implicit conversion is possible. 
2162
2163         (Convert.ImplicitConversionStandard): Only do implicit method
2164         group conversions if the language level is not ISO_1.
2165
2166         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2167         MethodInfo for the Invoke method.  used by Delegate and
2168         AnonymousDelegate.
2169
2170         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2171         method conversions if the target type is a delegate.
2172
2173         Removed extra debugging nops.
2174
2175         (LocalVariableReference): Turn the `local_info' into a public
2176         field. 
2177
2178         Add `prepared' field, the same hack used for FieldExprs to cope
2179         with composed assignments, as Local variables do not necessarily
2180         operate purely on the stack as they used to: they can be captured
2181         fields. 
2182
2183         Add `temp' for a temporary result, like fields.
2184
2185         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2186
2187         It now copes with Local variables that are captured and emits the
2188         proper instance variable to load it from a field in the captured
2189         case. 
2190
2191         (ParameterReference.DoResolveBase): During the resolve phase,
2192         capture parameters if we are in an anonymous method.
2193
2194         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2195         anonymous method, use the EmitContext helper routines to emit the
2196         parameter reference.
2197
2198         * iterators.cs: Set RemapToProxy to true/false during the
2199         EmitDispose class.
2200
2201         * parameters.cs (GetParameterByName): New helper method. 
2202
2203         * typemanager.cs (anonymous_method_type) a new type that
2204         represents an anonyous method.  This is always an internal type,
2205         used as a fencepost to test against the anonymous-methodness of an
2206         expression. 
2207         
2208 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2209
2210         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2211         561 report.
2212         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2213
2214 2004-11-10  Martin Baulig  <martin@ximian.com>
2215
2216         * expression.cs (Invocation.BetterFunction): If two methods have
2217         equal parameter types, but only one of them is generic, the
2218         non-generic one wins.
2219         (New.DoResolve): Don't set `is_struct' to false if we're a generic
2220         instance; just use `Type.IsValueType' to determine whether
2221         something is a struct or not.
2222         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
2223         so we can be called multiple times.
2224
2225 2004-11-10  Martin Baulig  <martin@ximian.com>
2226
2227         * generic.cs (TypeParameter.DefineConstraints): New public method.
2228         (TypeParameter.CheckAccessLevel): Override this and return true.
2229         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
2230         override ResolveType() anymore.
2231         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
2232
2233 2004-11-10  Martin Baulig  <martin@ximian.com>
2234
2235         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
2236         call DeclSpace.ResolveNestedType() on it.
2237
2238 2004-11-10  Martin Baulig  <martin@ximian.com>
2239
2240         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
2241         non-null, call ParameterModifier() on it.
2242
2243 2004-11-10  Martin Baulig  <martin@ximian.com>
2244
2245         * iterators.cs
2246         (Iterators): Added `current_type' and `this_type' fields.
2247         (Iterators.DefineIterator): Create a new EmitContext and store it
2248         in `ec'; compute `this_type'.
2249
2250 2004-11-10  Martin Baulig  <martin@ximian.com>
2251
2252         * typemanager.cs
2253         (TypeManager.IsPrivateAccessible): New public method.
2254         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
2255
2256 2004-11-10  Martin Baulig  <martin@ximian.com>
2257
2258         * class.cs (TypeContainer.DefineType): Call
2259         TypeBuilder.DefineGenericParameters() before resolving the type
2260         parameters.
2261         (MethodData.parent_method): New protected field.
2262         (MethodData..ctor): Added `MethodInfo parent_method' argument.
2263         (MethodData.Define): Compute `parent_method'.
2264
2265         * decl.cs
2266         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2267         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2268         (DeclSpace.ec): New protected field; store the EmitContext here.
2269         (DeclSpace.EmitContext): New public property.
2270         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
2271         (DeclSpace.ResolveNestedType): New public method.
2272         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
2273         (DeclSpace.NestedAccessible): Added `Type tb' argument.
2274         (DeclSpace.FamilyAccessible): Likewise.
2275         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
2276         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2277         EmitContext.
2278
2279         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
2280         field.
2281
2282         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2283         (Enum.Emit): Don't create a new EmitContext.
2284
2285 2004-10-18  Martin Baulig  <martin@ximian.com>
2286
2287         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2288         `Type' directly, but call ResolveType() on it.
2289         (Catch.Resolve): Likewise.
2290         (Foreach.Resolve): Likewise.
2291
2292 2004-10-18  Martin Baulig  <martin@ximian.com>
2293
2294         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2295         `Type' directly, but call ResolveType() on it.
2296         (Probe.DoResolve): Likewise.
2297         (ArrayCreation.LookupType): Likewise.
2298         (TypeOf.DoResolve): Likewise.
2299         (SizeOf.DoResolve): Likewise.
2300
2301 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2302
2303         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2304         the ResolveType.
2305
2306 2004-10-17  John Luke  <john.luke@gmail.com>
2307
2308         * class.cs (Operator.GetSignatureForError): use CSharpName
2309
2310         * parameter.cs (Parameter.GetSignatureForError): Returns
2311         correct name even if was not defined.
2312
2313 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2314
2315         Fix #65816.
2316         * class.cs (TypeContainer.EmitContext): New property.
2317         (DefineNestedTypes): Create an emitcontext for each part.
2318         (MethodCore.DoDefineParameters): Use container's emitcontext.
2319         Pass type array to InternalParameters.
2320         (MemberBase.DoDefine): Use container's emitcontext.
2321         (FieldMember.Define): Likewise.
2322         (Event.Define): Likewise.
2323         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2324         Pass type array to InternalParameters.
2325         (SetIndexerMethod.GetParameterInfo): Likewise.
2326         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2327         * delegate.cs (Define): Pass emitcontext to
2328         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2329         array to InternalParameters.
2330         * expression.cs (ParameterReference.DoResolveBase): Pass
2331         emitcontext to GetParameterInfo.
2332         (ComposedCast.DoResolveAsTypeStep): Remove check on
2333         ec.ResolvingTypeTree.
2334         * parameter.cs (Parameter.Resolve): Change argument to
2335         EmitContext.  Use ResolveAsTypeTerminal.
2336         (Parameter.GetSignature): Change argument to EmitContext.
2337         (Parameters.ComputeSignature): Likewise.
2338         (Parameters.ComputeParameterTypes): Likewise.
2339         (Parameters.GetParameterInfo): Likewise.
2340         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2341         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2342         * support.cs (InternalParameters..ctor): Remove variant that takes
2343         a DeclSpace.
2344         * typemanager.cs (system_intptr_expr): New.
2345         (InitExpressionTypes): Initialize it.
2346
2347 2004-10-12  Chris Toshok  <toshok@ximian.com>
2348
2349         * cs-parser.jay: fix location for try_statement and catch_clause.
2350
2351 2004-10-18  Martin Baulig  <martin@ximian.com>
2352
2353         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2354         `Type' directly, but call ResolveType() on it.
2355         (MemberBase.DoDefine): Likewise.
2356
2357         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2358         `Type' directly, but call ResolveType() on it.
2359         (ComposedCast.DoResolveAsTypeStep): Likewise.
2360
2361         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2362         `Type' directly, but call ResolveType() on it.
2363
2364 2004-10-17  John Luke  <john.luke@gmail.com>
2365
2366         * class.cs (Operator.GetSignatureForError): use CSharpName
2367
2368         * parameter.cs (Parameter.GetSignatureForError): Returns
2369         correct name even if was not defined.
2370
2371 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2372
2373         Fix #65816.
2374         * class.cs (TypeContainer.EmitContext): New property.
2375         (DefineNestedTypes): Create an emitcontext for each part.
2376         (MethodCore.DoDefineParameters): Use container's emitcontext.
2377         Pass type array to InternalParameters.
2378         (MemberBase.DoDefine): Use container's emitcontext.
2379         (FieldMember.Define): Likewise.
2380         (Event.Define): Likewise.
2381         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2382         Pass type array to InternalParameters.
2383         (SetIndexerMethod.GetParameterInfo): Likewise.
2384         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2385         * delegate.cs (Define): Pass emitcontext to
2386         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2387         array to InternalParameters.
2388         * expression.cs (ParameterReference.DoResolveBase): Pass
2389         emitcontext to GetParameterInfo.
2390         (ComposedCast.DoResolveAsTypeStep): Remove check on
2391         ec.ResolvingTypeTree.
2392         * parameter.cs (Parameter.Resolve): Change argument to
2393         EmitContext.  Use ResolveAsTypeTerminal.
2394         (Parameter.GetSignature): Change argument to EmitContext.
2395         (Parameters.ComputeSignature): Likewise.
2396         (Parameters.ComputeParameterTypes): Likewise.
2397         (Parameters.GetParameterInfo): Likewise.
2398         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2399         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2400         * support.cs (InternalParameters..ctor): Remove variant that takes
2401         a DeclSpace.
2402         * typemanager.cs (system_intptr_expr): New.
2403         (InitExpressionTypes): Initialize it.
2404
2405 2004-10-12  Chris Toshok  <toshok@ximian.com>
2406
2407         * cs-parser.jay: fix location for try_statement and catch_clause.
2408
2409 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2410
2411         More DeclSpace.ResolveType avoidance.
2412         * decl.cs (MemberCore.InUnsafe): New property.
2413         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2414         with newly created EmitContext.
2415         (FieldMember.Define): Likewise.
2416         * delegate.cs (Delegate.Define): Likewise.
2417         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2418         only if normal name-lookup fails.
2419         (TypeExpr.DoResolve): Enable error-checking.
2420         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2421         (SizeOf.DoResolve): Likewise.
2422         (ComposedCast.DoResolveAsTypeStep): Likewise.
2423         (StackAlloc.DoResolve): Likewise.
2424         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2425         (Block.Unsafe): New property.
2426         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2427         (Unsafe): Set 'unsafe' flag of contained block.
2428         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2429         (Fixed.Resolve): Likewise.
2430         (Catch.Resolve): Likewise.
2431         (Using.ResolveLocalVariableDecls): Likewise.
2432         (Foreach.Resolve): Likewise.
2433
2434 2004-10-05  John Luke <john.luke@gmail.com>
2435
2436         * cs-parser.jay: add location to error CS0175
2437
2438 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2439
2440         * ecore.cs (Expression.Constantity): Add support for turning null
2441         into a constant.
2442
2443         * const.cs (Const.Define): Allow constants to be reference types
2444         as long as the value is Null.
2445
2446 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2447
2448         * namespace.cs (NamespaceEntry.Using): No matter which warning
2449         level is set, check if this namespace name has already been added.
2450
2451 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2452
2453         * expression.cs: reftype [!=]= null should always use br[true,false].
2454         # 67410
2455
2456 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2457
2458         Fix #67108
2459         * attribute.cs: Enum conversion moved to 
2460         GetAttributeArgumentExpression to be applied to the all
2461         expressions.
2462
2463 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2464
2465         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2466         * class.c (TypeContainer.DefineType): Flag error if
2467         base types aren't accessible due to access permissions.
2468         * decl.cs (DeclSpace.ResolveType): Move logic to
2469         Expression.ResolveAsTypeTerminal.
2470         (DeclSpace.ResolveTypeExpr): Thin layer over
2471         Expression.ResolveAsTypeTerminal.
2472         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2473         Refactor code into NestedAccess.  Use it.
2474         (DeclSpace.NestedAccess): New.
2475         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2476         argument to silence errors.  Check access permissions.
2477         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2478         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2479         (Cast.DoResolve): Likewise.
2480         (New.DoResolve): Likewise.
2481         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2482         (TypeOf.DoResolve): Likewise.
2483
2484         * expression.cs (Invocation.BetterConversion): Return the Type of
2485         the better conversion.  Implement section 14.4.2.3 more faithfully.
2486         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2487         section 14.4.2.2 explicit.
2488         (Invocation.OverloadResolve): Update.
2489         (Invocation): Remove is_base field.
2490         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2491         (Invocation.Emit): Likewise.
2492
2493 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2494
2495         * cs-parser.jay: Reverted 642 warning fix.
2496
2497 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2498
2499         Fix bug #66615
2500         * decl.cs (FindMemberWithSameName): Indexer can have more than
2501         1 argument.
2502
2503 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2504
2505         * expression.cs (LocalVariableReference.DoResolveLValue):
2506         Do not report warning 219 for out values.
2507         (EmptyExpression.Null): New member to avoid extra allocations.
2508
2509 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2510
2511         * cs-parser.jay: Fix wrong warning 642 report.
2512
2513         * cs-tokenizer.cs (CheckNextToken): New helper;
2514         Inspect next character if is same as expected.
2515
2516 2004-09-23  Martin Baulig  <martin@ximian.com>
2517
2518         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2519         (Convert.ImplicitReferenceConversionExists): Likewise.
2520
2521 2004-11-09  Raja R Harinath  <rharinath@novell.com>
2522
2523         * Makefile (DISTFILES): Comment out a few missing files.
2524
2525 2004-10-29  Raja R Harinath  <rharinath@novell.com>
2526
2527         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
2528         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
2529         (gmcs.exe): Invoke bootstrap-libs.
2530         (clean-local): Clean the net_2_0_bootstrap profile too.
2531         (PROGRAM_INSTALL_DIR): New.
2532         (install-local): Use it.
2533
2534 2004-10-13  Martin Baulig  <martin@ximian.com>
2535
2536         * generic.cs (TypeManager.InflatedConstraints): New nested class.
2537         (TypeParameter.DefineType): If we're a method type parameter and
2538         that method is overriding something, "inflate" its constraints.
2539
2540 2004-10-12  Martin Baulig  <martin@ximian.com>
2541
2542         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
2543         and have type arguments, create and resolve a ConstructedType.
2544
2545 2004-10-12  Martin Baulig  <martin@ximian.com>
2546
2547         * decl.cs (MemberCache.FindMemberToOverride): Use
2548         TypeManager.IsEqual() to compare the parameters and Type.Equals()
2549         to compare the invocationType.
2550
2551         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
2552         When comparing two type parameters, only do the signature-only
2553         comparision for method type parameters.
2554
2555 2004-10-11  Martin Baulig  <martin@ximian.com>
2556
2557         * report.cs: Don't make --fatal abort on warnings, we have
2558         -warnaserror for that.
2559
2560 2004-10-11  Martin Baulig  <martin@ximian.com>
2561
2562         * typemanager.cs
2563         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
2564         (TypeManager.IsEqual): Call ourself recursively instead of using
2565         Type.IsEqual(). 
2566
2567 2004-10-11  Martin Baulig  <martin@ximian.com>
2568
2569         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2570         on our own type parameters, not on the ones we inherit from a containing
2571         class.
2572
2573         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2574         the comparision.
2575
2576         * generic.cs (TypeParameter.Define): We may only be called once.
2577
2578         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2579         instead of TypeManager.IsEqual().
2580
2581 2004-09-28  Martin Baulig  <martin@ximian.com>
2582
2583         * generic.cs
2584         (GenericConstraints.EffectiveBaseClass): New public property.
2585         (TypeParameter.GenericConstraints): New public property.
2586         (ConstructedType.CheckConstraints): Improved.
2587
2588         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2589         (Convert.TypeParameterConversion): New private method; use this in
2590         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2591         for all conversions related to type parameters.
2592
2593 2004-09-24  Martin Baulig  <martin@ximian.com>
2594
2595         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2596         type parameter conversions for type parameters which are known to
2597         be reference types.
2598
2599 2004-09-24  Martin Baulig  <martin@ximian.com>
2600
2601         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2602         `IsValueType' properties.
2603
2604         * support.cs (ReflectionConstraints): Use
2605         Type.GetGenericParameterConstraints() instead of the old hack.
2606
2607 2004-09-24  Martin Baulig  <martin@ximian.com>
2608
2609         * generic.cs (GenericConstraints): Moved here and made it an
2610         abstract class.
2611
2612         * support.cs (GenericConstraints): Moved to generic.cs.
2613
2614 2004-09-24  Martin Baulig  <martin@ximian.com>
2615
2616         * support.cs
2617         (ReflectionConstraints): Un-nested this class and made it public.
2618
2619         * typemanager.cs
2620         (TypeManager.GetTypeParameterConstraints): New public method.
2621         (TypeManager.HasConstructorConstraint): Use the attributes.
2622
2623 2004-09-24  Martin Baulig  <martin@ximian.com>
2624
2625         * support.cs (GenericConstraints): Replaced `HasConstructor',
2626         `IsReferenceType' and `IsValueType' with `Attributes'.
2627         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2628         method and made the .ctor public.
2629
2630         * generic.cs (Constraints.Attributes): New public property.
2631         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2632         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2633         `IsValueType' -> `HasValueTypeConstraint'.
2634
2635 2004-09-23  Martin Baulig  <martin@ximian.com>
2636
2637         * generic.cs (Constraints): Reflect latest runtime changes.
2638
2639 2004-09-23  Martin Baulig  <martin@ximian.com>
2640
2641         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2642         (Convert.ImplicitReferenceConversionExists): Likewise.
2643
2644 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2645
2646         * class.cs (Operator.Define): Add error 448 and 559 report.
2647         
2648 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2649
2650         * class.cs (MemberBase.IsTypePermitted): New protected
2651         method for checking error CS0610.
2652
2653 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2654
2655         * class.cs (TypeContainer.HasExplicitLayout): New property
2656         Returns whether container has StructLayout attribute set Explicit.
2657         (FieldMember): New abstract class for consts and fields.
2658         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2659         (Field): Reuse FieldMember.
2660
2661         * const.cs (Const): Reuse FieldMember.
2662
2663         * rootcontext.cs: EmitConstants call moved to class.
2664
2665 2004-09-22  Martin Baulig  <martin@ximian.com>
2666
2667         Marek and me just fixed one of our oldest bugs: #28562 :-)
2668
2669         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2670
2671         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2672         we're an EnumConstant, just return that.
2673         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2674         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2675         to get the value which'll actually be written into the attribute.
2676         However, we have to use GetValue() to access the attribute's value
2677         in the compiler.        
2678
2679 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2680
2681         * constant.cs (Constant.IsNegative): New abstract property
2682         IsNegative.
2683
2684         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2685         (StackAlloc.DoResolve): Reused IsNegative.
2686
2687 2004-09-22  Martin Baulig  <martin@ximian.com>
2688
2689         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2690         public method; like LookupTypeContainer, but also works for
2691         generic instances.
2692
2693         * report.cs (Report.SymbolRelatedToPreviousError): Use
2694         TypeManager.LookupGenericTypeContainer().       
2695
2696 2004-09-22  Martin Baulig  <martin@ximian.com>
2697
2698         Thanks to Peter Sestoft for this bug report.
2699
2700         * expression.cs (Conditional): If both the `trueExpr' and the
2701         `falseExpr' is a NullLiteral, return a NullLiteral.
2702
2703 2004-09-22  Martin Baulig  <martin@ximian.com>
2704
2705         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2706         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2707         for the "get_Current" call.
2708
2709 2004-09-21  Martin Baulig  <martin@ximian.com>
2710
2711         * convert.cs (Convert.ImplicitReferenceConversion): When
2712         converting to an interface type, first check whether we're
2713         converting from a reference type.
2714
2715 2004-09-14  Martin Baulig  <martin@ximian.com>
2716
2717         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2718
2719 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2720
2721         Fixed bug #61902
2722         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2723         called and is obsolete then this member suppress message
2724         when call is inside next [Obsolete] method or type.
2725
2726         * expression.cs: Use TestObsoleteMethodUsage member.
2727
2728 2004-09-14  Martin Baulig  <martin@ximian.com>
2729
2730         * genericparser.cs: Removed.
2731
2732 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2733
2734         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2735
2736 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2737
2738         * attribute.cs (Attribute.Resolve): Add error 653 report.
2739
2740         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2741         report.
2742         (Method.ApplyAttributeBuilder): Add error 685 report.
2743         (Operator.Define): Add error 564 report.
2744
2745         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2746
2747         * expression.cs (Invocation.DoResolve): Add error
2748         245 and 250 report.
2749
2750         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2751         error 674 report.
2752
2753 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2754
2755         * class.cs (ConstructorInitializer.Resolve):
2756         Wrong error number (515->516).
2757
2758 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2759
2760         * class.cs (Indexer.Define): Add error 631 report.
2761
2762 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2763
2764         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2765
2766 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2767
2768         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2769
2770 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2771
2772         * cs-parser.jay: Added error CS0241 report.
2773
2774 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2775
2776         * cs-parser.jay (fixed_statement): Introduce a scope for the
2777         declaration in the 'fixed' statement.
2778
2779 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2780
2781         * cs-parser.jay: Added CS0230 error report.
2782
2783 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2784
2785         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2786
2787 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2788
2789         * expression.cs (Argument.Resolve): Added error CS0192 and
2790         CS0199 report.
2791
2792 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2793
2794         C# 2.0 #pragma warning feature
2795
2796         * cs-tokenizer.cs (PreProcessPragma): New method; 
2797         Handles #pragma directive.
2798
2799         * report.cs (WarningRegions): New class; Support
2800         class for #pragma warning directive. It tests whether
2801         warning is enabled for a given line.
2802
2803 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2804
2805         * const.cs: Add more descriptive error report, tahnks to
2806         Sebastien. 
2807
2808 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2809
2810         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2811
2812 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2813
2814         * expression.cs: Apply patch from Ben: Remove dead code from
2815         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2816         as that code just threw an exception anwyays.
2817
2818         * const.cs: Remove the call to the turnintoconstant, for details
2819         see bug: #63144
2820         
2821         * literal.cs: The type of the null-literal is the null type;  So
2822         we use a placeholder type (literal.cs:System.Null, defined here)
2823         for it.
2824
2825         * expression.cs (Conditional.DoResolve): Remove some old code that
2826         is no longer needed, conversions have been fixed.
2827
2828         (ArrayCreationExpression.DoResolve): Return false if we fail to
2829         resolve the inner expression.
2830
2831 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2832
2833         Fix test-290.cs.
2834         * cs-parser.jay (delegate_declaration): Record a delegate
2835         declaration as a type declaration.
2836         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2837
2838 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2839
2840         * parameter.cs: Do not crash if the type can not be resolved. 
2841
2842         * expression.cs: Report errors with unsafe pointers, fixes #64896
2843
2844 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2845
2846         * expression.cs: Pointer arith always needs to do a conv.i
2847         if the operand is a long. fix 65320
2848
2849 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2850
2851         Fixed cs0619-37.cs, cs0619-38.cs
2852
2853         * enum.cs (GetObsoleteAttribute): Removed.
2854
2855         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2856         on Enum member is double staged. The first is tested member
2857         and then enum.
2858
2859 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2860
2861         Fixed #56986, #63631, #65231
2862
2863         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2864         adds member to name container.
2865         (TypeContainer.AddToTypeContainer): New method, adds type to
2866         name container.
2867         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2868         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2869         AddOperator): Simplified by reusing AddToMemberContainer.
2870         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2871         instead of field.
2872         (Method.CheckForDuplications): Fixed implementation to test all
2873         possibilities.
2874         (MemberBase): Detection whether member is explicit interface
2875         implementation is now in constructor.
2876         (MemberBase.UpdateMemberName): Handles IndexerName.
2877         (Accessor): Changed to keep also location information.
2878         (AbstractPropertyEventMethod): Is derived from MemberCore.
2879         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2880         will be emited or not.
2881         (PropertyBase.AreAccessorsDuplicateImplementation):
2882         Tests whether accessors are not in collision with some method.
2883         (Operator): Is derived from MethodCore to simplify common
2884         operations.
2885
2886         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2887         must be performed.
2888         (DeclSpace.AddToContainer): Adds the member to defined_names
2889         table. It tests for duplications and enclosing name conflicts.
2890
2891         * enum.cs (EnumMember): Clean up to reuse the base structures
2892
2893 2004-09-03  Martin Baulig  <martin@ximian.com>
2894
2895         Merged latest changes into gmcs.  Please keep this comment in
2896         here, it makes it easier for me to see what changed in MCS since
2897         the last time I merged.
2898
2899 2004-09-03  Martin Baulig  <martin@ximian.com>
2900
2901         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2902         into TypeContainer, to make partial classes work again.
2903
2904 2004-09-03  Martin Baulig  <martin@ximian.com>
2905
2906         * rootcontext.cs (RootContext.V2): Removed.
2907
2908 2004-03-23  Martin Baulig  <martin@ximian.com>
2909
2910         * expression.cs (Invocation.OverloadResolve): Added `bool
2911         may_fail' argument and use it instead of the Location.IsNull() hack.
2912
2913 2004-09-09  Martin Baulig  <martin@ximian.com>
2914
2915         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2916
2917 2004-09-09  Martin Baulig  <martin@ximian.com>
2918
2919         * generic.cs (TypeParameter.DefineType): Added support for
2920         explicit interface methods.
2921
2922 2004-09-09  Martin Baulig  <martin@ximian.com>
2923
2924         * README.Changes: New document.  Started to list important changes
2925         between MCS and GMCS here.
2926
2927 2004-09-08  Martin Baulig  <martin@ximian.com>
2928
2929         * class.cs
2930         (TypeContainer.CheckRecursiveDefinition): New protected method.
2931         (TypeContainer.DefineType): Move the CS0146 check into
2932         CheckRecursiveDefinition().     
2933
2934 2004-09-06  Martin Baulig  <martin@ximian.com>
2935
2936         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2937         types for the constructor constraint.
2938
2939 2004-09-03  Martin Baulig  <martin@ximian.com>
2940
2941         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2942         into TypeContainer, to make partial classes work again.
2943
2944 2004-09-03  Martin Baulig  <martin@ximian.com>
2945
2946         * rootcontext.cs (RootContext.V2): Removed.
2947
2948 2004-03-23  Martin Baulig  <martin@ximian.com>
2949
2950         * expression.cs (Invocation.OverloadResolve): Added `bool
2951         may_fail' argument and use it instead of the Location.IsNull() hack.
2952
2953 2004-09-03  Martin Baulig  <martin@ximian.com>
2954
2955         Merged latest changes into gmcs.  Please keep this comment in
2956         here, it makes it easier for me to see what changed in MCS since
2957         the last time I merged.
2958
2959 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2960
2961         Fix #61128.
2962         * expression.cs (BetterConversion): Don't allow either conversion 
2963         to be null.  Remove redundant implicit conversion test when 'q ==
2964         null' -- when this function is invoked, we already know that the
2965         implicit conversion exists.
2966         (BetterFunction): Assume that 'best' is non-null.  Remove
2967         redundant reimplementation of IsApplicable when 'best' is null.
2968         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2969         number of arguments.
2970         (IsAncestralType): Extract from OverloadResolve.
2971         (OverloadResolve): Make robust to the MethodGroupExpr being
2972         unsorted.  Implement all the logic of Section 14.5.5.1, and
2973         support overloading of methods from multiple applicable types.
2974         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
2975
2976         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2977         (RealError, Warning): Append type of report to related symbol.
2978
2979 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
2980
2981         * enum.cs: Fixed CLS-Compliance checks for enum members.
2982         Error tests cs3008-8.cs, cs3014-8.cs
2983
2984 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2985
2986         Fixed bug #62342, #63102
2987         * class.cs: ImplementIndexer uses member.IsExplicitImpl
2988         like ImplementMethod.
2989
2990 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2991
2992         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2993         Fixed bug #65170.
2994
2995 2004-09-02  Martin Baulig  <martin@ximian.com>
2996
2997         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2998         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2999         on the MethodBase.
3000
3001 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
3002
3003         C# 2.0 Static classes implemented
3004
3005         * class.cs (TypeContainer): instance_constructors,
3006         initialized_fields, initialized_static_fields,
3007         default_constructor, base_inteface_types are protected to be
3008         accessible from StaticClass.
3009         (TypeContainer.DefineDefaultConstructor): New virtual method
3010         for custom default constructor generating
3011         (StaticClass): New class to handle "Static classes" feature.
3012
3013         * cs-parser.jay: Handle static keyword on class like instance
3014         of StaticClass.
3015
3016         * driver.cs: Added "/langversion" command line switch with two
3017         options (iso-1, default).
3018
3019 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
3020
3021         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
3022
3023 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
3024
3025         * delegate.cs: Style.
3026
3027 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3028
3029         * delegate.cs: Add seperate instance expr field for miguel.
3030
3031 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3032
3033         * PointerArithmetic (Resolve): make sure we are not doing
3034         pointer arith on void*. Also, make sure we are resolved
3035         by not setting eclass until resolve.
3036
3037         All callers: Make sure that PointerArithmetic gets resolved.
3038
3039 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3040
3041         * ArrayCreation (LookupType): If the type does not resolve 
3042         to an array, give an error.
3043
3044 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
3045
3046         * statement.cs (Try.Resolve): Fixed bug #64222
3047
3048 2004-08-27  Martin Baulig  <martin@ximian.com>
3049
3050         * class.cs
3051         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3052         crash here.     
3053
3054 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3055
3056         * ecore.cs (Constantify): Get underlying type via
3057         System.Enum.GetUnderlyingType to avoid StackOverflow on the
3058         Windows in special cases.
3059
3060 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3061
3062         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3063         for obtaining also private methods.
3064         (GetRemoveMethod): Used GetRemoveMethod (true)
3065         for obtaining also private methods.
3066
3067 2004-09-02  Martin Baulig  <martin@ximian.com>
3068
3069         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3070         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3071         on the MethodBase.
3072
3073 2004-08-27  Martin Baulig  <martin@ximian.com>
3074
3075         * class.cs
3076         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3077         crash here.     
3078
3079 2004-08-25  Martin Baulig  <martin@ximian.com>
3080
3081         * support.cs (ReflectionParameters..ctor): If this is a generic
3082         method, retrieve and store its type parameters.
3083         (InternalParameters..ctor): Added `TypeParameter[]' argument.
3084         (ReflectionParameters.GenericConstraints): The argument specifies
3085         the type parameter, not the method parameter.
3086         (InternalParameters.GenericConstraints): Likewise.
3087
3088         * generic.cs (TypeParameter.DefineType): Correctly handle
3089         constraints wrt. generic methods in interfaces and their
3090         implementations.        
3091
3092 2004-08-24  Martin Baulig  <martin@ximian.com>
3093
3094         * generic.cs (TypeParameter.IsSubclassOf): New public method.
3095         (Constraints.IsSubclassOf): New internal method.
3096
3097         * typemanager.cs (TypeManager.FindMembers): Added special support
3098         for GenericTypeParameterBuilder's.      
3099         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
3100         type parameters.
3101
3102 2004-08-24  Martin Baulig  <martin@ximian.com>
3103
3104         * typemanager.cs
3105         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3106         this for accessibility checks.
3107         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3108         IsNestedFamilyAccessible.
3109         (TypeManager.IsSubclassOf): New method, do what the name actually
3110         says.   
3111
3112 2004-08-24  Martin Baulig  <martin@ximian.com>
3113
3114         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
3115         as a SimpleName, include the generic arity.
3116
3117 2004-08-24  Martin Baulig  <martin@ximian.com>
3118
3119         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3120         MethodAttributes.HideBySig for operators.
3121
3122 2004-08-23  Martin Baulig  <martin@ximian.com>
3123
3124         Back to the old error reporting system :-)
3125
3126         * report.cs (Message): Removed.
3127         (Report.MessageData, ErrorData, WarningData): Removed.
3128         (Report.Error, Warning): Back to the old system.
3129
3130 2004-08-23  Martin Baulig  <martin@ximian.com>
3131
3132         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3133
3134         * class.cs (TypeContainer.ParentContainer): New public virtual
3135         method; replaces the explicit interface implementation.
3136         (ClassPart.ParentContainer): Override.
3137
3138 2004-08-23  Martin Baulig  <martin@ximian.com>
3139
3140         * statement.cs (Switch): Added support for constant switches; see
3141         #59428 or test-285.cs.
3142
3143 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3144
3145         Fixed bug #62740.
3146         * statement.cs (GetEnumeratorFilter): Removed useless
3147         logic because C# specs is strict. GetEnumerator must be
3148         public.
3149
3150 2004-08-22  Martin Baulig  <martin@ximian.com>
3151
3152         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3153         a switch and may break, reset the barrier.  Fixes #59867.
3154
3155 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3156
3157         CLS-Compliance speed up (~5% for corlib)
3158
3159         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3160         New method. Tests container for CLS-Compliant names
3161
3162         * class.cs (TypeContainer.VerifyClsName): New method.
3163         Checks whether container name is CLS Compliant.
3164         (Constructor): Implements IMethodData.
3165
3166         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3167         low-case table for CLS Compliance test.
3168         (MemberCache.VerifyClsParameterConflict): New method.
3169         Checks method parameters for CS3006 error.
3170
3171         * enum.cs (EnumMember): Is derived from MemberCore.
3172         (Enum.VerifyClsName): Optimized for better performance.
3173
3174 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3175
3176         * report.cs: Renamed Error_T to Error and changed all
3177         references.
3178
3179 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3180
3181         * class.cs (TypeContainer.IndexerArrayList): New inner class
3182         container for indexers.
3183         (TypeContainer.DefaultIndexerName): New constant for default
3184         indexer name. Replaced all "Item" with this constant.
3185         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3186
3187         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3188         DefaultMemberAttribute constructor.
3189
3190 2004-08-05  Martin Baulig  <martin@ximian.com>
3191
3192         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3193         Fix bug #59429.
3194
3195 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3196
3197         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3198         multi platforms problem.
3199
3200         * compiler.csproj: Included shared files.
3201
3202 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3203
3204         Fix bug 60333, 55971 in the more general way
3205         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3206         Added arg_type argument for constant conversion.
3207         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3208
3209 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3210
3211         Fix bug #59760
3212         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3213         OperatorArrayList, MethodCoreArrayList for typecontainer
3214         containers. Changed class member types to these new types.
3215         (MethodArrayList.DefineMembers): Added test for CS0659.
3216
3217 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3218
3219         * cfold.cs: Synchronize the folding with the code in expression.cs
3220         Binary.DoNumericPromotions for uint operands.
3221
3222         * attribute.cs: Revert patch from Raja, it introduced a regression
3223         while building Blam-1.2.1 (hard to isolate a test case).
3224
3225 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3226
3227         Fix for #55382
3228         * class.cs:
3229         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3230         name collision.
3231         (MethodCore.parent_method): New member. The method we're overriding
3232         if this is an override method.
3233         (MethodCore.CheckBase): Moved from Method class and made common.
3234         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3235         private.
3236         (MethodCore.CheckForDuplications): New abstract method. For custom
3237         member duplication search in a container
3238         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3239         method and its return type.
3240         (Event.conflict_symbol): New member. Symbol with same name in the
3241         parent class.
3242
3243         * decl.cs:
3244         (MemberCache.FindMemberWithSameName): New method. The method
3245         is looking for conflict with inherited symbols.
3246
3247 2004-08-04  Martin Baulig  <martin@ximian.com>
3248
3249         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3250
3251         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3252
3253 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3254
3255         * report.cs (Message): New enum for better error, warning reference in
3256         the code.
3257         (MessageData): New inner abstract class. It generally handles printing of
3258         error and warning messages.
3259         Removed unused Error, Warning, Message methods.
3260
3261 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3262
3263         Fix for cs0592-8.cs test
3264         * attribute.cs
3265         (Attributable.ValidAttributeTargets): Made public.
3266         (Attribute.ExplicitTarget): New member for explicit target value.
3267         (Attribute.CheckTargets): Now we translate explicit attribute
3268         target to Target here.
3269
3270 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3271
3272         * ecore.cs (MethodGroupExpr): new IsBase property.
3273
3274         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3275
3276         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3277         rather than an instance expr.
3278
3279         (DelegateCreation.Emit): Use the method group rather than
3280         the instance expression. Also, if you have base.Foo as the
3281         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3282
3283         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3284
3285         (NewDelegate.DoResolve): Only check for the existance of Invoke
3286         if the method is going to be needed. Use MethodGroupExpr.
3287
3288         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3289
3290         * expression.cs: For pointer arith., make sure to use
3291         the size of the type, not the size of the pointer to
3292         the type.
3293
3294 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3295
3296         Fix for #60722
3297         * class.cs (Class): Added error CS0502 test.
3298
3299 2004-08-03  John Luke  <jluke@cfl.rr.com>
3300             Raja R Harinath  <rharinath@novell.com>
3301
3302         Fix for #60997.
3303         * attribute.cs (Attribute.complained_before): New flag.
3304         (Attribute.ResolveType, Attribute.Resolve),
3305         (Attribute.DefinePInvokeMethod): Set it.
3306         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3307         
3308 2004-08-03  Martin Baulig  <martin@ximian.com>
3309
3310         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3311         use a user-defined operator; we still need to do numeric
3312         promotions in case one argument is a builtin type and the other
3313         one has an implicit conversion to that type.  Fixes #62322.
3314
3315 2004-08-18  Martin Baulig  <martin@ximian.com>
3316
3317         * class.cs (Method.Define): Use the correct method name when
3318         creating the MethodBuilder for a generic method.
3319
3320 2004-08-17  Martin Baulig  <martin@ximian.com>
3321
3322         * generic.cs (Constraints): Support type parameter constraints.
3323
3324 2004-08-16  Martin Baulig  <martin@ximian.com>
3325
3326         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
3327         (Token.GENERIC_DIMENSION): New token; this is returned if we
3328         encounter an unbound generic type in a typeof() expression.
3329
3330         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
3331         this token is only generated while parsing a typeof() expression.
3332         (typeof_expression): Removed the old unbound_type hack.
3333
3334         * generic.cs (TypeArguments.IsUnbound): New public property.
3335
3336         * decl.cs (MemberName): Added support for unbound types.
3337
3338 2004-08-14  Martin Baulig  <martin@ximian.com>
3339
3340         * typemanager.cs
3341         (TypeManager.IsEqualGenericInstance): New static method.
3342         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
3343         just used to check accessibility, so follow the rules of 26.1.6.        
3344
3345         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
3346         ConstructedType instead of a TypeExpression if we have type arguments.
3347
3348         * cs-parser.jay (typeof_expression): Support unbound generic types.
3349
3350         * ecore.cs (UnboundTypeExpression): New public class.
3351
3352 2004-08-12  Martin Baulig  <martin@ximian.com>
3353
3354         * typemanager.cs (TypeManager.IsNestedChildOf): Use
3355         TypeManager.IsEqual() rather than `=='.
3356
3357         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
3358         generic instances as well.
3359
3360 2004-08-12  Martin Baulig  <martin@ximian.com>
3361
3362         * expression.cs (Invocation.InferType): We can only infer method
3363         type parameters.  Fixes #62647.
3364
3365 2004-08-11  Martin Baulig  <martin@ximian.com>
3366
3367         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
3368         before resolving the base classes.
3369
3370 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3371
3372         * Makefile: install .mdb file too.
3373
3374 2004-08-05  Martin Baulig  <martin@ximian.com>
3375
3376         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
3377         initializer, the current type is just the TypeBuilder, not the
3378         instantiated generic type.
3379         (FieldExpr.IsFieldInitializer): New public property.
3380
3381 2004-08-04  Martin Baulig  <martin@ximian.com>
3382
3383         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3384
3385         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3386
3387 2004-08-03  Martin Baulig  <martin@ximian.com>
3388
3389         * class.cs (MethodData.Define): If we're an explicit
3390         implementation, remove the generic arity from the type name.
3391
3392 2004-08-03  Martin Baulig  <martin@ximian.com>
3393
3394         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3395         use a user-defined operator; we still need to do numeric
3396         promotions in case one argument is a builtin type and the other
3397         one has an implicit conversion to that type.  Fixes #62322.
3398
3399 2004-08-02  Martin Baulig  <martin@ximian.com>
3400
3401         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
3402         `TypeExpr[]' array.
3403         (TypeContainer.GetClassBases): Return the unexpanded list of
3404         interfaces; we expand them later.
3405         (TypeContainer.DefineType): After creating the TypeBuilder, call
3406         TypeManager.ExpandInterfaces() to get an expanded and resolved
3407         list of interfaces.
3408
3409         * ecore.cs (TypeExpr.GetInterfaces): Removed
3410
3411         * generics.cs (Constraints.InterfaceConstraints): Remove.
3412         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
3413         register the interface constraints.
3414
3415         * typemanager.cs
3416         (TypeManager.AddUserType): Removed the `ifaces' argument.
3417         (TypeManager.AddTypeParameter): Likewise.
3418         (TypeManager.AddUserInterface): Removed, was unused.
3419         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
3420         `TypeExpr[]' array for the interfaces.
3421         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
3422         has been defined, returns a list of the resolved interfaces types.
3423         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
3424         (TypeManager.GetExplicitInterfaces): Likewise.  
3425
3426 2004-08-02  Martin Baulig  <martin@ximian.com>
3427
3428         * expression.cs (Invocation.EmitCall): If we're invoking a method
3429         on a type parameter, use the new `Constrained' prefix opcode.
3430
3431 2004-08-02  Martin Baulig  <martin@ximian.com>
3432
3433         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3434         (LocalInfo.IsThis): New public property.
3435         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3436
3437 2004-08-01  Martin Baulig  <martin@ximian.com>
3438
3439         * class.cs (TypeContainer.GetClassBases): Don't set the default
3440         here since we may get called from GetPartialBases().
3441         (TypeContainer.DefineType): If GetClassBases() didn't return a
3442         parent, use the default one.
3443
3444 2004-07-30  Martin Baulig  <martin@ximian.com>
3445
3446         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3447
3448         * class.cs (SourceMethod): New public class, derive from the
3449         symbol writer's ISourceMethod.
3450         (Method): Use the new symbol writer API.
3451
3452         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3453         as argument and use the new symbol writer.
3454
3455         * location.cs
3456         (SourceFile): Implement the symbol writer's ISourceFile.
3457         (Location.SymbolDocument): Removed.
3458         (Location.SourceFile): New public property.
3459
3460         * symbolwriter.cs: Use the new symbol writer API.
3461
3462 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3463
3464         * Makefile (install-local): Remove.  Functionality moved to
3465         executable.make.
3466
3467 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3468
3469         * Makefile: Install mcs.exe.config file together with mcs.exe.
3470         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3471         correct runtime version.
3472         
3473 2004-07-25  Martin Baulig  <martin@ximian.com>
3474
3475         * class.cs
3476         (TypeContainer.RegisterOrder): Removed, this was unused.
3477         (TypeContainer, interface_order): Removed.
3478         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3479         TypeContainer as argument since we can also be called with a
3480         `PartialContainer' for a partial class/struct/interface.
3481         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3482         of checking whether we're an `Interface' - we could be a
3483         `PartialContainer'.
3484         (PartialContainer.Register): Override; call
3485         AddClass()/AddStruct()/AddInterface() on our parent.
3486
3487         * cs-parser.jay (interface_member_declaration): Add things to the
3488         `current_container', not the `current_class'.
3489
3490         * rootcontext.cs (RegisterOrder): The overloaded version which
3491         takes an `Interface' was unused, removed.
3492
3493         * typemanager.cs (TypeManager.LookupInterface): Return a
3494         `TypeContainer', not an `Interface'.
3495         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3496         contain a `PartialContainer' for an interface, so check it's
3497         `Kind' to figure out what it is.
3498
3499 2004-07-25  Martin Baulig  <martin@ximian.com>
3500
3501         * class.cs (Class.DefaultTypeAttributes): New public constant.
3502         (Struct.DefaultTypeAttributes): Likewise.
3503         (Interface.DefaultTypeAttributes): Likewise.
3504         (PartialContainer.TypeAttr): Override this and add the
3505         DefaultTypeAttributes.
3506
3507 2004-07-25  Martin Baulig  <martin@ximian.com>
3508
3509         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3510         we can just use the `Parent' field instead.
3511
3512 2004-07-25  Martin Baulig  <martin@ximian.com>
3513
3514         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3515
3516 2004-07-25  Martin Baulig  <martin@ximian.com>
3517
3518         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3519         our parts before defining any methods.
3520         (TypeContainer.VerifyImplements): Make this virtual.
3521         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3522         on our PartialContainer.
3523
3524 2004-07-25  Martin Baulig  <martin@ximian.com>
3525
3526         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3527
3528         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3529         argument, we can just use the `Parent' field instead.
3530
3531         * class.cs
3532         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3533         (MemberBase.DoDefine): Likewise.
3534
3535 2004-07-24  Martin Baulig  <martin@ximian.com>
3536
3537         * decl.cs (MemberCore.Parent): New public field.
3538         (DeclSpace.Parent): Moved to MemberCore.
3539
3540         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3541         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3542         parent's .ctor.
3543         (FieldBase, Field, Operator): Likewise.
3544         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3545         (EventField, Event): Likewise.
3546
3547 2004-07-23  Martin Baulig  <martin@ximian.com>
3548
3549         * class.cs (PartialContainer): New public class.
3550         (ClassPart): New public class.
3551         (TypeContainer): Added support for partial classes.
3552         (TypeContainer.GetClassBases): Splitted some of the functionality
3553         out into GetNormalBases() and GetPartialBases().
3554
3555         * cs-tokenizer.cs (Token.PARTIAL): New token.
3556         (Tokenizer.consume_identifier): Added some hacks to recognize
3557         `partial', but only if it's immediately followed by `class',
3558         `struct' or `interface'.
3559
3560         * cs-parser.jay: Added support for partial clases.
3561
3562 2004-07-23  Martin Baulig  <martin@ximian.com>
3563
3564         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3565         a `DeclSpace' and also made it readonly.
3566         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3567         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3568         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3569
3570         * cs-parser.jay: Pass the `current_class', not the
3571         `current_container' (at the moment, this is still the same thing)
3572         to a new Method, Property, Event, Indexer or Constructor.
3573
3574 2004-07-23  Martin Baulig  <martin@ximian.com>
3575
3576         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3577         and removed the `current_interface' one.
3578         (struct_declaration, class_declaration, interface_declaration):
3579         Set `current_class' to the newly created class/struct/interface;
3580         set their `Bases' and call Register() before parsing their body.
3581
3582 2004-07-23  Martin Baulig  <martin@ximian.com>
3583
3584         * class.cs (Kind): New public enum.
3585         (TypeContainer): Made this class abstract.
3586         (TypeContainer.Kind): New public readonly field.
3587         (TypeContainer.CheckDef): New public method; moved here from
3588         cs-parser.jay.
3589         (TypeContainer.Register): New public abstract method.
3590         (TypeContainer.GetPendingImplementations): New public abstract
3591         method.
3592         (TypeContainer.GetClassBases): Removed the `is_class' and
3593         `is_iface' parameters.
3594         (TypeContainer.DefineNestedTypes): Formerly known as
3595         DoDefineType().
3596         (ClassOrStruct): Made this class abstract.
3597
3598         * tree.cs (RootTypes): New public type. 
3599
3600 2004-07-20  Martin Baulig  <martin@ximian.com>
3601
3602         * tree.cs (Tree.RecordNamespace): Removed.
3603         (Tree.Namespaces): Removed.
3604
3605         * rootcontext.cs (RootContext.IsNamespace): Removed.
3606
3607         * cs-parser.jay (namespace_declaration): Just create a new
3608         NamespaceEntry here.
3609
3610 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3611
3612         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3613         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3614         entry to make sure it runs in the correct runtime version.
3615         
3616 2004-07-18  Martin Baulig  <martin@ximian.com>
3617
3618         * generic.cs (ConstructedType.CheckConstraints): Improved
3619         constraints checking.
3620
3621 2004-07-18  Martin Baulig  <martin@ximian.com>
3622
3623         * expression.cs (Invocation.BetterMethod): Call
3624         TypeManager.TypeToCoreType() on all types and removed my previous
3625         hack; we're already doig the right thing here.
3626
3627 2004-07-17  Martin Baulig  <martin@ximian.com>
3628
3629         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3630
3631 2004-07-16  Martin Baulig  <martin@ximian.com>
3632
3633         * iterators.cs: Added generics support.
3634
3635 2004-07-16  Martin Baulig  <martin@ximian.com>
3636
3637         * iterators.cs: Rewrote this.  We're now using one single Proxy
3638         class for both the IEnumerable and the IEnumerator interface and
3639         `Iterator' derives from Class so we can use the high-level API.
3640
3641         * class.cs (TypeContainer.AddIterator): New method.
3642         (TypeContainer.DoDefineType): New protected virtual method, which
3643         is called from DefineType().
3644         (TypeContainer.DoDefineMembers): Call DefineType() and
3645         DefineMembers() on all our iterators.
3646         (TypeContainer.Emit): Call Emit() on all our iterators.
3647         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3648
3649         * codegen.cs (EmitContext.CurrentIterator): New public field.
3650
3651 2004-07-15  Martin Baulig  <martin@ximian.com>
3652
3653         * typemanager.cs
3654         (TypeManager.not_supported_exception_type): New type.   
3655
3656 2004-07-14  Martin Baulig  <martin@ximian.com>
3657
3658         * typemanager.cs
3659         (TypeManager.generic_ienumerable_type): New type.
3660         (TypeManager.generic_ienumerator_type): New type.
3661
3662         * rootcontext.cs
3663         (RootContext.interfaces_first_stage): Added
3664         "System.Collections.Generic.IEnumerator`1" and
3665         "System.Collections.Generic.IEnumerable`1".     
3666
3667 2004-07-14  Martin Baulig  <martin@ximian.com>
3668
3669         * iterators.cs: Use real error numbers.
3670
3671 2004-07-14  Martin Baulig  <martin@ximian.com>
3672
3673         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3674         requires this to be a System.Collection.IEnumerable and not a
3675         class implementing that interface.
3676         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3677
3678 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3679
3680         * class.cs: Fixed previous fix, it broke some error tests.
3681
3682 2004-07-12  Martin Baulig  <martin@ximian.com>
3683
3684         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3685         Fixes #61293.
3686
3687 2004-07-14  Martin Baulig  <martin@ximian.com>
3688
3689         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3690         an exclamation mark (!) for the generic arity to reflect the
3691         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3692
3693 2004-07-13  Martin Baulig  <martin@ximian.com>
3694
3695         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3696         specifiers being part of a type argument.
3697
3698 2004-07-13  Martin Baulig  <martin@ximian.com>
3699
3700         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3701         name for generic types.
3702
3703 2004-07-13  Martin Baulig  <martin@ximian.com>
3704
3705         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3706         bit to fix #60119.
3707
3708 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3709
3710         * assign.cs (LocalTemporary): Add new argument: is_address,If
3711         `is_address' is true, then the value that we store is the address
3712         to the real value, and not the value itself.
3713         
3714         * ecore.cs (PropertyExpr): use the new local temporary
3715         stuff to allow us to handle X.Y += z (where X is a struct)
3716
3717 2004-07-08  Martin Baulig  <martin@ximian.com>
3718
3719         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3720         not always return, just like we're doing in Using.Resolve().
3721
3722 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3723
3724         * cs-parser.jay (fixed_statement): flag this as Pinned.
3725
3726 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3727
3728         * typemanager.cs (TypeManager): Removed MakePinned method, this
3729         mechanism is replaced with the .NET 2.x compatible mechanism of
3730         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3731
3732         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3733         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3734         `IsFixed' property which has a different meaning.
3735
3736 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3737
3738         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3739         visible from inside a nested class, not just the names of the
3740         immediately enclosing class.
3741         Fix for bug #60730.
3742
3743 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3744
3745         * expression.cs (BetterConversion): Remove buggy special-case
3746         handling of "implicit constant expression conversions".  At this
3747         point, we already know that the conversion is possible -- we're
3748         only checking to see which is better.
3749
3750 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3751
3752         * cs-parser.jay: Added error CS0210 test.
3753
3754 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3755
3756         * cs-parser.jay: Added error CS0134 test.
3757
3758 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3759
3760         Fix bug #52507
3761         * cs-parser.jay: Added error CS0145 test.
3762
3763 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3764
3765         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3766
3767 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3768         
3769         * expression.cs (StackAlloc.Resolve): The argument may not
3770         be a constant; deal with this case.
3771         
3772 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3773
3774         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3775         GetIndexerAttributeValue.
3776         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3777
3778         * class.cs (Indexer.Define): Added error tests for CS0415,
3779         CS0609.
3780
3781 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3782
3783         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3784         property code.
3785
3786 2004-06-23  Martin Baulig  <martin@ximian.com>
3787
3788         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3789         neither return nor throw, reset the barrier as well.  Fixes #60457.
3790
3791 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3792
3793         * class.cs : EventAttributes is now set to None by default.
3794           This fixes bug #60459.
3795
3796 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3797
3798         Fix bug #60219
3799         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3800         Don't throw exception but return null (it's sufficient now).
3801
3802 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3803
3804         * typemanager.cs (GetArgumentTypes): Faster implementation.
3805
3806 2004-06-18  Martin Baulig  <martin@ximian.com>
3807
3808         * attribute.cs (Attribute.Resolve): Check whether we're an
3809         EmptyCast which a Constant child.  Fixes #60333.
3810
3811 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3812
3813         * statement.cs (EmitCollectionForeach): Account for the fact that
3814         not all valuetypes are in areas which we can take the address of.
3815         For these variables, we store to a temporary variable. Also, make
3816         sure that we dont emit a `callvirt' on a valuetype method.
3817
3818 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3819
3820         * expression.cs (StackAlloc.DoReSolve): Added test for
3821         negative parameter (CS0247).
3822
3823 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3824
3825         Fix bug #59792
3826         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3827
3828 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3829
3830         Fix bug #59781
3831         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3832         ulong.
3833
3834 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3835
3836         Fix bug #58254 & cs1555.cs, cs1556.cs
3837         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3838
3839 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3840
3841         * cs-parser.jay: Added error CS1669 test for indexers.
3842
3843 2004-06-18  Martin Baulig  <martin@ximian.com>
3844
3845         * generics.cs (GenericMethod.ctor): Don't take an Attributes
3846         argument.  Fixes #60441.
3847
3848 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
3849         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3850         The name needs to have the actual name of the method in order
3851         for other tests (such as the one in OverloadResolve for Invoke
3852         on a delegate) to work. As well, it does not really help
3853         error reporting because the method group had multiple methods.
3854         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3855         Make profiling work.
3856         
3857 2004-06-13  Martin Baulig  <martin@ximian.com>
3858
3859         * cs-parser.jay: Don't allow generic attributes.
3860
3861 2004-06-13  Martin Baulig  <martin@ximian.com>
3862
3863         * class.cs (MemberBase.DoDefineBase): New protected method.
3864         (MemberBase.DoDefine): Compute the `flags' in the new
3865         DoDefineBase() which must be called first.
3866         (Method.Define): Call DoDefineBase() first so we have the flags
3867         when defining the generic method.
3868
3869         * cs-parser.jay (interface_method_declaration): Support generic methods.
3870
3871 2004-06-13  Martin Baulig  <martin@ximian.com>
3872
3873         * decl.cs (TypeName): Removed.
3874         (MemberName): Removed TypeName and MemberNow; now we just have
3875         MemberName.
3876
3877         * cs-parser.jay: Don't distinguish between type arguments and type
3878         parameters in the grammar and simplified the rules a bit.  The
3879         reduce/reduce conflicts are now gone (except the one we inherited
3880         from mcs).
3881
3882 2004-06-11  Martin Baulig  <martin@ximian.com>
3883
3884         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3885         call this twice: for params and varargs methods.
3886
3887 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3888
3889         * class.cs:
3890         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3891
3892 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3893
3894         * attribute.cs (Attribute.GetValidTargets): Made public.
3895
3896         * class.cs: 
3897         (AbstractPropertyEventMethod): New class for better code sharing.
3898         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3899         CS1667 report.
3900         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3901
3902 2004-06-09  Martin Baulig  <martin@ximian.com>
3903
3904         * cs-parser.jay: Removed a reduce/reduce conflict.
3905
3906 2004-06-03  Martin Baulig  <martin@ximian.com>
3907
3908         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3909         GetSimpleName() and return a SimpleName.
3910
3911         * ecore.cs (SimpleName.Arguments): New public field.
3912         (SimpleName): Added overloaded ctor which takes an additional
3913         TypeArguments argument.
3914         (SimpleName.SimpleNameResolve): Added support for generic methods.
3915         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
3916         formerly in MemberAccess.DoResolve(), but we also need it in
3917         SimpleNameResolve().
3918
3919         * expression.cs (MemberAccess.DoResolve): Use the new
3920         MethodGroupExpr.ResolveGeneric().       
3921
3922 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3923
3924         * decl.cs: If possible, use lookuptypedirect here. We can only do
3925         this if there is no `.' after the namespace. Avoids using
3926         LookupType, which does lots of slow processing.
3927         (FindNestedType) New method, does what it says :-).
3928         * namespace.cs: use LookupTypeDirect.
3929         * rootcontext.cs: use membercache, if possible.
3930         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3931
3932 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3933
3934         * expression.cs:
3935         According to the spec, 
3936
3937         In a member access of the form E.I, if E is a single identifier,
3938         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3939         field, property, localvariable, or parameter with the same type as
3940         the meaning of E as a type-name (§3.8), then both possible
3941         meanings of E are permitted.
3942
3943         We did not check that E as a simple-name had the same type as E as
3944         a type name.
3945
3946         This trivial check gives us 5-7% on bootstrap time.
3947
3948 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3949
3950         * expression.cs (Invocation.OverloadResolve): Avoid the
3951         use of hashtables and boxing here by allocating on demand.
3952
3953 2004-05-30  Martin Baulig  <martin@ximian.com>
3954
3955         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3956         we're doing a silent lookup.  Don't try to lookup nested types in
3957         TypeManager.object_type (thanks to Ben Maurer).
3958
3959 2004-05-30  Martin Baulig  <martin@ximian.com>
3960
3961         Committing a patch from Ben Maurer.
3962
3963         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3964
3965 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3966
3967         * convert.cs: add a trivial cache for overload operator resolution.
3968
3969 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
3970
3971         * attribute.cs
3972         (AttributeTester.GetObsoleteAttribute): Returns instance of
3973         ObsoleteAttribute when type is obsolete.
3974
3975         * class.cs
3976         (TypeContainer.VerifyObsoleteAttribute): Override.
3977         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3978         (MethodCode.VerifyObsoleteAttribute): Override.
3979         (MemberBase.VerifyObsoleteAttribute): Override.
3980
3981         * decl.cs
3982         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3983         and report proper error.
3984
3985         *delegate.cs
3986         (Delegate.VerifyObsoleteAttribute): Override.
3987
3988         * ecore.cs
3989         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3990         and report proper error.
3991         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3992
3993         * enum.cs
3994         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3995         and enum member.
3996
3997         * expression.cs
3998         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
3999         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
4000         Added test for ObsoleteAttribute.
4001
4002         * statement.cs
4003         (Catch): Derived from Statement.
4004
4005 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4006
4007         * decl.cs: If possible, use lookuptypedirect here. We can only do
4008         this if there is no `.' after the namespace. Avoids using
4009         LookupType, which does lots of slow processing.
4010         (FindNestedType) New method, does what it says :-).
4011         * namespace.cs: use LookupTypeDirect.
4012         * rootcontext.cs: use membercache, if possible.
4013         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
4014
4015 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4016
4017         * expression.cs:
4018         According to the spec, 
4019
4020         In a member access of the form E.I, if E is a single identifier,
4021         and if the meaning of E as a simple-name (§7.5.2) is a constant,
4022         field, property, localvariable, or parameter with the same type as
4023         the meaning of E as a type-name (§3.8), then both possible
4024         meanings of E are permitted.
4025
4026         We did not check that E as a simple-name had the same type as E as
4027         a type name.
4028
4029         This trivial check gives us 5-7% on bootstrap time.
4030
4031 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
4032
4033         Fixed bug #59071 & cs0160.cs
4034         * statement.cs (Try.Resolve): Check here whether order of catch
4035         clauses matches their dependencies.
4036
4037 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
4038
4039         Fixed bug #58624
4040         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
4041         unsafe type.
4042
4043 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4044
4045         * expression.cs (Invocation.OverloadResolve): Avoid the
4046         use of hashtables and boxing here by allocating on demand.
4047
4048 2004-05-30  Martin Baulig  <martin@ximian.com>
4049
4050         * rootcontext.cs (RootContext.LookupType): Don't cache things if
4051         we're doing a silent lookup.  Don't try to lookup nested types in
4052         TypeManager.object_type (thanks to Ben Maurer).
4053
4054 2004-05-30  Martin Baulig  <martin@ximian.com>
4055
4056         Committing a patch from Ben Maurer.
4057
4058         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
4059
4060 2004-05-29  Martin Baulig  <martin@ximian.com>
4061
4062         * class.cs (IMethodData.ShouldIgnore): New method.
4063
4064         * typemanager.cs (TypeManager.MethodFlags): Don't take a
4065         `Location' argument, we don't need it anywhere.  Use
4066         `IMethodData.ShouldIgnore ()' instead of
4067         `MethodData.GetMethodFlags ()'.
4068         (TypeManager.AddMethod): Removed.
4069         (TypeManager.AddMethod2): Renamed to AddMethod.
4070
4071 2004-05-29  Martin Baulig  <martin@ximian.com>
4072
4073         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4074
4075         * convert.cs (Convert.ImplicitReferenceConversion): If we're
4076         converting from a class type S to an interface type and we already
4077         have an object on the stack, don't box it again.  Fixes #52578.
4078
4079 2004-05-29  Martin Baulig  <martin@ximian.com>
4080
4081         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4082         Added support for `params' parameters.  Fixes #59267.
4083
4084 2004-05-29  Martin Baulig  <martin@ximian.com>
4085
4086         * literal.cs (NullPointer): Provide a private .ctor which sets
4087         `type' to TypeManager.object_type.  Fixes #59048.
4088
4089 2004-05-29  Martin Baulig  <martin@ximian.com>
4090
4091         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4092         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
4093
4094         * ecore.cs (EventExpr.instance_expr): Make the field private.
4095
4096 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
4097
4098         Fixed bug #50080 & cs0214-2.cs
4099         * expression.cs (Cast.DoResolve): Check unsafe context here.
4100         
4101         * statement.cs (Resolve.DoResolve): Likewise.
4102
4103 2004-05-26  Martin Baulig  <martin@ximian.com>
4104
4105         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4106
4107         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4108         (RootContext.LookupType): Pass down the `silent' flag.
4109
4110 2004-05-25  Martin Baulig  <martin@ximian.com>
4111
4112         * expression.cs
4113         (MethodGroupExpr.IdenticalTypeName): New public property.
4114         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4115         expression actually refers to a type.
4116
4117 2004-05-25  Martin Baulig  <martin@ximian.com>
4118
4119         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4120         for #56176 and made it actually work.
4121
4122 2004-05-25  Martin Baulig  <martin@ximian.com>
4123
4124         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4125         (FieldExpr, PropertyExpr): Override and implement
4126         CacheTemporaries.  Fixes #52279.
4127
4128 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
4129
4130         * location.cs: In the new compiler listing a file twice is a
4131         warning, not an error.
4132
4133 2004-05-24  Martin Baulig  <martin@ximian.com>
4134
4135         * enum.cs (Enum.DefineType): For the `BaseType' to be a
4136         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
4137
4138 2004-05-24  Martin Baulig  <martin@ximian.com>
4139
4140         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4141         walking the `using' list.  Fixes #53921.
4142
4143 2004-05-24  Martin Baulig  <martin@ximian.com>
4144
4145         * const.cs (Const.LookupConstantValue): Added support for
4146         EmptyCast's; fixes #55251.
4147
4148 2004-05-24  Martin Baulig  <martin@ximian.com>
4149
4150         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4151         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4152         which does the CS0135 check.  The reason is that we first need to
4153         check whether the variable actually exists.
4154
4155 2004-05-24  Martin Baulig  <martin@ximian.com>
4156
4157         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4158         than RootContext.LookupType() to find the explicit interface
4159         type.  Fixes #58584.
4160
4161 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4162
4163         * Makefile: Simplify.  Use executable.make.
4164         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4165
4166 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4167
4168         * decl.cs:
4169         * enum.cs:
4170         Use the invariant culture when doing String.Compare for CLS case
4171         sensitivity.
4172         
4173 2004-05-23  Martin Baulig  <martin@ximian.com>
4174
4175         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4176         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4177
4178         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4179
4180 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4181
4182         * class.cs (MemberBase.Define): Reuse MemberType member for 
4183         resolved type. Other methods can use it too.
4184
4185 2004-05-23  Martin Baulig  <martin@ximian.com>
4186
4187         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4188         the variable also exists in the current block (otherwise, we need
4189         to report a CS0103).  Fixes #58670.
4190
4191 2004-05-23  Martin Baulig  <martin@ximian.com>
4192
4193         * flowanalysis.cs (Reachability.Reachable): Compute this
4194         on-the-fly rather than storing it as a field.
4195
4196 2004-05-23  Martin Baulig  <martin@ximian.com>
4197
4198         * flowanalysis.cs (Reachability.And): Manually compute the
4199         resulting `barrier' from the reachability.      
4200        
4201 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4202
4203         Fix bug #57835
4204         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4205         instance of ObsoleteAttribute when symbol is obsolete.
4206
4207         * class.cs
4208         (IMethodData): Extended interface for ObsoleteAttribute support.
4209
4210 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4211
4212         * attribute.cs: Fix bug #55970
4213
4214 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4215
4216         Fix bug #52705
4217         * attribute.cs
4218         (GetObsoleteAttribute): New method. Creates the instance of
4219         ObsoleteAttribute.
4220         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4221         ObsoleteAttribute when member is obsolete.
4222         (AttributeTester.Report_ObsoleteMessage): Common method for
4223         Obsolete error/warning reporting.
4224
4225         * class.cs
4226         (TypeContainer.base_classs_type): New member for storing parent type.
4227
4228         * decl.cs
4229         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4230         for this MemberCore.
4231
4232 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4233
4234         * attribute.cs, const.cs: Fix bug #58590
4235
4236 2004-05-21  Martin Baulig  <martin@ximian.com>
4237
4238         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4239         out parameters if the end of the method is unreachable.  Fixes
4240         #58098. 
4241
4242 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4243
4244         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4245         Hari was right, why extra method.
4246
4247 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4248
4249         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4250
4251 2004-05-20  Martin Baulig  <martin@ximian.com>
4252
4253         * delegate.cs: Convert this file to Unix mode - like the original
4254         version in mcs is.
4255
4256 2004-05-20  Martin Baulig  <martin@ximian.com>
4257
4258         * attribute.cs: Convert this file to Unix mode - like the original
4259         version in mcs is.
4260
4261 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4262
4263        Fix bug #58688 (MCS does not report error when the same attribute
4264        is assigned twice)
4265
4266        * attribute.cs (Attribute.Emit): Distinction between null and default.
4267
4268 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4269
4270        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4271        of a top-level attribute without an attribute target.
4272        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4273        Make non-static.
4274        (Attribute.Conditional_GetConditionName), 
4275        (Attribute.Obsolete_GetObsoleteMessage): Update.
4276        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4277        part of ScanForIndexerName.
4278        (Attribute.CanIgnoreInvalidAttribute): New function.
4279        (Attribute.ScanForIndexerName): Move to ...
4280        (Attributes.ScanForIndexerName): ... here.
4281        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4282        (Attributes.Search): New internal variant that can choose not to
4283        complain if types aren't resolved.  The original signature now
4284        complains.
4285        (Attributes.GetClsCompliantAttribute): Use internal variant, with
4286        complaints suppressed.
4287        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4288        only if it not useful.
4289        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4290        top-level for attributes that are shared between the assembly
4291        and a top-level class.
4292        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4293        * class.cs: Update to reflect changes.
4294        (DefineIndexers): Fuse loops.
4295        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4296        a couple more variants of attribute names.
4297
4298 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4299
4300         Fix bug #52585 (Implemented explicit attribute declaration)
4301
4302         * attribute.cs:
4303         (Attributable.ValidAttributeTargets): New abstract method. It gets
4304         list of valid attribute targets for explicit target declaration.
4305         (Attribute.Target): It holds target itself.
4306         (AttributeSection): Removed.
4307         (Attribute.CheckTargets): New method. It checks whether attribute
4308         target is valid for the current element.
4309
4310         * class.cs:
4311         (EventProperty): New class. For events that are declared like
4312         property (with add and remove accessors).
4313         (EventField): New class. For events that are declared like field.
4314         class.cs
4315
4316         * cs-parser.jay: Implemented explicit attribute target declaration.
4317
4318         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4319         Override ValidAttributeTargets.
4320
4321         * parameter.cs:
4322         (ReturnParameter): Class for applying custom attributes on 
4323         the return type.
4324         (ParameterAtribute): New class. Class for applying custom
4325         attributes on the parameter type.
4326
4327 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4328
4329         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4330         definitions. 
4331
4332         (Method): Allow UNSAFE here.
4333
4334         * modifiers.cs: Support unsafe reporting.
4335
4336 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4337
4338         * decl.cs: Fix bug #58478.
4339
4340 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4341
4342         * statement.cs: When checking for unreachable code on an EmptyStatement,
4343         set the location. Fixes bug #58488.
4344
4345 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4346
4347         * driver.cs: Add -pkg handling.
4348
4349         From Gonzalo: UseShelLExecute=false
4350
4351 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4352
4353         * attribute.cs:
4354         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4355         for attribute.
4356         (Attribute.IsClsCompliaceRequired): Moved to base for better
4357         accesibility.
4358         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4359         when attribute is AttributeUsageAttribute.
4360         (Attribute.GetValidTargets): Simplified.
4361         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4362         attribute for this type.
4363         (Attribute.ApplyAttributes): Method renamed to Emit and make
4364         non-static.
4365         (GlobalAttributeSection): New class for special handling of global
4366         attributes (assembly, module).
4367         (AttributeSection.Emit): New method.
4368
4369         * class.cs: Implemented Attributable abstract methods.
4370         (MethodCore.LabelParameters): Moved to Parameter class.
4371         (Accessor): Is back simple class.
4372         (PropertyMethod): Implemented Attributable abstract class.
4373         (DelegateMethod): Implemented Attributable abstract class.
4374         (Event): New constructor for disctintion between normal Event
4375         and Event with accessors.
4376
4377         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4378
4379         * codegen.cs, const.cs, decl.cs, delegate.cs:
4380         (CommonAssemblyModulClass): Implemented Attributable abstract class
4381         and simplified.
4382
4383         * enum.cs: Implement IAttributeSupport interface.
4384         (EnumMember): New class for emum members. Implemented Attributable
4385         abstract class
4386
4387         * parameter.cs:
4388         (ParameterBase): Is abstract.
4389         (ReturnParameter): New class for easier [return:] attribute handling.
4390
4391         * typemanager.cs: Removed builder_to_attr.
4392
4393 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4394
4395         Fix bug #57151.
4396         * attribute.cs (Attribute.GetPositionalValue): New function.
4397         * class.cs (TypeContainer.VerifyMembers): New function.
4398         (TypeContainer.Emit): Use it.
4399         (ClassOrStruct): New base class for Class and Struct.
4400         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4401         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4402         class.
4403         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4404         then each non-static field should have a FieldOffset attribute.
4405         Otherwise, none of the fields should have a FieldOffset attribute.
4406         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4407         and FieldOffset attributes.
4408         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4409         (TypeManager.field_offset_attribute_type): New core types.
4410         (TypeManager.InitCoreTypes): Initialize them.
4411
4412 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4413
4414         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4415         Return correct type.
4416         From bug #58270.
4417
4418 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4419
4420         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4421         be implicitly converted to ulong.
4422         
4423         * expression.cs: The logic for allowing operator &, | and ^ worked
4424         was wrong, it worked before because we did not report an error in
4425         an else branch.  Fixes 57895.
4426
4427         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4428         allow volatile fields to be reference types.
4429
4430 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4431
4432         * driver.cs: Add support for /debug-
4433
4434 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4435
4436         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4437         Add a 'complain' parameter to silence errors.
4438         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4439         silently overlooked type-resolutions.
4440         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4441         to reflect changes.
4442         (Attributes.Search): New function.
4443         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4444         (Attributes.GetAttributeFullName): Remove hack.
4445         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4446         Update to reflect changes.
4447         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4448         Use Attributes.Search instead of nested loops.
4449
4450 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4451
4452         * decl.cs:
4453         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4454         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4455         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4456
4457         * report.cs: (Report.Warning): Renamed to Warning_T because of
4458         parameter collision.
4459
4460 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4461
4462         * expression.cs (MemberAccess.ResolveMemberAccess):
4463         Exit with non-zero status after Report.Error.
4464         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4465         Likewise.
4466         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4467
4468 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4469
4470         * support.cs: Don't hang when the file is empty.
4471
4472 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4473
4474         * support.cs: In SeekableStreamReader, compute the preamble size of the
4475           underlying stream. Position changes should take into account that initial
4476           count of bytes.
4477
4478 2004-05-03  Todd Berman  <tberman@sevenl.net>
4479
4480         * driver.cs: remove unused GetSysVersion function.
4481
4482 2004-05-03  Todd Berman  <tberman@sevenl.net>
4483
4484         * driver.cs: Remove the hack from saturday, as well as the hack
4485         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4486         link_paths to get that bit proper.
4487
4488 2004-05-01  Todd Berman  <tberman@sevenl.net>
4489
4490         * driver.cs: Try a LoadFrom before a Load, this checks the current
4491         path. This is currently a bug in mono that is be fixed, however, this
4492         provides a workaround for now. This will be removed when the bug
4493         is fixed.
4494
4495 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4496
4497         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4498         incomplete key pairs (#57941).
4499
4500 2004-05-01  Todd Berman  <tberman@sevenl.net>
4501
4502         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4503         from the GAC
4504
4505 2004-04-30  Jackson Harper  <jackson@ximian.com>
4506
4507         * codegen.cs: Open keys readonly.
4508         
4509 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4510
4511         * typemanager.cs: don't report cyclic struct layout when a struct
4512         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4513         which has 2 Pango.Rectangle fields.
4514
4515 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4516
4517         * expression.cs: Handle IntPtr comparisons with IL code
4518         rather than a method call.
4519
4520 2004-04-29  Martin Baulig  <martin@ximian.com>
4521
4522         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4523         the list of PropertyInfo's in class hierarchy and find the
4524         accessor.  Fixes #56013.
4525
4526 2004-04-29  Martin Baulig  <martin@ximian.com>
4527
4528         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4529
4530 2004-04-29  Martin Baulig  <martin@ximian.com>
4531
4532         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4533
4534         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4535
4536 2004-04-29  Martin Baulig  <martin@ximian.com>
4537
4538         * class.cs (ConstructorInitializer.Resolve): Check whether the
4539         parent .ctor is accessible.  Fixes #52146.
4540
4541 2004-04-29  Martin Baulig  <martin@ximian.com>
4542
4543         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4544
4545         * statement.cs (Using.EmitLocalVariableDecls): Use
4546         TypeManager.idisposable_type, not typeof (IDisposable).
4547         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4548
4549 2004-04-29  Martin Baulig  <martin@ximian.com>
4550
4551         * class.cs (Event.Define): Don't emit the field and don't set
4552         RTSpecialName and SpecialName for events on interfaces.  Fixes
4553         #57703. 
4554
4555 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4556
4557         Refactor Attribute.ApplyAttributes.
4558         * attribute.cs (Attributable): New base class for objects that can
4559         have Attributes applied on them.
4560         (Attribute): Make AttributeUsage fields public.
4561         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4562         (Attribute.IsInternalCall): New property.
4563         (Attribute.UsageAttr): Convert to a public read-only property.
4564         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4565         (Attribute.ResolveType, Attribute.Resolve)
4566         (Attribute.ScanForIndexerName): Update to reflect changes.
4567         (Attribute.CheckAttributeTarget): Re-format.
4568         (Attribute.ApplyAttributes): Refactor, to various
4569         Attributable.ApplyAttributeBuilder methods.
4570         * decl.cs (MemberCore): Make Attributable.
4571         * class.cs (Accessor): Make Attributable.
4572         (MethodData.ApplyAttributes): Use proper attribute types, not
4573         attribute names.
4574         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4575         (TypeContainer.ApplyAttributeBuilder)
4576         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4577         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4578         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4579         (Operator.ApplyAttributeBuilder): New factored-out methods.
4580         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4581         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4582         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4583         * parameter.cs (ParameterBase): New Attributable base class
4584         that can also represent Return types.
4585         (Parameter): Update to the changes.
4586
4587 2004-04-29  Jackson Harper  <jackson@ximian.com>
4588
4589         * driver.cs: Prefer the corlib system version when looking for
4590         assemblies in the GAC. This is still a hack, but its a better hack
4591         now.
4592         
4593 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4594
4595         * decl.cs, enum.cs: Improved error 3005 reporting.
4596   
4597         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4598         (related_symbols): New private member for list of symbols
4599         related to reported error/warning.
4600         
4601         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4602
4603 2004-04-29  Martin Baulig  <martin@ximian.com>
4604
4605         * ecore.cs (Expression.Constantify): If we're an enum and
4606         TypeManager.TypeToCoreType() doesn't give us another type, use
4607         t.UnderlyingSystemType.  Fixes #56178.  
4608
4609 2004-04-29  Martin Baulig  <martin@ximian.com>
4610
4611         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4612         interfaces and for each interface, only add members directly
4613         declared in that interface.  Fixes #53255.
4614
4615 2004-04-28  Martin Baulig  <martin@ximian.com>
4616
4617         * expression.cs (ConditionalLogicalOperator): Use a temporary
4618         variable for `left' to avoid that we evaluate it more than once;
4619         bug #52588.
4620
4621 2004-04-28  Martin Baulig  <martin@ximian.com>
4622
4623         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4624         `void[]' (CS1547).
4625
4626 2004-04-28  Martin Baulig  <martin@ximian.com>
4627
4628         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4629         void (CS1547).
4630
4631         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4632         whether the type is not void (CS1547).
4633
4634 2004-04-28  Martin Baulig  <martin@ximian.com>
4635
4636         * expression.cs (Unary.DoResolveLValue): Override this and report
4637         CS0131 for anything but Operator.Indirection.
4638
4639 2004-04-28  Martin Baulig  <martin@ximian.com>
4640
4641         Committing a patch from Ben Maurer; see bug #50820.
4642
4643         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4644         check for classes.
4645
4646         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4647         classes.        
4648
4649 2004-04-28  Martin Baulig  <martin@ximian.com>
4650
4651         Committing a patch from Ben Maurer; see bug #50820.
4652
4653         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4654         check for classes.
4655
4656         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4657         classes.        
4658
4659 2004-04-28  Martin Baulig  <martin@ximian.com>
4660
4661         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4662         (Block.AddLabel): Call DoLookupLabel() to only search in the
4663         current block.
4664
4665 2004-04-28  Martin Baulig  <martin@ximian.com>
4666
4667         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4668         comparing StringConstants and NullLiterals in Equality and Inequality.
4669
4670 2004-04-28  Jackson Harper  <jackson@ximian.com>
4671
4672         * driver.cs: Attempt to load referenced assemblies from the
4673         GAC. This is the quick and dirty version of this method that
4674         doesnt take into account versions and just takes the first
4675         canidate found. Will be good enough for now as we will not have more
4676         then one version installed into the GAC until I update this method.
4677
4678 2004-04-28  Martin Baulig  <martin@ximian.com>
4679
4680         * typemanager.cs (TypeManager.CheckStructCycles): New public
4681         static method to check for cycles in the struct layout.
4682
4683         * rootcontext.cs (RootContext.PopulateTypes): Call
4684         TypeManager.CheckStructCycles() for each TypeContainer.
4685         [Note: We only need to visit each type once.]
4686
4687 2004-04-28  Martin Baulig  <martin@ximian.com>
4688
4689         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4690
4691         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4692         success and added `out object value'.  Use a `bool resolved' field
4693         to check whether we've already been called rather than
4694         `ConstantValue != null' since this breaks for NullLiterals.
4695
4696 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4697
4698         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4699         setting of this flag, since the 'set' method may be non-public.
4700
4701 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4702
4703         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4704         check on current_vector.Block.
4705
4706 2004-04-27  Martin Baulig  <martin@ximian.com>
4707
4708         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4709         a field initializer.  Fixes #56459.
4710
4711 2004-04-27  Martin Baulig  <martin@ximian.com>
4712
4713         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4714         we're not attempting to use an indexer.  Fixes #52154.
4715
4716 2004-04-27  Martin Baulig  <martin@ximian.com>
4717
4718         * statement.cs (Return): Don't create a return label if we don't
4719         need it; reverts my change from January 20th.  Thanks to Ben
4720         Maurer for this.
4721
4722 2004-04-27  Martin Baulig  <martin@ximian.com>
4723
4724         According to the spec, `goto' can only leave a nested scope, but
4725         never enter it.
4726
4727         * statement.cs (Block.LookupLabel): Only lookup in the current
4728         block, don't recurse into parent or child blocks.
4729         (Block.AddLabel): Check in parent and child blocks, report
4730         CS0140/CS0158 if we find a duplicate.
4731         (Block): Removed this indexer for label lookups.
4732         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4733         this already does the error reporting for us.
4734
4735         * flowanalysis.cs
4736         (FlowBranching.UsageVector.Block): New public variable; may be null.
4737         (FlowBranching.CreateSibling): Added `Block' argument.
4738         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4739         label for the target of a `goto' and check whether we're not
4740         leaving a `finally'.
4741
4742 2004-04-27  Martin Baulig  <martin@ximian.com>
4743
4744         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4745         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4746         just for returns).
4747
4748 2004-04-27  Martin Baulig  <martin@ximian.com>
4749
4750         * statement.cs (Block.AddLabel): Also check for implicit blocks
4751         and added a CS0158 check.
4752
4753 2004-04-27  Martin Baulig  <martin@ximian.com>
4754
4755         * flowanalysis.cs (FlowBranchingLoop): New class.
4756         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4757         UsageVector's instead of an ArrayList.
4758         (FlowBranching.Label): Likewise.
4759         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4760         (FlowBranching.AddBreakVector): New method.
4761
4762 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4763
4764         * attribute.cs: Small regression fix: only convert the type if we
4765         the type is different, fixes System.Drawing build.
4766
4767 2004-04-27  Martin Baulig  <martin@ximian.com>
4768
4769         * attribute.cs (Attribute.Resolve): If we have a constant value
4770         for a named field or property, implicity convert it to the correct
4771         type.
4772
4773 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4774
4775         * statement.cs (Block.Block): Implicit blocks share
4776         'child_variable_names' fields with parent blocks.
4777         (Block.AddChildVariableNames): Remove.
4778         (Block.AddVariable): Mark variable as "used by a child block" in
4779         every surrounding block.
4780         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4781         been used in a child block, complain about violation of "Invariant
4782         meaning in blocks" rule.
4783         * cs-parser.jay (declare_local_variables): Don't use
4784         AddChildVariableNames.
4785         (foreach_statement): Don't create an implicit block: 'foreach'
4786         introduces a scope.
4787
4788 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4789
4790         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4791         converting from 0L to ulong.  Fixes 57522.
4792
4793 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4794
4795         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4796         derived class hides via 'new' keyword field from base class (test-242.cs).
4797         TODO: Handle this in the more general way.
4798         
4799         * class.cs (CheckBase): Ditto.
4800
4801 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4802
4803         * decl.cs (caching_flags): New member for storing cached values
4804         as bit flags.
4805         (MemberCore.Flags): New enum where bit flags for caching_flags
4806         are defined.
4807         (MemberCore.cls_compliance): Moved to caching_flags.
4808         (DeclSpace.Created): Moved to caching_flags.
4809
4810         * class.cs: Use caching_flags instead of DeclSpace.Created
4811         
4812 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4813
4814         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4815         if we are only a derived class, not a nested class.
4816
4817         * typemanager.cs: Same as above, but do this at the MemberLookup
4818         level (used by field and methods, properties are handled in
4819         PropertyExpr).   Allow for the qualified access if we are a nested
4820         method. 
4821
4822 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4823
4824         * class.cs: Refactoring.
4825         (IMethodData): New inteface; Holds links to parent members
4826         to avoid member duplication (reduced memory allocation).
4827         (Method): Implemented IMethodData interface.
4828         (PropertyBase): New inner classes for get/set methods.
4829         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4830         (Event): New inner classes for add/remove methods.
4831         (Event.DelegateMethod): Implemented IMethodData interface.
4832
4833         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4834         EmitContext (related to class.cs refactoring).
4835
4836 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4837
4838         * delegate.cs (Delegate.VerifyApplicability): If the number of
4839         arguments are the same as the number of parameters, first try to
4840         verify applicability ignoring  any 'params' modifier on the last
4841         parameter.
4842         Fixes #56442.
4843
4844 2004-04-08  Martin Baulig  <martin@ximian.com>
4845
4846         Merged latest changes into gmcs.  Please keep this comment in
4847         here, it makes it easier for me to see what changed in MCS since
4848         the last time I merged.
4849
4850 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4851
4852         * class.cs (TypeContainer.AddIndexer): Use
4853         'ExplicitInterfaceName' to determine if interface name was
4854         explicitly specified.  'InterfaceType' is not initialized at this time.
4855         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4856         Indexers array is already in the required order.  Initialize
4857         'IndexerName' only if there are normal indexers.
4858         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4859         (TypeContainer.Emit): Emit DefaultMember attribute only if
4860         IndexerName is initialized.
4861         Fixes #56300.
4862
4863 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4864
4865         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4866         Fixes #57007
4867
4868 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4869
4870         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4871         attributes.
4872         Fix for #56456.
4873
4874         * attribute.cs (Attribute.Resolve): Check for duplicate named
4875         attributes.
4876         Fix for #56463.
4877
4878 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4879
4880         * iterators.cs (MarkYield): track whether we are in an exception,
4881         and generate code accordingly.  Use a temporary value to store the
4882         result for our state.
4883
4884         I had ignored a bit the interaction of try/catch with iterators
4885         since their behavior was not entirely obvious, but now it is
4886         possible to verify that our behavior is the same as MS .NET 2.0
4887
4888         Fixes 54814
4889
4890 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4891
4892         * iterators.cs: Avoid creating temporaries if there is no work to
4893         do. 
4894
4895         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4896         Enumerations, use TypeManager.EnumToUnderlying and call
4897         recursively. 
4898
4899         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4900         bug #57013
4901
4902         (This.Emit): Use EmitContext.EmitThis to emit our
4903         instance variable.
4904
4905         (This.EmitAssign): Ditto.
4906
4907         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4908         codepaths, we will move all the functionality into
4909         Mono.CSharp.This 
4910
4911         (FieldExpr.EmitAssign): Ditto.
4912
4913         This fixes several hidden bugs that I uncovered while doing a code
4914         review of this today.
4915
4916         * codegen.cs (EmitThis): reworked so the semantics are more clear
4917         and also support value types "this" instances.
4918
4919         * iterators.cs: Changed so that for iterators in value types, we
4920         do not pass the value type as a parameter.  
4921
4922         Initialization of the enumerator helpers is now done in the caller
4923         instead of passing the parameters to the constructors and having
4924         the constructor set the fields.
4925
4926         The fields have now `assembly' visibility instead of private.
4927
4928 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4929
4930         * expression.cs (Argument.Resolve): Check if fields passed as ref
4931         or out are contained in a MarshalByRefObject.
4932
4933         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4934         another compiler type.
4935
4936 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4937
4938         * class.cs (Indexer.Define): use the new name checking method.
4939         Also, return false on an error.
4940         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4941         (is_identifier_[start/part]_character): make static.
4942
4943 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4944
4945         * expression.cs (Binary.ResolveOperator): Do no append strings
4946         twice: since we can be invoked more than once (array evaluation)
4947         on the same concatenation, take care of this here.  Based on a fix
4948         from Ben (bug #56454)
4949
4950 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4951
4952         * codegen.cs: Fix another case where CS1548 must be reported (when 
4953         delay-sign isn't specified and no private is available #56564). Fix
4954         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4955         error when MCS is used on the MS runtime and we need to delay-sign 
4956         (which seems unsupported by AssemblyBuilder - see #56621).
4957
4958 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4959
4960         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4961         (TypeManager.ComputeNamespaces): Faster implementation for
4962         Microsoft runtime.
4963
4964         * compiler.csproj: Updated AssemblyName to mcs.
4965
4966 2004-05-11  Jackson Harper  <jackson@ximian.com>
4967
4968         * Makefile: Preserve MONO_PATH
4969         
4970 2004-05-11  Jackson Harper  <jackson@ximian.com>
4971
4972         * Makefile: Use mono and mcs to build gmcs
4973         
4974 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
4975
4976         * codegen.cs: Add patch from Robert Shade
4977         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
4978         sync with mcs.
4979
4980 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
4981
4982         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4983         incomplete key pairs (#57941).
4984
4985 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4986
4987         * codegen.cs: Fix another case where CS1548 must be reported (when 
4988         delay-sign isn't specified and no private is available #56564). Fix
4989         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4990         error when MCS is used on the MS runtime and we need to delay-sign 
4991         (which seems unsupported by AssemblyBuilder - see #56621).
4992
4993 2004-04-29  Jackson Harper  <jackson@ximian.com>
4994
4995         * Makefile: Set MONO_PATH to use the bootstrap corlib
4996         * driver.cs: Check the GAC for referenced assemblies.
4997                 
4998 2004-04-29  Martin Baulig  <martin@ximian.com>
4999
5000         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
5001
5002 2004-04-07  Martin Baulig  <martin@ximian.com>
5003
5004         * expression.cs (Binary.ResolveOperator): Added special case for
5005         Equality/Inequality between a type parameter and a null literal.
5006
5007 2004-04-07  Martin Baulig  <martin@ximian.com>
5008
5009         * convert.cs: Check null literal -> type parameter conversions.
5010
5011 2004-04-07  Martin Baulig  <martin@ximian.com>
5012
5013         * generic.cs (ConstructedType.CheckConstraints): Enforce the
5014         `class' and `struct' constraints.
5015
5016 2004-04-07  Martin Baulig  <martin@ximian.com>
5017
5018         * generic.cs (SpecialConstraint): New public enum.
5019         (Constraints.Resolve): Added support for the `class' and `struct'
5020         constraints.
5021
5022         * cs-parser.jay (type_parameter_constraint): Added support for the
5023         `class' and `struct' constraints.
5024
5025 2004-04-07  Martin Baulig  <martin@ximian.com>
5026
5027         * support.cs (GenericConstraints): Replaced `Types' by
5028         `ClassConstraint' and `InterfaceConstraints'; added
5029         `HasClassConstraint'.   
5030
5031 2004-04-07  Martin Baulig  <martin@ximian.com>
5032
5033         * generic.cs
5034         (Constraints.InterfaceConstraints): New public property.
5035         (Constraints.Types): Make this property public
5036         (TypeParameter): Implement IMemberContainer.
5037         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
5038         instead of a TypeBuilder/MethodBuilder; pass the interface
5039         constraints to TypeManager.AddTypeParameter().
5040         (TypeParameter.DefineType): Just take an EmitContext and no
5041         TypeBuilder/MethodBuilder.  Use the new public API.
5042
5043         * typemanager.cs (TypeManager.AddTypeParameter): Added
5044         `TypeExpr[]' argument; add the interfaces to the
5045         `builder_to_ifaces' hash.
5046         (TypeManager.LookupMemberContainer): For
5047         GenericTypeParameterBuilders, get the TypeParameter from the
5048         `builder_to_type_param'.
5049         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
5050         the TypeParameter and call FindMembers on it.
5051
5052 2004-04-07  Martin Baulig  <martin@ximian.com>
5053
5054         * class.cs
5055         (MethodCore.GenericMethod): Moved this field here from Method.
5056         (MethodCore.IsDuplicateImplementation): Take the number of type
5057         parameters into account if we're a generic method.
5058
5059         * expression.cs (Invocation.InferTypeArguments): Don't return true
5060         if `arguments' is null; we still need to check whether we actually
5061         don't need to infer anything in this case.
5062         (MemberAccess): Merged the functionality from GenericMemberAccess
5063         into this class.
5064
5065         * generic.cs (GenericMemberAccess): Removed.
5066
5067 2004-04-05  Martin Baulig  <martin@ximian.com>
5068
5069         * decl.cs (MemberCore): For generic classes, interfaces and
5070         structs, `Name' now includes the number of type parameters
5071         ("Stack!1.Node!1").
5072         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
5073         encode the number of type arguments in the type name.
5074
5075         * expression.cs (Expression.MemberLookup): Removed the
5076         `num_type_args' argument; we now encode the number of type
5077         arguments in the type name.
5078
5079         * ecore.cs (SimpleName): Encode the number of type arguments in
5080         the type name itself.
5081
5082         * generic.cs (ConstructedType): Likewise.
5083
5084         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
5085         `MemberName'; we now include the number of type parameters in the
5086         type name.
5087
5088         * typemanager.cs (TypeManager.CheckGeneric): Removed.
5089         (TypeManager.MemberLookup): Removed the
5090         `num_type_args' argument; we now encode the number of type
5091         arguments in the type name.     
5092
5093 2004-04-03  Martin Baulig  <martin@ximian.com>
5094
5095         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
5096         (MemberCore.MemberName): Moved here from MemberBase.
5097         (DeclSpace.SetParameterInfo): Just take the constraints as an
5098         ArrayList; we already have the type parameters in our
5099         `MemberName'; also do the CS0080 reporting here.
5100
5101         * cs-parser.jay (struct_declaration): Use `member_name' instead of
5102         `IDENTIFIER opt_type_parameter_list'; when constructing our
5103         `MemberName', it'll already include our type parameters.
5104         (class_declaration, interface_declaration): Likewise.
5105         (delegate_declaration): Likewise.
5106         (MakeName): Take a MemberName and return a MemberName.
5107         The following two changes are required to avoid shift/reduce conflicts:
5108         (member_name): Don't include a TypeName anymore; ie. this is now
5109         just 'IDENTIFIER opt_type_parameter_list'.
5110         (property_declaration, event_declaration): Use a
5111         `namespace_or_type_name' instead of a `member_name'.            
5112
5113 2004-04-03  Martin Baulig  <martin@ximian.com>
5114
5115         * decl.cs (MemberName): Renamed to `TypeName' and created a new
5116         `MemberName' class.
5117         (TypeName): Formerly known as MemberName.
5118
5119         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
5120         instead of a `MemberName'.
5121
5122         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
5123         (member_name): New rule; create a MemberName.
5124
5125 2004-04-02  Martin Baulig  <martin@ximian.com>
5126
5127         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
5128         (CS0305 and CS0308).
5129
5130 2004-04-02  Martin Baulig  <martin@ximian.com>
5131
5132         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
5133         support for nested types.
5134
5135 2004-04-02  Martin Baulig  <martin@ximian.com>
5136
5137         * ecore.cs (IAlias): New public interface.
5138         (TypeExpr, TypeExpression): Implement IAlias.
5139         (TypeAliasExpression): New public class.
5140
5141         * namespace.cs (Namespace): Implement IAlias.
5142         (Namespace.Lookup): Return an IAlias instead on an object.
5143         (Namespace.DefineName): Take an IAlias instead of an object.
5144         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
5145         an object.
5146         (NamespaceEntry.UsingAlias): Take a Membername instead of an
5147         Expression.
5148         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
5149         object.
5150         (NamespaceEntry.Lookup): Likewise.
5151
5152         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
5153         instead of a Type.      
5154
5155         * decl.cs (DeclSpace): Implement IAlias.
5156         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
5157
5158         * generic.cs (ConstructedType): Improved error checking.
5159
5160 2004-04-02  Martin Baulig  <martin@ximian.com>
5161
5162         * convert.cs: Added type parameter conversions.
5163
5164         * ecore.cs
5165         (UnboxCast.Emit): Emit an `unbox.any' for type params.
5166         (ClassCast.Emit): If the source type is a type parameter, box it.
5167         If the target type is a type parameter, emit an `unbox.any'
5168         instead of a `classcast'.1      
5169
5170 2004-04-01  Martin Baulig  <martin@ximian.com>
5171
5172         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
5173
5174 2004-04-01  Martin Baulig  <martin@ximian.com>
5175
5176         * generic.cs (ConstructedType.CheckConstraints): Use
5177         Convert.ImplicitStandardConversionExists(); user-defined implicit
5178         conversions are not allowed according to the spec.
5179
5180 2004-03-30  Martin Baulig  <martin@ximian.com>
5181
5182         * expression.cs (New): Added support for type parameters.
5183
5184         * typemanager.cs
5185         (TypeManager.activator_type): New public static field.
5186         (TypeManager.activator_create_instance): Likewise.
5187
5188 2004-03-30  Martin Baulig  <martin@ximian.com>
5189
5190         * typemanager.cs (TypeManager.HasConstructorConstraint): New
5191         public method.
5192
5193 2004-03-30  Martin Baulig  <martin@ximian.com>
5194
5195         * generic.cs (ConstructedType.CheckConstraints): Actually follow
5196         the spec here: the argument type must be convertible to the
5197         constraints.
5198
5199 2004-03-30  Martin Baulig  <martin@ximian.com>
5200
5201         * generic.cs
5202         (TypeParameter.Define, TypeParameter.DefineMethod): Call
5203         TypeManager.AddTypeParameter().
5204         (ConstructedType.CheckConstraints): Re-enable this and actually
5205         check whether we have a constructor constraint.
5206
5207         * typemanager.cs
5208         (TypeManager.builder_to_type_param): New static field.
5209         (TypeManager.AddTypeParameter): New static method.
5210         (TypeManager.LookupTypeParameter): New public method.
5211
5212 2004-03-30  Martin Baulig  <martin@ximian.com>
5213
5214         * generic.cs (TypeParameter.DefineType): Return a boolean and use
5215         the new API to actually define the constructor constraint.
5216
5217         * typemanager.cs
5218         (TypeManager.new_constraint_attr_type): New static field.
5219         (TypeManager.InitCoreTypes): Initialize it.
5220
5221 2004-03-30  Martin Baulig  <martin@ximian.com>
5222
5223         * generic.cs (Constraints): Completed error checking, use correct
5224         error numbers.
5225
5226 2004-03-29  Martin Baulig  <martin@ximian.com>
5227
5228         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
5229
5230         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5231         public version which takes a `ParameterData pd' instead of an
5232         `ArrayList args'.
5233
5234 2004-03-29  Martin Baulig  <martin@ximian.com>
5235
5236         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
5237         not a MethodInfo.       
5238
5239 2004-03-29  Martin Baulig  <martin@ximian.com>
5240
5241         * expression.cs (Argument.ResolveMethodGroup): If we're a
5242         ConstructedType, call GetMemberAccess() on it.  
5243
5244 2004-03-29  Martin Baulig  <martin@ximian.com>
5245
5246         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
5247         (MethodCore.CheckGenericOverride): When overriding a generic
5248         method, check whether the constraints match.
5249
5250         * support.cs (GenericConstraints): New public interface.
5251         (ParameterData.GenericConstraints): New public method.
5252
5253         * parameter.cs (Parameter.Resolve): Check whether we're a generic
5254         method parameter and compute our constraints if appropriate.
5255         (Parameter.GenericConstraints): New public property.
5256
5257         * generic.cs (Constraints): Implement GenericConstraints.
5258
5259 2004-03-29  Martin Baulig  <martin@ximian.com>
5260
5261         * decl.cs (MemberCache.FindMemberToOverride): Use
5262         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
5263
5264 2004-03-29  Martin Baulig  <martin@ximian.com>
5265
5266         * generic.cs (GenericMethod.Define): Resolve our type parameters.
5267
5268 2004-03-29  Martin Baulig  <martin@ximian.com>
5269
5270         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
5271         not allowed on non-generic declarations").
5272
5273 2004-03-29  Martin Baulig  <martin@ximian.com>
5274
5275         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5276         public version of this method.
5277
5278         * class.cs (MethodCore.IsDuplicateImplementation): Use
5279         Invocation.InferTypeArguments() to check this.
5280
5281 2004-03-29  Martin Baulig  <martin@ximian.com>
5282
5283         * convert.cs: Use TypeManager.IsDelegateType() instead of
5284         comparing types correctly.
5285
5286 2004-03-29  Martin Baulig  <martin@ximian.com>
5287
5288         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
5289         types directly to make it work for generic instances.
5290
5291         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
5292
5293 2004-03-29  Martin Baulig  <martin@ximian.com>
5294
5295         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
5296         support for arrays.     
5297
5298 2004-03-24  Martin Baulig  <martin@ximian.com>
5299
5300         * decl.cs (DeclSpace.FindType): Also use
5301         TypeManager.CheckGeneric() for types from the using clauses.
5302
5303 2004-03-23  Martin Baulig  <martin@ximian.com>
5304
5305         * expression.cs (Invocation.OverloadResolve): Added `bool
5306         may_fail' argument and use it instead of the Location.IsNull() hack.
5307
5308 2004-03-23  Martin Baulig  <martin@ximian.com>
5309
5310         * expression.cs (Invocation.InferType): Use correct type inference
5311         rules here.     
5312
5313 2004-03-23  Martin Baulig  <martin@ximian.com>
5314
5315         * ecore.cs (MethodGroupExpr.Name): Use
5316         TypeManager.CSharpSignature() instead of just the name.
5317
5318         * expression.cs (Invocation.OverloadResolve): Provide better error
5319         reporting.
5320         (Invocation.DoResolve): OverloadResolve() never returns null
5321         without reporting an error, so removed the error -6 reporting here.
5322
5323 2004-03-23  Martin Baulig  <martin@ximian.com>
5324
5325         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
5326         generic methods.
5327
5328         * cs-parser.jay (delegate_declaration): Support generic delegates.
5329
5330         * delegate.cs: Support generic delegates.
5331
5332 2004-03-22  Martin Baulig  <martin@ximian.com>
5333
5334         * expression.cs (Invocation.InferParamsTypeArguments): New static
5335         method; does type inference for params arguments.
5336
5337 2004-03-21  Martin Baulig  <martin@ximian.com>
5338
5339         * typemanager.cs (TypeManager.IsGenericMethod): New public static
5340         method; checks whether a method is a generic method.    
5341
5342         * expression.cs (Invocation.InferTypeArguments): New static method;
5343         infer type arguments for generic method invocation.
5344
5345         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
5346         property; we set this to true if we're resolving a generic method
5347         invocation and the user specified type arguments, ie. we're not
5348         doing type inference.
5349
5350 2004-03-20  Martin Baulig  <martin@ximian.com>
5351
5352         * class.cs (MethodData.DeclaringType): New public property.
5353         (MethodData.Define): Set DeclaringType here.
5354         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
5355         instead of OperatorMethodBuilder.DeclaringType.
5356
5357 2004-03-20  Martin Baulig  <martin@ximian.com>
5358
5359         * cs-tokenizer.cs (xtoken): Return a special
5360         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
5361
5362         * cs-parser.jay (default_value_expression): Switch to the new
5363         syntax (14.5.13).
5364
5365 2004-03-19  Martin Baulig  <martin@ximian.com>
5366
5367         * decl.cs (MemberName): New class.  We use this to "construct"
5368         namespace_or_type_name's.
5369
5370         * generics.cs (TypeArguments.GetDeclarations): New public method;
5371         returns the type arguments as a string[] and reports a CS0081 if
5372         one of them is not an identifier.
5373
5374         * class.cs (MemberBase): The .ctor now takes the name as a
5375         MemberName instead of a string.
5376         (MemberBase.ExplicitInterfaceName): Changed type from string to
5377         Expression.
5378         (MemberBase.DoDefine): If we're an explicit implementation, the
5379         InterfaceType may be a generic instance.
5380
5381         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
5382         (namespace_name): Call MemberName.GetName () to transform the
5383         MemberName into a string and ensure we don't have any type
5384         arguments.
5385         (type_name): Call MemberName.GetTypeExpression() to transfrom the
5386         MemberName into an expression.
5387         (method_header): Use namespace_or_type_name instead of member_name.     
5388
5389 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5390
5391         * rootcontext.cs: Add new types to the boot resolution.
5392
5393         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5394         MulticastDelegate is not allowed.
5395
5396         * typemanager.cs: Add new types to lookup: System.TypedReference
5397         and ArgIterator.
5398
5399         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5400         check for TypedReference or ArgIterator, they are not allowed. 
5401
5402         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5403         makes us properly catch 1510 in some conditions (see bug 56016 for
5404         details). 
5405
5406 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5407
5408         * CryptoConvert.cs: update from corlib version
5409         with endian fixes.
5410
5411 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5412
5413         * class.cs (Indexer.Define): Check indexername declaration
5414
5415 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5416
5417         * attribute.cs (IsClsCompliant): Fixed problem with handling
5418         all three states (compliant, not-compliant, undetected).
5419
5420 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5421
5422         * attribute.cs (Attribute): Location is now public.
5423         (Resolve): Store resolved arguments (pos_values) in attribute class.
5424         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5425         (GetClsCompliantAttributeValue): New method that gets
5426         CLSCompliantAttribute value.
5427         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5428         if exists else null.
5429         (AttributeTester): New class for CLS-Compliant verification routines.
5430
5431         * class.cs (Emit): Add CLS-Compliant verification.
5432         (Method.GetSignatureForError): Implemented.
5433         (Constructor.GetSignatureForError): Implemented
5434         (Constructor.HasCompliantArgs): Returns if constructor has
5435         CLS-Compliant arguments.
5436         (Constructor.Emit): Override.
5437         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5438         is needed to test only parameters.
5439         (FieldBase.GetSignatureForError): Implemented.
5440         (TypeContainer): New member for storing base interfaces.
5441         (TypeContainer.FindMembers): Search in base interfaces too.
5442
5443         * codegen.cs (GetClsComplianceAttribute): New method that gets
5444         assembly or module CLSCompliantAttribute value.
5445         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5446         for assembly.
5447         (ModuleClass.Emit): Add error 3012 test.
5448
5449         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5450
5451         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5452         state for all decl types.
5453         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5454         if CLS-Compliant tests are required.
5455         (IsClsCompliaceRequired): New method. Analyze whether code
5456         must be CLS-Compliant.
5457         (IsExposedFromAssembly): New method. Returns true when MemberCore
5458         is exposed from assembly.
5459         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5460         value or gets cached value.
5461         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5462         is explicitly marked with CLSCompliantAttribute.
5463         (IsIdentifierClsCompliant): New abstract method. This method is
5464         used to testing error 3005.
5465         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5466         for identifier and parameters CLS-Compliant testing.
5467         (VerifyClsCompliance): New method. The main virtual method for
5468         CLS-Compliant verifications.
5469         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5470         null. I don't know why is null (too many public members !).
5471         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5472         and get value of first CLSCompliantAttribute that found.
5473
5474         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5475         (VerifyClsCompliance): Override and add extra tests.
5476
5477         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5478         clscheck- disable CLS-Compliant verification event if assembly is has
5479         CLSCompliantAttribute(true).
5480
5481         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5482         ApllyAttribute is now called in emit section as in the other cases.
5483         Possible future Emit integration.
5484         (IsIdentifierClsCompliant): New override.
5485         (VerifyClsCompliance): New override.
5486         (GetEnumeratorName): Returns full enum name.
5487
5488         * parameter.cs (GetSignatureForError): Implemented.
5489
5490         * report.cs (WarningData): New struct for Warning message information.
5491         (LocationOfPreviousError): New method.
5492         (Warning): New method. Reports warning based on the warning table.
5493         (Error_T): New method. Reports error based on the error table.
5494
5495         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5496         verifications are done here.
5497
5498         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5499
5500         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5501         CLSCompliantAttribute.
5502         (all_imported_types): New member holds all imported types from other
5503         assemblies.
5504         (LoadAllImportedTypes): New method fills static table with exported types
5505         from all referenced assemblies.
5506         (Modules): New property returns all assembly modules.
5507
5508 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5509
5510         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5511         throwing a parser error.
5512
5513         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5514         which removes the hardcoded get_/set_ prefixes for properties, as
5515         IL allows for the properties to be named something else.  
5516
5517         Bug #56013
5518
5519         * expression.cs: Do not override operand before we know if it is
5520         non-null.  Fix 56207
5521
5522 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5523
5524         * typemanager.cs: support for pinned variables.
5525
5526 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5527
5528         * decl.cs, typemanager.cs: Avoid using an arraylist
5529         as a buffer if there is only one result set.
5530
5531 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5532
5533         * expression.cs: Make sure you cant call a static method
5534         with an instance expression, bug #56174.
5535
5536 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5537
5538         * class.cs (IsDuplicateImplementation): Improve error reporting to
5539         flag 663 (method only differs in parameter modifier).
5540
5541         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5542         in preprocessor directives.
5543
5544         * location.cs (LookupFile): Allow for the empty path.
5545
5546         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5547         better approach for some of that patch, but its failing with the
5548         CharSet enumeration.  For now try/catch will do.
5549
5550         * typemanager.cs: Do not crash if a struct does not have fields.
5551         Fixes 56150.
5552
5553 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5554
5555         * expression.cs: cs0213, cant fix a fixed expression.
5556         fixes 50231.
5557
5558 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5559
5560         * cs-parser.jay: detect invalid embeded statements gracefully.
5561         bug #51113.
5562
5563 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5564
5565         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5566         As a regex:
5567         s/
5568         the invocation type may not be a subclass of the tye of the item/
5569         The type of the item must be a subclass of the invocation item.
5570         /g
5571
5572         Fixes bug #50820.
5573
5574 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5575
5576         * attribute.cs: Added methods to get a string and a bool from an
5577         attribute. Required to information from AssemblyKeyFileAttribute,
5578         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5579         * codegen.cs: Modified AssemblyName creation to include support for
5580         strongnames. Catch additional exceptions to report them as CS1548.
5581         * compiler.csproj: Updated include CryptoConvert.cs.
5582         * compiler.csproj.user: Removed file - user specific configuration.
5583         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5584         Mono.Security assembly. The original class is maintained and tested in
5585         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5586         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5587         like CSC 8.0 (C# v2) supports.
5588         * Makefile: Added CryptoConvert.cs to mcs sources.
5589         * rootcontext.cs: Added new options for strongnames.
5590
5591 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5592
5593         * driver.cs: For --expect-error, report error code `2'
5594         if the program compiled with no errors, error code `1' if
5595         it compiled with an error other than the one expected.
5596
5597 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5598
5599         * compiler.csproj: Updated for Visual Studio .NET 2003.
5600         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5601         * compiler.sln: Updated for Visual Studio .NET 2003.
5602
5603 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5604
5605         * expression.cs: Fix bug #47234. We basically need to apply the
5606         rule that we prefer the conversion of null to a reference type
5607         when faced with a conversion to 'object' (csc behaviour).
5608
5609 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5610
5611         * statement.cs: Shorter form for foreach, eliminates
5612         a local variable. r=Martin.
5613
5614 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5615
5616         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5617         checks if we can use brtrue/brfalse to test for 0.
5618         * expression.cs: use the above in the test for using brtrue/brfalse.
5619         cleanup code a bit.
5620
5621 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5622
5623         * expression.cs: Rewrite string concat stuff. Benefits:
5624
5625         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5626         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5627         rather than a concat chain.
5628
5629         * typemanager.cs: Add lookups for more concat overloads.
5630
5631 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5632
5633         * expression.cs: Emit shorter il code for array init.
5634
5635         newarr
5636         dup
5637         // set 1
5638
5639         // set 2
5640
5641         newarr
5642         stloc.x
5643
5644         ldloc.x
5645         // set 1
5646
5647         ldloc.x
5648         // set 2
5649
5650 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5651
5652         * statement.cs: Before, two switch blocks would be merged if the
5653         total size of the blocks (end_item - begin_item + 1) was less than
5654         two times the combined sizes of the blocks.
5655
5656         Now, it will only merge if after the merge at least half of the
5657         slots are filled.
5658
5659         fixes 55885.
5660
5661 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5662
5663         * class.cs : csc build fix for GetMethods(). See bug #52503.
5664
5665 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5666
5667         * expression.cs: Make sure fp comparisons work with NaN.
5668         This fixes bug #54303. Mig approved this patch a long
5669         time ago, but we were not able to test b/c the runtime
5670         had a related bug.
5671
5672 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5673
5674         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5675
5676 2004-03-19  Martin Baulig  <martin@ximian.com>
5677
5678         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5679         two overloads may unify for some type parameter substitutions and
5680         report a CS0408 if appropriate.
5681
5682 2004-03-19  Martin Baulig  <martin@ximian.com>
5683
5684         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5685         error here and not in our caller.
5686
5687 2004-03-19  Martin Baulig  <martin@ximian.com>
5688
5689         * interface.cs: Completely killed this file.
5690         (Interface): We're now a TypeContainer and live in class.cs.
5691
5692         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5693         argument; we're now also called for interfaces.
5694         (TypeContainer.DefineMembers): Allow this method being called
5695         multiple times.
5696         (TypeContainer.GetMethods): New public method; formerly known as
5697         Interface.GetMethod().  This is used by PendingImplementation.
5698         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5699         it's now private and non-static.
5700         (Interface): Moved this here; it's now implemented similar to
5701         Class and Struct.
5702         (Method, Property, Event, Indexer): Added `bool is_interface'
5703         argument to their .ctor's.
5704         (MemberBase.IsInterface): New public field.
5705
5706         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5707         instances instead of InterfaceMethod, InterfaceProperty, etc.
5708         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5709         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5710
5711 2004-03-19  Martin Baulig  <martin@ximian.com>
5712
5713         * class.cs (MethodCore.IsDuplicateImplementation): New private
5714         method which does the CS0111 checking.
5715         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5716         Use IsDuplicateImplementation().
5717
5718 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5719
5720         * decl.cs (FindMemberToOverride): New method to find the correct
5721         method or property to override in the base class.
5722         * class.cs
5723             - Make Method/Property use the above method to find the
5724               version in the base class.
5725             - Remove the InheritableMemberSignatureCompare as it is now
5726               dead code.
5727
5728         This patch makes large code bases much faster to compile, as it is
5729         O(n) rather than O(n^2) to do this validation.
5730
5731         Also, it fixes bug 52458 which is that nested classes are not
5732         taken into account when finding the base class member.
5733
5734         Reviewed/Approved by Martin.
5735
5736 2004-03-17  Martin Baulig  <martin@ximian.com>
5737
5738         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5739         of type arguments into account; use the `real_num_type_args'
5740         approach like in DoResolveAsTypeStep().
5741
5742         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5743         nested types.
5744
5745 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5746
5747         * interface.cs: In all interface classes removed redundant
5748         member initialization.
5749
5750 2004-03-16  Martin Baulig  <martin@ximian.com>
5751
5752         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5753
5754 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5755
5756         * decl.cs (DefineTypeAndParents): New helper method to define a
5757         type's containers before the type itself is defined;  This is a
5758         bug exposed by the recent changes to Windows.Forms when an
5759         implemented interface was defined inside a class that had not been
5760         built yet.   
5761
5762         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5763
5764         (Check): Loop correctly to report errors modifiers
5765         (UNSAFE was not in the loop, since it was the same as TOP).
5766
5767         * interface.cs: Every interface member now takes a ModFlags,
5768         instead of a "is_new" bool, which we set on the base MemberCore. 
5769
5770         Every place where we called "UnsafeOk" in the interface, now we
5771         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5772         the unsafe settings from the member declaration instead of the
5773         container interface. 
5774
5775         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5776
5777         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5778         `set_indexer_name' to the pending bits (one per type).
5779
5780         We fixed a bug today that was picking the wrong method to
5781         override, since for properties the existing InterfaceMethod code
5782         basically ignored the method name.  Now we make sure that the
5783         method name is one of the valid indexer names.
5784
5785 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5786  
5787         * support.cs (SeekableStreamReader): Keep track of stream byte
5788         positions and don't mix them with character offsets to the buffer.
5789
5790         Patch from Gustavo Giráldez
5791
5792 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5793
5794         * interface.cs (InterfaceSetGetBase): Removed double member
5795         initialization, base class does it as well.
5796
5797 2004-03-13  Martin Baulig  <martin@ximian.com>
5798
5799         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5800         when compiling corlib.
5801
5802 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5803
5804         * convert.cs (ExplicitConversion): We were reporting an error on
5805         certain conversions (object_type source to a value type, when the
5806         expression was `null') before we had a chance to pass it through
5807         the user defined conversions.
5808
5809         * driver.cs: Replace / and \ in resource specifications to dots.
5810         Fixes 50752
5811
5812         * class.cs: Add check for duplicate operators.  Fixes 52477
5813
5814 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5815
5816         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5817         that are in the middle of the statements, not only at the end.
5818         Fixes #54987
5819
5820         * class.cs (TypeContainer.AddField): No longer set the
5821         `HaveStaticConstructor' flag, now we call it
5822         `UserDefineStaticConstructor' to diferentiate the slightly
5823         semantic difference.
5824
5825         The situation is that we were not adding BeforeFieldInit (from
5826         Modifiers.TypeAttr) to classes that could have it.
5827         BeforeFieldInit should be set to classes that have no static
5828         constructor. 
5829
5830         See:
5831
5832         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5833
5834         And most importantly Zoltan's comment:
5835
5836         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5837
5838         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5839          before its static fields are used', i.e. initialization does not need
5840          to be triggered by the first access to the type. Setting this flag
5841          helps the JIT to compile better code, since it can run the static
5842          constructor at JIT time, and does not need to generate code to call it
5843          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5844          this flag for lots of classes like String. 
5845          
5846          csc sets this flag if the type does not have an explicit static 
5847          constructor. The reasoning seems to be that if there are only static
5848          initalizers for a type, and no static constructor, then the programmer
5849          does not care when this initialization happens, so beforefieldinit
5850          can be used.
5851          
5852          This bug prevents the AOT compiler from being usable, since it 
5853          generates so many calls to mono_runtime_class_init that the AOT code
5854          is much slower than the JITted code. The JITted code is faster, 
5855          because it does not generate these calls if the vtable is type is
5856          already initialized, which is true in the majority of cases. But the
5857          AOT compiler can't do this."
5858
5859 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5860
5861         * class.cs (MethodData.Emit): Refactor the code so symbolic
5862         information is generated for destructors;  For some reasons we
5863         were taking a code path that did not generate symbolic information
5864         before. 
5865
5866 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5867
5868         * class.cs: Create a Constructor.CheckBase method that
5869         takes care of all validation type code. The method
5870         contains some code that was moved from Define.
5871
5872         It also includes new code that checks for duplicate ctors.
5873         This fixes bug #55148.
5874
5875 2004-03-09  Joshua Tauberer <tauberer@for.net>
5876
5877         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5878         a { ... }-style array creation invokes EmitStaticInitializers
5879         which is not good for reference-type arrays.  String, decimal
5880         and now null constants (NullCast) are not counted toward
5881         static initializers.
5882
5883 2004-03-05  Martin Baulig  <martin@ximian.com>
5884
5885         * location.cs (SourceFile.HasLineDirective): New public field;
5886         specifies whether the file contains or is referenced by a "#line"
5887         directive.
5888         (Location.DefineSymbolDocuments): Ignore source files which
5889         either contain or are referenced by a "#line" directive.        
5890
5891 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5892
5893         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5894         direct access to our parent, so check the method inline there.
5895
5896 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5897
5898         * expression.cs (Invocation.EmitCall): Miguel's last commit
5899         caused a regression. If you had:
5900
5901             T t = null;
5902             t.Foo ();
5903
5904         In Foo the implict this would be null.
5905
5906 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5907
5908         * expression.cs (Invocation.EmitCall): If the method is not
5909         virtual, do not emit a CallVirt to it, use Call.
5910
5911         * typemanager.cs (GetFullNameSignature): Improve the method to
5912         cope with ".ctor" and replace it with the type name.
5913
5914         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5915         as an argument the ConstructorBuilder where it is being defined,
5916         to catch the recursive constructor invocations.
5917
5918 2004-03-16  Martin Baulig  <martin@ximian.com>
5919
5920         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5921         ConstructedType, call ResolveType() on it to get the type rather
5922         than just using `expr.Type'.
5923
5924 2004-03-16  Martin Baulig  <martin@ximian.com>
5925
5926         * generics.cs (ConstructedType.GetMemberAccess): Take the
5927         EmitContext instead on the TypeExpr and use
5928         ec.TypeContainer.CurrentType/ec.ContainerType.
5929
5930 2004-03-16  Martin Baulig  <martin@ximian.com>
5931
5932         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5933         parameters before aliases.
5934
5935 2004-03-16  Martin Baulig  <martin@ximian.com>
5936
5937         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5938         New oublic function; checks whether two generic instances may become
5939         equal under some instantiations (26.3.1).
5940
5941         * class.cs (TypeContainer.Define): Call
5942         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5943         error.
5944
5945 2004-03-16  Martin Baulig  <martin@ximian.com>
5946
5947         * class.cs (TypeContainer.GetClassBases): Moved
5948         Error_TypeParameterAsBase() here and also check whether the base
5949         class is not an attribute.
5950
5951 2004-03-16  Martin Baulig  <martin@ximian.com>
5952
5953         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5954
5955 2004-03-16  Martin Baulig  <martin@ximian.com>
5956
5957         * class.cs (Error_TypeParameterAsBase): Use correct error number
5958         here (CS0689).  
5959
5960 2004-03-16  Martin Baulig  <martin@ximian.com>
5961
5962         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5963         for generics.
5964
5965         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5966         error reporting.
5967
5968 2004-03-15  Martin Baulig  <martin@ximian.com>
5969
5970         * typemanager.cs (TypeManager.GetFullName): New public method.
5971         (TypeManager.MemberLookup): Added `int_num_type_arguments'
5972         argument; only return members with the correct number of type
5973         arguments.
5974         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
5975         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
5976         whether the number of type arguments matches.
5977
5978         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
5979         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
5980
5981         * expression.cs (MemberAccess): Added public `NumTypeArguments'
5982         field; it's set by the protected .ctor when we're actually a
5983         GenericMemberAccess.
5984         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
5985         arguments and pass it to MemberLookupFinal ().
5986
5987         * ecore.cs (Expression.MemberLookup): Added `int
5988         num_type_arguments' argument; only return members with the correct
5989         number of type arguments.
5990         (Expression.MemberLookupFailed): Check whether the MemberLookup
5991         failed because we did not have the correct number of type
5992         arguments; report CS0305 in this case.
5993
5994         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
5995         `e.ResolveAsTypeTerminal()' already did so.
5996
5997 2004-03-15  Martin Baulig  <martin@ximian.com>
5998
5999         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
6000         we're a ConstructedType; in this case, the caller must report an
6001         error (for instance CS0131).
6002
6003         * generic.cs (TypeArguments): Added Location argument to the .ctor.
6004         (TypeArguments.Resolve): Actually report errors here.
6005
6006 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
6007
6008         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
6009         `set_indexer_name' to the pending bits (one per type).
6010
6011         We fixed a bug today that was picking the wrong method to
6012         override, since for properties the existing InterfaceMethod code
6013         basically ignored the method name.  Now we make sure that the
6014         method name is one of the valid indexer names.
6015
6016 2004-03-15  Martin Baulig  <martin@ximian.com>
6017
6018         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
6019         for generic instances.
6020
6021 2004-03-13  Martin Baulig  <martin@ximian.com>
6022
6023         * class.cs (TypeContainer.DefineType): Call
6024         TypeManager.AddUserType() immediately after creating the
6025         TypeBuilder; pass all type parameters when creating the
6026         CurrentType.
6027
6028         * decl.cs (DeclSpace.FindNestedType): New public method.
6029         (DeclSpace.FindType): Added `int num_type_args' argument; only
6030         return types with the correct number of type parameters.
6031         (DeclSpace.CountTypeParams): New public property.
6032
6033         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
6034         the number of type parameters; defaults to zero.
6035
6036         * generic.cs (TypeArguments.Count): New public property.
6037         (ConstructedType.DoResolveAsTypeStep): First call
6038         ds.FindNestedType() to find out whether we're nested in the
6039         current generic type; in this case, we inherit all type parameters
6040         from the current class.
6041
6042         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
6043         num_type_args' argument.
6044         (RootContext.LookupType): Added overloaded version which takes the
6045         number of type arguments; only return types with the correct
6046         number of type arguments.
6047
6048         * typemanager.cs (TypeManager.CheckGeneric): New public function;
6049         checks whether `Type t' has `int num_type_args'.
6050
6051 2004-03-13  Martin Baulig  <martin@ximian.com>
6052
6053         * generic.cs (GenericMethod.DefineType): New method; calls
6054         DefineType() on all the type parameters.
6055
6056         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
6057         (MethodData.Define): If we're a generic method, call
6058         GenericMethod.DefineType() to define the type parameters.       
6059
6060 2004-03-10  Martin Baulig  <martin@ximian.com>
6061
6062         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
6063         instead of IsAssignableFrom.    
6064
6065 2004-03-10  Martin Baulig  <martin@ximian.com>
6066
6067         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
6068
6069         * support.cs (ParameterData.HasArrayParameter): New property.
6070         (ReflectionParameters.ctor): Take a MethodBase instead of a
6071         ParameterInfo[].  If we have any type parameters, get the generic
6072         method definition and ask it whether we have variable arguments.
6073
6074 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
6075
6076         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
6077         routines to check if a type is an enumerable/enumerator allow
6078         classes that implement the IEnumerable or IEnumerator interfaces.
6079
6080         * class.cs (Property, Operator): Implement IIteratorContainer, and
6081         implement SetYields.
6082
6083         (Property.Define): Do the block swapping for get_methods in the
6084         context of iterators.   We need to check if Properties also
6085         include indexers or not.
6086
6087         (Operator): Assign the Block before invoking the
6088         OperatorMethod.Define, so we can trigger the Iterator code
6089         replacement. 
6090
6091         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
6092         Property and Operator classes are not created when we parse the
6093         declarator but until we have the block completed, so we use a
6094         singleton SimpleIteratorContainer.Simple to flag whether the
6095         SetYields has been invoked.
6096
6097         We propagate this setting then to the Property or the Operator to
6098         allow the `yield' to function.
6099
6100 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
6101
6102         * codegen.cs: Implemented attribute support for modules.
6103         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
6104         Assembly/Module functionality.
6105
6106         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
6107         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
6108         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
6109
6110 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
6111
6112         * interface.cs (FindMembers): The operation is performed on all base
6113         interfaces and not only on the first. It is required for future CLS Compliance patch.
6114
6115 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6116
6117         * statement.cs, codegen.cs:
6118         This patch deals with patterns such as:
6119
6120         public class List : IEnumerable {
6121
6122                 public MyEnumerator GetEnumerator () {
6123                         return new MyEnumerator(this);
6124                 }
6125
6126                 IEnumerator IEnumerable.GetEnumerator () {
6127                         ...
6128                 }
6129                 
6130                 public struct MyEnumerator : IEnumerator {
6131                         ...
6132                 }
6133         }
6134
6135         Before, there were a few things we did wrong:
6136         1) we would emit callvirt on a struct, which is illegal
6137         2) we emited ldarg when we needed to emit ldarga
6138         3) we would mistakenly call the interface methods on an enumerator
6139         type that derived from IEnumerator and was in another assembly. For example:
6140
6141         public class MyEnumerator : IEnumerator
6142
6143         Would have the interface methods called, even if there were public impls of the
6144         method. In a struct, this lead to invalid IL code.
6145
6146 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
6147
6148         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
6149           renamed to Emit.
6150
6151         * delegate.cs (Define): Fixed crash when delegate type is undefined.
6152
6153 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
6154
6155         * cs-parser.jay: Fix small regression: we were not testing V2
6156         compiler features correctly.
6157
6158         * interface.cs: If the emit context is null, then create one
6159
6160 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6161
6162         * decl.cs (GetSignatureForError): New virtual method to get full name
6163           for error messages.
6164
6165         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6166           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6167
6168         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6169           Duplicated members and code in these classes has been removed.
6170           Better encapsulation in these classes.
6171
6172 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
6173
6174         * assign.cs (Assign.DoResolve): When dealing with compound
6175         assignments, there is a new rule in ECMA C# 2.4 (might have been
6176         there before, but it is documented here) that states that in:
6177
6178         a op= b;
6179
6180         If b is of type int, and the `op' is a shift-operator, then the
6181         above is evaluated as:
6182
6183         a = (int) a op b 
6184
6185         * expression.cs (Binary.ResolveOperator): Instead of testing for
6186         int/uint/long/ulong, try to implicitly convert to any of those
6187         types and use that in pointer arithmetic.
6188
6189         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6190         method to print information for from the type, not from the
6191         null-method we were given.
6192
6193 2004-02-01  Duncan Mak  <duncan@ximian.com>
6194
6195         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6196         parsing for cmd, fixes bug #53694.
6197
6198 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6199
6200         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6201         in the member name duplication tests. Property and operator name duplication
6202         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6203
6204 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6205
6206         * interface.cs (PopulateMethod): Fixed crash when interface method
6207         returns not existing type (error test cs0246-3.cs).
6208
6209 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6210
6211         * cs-parser.jay (interface_accessors): Re-write actions to also
6212         store attributes attached to get and set methods. Fix spelling
6213         while at it.
6214
6215         (inteface_property_declaration): Modify accordingly.
6216
6217         (InterfaceAccessorInfo): New helper class to store information to pass
6218         around between rules that use interface_accessors.
6219
6220         * interface.cs (Emit): Apply attributes on the get and set
6221         accessors of properties and indexers too.
6222
6223         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6224         right MethodBuilder when applying attributes to the get and set accessors.
6225
6226 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6227
6228         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6229
6230 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6231
6232         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6233
6234 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6235
6236         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6237         changes that treat `yield' specially when present before `break'
6238         or `return' tokens.
6239
6240         * cs-tokenizer.cs: yield is no longer a keyword.
6241
6242 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6243
6244         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6245         setting for default constructors.
6246         For default constructors are almost every time set wrong Modifier. The
6247         generated IL code has been alright. But inside mcs this values was
6248         wrong and this was reason why several of my CLS Compliance tests
6249         failed.
6250
6251 2004-02-27  Martin Baulig  <martin@ximian.com>
6252
6253         * generics.cs (ConstructedType.ResolveType): Make the nested type
6254         stuff actually work.
6255
6256 2004-02-25  Martin Baulig  <martin@ximian.com>
6257
6258         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
6259         property; returns the type parameters just from the current type,
6260         ie. with the ones from outer classes.
6261         (DeclSpace.LookupGeneric): First search in the current class, then
6262         in outer classes.
6263         (DeclSpace.initialize_type_params): When hiding a type parameter
6264         from an outer class, put it into the `type_param_list' anyways.
6265
6266         * expression.cs (MemberAccess.expr): Made this field protected.
6267
6268         * class.cs (TypeContainer.Define): The `CurrentType' just contains
6269         the type parameters from the current class.
6270
6271         * generic.cs (ConstructedType.ResolveType): Support nested generic
6272         types by taking the type parameters which we inherit from outer
6273         classes into account.
6274         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
6275         support for nested generic types.
6276
6277 2004-02-23  Martin Baulig  <martin@ximian.com>
6278
6279         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
6280         field and check whether we're nested inside a generic type.
6281         (DeclSpace.ResolveType): If we're resolving to a generic type
6282         definition, create a ConstructedType and return its resolved type.
6283         (DeclSpace.initialize_type_params): New private method;
6284         initializes the `type_param_list' field from the type parameters
6285         from this and all enclosing classes.
6286         (DeclSpace.TypeParameters): Call initialize_type_params() unless
6287         we're already initialized.
6288
6289 2004-02-23  Martin Baulig  <martin@ximian.com>
6290
6291         * class.cs (Method.Define): Create the generic method before
6292         calling DoDefine().
6293         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
6294         the TypeContainer one); we use this for generic methods.
6295
6296         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
6297         parent's TypeBuilder.
6298
6299 2004-02-18  Martin Baulig  <martin@ximian.com>
6300
6301         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
6302         to check for equality.
6303
6304 2004-02-05  Martin Baulig  <martin@ximian.com>
6305
6306         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
6307         `ec.TypeContainer.CurrentType', use it instead of
6308         `ec.ContainerType' to check whether we're in the type's ctor.
6309
6310 2004-01-29  Martin Baulig  <martin@ximian.com>
6311
6312         * expression.cs (Invocation.DoResolve): If we're a
6313         `ConstructedType', then we're actually a generic method, so
6314         rewrite the expr as a GenericMemberAccess.
6315
6316         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
6317         here; manually parse it into a string.
6318
6319 2004-01-28  Martin Baulig  <martin@ximian.com>
6320
6321         * typemanager.cs (TypeManager.IsEqual): New static method.
6322         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
6323         check for equality instead of using `=='.
6324
6325 2004-01-26  Martin Baulig  <martin@ximian.com>
6326
6327         * decl.cs (DeclSpace.CurrentType): New public field.
6328
6329         * expression.cs (This.ResolveBase): If we have an
6330         `ec.TypeContainer.CurrentType', use it instead of
6331         `ec.ContainerType'.
6332
6333         * class.cs (TypeContainer.DefineType): If we're a generic type,
6334         create the `CurrentType' (unresolved).
6335         (TypeContainer.GenericType): New private field.
6336         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
6337         it and store it in `GenericType' before creating the MemberCache.
6338         (TypeContainer.GetMembers): If we have a `GenericType', call
6339         TypeManager.FindMembers() on it.
6340
6341         * interface.cs (Interface.GenericType): New private field.
6342         (Interface.DefineType): If we're a generic type, create the
6343         `CurrentType' (unresolved).
6344         (Interface.DefineMembers): If we have a `CurrentType', resolve it
6345         and store it in `GenericType' before creating the MemberCache.
6346         (Interface.GetMembers): If we have a `GenericType', call
6347         TypeManager.FindMembers() on it.
6348
6349 2004-01-22  Martin Baulig  <martin@ximian.com>
6350
6351         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6352         not a QualifiedIdentifier.  This is what `type_name_expression'
6353         was previously doing.
6354         (type_name_expression): Removed; the code is now in
6355         `namespace_or_type_name'.
6356         (qualified_identifier): Removed, use `namespace_or_type_name'
6357         instead.
6358         (QualifiedIdentifier): Removed this class.      
6359
6360 2004-01-22  Martin Baulig  <martin@ximian.com>
6361
6362         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6363         not a string as alias name.
6364
6365 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6366
6367         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6368         #52730 bug, and instead compute correctly the need to use a
6369         temporary variable when requesting an address based on the
6370         static/instace modified of the field and the constructor.
6371  
6372 2004-01-21  Martin Baulig  <martin@ximian.com>
6373
6374         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6375         class and namespace before looking up aliases.  Fixes #52517.
6376
6377 2004-01-21  Martin Baulig  <martin@ximian.com>
6378
6379         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6380         assinged in a 'try'; fixes exception4.cs.
6381
6382 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6383         * class.cs : Implemented parameter-less constructor for TypeContainer
6384
6385         * decl.cs: Attributes are now stored here. New property OptAttributes
6386
6387         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6388
6389         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6390
6391 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6392
6393         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6394           (CSharpSignature): New method for indexer and property signature.
6395
6396 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6397
6398         * pending.cs (IsVirtualFilter): Faster implementation.
6399
6400 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6401
6402         * typemanager.cs: Avoid inclusion of same assembly more than once.
6403
6404 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6405
6406         * cs-parser.jay: Fixed problem where the last assembly attribute
6407           has been applied also to following declaration (class, struct, etc.)
6408           
6409 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6410
6411         * class.cs: Added error CS0538, CS0539 reporting.
6412         Fixed crash on Microsoft runtime when field type is void.
6413
6414         * cs-parser.jay: Added error CS0537 reporting.
6415
6416         * pending.cs: Added error CS0535 reporting.
6417         Improved error report for errors CS0536, CS0534.
6418
6419 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6420
6421         Merge a few bits from the Anonymous Method MCS tree.
6422
6423         * statement.cs (ToplevelBlock): New class for toplevel methods,
6424         will hold anonymous methods, lifted variables.
6425
6426         * cs-parser.jay: Create toplevel blocks for delegates and for
6427         regular blocks of code. 
6428
6429 2004-01-20  Martin Baulig  <martin@ximian.com>
6430
6431         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6432         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6433         and `NeedExplicitReturn'; added `IsLastStatement'.
6434         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6435         have a `ReturnLabel' or we're not unreachable.
6436
6437         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6438         child's reachability; don't just override ours with it.  Fixes
6439         #58058 (lluis's example).
6440         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6441         InFinally(), InLoop(), InSwitch() and
6442         BreakCrossesTryCatchBoundary() methods.
6443
6444         * statement.cs (Return): Do all error checking in Resolve().
6445         Unless we are the last statement in a top-level block, always
6446         create a return label and jump to it.
6447         (Break, Continue): Do all error checking in Resolve(); also make
6448         sure we aren't leaving a `finally'.
6449         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6450         statement in a top-level block.
6451         (Block.Flags): Added `IsDestructor'.
6452         (Block.IsDestructor): New public property.
6453
6454 2004-01-20  Martin Baulig  <martin@ximian.com>
6455
6456         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6457
6458 2004-01-20  Martin Baulig  <martin@ximian.com>
6459
6460         * statement.cs (Statement.ResolveUnreachable): New public method.
6461         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6462         (Block.Resolve): Resolve unreachable statements.
6463
6464 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6465
6466         * expression.cs: We need to fix the case where we do
6467         not have a temp variable here.
6468
6469         * assign.cs: Only expression compound assignments need
6470         temporary variables.
6471
6472 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6473
6474         * flowanalysis.cs: Reduce memory allocation in a few ways:
6475           - A block with no variables should not allocate a bit
6476             vector for itself.
6477           - A method with no out parameters does not need any tracking
6478             for assignment of the parameters, so we need not allocate
6479             any data for it.
6480           - The arrays:
6481                 public readonly Type[] VariableTypes;
6482                 public readonly string[] VariableNames;
6483             Are redundant. The data is already stored in the variable
6484             map, so we need not allocate another array for it.
6485           - We need to add alot of checks for if (params | locals) == null
6486             due to the first two changes.
6487
6488 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6489
6490         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6491         implement IMemoryLocation, we store a copy on a local variable and
6492         take the address of it.  Patch from Benjamin Jemlich
6493
6494         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6495         to use a special "type_name_expression" rule which reduces the
6496         number of "QualifiedIdentifier" classes created, and instead
6497         directly creates MemberAccess expressions.
6498
6499 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6500
6501         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6502         that fixes #52853.  Null literal assignment to ValueType
6503
6504         * class.cs (MethodData.Emit): Instead of checking the name of the
6505         method to determine if its a destructor, create a new derived
6506         class from Method called Destructor, and test for that.  
6507
6508         * cs-parser.jay: Create a Destructor object instead of a Method.  
6509
6510         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6511
6512         Fixes: 52933
6513
6514 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6515
6516         * expression.cs (Binary.ResolveOperator): Perform an implicit
6517         conversion from MethodGroups to their delegate types on the
6518         Addition operation.
6519
6520         * delegate.cs: Introduce a new class DelegateCreation that is the
6521         base class for `NewDelegate' and `ImplicitDelegateCreation',
6522         factor some code in here.
6523
6524         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6525         conversion from MethodGroups to compatible delegate types. 
6526
6527         * ecore.cs (Expression.Resolve): Do not flag error 654
6528         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6529         we allow conversions from MethodGroups to delegate types now.
6530
6531         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6532         assignments in v2 either.
6533
6534 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6535
6536         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6537         static read-only fields in ctors.
6538
6539         Applied patch from Benjamin Jemlich 
6540
6541         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6542
6543 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6544
6545         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6546         here to return true, as they can be used like this:
6547
6548                 (XXX) int.MEMBER ()
6549
6550         Fixed 49836 and all the other dups
6551
6552 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6553
6554         * driver.cs: Implement /win32res and /win32icon.
6555
6556 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6557
6558         * cs-parser.jay: Add a rule to improve error handling for the
6559         common mistake of placing modifiers after the type.
6560
6561 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6562
6563         * cs-parser.jay (interface_event_declaration): Catch
6564         initialization of events on interfaces, and report cs0068
6565
6566         * cs-parser.jay (interface_event_declaration): Catch
6567         initialization of events. 
6568
6569         * ecore.cs: Better report missing constructors.
6570
6571         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6572         the error reporting done in the wrong place.  Fix.
6573
6574         * expression.cs (Binary.ResolveOperator): Catch the 
6575         operator + (E x, E y) error earlier, and later allow for implicit
6576         conversions in operator +/- (E e, U x) from U to the underlying
6577         type of E.
6578
6579         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6580         52596, if the container class is abstract, the default constructor
6581         is protected otherwise its public (before, we were always public).
6582
6583         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6584         fixed statement.
6585
6586         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6587         Jemlich that fixes bug #52597, MCS was generating invalid code for
6588         idisposable structs.   Thanks to Ben for following up with this
6589         bug as well.
6590
6591 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6592
6593         * driver.cs: Allow assemblies without code to be generated, fixes
6594         52230.
6595
6596 2004-01-07  Nick Drochak <ndrochak@gol.com>
6597
6598         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6599
6600 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6601
6602         * cs-parser.jay: Add rules to improve error reporting if fields or
6603         methods are declared at the namespace level (error 116)
6604
6605         * Add rules to catch event add/remove
6606
6607 2004-01-04  David Sheldon <dave-mono@earth.li>
6608
6609   * expression.cs: Added matching ")" to error message for 
6610   CS0077
6611
6612 2004-01-03 Todd Berman <tberman@gentoo.org>
6613
6614         * ecore.cs, attribute.cs:
6615         Applying fix from #52429.
6616
6617 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6618
6619         * ecore.cs, expression.cs, statement.cs:
6620         Total rewrite of how we handle branching. We
6621         now handle complex boolean expressions with fewer
6622         jumps. As well if (x == 0) no longer emits a ceq.
6623
6624         if (x is Foo) is much faster now, because we generate
6625         better code.
6626
6627         Overall, we get a pretty big improvement on our benchmark
6628         tests. The code we generate is smaller and more readable.
6629
6630         I did a full two-stage bootstrap. The patch was reviewed
6631         by Martin and Miguel.
6632
6633 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6634
6635         * cs-parser.jay: Make primary_expression not take a QI.
6636         we dont need this because the member_access rule covers
6637         us here. So we replace the rule with just IDENTIFIER.
6638
6639         This has two good effects. First, we remove a s/r conflict.
6640         Second, we allocate many fewer QualifiedIdentifier objects.
6641
6642 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6643
6644         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6645         set the correct information via SRE. This prevents
6646         hanging on the MS runtime. Fixes #29374.
6647
6648 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6649
6650         * convert.cs: correctly handle conversions to value types
6651         from Enum and ValueType as unboxing conversions.
6652
6653         Fixes bug #52569. Patch by Benjamin Jemlich.
6654
6655 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6656
6657         * expression.cs (BetterConversion): Prefer int -> uint
6658         over int -> ulong (csc's behaviour). This fixed bug #52046.
6659
6660 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6661
6662         * decl.cs (MemberCache.FindMembers): now returns a
6663         MemberInfo [].
6664
6665         * typemanager.cs: In general, go with with ^^.
6666         (CopyNewMethods): take an IList.
6667         (RealMemberLookup): Only allocate an arraylist
6668         if we copy from two sets of methods.
6669
6670         This change basically does two things:
6671         1) Fewer array lists allocated due to CopyNewMethods.
6672         2) the explicit cast in MemberList costed ALOT.
6673
6674 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6675
6676         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6677         a hashtable to avoid needless string allocations when an identifier is
6678         used more than once (the common case).
6679
6680 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6681
6682         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6683         is broken, it will not return anything. So, we
6684         have to use the information we have in mcs to
6685         do the task.
6686
6687         * typemanager.cs: Add a cache for GetInterfaces,
6688         since this will now be used more often (due to ^^)
6689
6690         (GetExplicitInterfaces) New method that gets the
6691         declared, not effective, interfaces on a type
6692         builder (eg, if you have interface IFoo, interface
6693         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6694         { IBar }.
6695
6696         This patch makes MCS able to bootstrap itself on
6697         Windows again.
6698
6699 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6700
6701         * expression.cs: Remove the Nop's that Miguel put
6702         in by mistake.
6703
6704 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6705
6706         * report.cs, codegen.cs: Give the real stack trace to
6707         the error when an exception is thrown.
6708
6709 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6710
6711         * decl.cs: only allocate hashtables for ifaces if 
6712         it is an iface!
6713
6714 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6715
6716         * expression.cs: fix the error from cs0121-2.cs
6717         (a parent interface has two child interfaces that
6718         have a function with the same name and 0 params
6719         and the function is called through the parent).
6720
6721 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6722
6723         * class.cs, rootcontext.cs, typmanager.cs: do not
6724         leak pointers.
6725
6726 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6727
6728         * codegen.cs: remove stack for the ec flow branching.
6729         It is already a linked list, so no need.
6730
6731 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6732
6733         * Makefile: Allow custom profiler here.
6734
6735 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6736
6737         * typemanager.cs (LookupType):
6738           - Use a static char [], because split takes
6739             a param array for args, so it was allocating
6740             every time.
6741           - Do not store true in a hashtable, it boxes.
6742
6743 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6744
6745         * flowanalysis.cs: bytify common enums.
6746
6747 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6748
6749         * modifiers.cs: Add a new set of flags for the
6750         flags allowed on explicit interface impls.
6751         * cs-parser.jay: catch the use of modifiers in
6752         interfaces correctly.
6753         * class.cs: catch private void IFoo.Blah ().
6754
6755         All related to bug #50572.
6756
6757 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6758
6759         * decl.cs: Rewrite the consistant accessability checking.
6760         Accessability is not linear, it must be implemented in
6761         a tableish way. Fixes #49704.
6762
6763 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6764
6765         * expression.cs: Handle negation in a checked context.
6766         We must use subtraction from zero. Fixes #38674.
6767
6768 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6769
6770         * class.cs: Ignore static void main in DLLs.
6771         * rootcontext.cs: Handle the target type here,
6772         since we are have to access it from class.cs
6773         * driver.cs: account for the above.
6774
6775 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6776
6777         * report.cs: Give line numbers and files if available.
6778
6779 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6780
6781         * driver.cs: Implement /addmodule.
6782
6783         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6784         ModuleBuilders.
6785
6786 2003-12-20  Martin Baulig  <martin@ximian.com>
6787
6788         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6789         (FieldBase.IsAssigned): Removed this field.
6790         (FieldBase.SetAssigned): New public method.
6791         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6792
6793 2003-12-20  Martin Baulig  <martin@ximian.com>
6794
6795         * expression.cs (LocalVariableReference.DoResolve): Don't set
6796         `vi.Used' if we're called from DoResolveLValue().
6797
6798         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6799         returns the usage vector it just merged into the current one -
6800         pass this one to UsageWarning().
6801         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6802         of the `EmitContext', don't call this recursively on our children.
6803
6804 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6805
6806         * driver.cs: Implement /target:module.
6807
6808 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6809
6810         * support.cs (CharArrayHashtable): New helper class.
6811
6812         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6813         char arrays, not strings, so we can avoid creating a string in
6814         consume_identifier if the identifier is a keyword.
6815
6816 2003-12-16  Martin Baulig  <martin@ximian.com>
6817
6818         * statement.cs (LocalInfo.Assigned): Removed this property.
6819         (LocalInfo.Flags): Removed `Assigned'.
6820         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6821         and uses flow analysis.
6822         (Block.UsageWarning): Made this method private.
6823         (Block.Resolve): Call UsageWarning() if appropriate.
6824
6825         * expression.cs (LocalVariableReference.DoResolve): Always set
6826         LocalInfo.Used here.
6827
6828 2003-12-13  Martin Baulig  <martin@ximian.com>
6829
6830         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6831         any value here; we're now using flow analysis to figure out
6832         whether a statement/block returns a value.
6833
6834 2003-12-13  Martin Baulig  <martin@ximian.com>
6835
6836         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6837         working again.
6838         (FlowBranching.MergeFinally): Don't call
6839         `branching.CheckOutParameters()' here, this is called in
6840         MergeTopBlock().
6841         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6842         when adding the `finally' vector.       
6843
6844 2003-12-13  Martin Baulig  <martin@ximian.com>
6845
6846         * flowanalysis.cs
6847         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6848         actually work and also fix #48962.
6849
6850 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6851
6852         * decl.cs: Do not check System.Object for nested types,
6853         since we know it does not have any. Big bang for buck:
6854
6855         BEFORE:
6856            Run 1:   8.35 seconds
6857            Run 2:   8.32 seconds
6858            corlib:  17.99 seconds
6859         AFTER:
6860            Run 1:   8.17 seconds
6861            Run 2:   8.17 seconds
6862            corlib:  17.39 seconds
6863
6864 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6865
6866         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6867         time we are returning 0 members, so we save alot here.
6868
6869 2003-12-11  Martin Baulig  <martin@ximian.com>
6870
6871         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6872         `MergeChild()', also just take the `FlowBranching' as argument;
6873         call Merge() on it and return the result.
6874         (FlowBranching.Merge): We don't need to do anything if we just
6875         have one sibling.
6876
6877 2003-12-11  Martin Baulig  <martin@ximian.com>
6878
6879         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6880         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6881         Maurer for this idea.
6882
6883 2003-12-11  Martin Baulig  <martin@ximian.com>
6884
6885         * flowanalysis.cs (MergeResult): This class is now gone; we now
6886         use the `UsageVector' for this.  The reason for this is that if a
6887         branching just has one sibling, we don't need to "merge" them at
6888         all - that's the next step to do.
6889         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6890         `MergeResult'.
6891
6892 2003-12-11  Martin Baulig  <martin@ximian.com>
6893
6894         Reworked flow analyis and made it more precise and bug-free.  The
6895         most important change is that we're now using a special `Reachability'
6896         class instead of having "magic" meanings of `FlowReturns'.  I'll
6897         do some more cleanups and optimizations and also add some more
6898         documentation this week.
6899
6900         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6901         largely reworked this class.
6902         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6903         the new `Reachability' class instead of having "magic" values here.
6904         (FlowBranching): We're now using an instance of `Reachability'
6905         instead of having separate `Returns', `Breaks' etc. fields.
6906
6907         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6908         based on flow analysis; ignore the return value of block.Emit ().
6909
6910 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6911
6912         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6913         if they are private.
6914
6915 2003-12-09  Martin Baulig  <martin@ximian.com>
6916
6917         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6918         call them directly on the UsageVector.
6919
6920 2003-12-09  Martin Baulig  <martin@ximian.com>
6921
6922         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6923         Changed return type from `FlowReturns' to `Reachability'.
6924
6925 2003-12-09  Martin Baulig  <martin@ximian.com>
6926
6927         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6928         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6929         `Reachable' fields with a single `Reachability' one.
6930
6931 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6932
6933         * class.cs (FindMembers): Remove foreach's.
6934
6935         Bootstrap times:
6936
6937         BEFORE
6938                 Run 1:   8.74 seconds
6939                 Run 2:   8.71 seconds
6940
6941         AFTER
6942                 Run 1:   8.64 seconds
6943                 Run 2:   8.58 seconds
6944
6945
6946 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6947
6948         * cs-parser.jay:
6949         * gen-treedump.cs:
6950         * statement.cs:
6951         This patch does a few things:
6952                 1. EmptyStatement is now a singleton, so it is never reallocated.
6953                 2. All blah is EmptyStatement constructs have been changed to
6954                    blah == EmptyStatement.Value, which is much faster and valid
6955                    now that EmptyStatement is a singleton.
6956                 3. When resolving a block, rather than allocating a new array for
6957                    the non-empty statements, empty statements are replaced with
6958                    EmptyStatement.Value
6959                 4. Some recursive functions have been made non-recursive.
6960         Mainly the performance impact is from (3), however (1) and (2) are needed for
6961         this to work. (4) does not make a big difference in normal situations, however
6962         it makes the profile look saner.
6963
6964         Bootstrap times:
6965
6966         BEFORE
6967         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6968         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6969         Total memory allocated: 56397 KB
6970
6971         AFTER
6972         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6973         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6974         Total memory allocated: 55666 KB
6975
6976 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6977
6978         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6979         than the hashtable in a hashtable version
6980
6981         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6982         we always end up concating a string. This results in a huge perf
6983         loss, because many strings have to be tracked by the GC. In this
6984         patch, we first use a hashtable that works with two keys, so that
6985         the strings do not need to be concat'ed.
6986
6987         Bootstrap times:
6988         BEFORE
6989                 Run 1:   8.74 seconds
6990                 Run 2:   8.71 seconds
6991
6992         AFTER
6993                 Run 1:   8.65 seconds
6994                 Run 2:   8.56 seconds
6995
6996 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6997
6998         * Makefile: Add a new target `do-time' that does a quick and simple
6999         profile, leaving easy to parse output.
7000
7001 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
7002
7003         * codegen.cs (Init): Create the dynamic assembly with 
7004         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
7005
7006 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7007
7008         * support.cs: Make the PtrHashtable use only one
7009         instance of its comparer.
7010
7011 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
7012
7013         * typemanager.cs: Fix lookup of GetNamespaces.
7014
7015 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
7016
7017         * expression.cs: Removed redundant line.
7018
7019         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
7020         ArrayLists, use for loops with bounds.  
7021
7022         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
7023         arraylist.
7024
7025         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
7026         arraylists, use for loop with bounds.
7027
7028         The above three changes give us a 0.071 second performance
7029         improvement out of 3.294 seconds down to 3.223.  On my machine
7030         the above changes reduced the memory usage by 1,387 KB during
7031         compiler bootstrap.
7032
7033         * cs-parser.jay (QualifiedIdentifier): New class used to represent
7034         QualifiedIdentifiers.  Before we created a new string through
7035         concatenation, and mostly later on, the result would be
7036         manipulated by DecomposeQI through string manipulation.
7037
7038         This reduced the compiler memory usage for bootstrapping from
7039         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
7040         compile times in 0.05 seconds.
7041
7042 2003-11-28  Dick Porter  <dick@ximian.com>
7043
7044         * support.cs: Do string compares with the Invariant culture.
7045
7046         * rootcontext.cs: 
7047         * gen-treedump.cs: 
7048         * expression.cs: 
7049         * driver.cs: 
7050         * decl.cs: 
7051         * codegen.cs: 
7052         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
7053         the comparison is done with the Invariant culture.
7054
7055 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
7056
7057         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7058         GetEnumerator method.
7059
7060         (ProbeCollectionType): Iterate starting at the most specific type
7061         upwards looking for a GetEnumerator
7062
7063         * expression.cs: Shift count can be up to 31 for int/uint and 63
7064         for long/ulong.
7065
7066 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
7067
7068         * statement.cs (Block.LookupLabel): Also look for the label on the
7069         children blocks.  Use a hash table to keep track of visited
7070         nodes. 
7071
7072         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7073         we actually did transform the other operand, otherwise fall back
7074         to the common codepath that casts to long.
7075
7076         * cs-tokenizer.cs: Use the same code pattern as the int case.
7077         Maybe I should do the parsing myself, and avoid depending on the
7078         Parse routines to get this done.
7079
7080 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
7081
7082         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7083         which fixes bug 51347.  This time test it.
7084
7085         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7086         attributes for example can not tell the difference between these.
7087         The difference was only a syntax feature of the language. 
7088
7089         * attribute.cs: Apply attributes to delegates.
7090
7091         * delegate.cs: Call the apply attributes method.
7092
7093 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
7094
7095         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7096         comparing 0 vs Byte.MinValue, not the value
7097
7098         (ImplicitConversionRequired): When reporting a conversion error,
7099         use error 31 to print out the constant error instead of the
7100         simpler 29.
7101
7102         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7103         which fixes bug 51347.
7104
7105 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
7106
7107         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
7108         which fixes the -warnaserror command line option.
7109
7110 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
7111
7112         * cfold.cs (DoNumericPromotions): During constant folding of
7113         additions on UIntConstant, special case intconstants with
7114         IntConstants like we do on the expression binary operator. 
7115
7116 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
7117
7118         * convert.cs (ImplicitReferenceConversion): We were missing a case
7119         (System.Enum are not value types or class types, so we need to
7120         classify them separatedly).
7121
7122         * driver.cs: We do not support error 2007.
7123
7124 2003-11-12 Jackson Harper <jackson@ximian.com>
7125
7126         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
7127         system directory. Also use the full file name so users can
7128         libraries names mscorlib-o-tron.dll in a non system dir.
7129         
7130 2004-01-04  David Sheldon <dave-mono@earth.li>
7131
7132         * expression.cs: Added matching ")" to error message for CS0077.
7133
7134 2003-12-19  Martin Baulig  <martin@ximian.com>
7135
7136         * typemanager.cs (TypeManager.IsEqualGenericType): New public
7137         static method; see documentation in the method.
7138         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
7139
7140         * convert.cs (Convert.ImplicitReferenceConversion,
7141         Convert.ImplicitReferenceConversionExists): Add support for
7142         generic type declarations; see gen-36.cs.
7143
7144 2003-12-19  Martin Baulig  <martin@ximian.com>
7145
7146         * pending.cs (Pending.InterfaceMethod): Use
7147         `Type.IsAssignableFrom()' instead of `=='.
7148
7149 2003-12-18  Martin Baulig  <martin@ximian.com>
7150
7151         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
7152         byref types first.
7153
7154         * convert.cs (Convert.ImplicitStandardConversionExists): Use
7155         `expr_type.Equals (target_type)' instead of `=='.
7156
7157 2003-12-08  Martin Baulig  <martin@ximian.com>
7158
7159         * generics.cs (Constraints.Types): Removed.
7160         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
7161         to Type's.
7162         (Constraints.ResolveTypes): New public method; resolves the
7163         TypeExpr's to Type's.
7164         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
7165         longer takes the constraints.
7166         (TypeParameter.DefineMethod): Likewise.
7167         (TypeParameter.DefineType): New public method.  Calls
7168         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
7169         the constraints.
7170
7171 2003-12-08  Martin Baulig  <martin@ximian.com>
7172
7173         * convert.cs (Convert.ImplicitConversionStandard): Use
7174         `expr_type.Equals (target_type)' instead of `=='.
7175
7176 2003-12-08  Martin Baulig  <martin@ximian.com>
7177
7178         * typemanager.cs (TypeManager.GetReferenceType): Call
7179         `Type.MakeByRefType ()'.
7180
7181 2003-12-08  Martin Baulig  <martin@ximian.com>
7182
7183         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
7184         just has some special meaning in some situations.  For instance,
7185         it is allowed to use `where' as the name of a variable etc.
7186
7187 2003-12-04  Martin Baulig  <martin@ximian.com>
7188
7189         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7190         `Type.MakeArrayType()' for array types.
7191
7192 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
7193
7194         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
7195         debugging message.
7196
7197         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
7198         corlib to compile.
7199
7200 2003-11-16  Martin Baulig  <martin@ximian.com>
7201
7202         * codegen.cs (EmitContext.IsGeneric): Removed.
7203
7204         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
7205         ResolveGeneric() on the DeclSpace.
7206
7207 2003-11-16  Martin Baulig  <martin@ximian.com>
7208
7209         * generic.cs (TypeArguments.Resolve):
7210         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
7211         `ResolveType()' on it to get the Type.
7212
7213 2003-11-15  Martin Baulig  <martin@ximian.com>
7214
7215         * generic.cs (ConstructedType.GetInterfaces): Override this.
7216
7217 2003-11-14  Martin Baulig  <martin@ximian.com>
7218
7219         * interface.cs (Interface.DefineType): Define all type parameters
7220         before adding the interfaces we inherit.
7221
7222 2003-11-11  Martin Baulig  <martin@ximian.com>
7223
7224         * generic.cs (ConstructedType.ResolveType): Always call
7225         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
7226
7227 2003-11-10  Martin Baulig  <martin@ximian.com>
7228
7229         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7230         (TypeManager.InitCoreTypes): Initialize them here, but instead of
7231         calling `ResolveType()' on them, directly assign their `Type'.
7232
7233 2003-11-08  Martin Baulig  <martin@ximian.com>
7234
7235         * generic.cs (ConstructedType): Override `IsClass' etc.
7236
7237 2003-11-08  Martin Baulig  <martin@ximian.com>
7238
7239         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7240         return value and the `out parent' parameter.
7241         (TypeContainer.DefineType): Moved the CS0644 check into
7242         GetClassBases().  Don't pass the interface types to the
7243         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7244         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7245
7246         * ecore.cs (TypeExpr.IsAttribute): New property.
7247         (TypeExpr.GetInterfaces): New method.
7248
7249         * interface.cs (Interface.GetInterfaceTypeByName): Return a
7250         TypeExpr instead of a Type.
7251         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7252         (Interface.DefineType): Don't pass the interface types to the
7253         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7254         them later and then call `TypeBulider.AddInterfaceImplementation()'.
7255
7256         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7257         instead of a `Type[]'.
7258         (TypeManager.RegisterBuilder): Likewise.
7259         (TypeManager.AddUserInterface): Likewise.
7260         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7261         `Type[]' and also return a `TypeExpr[]'.
7262         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7263
7264 2003-11-08  Martin Baulig  <martin@ximian.com>
7265
7266         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7267         Expression.     
7268
7269 2003-11-08  Martin Baulig  <martin@ximian.com>
7270
7271         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7272         TypeManager.ResolveExpressionTypes().
7273
7274         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7275         instead of an Expression.
7276         (TypeExpr): This is now an abstract base class for `TypeExpression'.
7277         (TypeExpression): New public class; formerly known as `TypeExpr'.
7278
7279         * expression.cs (ComposedCast): Derive from TypeExpr.
7280
7281         * typemanager.cs (TypeManager.system_*_expr): These are now
7282         TypExpr's instead of Expression's.
7283         (TypeManager.ResolveExpressionTypes): New public static function;
7284         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7285         of them.        
7286
7287 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
7288
7289         * expression.cs (New.DoResolve): Do not dereference value that
7290         might be a null return.
7291
7292         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7293         sure that the constant value has the right type.  Fixes an
7294         unreported bug, similar to 50425.
7295
7296         * const.cs (Const.LookupConstantValue): Call
7297         ImplicitStandardConversionExists before doing a conversion to
7298         avoid havng the TypeManager.ChangeType do conversions.
7299
7300         Reduced the number of casts used
7301
7302         (Const.ChangeType): New routine to enable reuse of the constant
7303         type changing code from statement.
7304
7305         * typemanager.cs (ChangeType): Move common initialization to
7306         static global variables.
7307
7308         Fixes #50425.
7309
7310         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7311         every value type to go through, even if it was void.  Fix that. 
7312
7313         * cs-tokenizer.cs: Use is_identifier_start_character on the start
7314         character of the define, and the is_identifier_part_character for
7315         the rest of the string.
7316
7317 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
7318
7319         * expression.cs (UnaryMutator.EmitCode): When I updated
7320         LocalVariableReference.DoResolve, I overdid it, and dropped an
7321         optimization done on local variable references.
7322
7323 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
7324
7325         * ecore.cs: Convert the return from Ldlen into an int.
7326
7327 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
7328
7329         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7330         the accessibility, this is a special case for toplevel non-public
7331         classes (internal for instance).
7332
7333 2003-10-20  Nick Drochak <ndrochak@gol.com>
7334
7335         * ecore.cs: Fix typo and build.  Needed another right paren.
7336
7337 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
7338
7339         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
7340         `internal' case regular and protected, but not allowing protected
7341         to be evaluated later.  Bug 49840
7342
7343 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
7344
7345         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7346         to kb.Nlast, and not the kb.nFirst to isolate the switch
7347         statement.
7348
7349         Extract the underlying type, so enumerations of long/ulong are
7350         treated like long/ulong.
7351
7352 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
7353
7354         * expression.cs (New): Overload the meaning of RequestedType to
7355         track the possible creation of the NewDelegate type, since
7356         DoResolve is invoked more than once for new constructors on field
7357         initialization.
7358
7359         See bugs: #48800 and #37014
7360
7361         * cs-parser.jay (declare_local_constants): Take an arraylist
7362         instead of a single constant.
7363
7364         (local_constant_declaration): It should take a
7365         constant_declarators, not a constant_declarator.  Fixes 49487
7366
7367         * convert.cs: Fix error report.
7368
7369 2003-10-13 Jackson Harper <jackson@ximian.com>
7370
7371         * typemanager.cs (TypeToCoreType): Add float and double this fixes
7372         bug #49611
7373         
7374 2003-11-03  Martin Baulig  <martin@ximian.com>
7375
7376         * expression.cs (ArrayAccess.GetStoreOpcode): Added
7377         `out bool has_type_arg'; if set, we need to pass the type to
7378         ig.Emit().
7379         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
7380         Stelem_Any/Ldelem_Any for generic parameters.   
7381
7382 2003-11-02  Martin Baulig  <martin@ximian.com>
7383
7384         * expression.cs (Invocation.EmitCall): Use
7385         `TypeManager.IsValueType()' to check whether it's a value type.
7386         Don't set `struct_call' when calling a method on a type parameter.
7387
7388 2003-11-02  Martin Baulig  <martin@ximian.com>
7389
7390         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
7391         and removed the TypeBuilder argument.
7392
7393         * typemanager.cs (TypeManager.IsValueType): Return
7394         `t.IsGenericParameter || t.IsValueType'.
7395
7396 2003-10-25  Martin Baulig  <martin@ximian.com>
7397
7398         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
7399         call ConstructedType.Resolve() on it.
7400
7401         * generic.cs (ConstructedType.Resolve): Set `type' on success.
7402
7403 2003-10-25  Martin Baulig  <martin@ximian.com>
7404
7405         * class.cs (TypeContainer.GetClassBases): Changed
7406         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
7407         CS8214 reporting here.
7408         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
7409         instead of a `Type' for our parent.  In case of a recursive
7410         declaration (see tests/gen-23.cs for an example), our parent is a
7411         ConstructedType and it doesn't have its type set.  So, first
7412         create our own TypeBuilder, then call constructed.Resolve() to get
7413         the parent's type and finally TypeBuilder.SetParent() it.
7414
7415         * ecore.cs (TypeExpr.Name): New public virtual property.
7416
7417         * generic.cs
7418         (ConstructedType): We're now a TypeExpr and not just an Expression.
7419         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
7420         arguments here; this is done later.
7421         (ConstructedType.Resolve): New public method to resolve the type
7422         arguments and bind them.
7423
7424 2003-10-21  Martin Baulig  <martin@ximian.com>
7425
7426         * convert.cs: Use `TypeManager.IsValueType' instead of
7427         'type.IsValueType' everywhere.
7428
7429         * typemanager.cs (TypeManager.IsValueType): Return true for type
7430         parameters.  The reason for this is that we need to box a type
7431         parameter when converting it to a reference type.
7432
7433         * cs-parser.jay: Added support for default value expressions.
7434
7435         * generics.cs (DefaultValueExpression): New public class.       
7436
7437 2003-10-17  Martin Baulig  <martin@ximian.com>
7438
7439         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
7440         TypeContainer so we can also use this for Interfaces.
7441         (TypeParameter.Resolve): Likewise.
7442
7443         * interface.cs (Interface.DefineType): Added support for generic
7444         interfaces.
7445
7446         * cs-parser.jay: Added support for generic structs and interfaces.
7447
7448 2003-10-17  Martin Baulig  <martin@ximian.com>
7449
7450         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
7451         call generic methods :-)
7452
7453 2003-10-16  Martin Baulig  <martin@ximian.com>
7454
7455         * cs-parser.jay (namespace_or_type_name): Only create a
7456         GenericMemberAccess if we actually have type arguments.
7457
7458 2003-10-13  Martin Baulig  <martin@ximian.com>
7459
7460         * class.cs (Method.Define): If we're a generic method, call
7461         TypeBuilder.DefineGenericMethod () before resolving
7462         the parameters.
7463         (MethodData): Added .ctor which takes an additional MethodBuilder
7464         argument; this is used for generic methods.
7465         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
7466         we already have a MethodBuilder.
7467
7468 2003-10-10  Martin Baulig  <martin@ximian.com>
7469
7470         * class.cs (Method): Added .ctor which takes a `GenericMethod'
7471         instead of a `DeclSpace'.  This is used for generic methods.
7472
7473         * cs-parser.jay (method_header): Added support for generic
7474         methods; create a `GenericMethod' instance and pass it to the
7475         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
7476         parameters and locals.
7477
7478         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
7479         since we already have the location.  Check whether we're a generic
7480         type declaration or a generic method and create the correct type
7481         parameter.
7482
7483         * generic.cs (TypeParameter.DefineMethod): New public method.
7484         (GenericMethod): New public class; derives from DeclSpace and is
7485         used for generic methods.       
7486
7487 2003-10-09  Martin Baulig  <martin@ximian.com>
7488
7489         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7490         to the .ctor.
7491         (MethodCore.DoDefineParameters): Removed the TypeContainer
7492         argument; use the DeclSpace which was passed to the .ctor instead.
7493         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7494         TypeContainer; we only need a DeclSpace here.
7495
7496 2003-10-09  Martin Baulig  <martin@ximian.com>
7497
7498         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7499         to the .ctor.
7500         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7501         EmitContext's .ctor.    
7502
7503 2003-10-09  Martin Baulig  <martin@ximian.com>
7504
7505         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7506         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7507         AsAccessible(), moved them as well.
7508
7509         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7510
7511 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7512
7513         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7514         generation for >=, as spotted by Paolo, bug 48679.  
7515         Patch from David Waite.
7516
7517         * cs-tokenizer.cs: Add handling for #pragma.
7518
7519         * cs-parser.jay: Allow for both yield and yield return in the
7520         syntax.  The anti-cobolization of C# fight will go on!
7521
7522         * class.cs (TypeBuilder.DefineType): Catch error condition here
7523         (Parent.DefineType erroring out and returning null).
7524
7525         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7526         coping with enumerations variables, we were mistakenly processing
7527         them as a regular value type instead of built-in types.  Fixes the
7528         bug #48063
7529
7530         * typemanager.cs (IsBuiltinOrEnum): New method.
7531
7532 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7533
7534         * cs-parser.jay: Upgrade: yield now needs the return clause.
7535
7536 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7537
7538         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7539
7540 2003-09-29  Martin Baulig  <martin@ximian.com>
7541
7542         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
7543         inflated generic methods.
7544
7545         * generics.cs (ConstructedType): Distinguish between open and
7546         closed constructed types; correctly resolve the arguments.
7547
7548 2003-09-22  Martin Baulig  <martin@ximian.com>
7549
7550         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
7551         all type arguments meet their constraints.
7552
7553 2003-09-19  Martin Baulig  <martin@ximian.com>
7554
7555         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7556         `MemberCache parent' argument.  Normally, an interface doesn't
7557         have a parent type except System.Object, but we use this in gmcs
7558         for generic type parameters.
7559
7560 2003-09-18  Martin Baulig  <martin@ximian.com>
7561
7562         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7563         on `type.IsInterface'; don't check whether the type has a parent
7564         to determine whether it's an interface.
7565
7566 2003-09-17  Martin Baulig  <martin@ximian.com>
7567
7568         * generic.cs (ConstructedType.ToString): Always use `name' as the
7569         type name.
7570
7571 2003-09-15  Martin Baulig  <martin@ximian.com>
7572
7573         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7574
7575         * generic.cs (Constraints.Resolve): New public method; this is
7576         called to resolve the constraint types and to check whether all
7577         the constraints are correct.
7578         (Constraints.Types): New public property.
7579         (TypeParameter.Resolve): New public method; resolves all the
7580         type's constraints.
7581
7582         * class.cs (TypeContainer.DefineType): Call
7583         TypeParameter.Resolve() before actually defining the type.
7584
7585 2003-09-15  Martin Baulig  <martin@ximian.com>
7586
7587         * class.cs (TypeContainer.DefineType): Added an error flag to
7588         avoid reporting duplicate CS0146's ("class definition is
7589         circular.").
7590
7591         * driver.cs (Driver.MainDriver): Abort if
7592         RootContext.ResolveTree() reported any errors.
7593
7594 2003-09-07  Martin Baulig  <martin@ximian.com>
7595
7596         * report.cs (Error, Warning): Added overloaded versions which take
7597         a `params object[] args' and call String.Format().
7598
7599 2003-09-07  Martin Baulig  <martin@ximian.com>
7600
7601         * decl.cs (DeclSpace..ctor): Don't call
7602         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7603         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7604         (DeclSpace.RecordDecl): New method.
7605
7606         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7607
7608 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7609
7610         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7611         value attributes to be applied to ParameterBuilders.
7612
7613         * class.cs (MethodCore.LabelParameters): Make static and more
7614         generic so that it can be used from other places - like interface
7615         methods, for instance.
7616
7617         * interface.cs (Interface.Emit): Call LabelParameters before
7618         emitting attributes on the InterfaceMethod.
7619
7620 2003-09-07  Martin Baulig  <martin@ximian.com>
7621
7622         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7623         if the number of type parameters doesn't match.
7624
7625 2003-09-04  Martin Baulig  <martin@ximian.com>
7626
7627         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7628         for arrays of generic type params (ie. `!0[]').
7629
7630 2003-09-04  Martin Baulig  <martin@ximian.com>
7631
7632         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7633         for the moment.
7634
7635 2003-09-04  Martin Baulig  <martin@ximian.com>
7636
7637         * decl.cs (DeclSpace.LookupGeneric): New method.
7638         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7639         moment.
7640
7641         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7642         argument, not just a string.
7643         (TypeParameter.Define): New public method; this is called to
7644         actually define the generic parameter; after this, you can use the
7645         new `Type' property to get the type.
7646
7647 2003-09-04  Martin Baulig  <martin@ximian.com>
7648
7649         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7650         is now an ArrayList; initialize the result of the `TypeParameters'
7651         property here.
7652         (DeclSpace.GetGenericData): Removed.
7653         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7654         implement this in a different way.
7655         (DeclSpace.GetTypeParameters): Removed; there's now a
7656         `TypeParameters' property.
7657         (DeclSpace.TypeParameters): New public property.
7658
7659         * generic.cs (Constraints): Make this class public.
7660         (TypeParameter): New public class.
7661
7662 2003-09-04  Martin Baulig  <martin@ximian.com>
7663
7664         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7665         generic parameters.
7666
7667         * class.cs (TypeContainer.DefineType): Call
7668         TypeBuilder.DefineGenericParameter () on all generic parameters if
7669         this is a generic type.
7670
7671 2003-08-28  Martin Baulig  <martin@ximian.com>
7672
7673         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7674         sample-stack.il".
7675
7676         * sample-hello.cs: Compile this with gmcs: "gmcs
7677         /r:sample-stack.dll sample-hello.cs".
7678
7679 2003-08-28  Martin Baulig  <martin@ximian.com>
7680
7681         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7682         the parameters to the generic type.
7683
7684 2003-08-28  Martin Baulig  <martin@ximian.com>
7685
7686         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7687
7688 2003-08-28  Martin Baulig  <martin@ximian.com>
7689
7690         * cs-parser.jay (opt_type_argument_list): Use
7691         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7692         (primary_expression): Replace `qualified_identifier' with `type_name'.
7693         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7694
7695         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7696         parser to check whether it is syntactically a type parameter list;
7697         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7698         this case.
7699
7700 2003-08-26  Martin Baulig  <martin@ximian.com>
7701
7702         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7703         resolving aliases; fixes #47927.
7704
7705 2003-08-26  Martin Baulig  <martin@ximian.com>
7706
7707         * statement.cs (Using.DoResolve): This is internally emitting a
7708         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7709         do not always return.  Fixes #47681.
7710
7711 2003-08-26  Martin Baulig  <martin@ximian.com>
7712
7713         * decl.cs (MemberCore): Moved WarningNotHiding(),
7714         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7715         into MemberBase.
7716         (AdditionResult): Make this nested in DeclSpace.
7717         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7718         argument; call NamespaceEntry.Define() unless we're nested in a
7719         class or struct.
7720
7721         * namespace.cs (Namespace.DefineName): New public function.  This
7722         is called from DeclSpace's .ctor to add 
7723         (Namespace.Lookup): Include DeclSpaces in the lookup.
7724
7725         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7726
7727         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7728
7729 2003-08-25  Martin Baulig  <martin@ximian.com>
7730
7731         * convert.cs (Convert.ExplicitReferenceConversion): When
7732         converting from an interface type to a class, unbox if the target
7733         type is a struct type.  Fixes #47822.
7734
7735 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7736
7737         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7738         #47854.
7739
7740 2003-08-22  Martin Baulig  <martin@ximian.com>
7741
7742         * class.cs (TypeManager.DefineType): When defining a nested type,
7743         call DefineType() on our parent; fixes #47801.
7744
7745 2003-08-22  Martin Baulig  <martin@ximian.com>
7746
7747         * class.cs (MethodData.Define): While checking if a method is an
7748         interface implementation, improve the test a bit more to fix #47654.
7749
7750 2003-08-22  Martin Baulig  <martin@ximian.com>
7751
7752         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7753         correctly; fixes #47722.
7754
7755 2003-08-22  Martin Baulig  <martin@ximian.com>
7756
7757         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7758         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7759
7760         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7761
7762 2003-08-22  Martin Baulig  <martin@ximian.com>
7763
7764         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7765         can only be assigned in static constructors.  Fixes #47161.
7766
7767 2003-08-22  Martin Baulig  <martin@ximian.com>
7768
7769         Rewrote and improved the flow analysis code.
7770
7771         * flowbranching.cs (FlowBranching): Make this class abstract.
7772         (FlowBranching.CreateBranching): New static function to create a
7773         new flow branching.
7774         (FlowBranchingBlock, FlowBranchingException): New classes.
7775         (FlowBranching.UsageVector.Type): New public readonly field.
7776         (FlowBranching.UsageVector.Breaks): Removed the setter.
7777         (FlowBranching.UsageVector.Returns): Removed the setter.
7778         (FlowBranching.UsageVector): Added Break(), Return(),
7779         NeverReachable() and Throw() methods to modify the reachability.
7780         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7781         done by FlowBranching.Merge().
7782         (FlowBranching.UsageVector.MergeChild): New method; merges the
7783         merge result into the current vector.
7784         (FlowBranching.Merge): New abstract method to merge a branching.
7785
7786 2003-08-12  Martin Baulig  <martin@ximian.com>
7787
7788         * expression.cs (Indirection.CacheTemporaries): Create the
7789         LocalTemporary with the pointer type, not its element type.
7790
7791 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7792
7793         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7794         token was a keyword or not.
7795
7796         Add `error' options where an IDENTIFIER was expected;  Provide
7797         CheckToken and CheckIdentifierToken convenience error reporting
7798         functions. 
7799
7800         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7801
7802         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7803         NameSpaceEntry NameSpaceEntry.
7804
7805         (LookupInterfaceOrClass): Avoid creating a full qualified name
7806         from namespace and name: avoid doing lookups when we know the
7807         namespace is non-existant.   Use new Tree.LookupByNamespace which
7808         looks up DeclSpaces based on their namespace, name pair.
7809
7810         * driver.cs: Provide a new `parser verbose' to display the
7811         exception thrown during parsing.  This is turned off by default
7812         now, so the output of a failure from mcs is more graceful.
7813
7814         * namespace.cs: Track all the namespaces defined in a hashtable
7815         for quick lookup.
7816
7817         (IsNamespace): New method
7818
7819 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7820
7821         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7822         we know that we need to concatenate (full typename can never be
7823         null). 
7824
7825         * class.cs: ditto.
7826
7827         * statement.cs: Use a bitfield;  Do not initialize to null things
7828         which are done by the constructor by default.
7829
7830         * cs-parser.jay: bug fix, parameter was 4, not 3.
7831
7832         * expression.cs: Just use the property;
7833
7834         * statement.cs: No need for GetVariableInfo method.
7835
7836 2003-08-08  Martin Baulig  <martin@ximian.com>
7837
7838         * flowanalysis.cs (FlowReturns): This is now nested in the
7839         `FlowBranching' class.
7840         (MyBitVector): Moved this here from statement.cs.
7841         (FlowBranching.SiblingType): New enum type.
7842         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7843
7844 2003-08-07  Martin Baulig  <martin@ximian.com>
7845
7846         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7847         `FlowBranching' class and called `BranchingType'.
7848
7849 2003-08-07  Martin Baulig  <martin@ximian.com>
7850
7851         * flowanalysis.cs: Moved all the control flow analysis code into
7852         its own file.
7853
7854 2003-08-07  Martin Baulig  <martin@ximian.com>
7855
7856         * assign.cs (Assign.DoResolve): `target' must either be an
7857         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7858         #37319.
7859
7860 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7861
7862         * expression.cs (BinaryMethod): This kind of expression is created by the
7863         Binary class if it determines that the operator has to be handled
7864         by a method.
7865
7866         (BinaryDelegate): This kind of expression is created if we are
7867         dealing with a + or - operator on delegates.
7868
7869         (Binary): remove method, argumetns, and DelegateOperator: when
7870         dealing with methods, 
7871
7872         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7873
7874         * statement.cs (Block): use bitfields for the three extra booleans
7875         we had in use.   Remove unused topblock parameter.
7876
7877         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7878
7879         * assign.cs: Drop extra unneeded tests.
7880
7881 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7882
7883         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7884
7885         * statement.cs (Foreach): Use VariableStorage instead of
7886         LocalBuilders.   
7887
7888         * codegen.cs (VariableStorage): New class used by clients that
7889         require a variable stored: locals or fields for variables that
7890         need to live across yield.
7891
7892         Maybe provide a convenience api for EmitThis+EmitLoad?
7893
7894         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7895         these bad boys.
7896
7897 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7898
7899         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7900         RemapParameterLValue): New methods that are used to turn a
7901         precomputed FieldInfo into an expression like this:
7902
7903                 instance.FieldInfo
7904
7905         The idea is to use this instead of making LocalVariableReference
7906         have more than one meaning.
7907
7908         * cs-parser.jay: Add error production to BASE.
7909
7910         * ecore.cs: Deal with TypeManager.GetField returning null, which
7911         is now a valid return value.
7912
7913         (FieldExprNoAddress): New expression for Fields whose address can
7914         not be taken.
7915
7916         * expression.cs (LocalVariableReference): During the resolve
7917         phases, create new expressions if we are in a remapping context.
7918         Remove code that dealt with remapping here.
7919
7920         (ParameterReference): same.
7921
7922         (ProxyInstance): New expression, like the `This' expression, but
7923         it is born fully resolved.  We know what we are doing, so remove
7924         the errors that are targeted to user-provided uses of `this'.
7925
7926         * statement.cs (Foreach): our variable is now stored as an
7927         Expression;  During resolution, follow the protocol, dont just
7928         assume it will return this.
7929
7930 2003-08-06  Martin Baulig  <martin@ximian.com>
7931
7932         * support.cs (SeekableStreamReader.cs): New public class.
7933
7934         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7935         SeekableStreamReader instead of the normal StreamReader.
7936
7937 2003-08-04  Martin Baulig  <martin@ximian.com>
7938
7939         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7940         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7941         deambiguate casts and delegate invocations.
7942         (parenthesized_expression): Use the new tokens to ensure this is
7943         not a cast of method invocation.
7944
7945         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7946         when reading a `)' and Deambiguate_CloseParens () was previously
7947         called.
7948
7949         * expression.cs (ParenthesizedExpression): New class.  This is
7950         just used for the CS0075 test.
7951         (Binary.DoResolve): Check for CS0075.   
7952
7953 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7954
7955         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7956         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7957         reference comparison.
7958
7959         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7960         examine the ReturnType for equality - this is necessary in the
7961         cases of implicit and explicit operators whose signature also
7962         includes the return type.
7963
7964 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7965
7966         * namespace.cs: Cache the result of the namespace computation,
7967         instead of computing it every time.
7968
7969 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7970
7971         * decl.cs: Use a global arraylist that we reuse over invocations
7972         to avoid excesive memory consumption.  Reduces memory usage on an
7973         mcs compile by one meg (45 average).
7974
7975         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7976         private, work around that.
7977
7978 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7979
7980         * literal.cs (IntLiteral): Define Zero and One static literals. 
7981
7982         * cs-parser.jay (integer_literal): use static literals to reduce
7983         memory usage for the most used literals (0, 1 and -1).  211kb
7984         reduced in memory usage.
7985
7986         Replace all calls to `new ArrayList' with `new
7987         ArrayList(4)' which is a good average number for most allocations,
7988         and also requires only 16 bytes of memory for its buffer by
7989         default. 
7990
7991         This reduced MCS memory usage in seven megabytes for the RSS after
7992         bootstrapping.
7993
7994 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7995
7996         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7997         handle params methods the correct way by forming only one
7998         applicable set with params and normal methods in them. Earlier we
7999         were looking at params methods only if we found no normal methods
8000         which was not the correct thing to do.
8001
8002         (Invocation.BetterFunction): Take separate arguments indicating
8003         when candidate and the best method are params methods in their
8004         expanded form.
8005
8006         This fixes bugs #43367 and #46199.
8007
8008         * attribute.cs: Documentation updates.
8009
8010         (CheckAttribute): Rename to CheckAttributeTarget.
8011         (GetValidPlaces): Rename to GetValidTargets.
8012
8013         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8014         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8015
8016         Fixes bug #44468.
8017
8018 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
8019
8020         * codegen.cs: Compute IsGeneric correctly.
8021
8022         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
8023         resolution. 
8024
8025         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
8026         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
8027         regressions, and I was chasing more bugs than I required.
8028
8029         * interface.cs: Use expressions for base type names (like classes
8030         and structs have been doing for a while now), and resolve that.
8031         This patch should probably go into head as well.
8032
8033         This makes it one less user of FindType.
8034
8035 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8036
8037         This compiler can not self host currently.  Need to fix that.
8038         
8039         * Makefile: compile to `gmcs.exe'
8040
8041         * driver.cs: Turn on v2 by default on gmcs.
8042
8043         * generic.cs (ConstructedType): Does no longer take a container
8044         type argument;  That will be taken care of later.
8045
8046         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
8047         Use SimpleName to resolve for now, so we can continue the work on
8048         the parser, until we get Type.GetType that understands generics.
8049
8050         (ConstructedType.ToString): Implement
8051
8052         (TypeArguments.Resolve): Resolve the child expressions as types. 
8053         
8054         * cs-parser.jay: Rename interface_constraints to
8055         type_parameter_constraints
8056
8057         (namespace_or_type_name): Only use constructed types for the basic
8058         construction, we will deal with identifier<...> later.
8059
8060         (type/type_name): No longer call DecomposeQI, as
8061         namespace_or_type_name is always decoded now.
8062         
8063 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8064
8065         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8066         closely: we eliminate methods in base types when we have an
8067         applicable method in a top-level type.
8068
8069         Please see section 14.5.5.1 for an exact description of what goes
8070         on. 
8071
8072         This fixes bug #45127 and a host of other related to corlib compilation.
8073
8074         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8075         array is the method corresponding to the top-level type (this is
8076         because of the changes made to icall.c) so we change this
8077         accordingly.
8078
8079         (MethodGroupExpr.Name): This too.
8080
8081         * typemanager.cs (GetElementType): New method which does the right
8082         thing when compiling corlib. 
8083
8084         * everywhere: Make use of the above in the relevant places.
8085
8086 2003-07-22  Martin Baulig  <martin@ximian.com>
8087
8088         * cs-parser.jay (invocation_expression): Moved
8089         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8090         `cast_expression', but create a InvocationOrCast which later
8091         resolves to either an Invocation or a Cast.
8092
8093         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8094         method; call this before EmitStatement() to make sure that this
8095         expression can be used as a statement.
8096
8097         * expression.cs (InvocationOrCast): New class; resolves to either
8098         an Invocation or a Cast.
8099
8100         * statement.cs (StatementExpression): Call ResolveStatement() on
8101         the ExpressionStatement before emitting it.
8102
8103 2003-07-21  Martin Baulig  <martin@ximian.com>
8104
8105         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8106         `ref' and `out' attributes match; fixes #46220.
8107         (MemberAccess.ResolveMemberAccess): You can't reference a type
8108         through an expression; fixes #33180.
8109         (Indexers.GetIndexersForType): Don't return the indexers from
8110         interfaces the class implements; fixes #46502.
8111
8112 2003-07-21  Martin Baulig  <martin@ximian.com>
8113
8114         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8115         CS0661 checks; fixes bug #30442.
8116
8117 2003-07-21  Martin Baulig  <martin@ximian.com>
8118
8119         * decl.cs (AdditionResult): Added `Error'.
8120
8121         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8122
8123         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
8124         cs0031.cs actually work.
8125
8126  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8127  
8128         * cs-parser.jay (namespace_name): do not use
8129         namespace_or_type_name, use qualified_identifier, because
8130         namespace_or_type_name will soon return a composed expression
8131         instead of a string.
8132  
8133         (namespace_or_type_name): Instead of returning a string, now this
8134         production returns an expression.
8135  
8136         * codegen.cs (EmitContext): Setup IsGeneric property based on
8137         whether our DeclSpace is generic, our the method is generic.
8138  
8139         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
8140         the method is generic.
8141  
8142         * cs-parser.jay (type_arguments, opt_type_argument_list,
8143         type_parameters, type_parameter_list, opt_type_parameter_list,
8144         type_parameter,, opt_type_parameter_constraints_clauses,
8145         type_parameter_constraints_clauses,
8146         type_parameter_constraint_clause, type_parameter_constraint,
8147         interface_constraints): Add new production
8148  
8149         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
8150         DeclSpace is generic or not.
8151  
8152         (DeclSpace.SetParameterInfo): New routine, used to set the
8153         parameter info for a type.
8154  
8155         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
8156         returns a GenericTypeExpr
8157  
8158         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
8159         generic, lookup the generic argument.
8160  
8161         * attribute.cs: Do not allow TypeParameterExpressions in
8162         Attributes.
8163  
8164         * class.cs: Do not allow the Main method to be defined in a
8165         Generic container.
8166  
8167         * expression.cs (SizeOf): Do not allow generic types to be used as
8168         arguments to sizeof.
8169  
8170         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
8171         it: whether a type is generic or not.  Only works for types we are
8172         currently building for now.
8173         
8174 2003-07-20  Martin Baulig  <martin@ximian.com>
8175
8176         * namespace.cs: Fixed that bug which caused a crash when compiling
8177         the debugger's GUI.
8178
8179 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8180
8181         * typemanager.cs (LookupTypeReflection): Never expose types which
8182         are NotPublic, NestedPrivate, NestedAssembly, or
8183         NestedFamANDAssem.  We used to return these, and later do a check
8184         that would report a meaningful error, but the problem is that we
8185         would not get the real match, if there was a name override.
8186
8187 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8188
8189         * namespace.cs (Namespace, Name): Do not compute the namespace
8190         name dynamically, compute it in the constructor.  This reduced
8191         memory usage by 1697 KB.
8192
8193         * driver.cs: Use --pause to pause at the end.
8194
8195 2003-07-17  Peter Williams  <peter@newton.cx>
8196
8197         * Makefile: Change the name of the test target so that it doesn't
8198         conflict with the recursive test target.
8199
8200 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8201
8202         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8203         AddressOf): Do not use EmitThis, that was wrong, use the actual
8204         this pointer.
8205
8206 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8207
8208         * class.cs (MethodData.Define): While checking if a method is an
8209         interface implementation, improve the test: If we are not public
8210         (use new test here: use the computed MethodAttributes directly,
8211         instead of the parsed modifier flags) check if the `implementing'
8212         method comes from an interface or not.
8213
8214         * pending.cs (VerifyPendingMethods): Slightly better error
8215         message.
8216
8217         * makefile: add test target that does the mcs bootstrap.
8218
8219 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8220
8221         * interface.cs (Define): Do nothing here since there are no
8222         members to populate etc. Move the attribute emission out of here
8223         since this was just totally the wrong place to put it. Attribute
8224         application happens during the 'Emit' phase, not in the 'Define'
8225         phase.
8226
8227         (Emit): Add this method and move the attribute emission here
8228
8229         * rootcontext.cs (EmitCode): Call the Emit method on interface
8230         types too.
8231
8232 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8233
8234         * expression.cs (OverloadResolve): Report error only if Location
8235         is not 'Null' which means that there was a probe going on.
8236
8237 2003-07-14  Martin Baulig  <martin@ximian.com>
8238
8239         * expression.cs (ConditionalLogicalOperator): New public class to
8240         implement user defined conditional logical operators.
8241         This is section 14.11.2 in the spec and bug #40505.
8242
8243 2003-07-14  Martin Baulig  <martin@ximian.com>
8244
8245         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8246
8247 2003-07-14  Martin Baulig  <martin@ximian.com>
8248
8249         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8250
8251         * ecore.cs (IVariable.VerifyFixed): New interface method.
8252
8253         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8254         operator, check whether the variable is actually fixed.  Fixes bug
8255         #36055.  Set a variable definitely assigned when taking its
8256         address as required by the spec.
8257
8258         * statement.cs (LocalInfo.IsFixed): New field.
8259         (LocalInfo.MakePinned): Set `IsFixed' to true.
8260
8261 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8262
8263         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8264         for .ctors, ensure that we only ask for members declared in the
8265         attribute type (BindingFlags.DeclaredOnly).
8266
8267         Fixes bug #43632.
8268
8269         * expression.cs (Error_WrongNumArguments): Report error 1501
8270         correctly the way CSC does.
8271
8272 2003-07-13  Martin Baulig  <martin@ximian.com>
8273
8274         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8275         lookup on the fully qualified name, to make things like "X.X" work
8276         where "X.X" is a fully qualified type name, but we also have a
8277         namespace "X" in the using list.  Fixes #41975.
8278
8279 2003-07-13  Martin Baulig  <martin@ximian.com>
8280
8281         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8282         function. If we're a CompoundAssign, we need to create an embedded
8283         CompoundAssign, not an embedded Assign.
8284         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8285         Fixes #45854.
8286
8287 2003-07-13  Martin Baulig  <martin@ximian.com>
8288
8289         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8290         work to fix bug #46088.
8291
8292 2003-07-13  Ravi Pratap <ravi@ximian.com>
8293
8294         * class.cs (Operator.Emit): Do not emit attributes here - it is
8295         taken care of by the Method class that we delegate too. This takes
8296         care of bug #45876.
8297
8298 2003-07-10  Martin Baulig  <martin@ximian.com>
8299
8300         * expression.cs (TypeOfVoid): New class.
8301         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8302
8303 2003-07-10  Martin Baulig  <martin@ximian.com>
8304
8305         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8306         bug #35957.
8307
8308 2003-07-10  Martin Baulig  <martin@ximian.com>
8309
8310         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8311         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8312
8313         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8314
8315         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8316
8317 2003-07-10  Martin Baulig  <martin@ximian.com>
8318
8319         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8320         of decimal.  Fixes #42850.
8321
8322         NOTE: I also fixed the created byte blob, but this doesn't work on
8323         the MS runtime and csc never produces any byte blobs for decimal
8324         arrays.
8325
8326 2003-07-10  Martin Baulig  <martin@ximian.com>
8327
8328         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8329         structs; fixes #32068.
8330         (Block.AddChildVariableNames): Fixed #44302.
8331
8332 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8333
8334         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8335
8336 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8337
8338         * attribute.cs: And this test is onger needed.
8339
8340 2003-07-08  Martin Baulig  <martin@ximian.com>
8341
8342         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8343         inaccessible types.  Fixes #36313.
8344
8345         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8346
8347         * namespace.cs (NamespaceEntry): Create implicit entries for all
8348         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8349         implicit entries for N1.N2 and N1.
8350
8351 2003-07-08  Martin Baulig  <martin@ximian.com>
8352
8353         Rewrote the handling of namespaces to fix a lot of the issues
8354         wrt. `using' aliases etc.
8355
8356         * namespace.cs (Namespace): Splitted this class into a
8357         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8358
8359         * typemanager.cs (TypeManager.IsNamespace): Removed.
8360         (TypeManager.ComputeNamespaces): Only compute namespaces from
8361         loaded assemblies here, not the namespaces from the assembly we're
8362         currently compiling.
8363
8364 2003-07-08  Martin Baulig  <martin@ximian.com>
8365
8366         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8367
8368 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8369
8370         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8371         already fixed it.  
8372
8373         I thought about the memory savings here, but LookupTypeReflection
8374         is used under already very constrained scenarios.  Compiling
8375         corlib or mcs only exposes one hit, so it would not really reduce
8376         any memory consumption.
8377
8378 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8379
8380         * typemanager.cs: fixes bug #45889 by only adding public types from
8381         other assemblies to the list of known types.
8382
8383 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8384
8385         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8386         on the type we resolved.
8387
8388 2003-07-05  Martin Baulig  <martin@ximian.com>
8389
8390         * pending.cs (PendingImplementation.ParentImplements): Don't
8391         create the proxy if the parent is abstract.
8392
8393         * class.cs (TypeContainer.DefineIndexers): Process explicit
8394         interface implementations first.  Fixes #37714.
8395
8396 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8397
8398         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8399         defined recursively;  but since we modify the input parameters
8400         (left is set to `this' temporarily), we reset this value if the
8401         left_is_explicit is false, which gives the original semantics to
8402         the code.  
8403
8404         * literal.cs (NullPointer): new class used to represent a null
8405         literal in a pointer context.
8406
8407         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8408         type is a pointer, use a NullPointer object instead of a
8409         NullLiteral.   Closes 43687
8410
8411         (ExplicitConversion): Convert pointer values using
8412         the conv opcode to the proper type.
8413
8414         * ecore.cs (New): change ValueTypeVariable property into a method,
8415         that returns whether the valuetype is suitable for being used.
8416
8417         * expression.cs (Binary.DoNumericPromotions): Only return if we
8418         the int constant was a valid uint, and we can return both left and
8419         right as uints.  If not, we continue processing, to trigger the
8420         type conversion.  This fixes 39018.
8421
8422         * statement.cs (Block.EmitMeta): During constant resolution, set
8423         the CurrentBlock property on the emitcontext, so that we resolve
8424         constants propertly.
8425
8426 2003-07-02  Martin Baulig  <martin@ximian.com>
8427
8428         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8429         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8430
8431         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8432         than emitting it here.
8433
8434         * statement.cs: Fixed some more flow analysis bugs.
8435
8436 2003-07-02  Martin Baulig  <martin@ximian.com>
8437
8438         * class.cs (MethodData.Define): When implementing interface
8439         methods, set Final unless we're Virtual.
8440
8441         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8442         check work for interface methods.
8443
8444 2003-07-01  Martin Baulig  <martin@ximian.com>
8445
8446         * ecore.cs (EmitContext.This): Replaced this property with a
8447         GetThis() method which takes a Location argument.  This ensures
8448         that we get the correct error location for a CS0188.
8449
8450 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8451
8452         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8453         ImplicitStandardConversion.
8454
8455         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8456
8457 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8458
8459         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8460         optimization.
8461
8462 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8463
8464         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8465         constructors.
8466
8467         (MethodData.Define): Turn off initlocals for unsafe methods.
8468
8469 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8470
8471         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8472         complete;  Fixes #37521.
8473
8474         * delegate.cs: Use Modifiers.TypeAttr to compute the
8475         TypeAttributes, instead of rolling our own.  This makes the flags
8476         correct for the delegates.
8477
8478 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8479
8480         * class.cs (Constructor.Define): Set the private flag for static
8481         constructors as well.
8482
8483         * cs-parser.jay (statement_expression): Set the return value to
8484         null, to avoid a crash when we catch an error.
8485
8486 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8487
8488         * cs-parser.jay: Applied patch from Jackson that adds support for
8489         extern and unsafe modifiers to destructor declarations.
8490
8491         * expression.cs: Report error 21 if the user is trying to index a
8492         System.Array.
8493
8494         * driver.cs: Add an error message, suggested by the bug report.
8495
8496         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8497         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8498
8499 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8500
8501         * namespace.cs: Add some information to reduce FAQs.
8502
8503 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8504
8505         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8506         underlying enumeration types.  Fixes #43915.
8507
8508         * expression.cs: Treat ushort/short as legal values to be used in
8509         bitwise operations.
8510
8511 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8512
8513         * delegate.cs: transfer custom attributes for paramenters from
8514         the delegate declaration to Invoke and BeginInvoke.
8515
8516 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8517
8518         * attribute.cs: handle custom marshalers and emit marshal info
8519         for fields, too.
8520
8521 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8522
8523         * makefile.gnu: Added anonymous.cs to the compiler sources.
8524
8525 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8526
8527         * iterators.cs: Change the name of the proxy class to include two
8528         underscores.
8529
8530         * cs-parser.jay: Update grammar to include anonymous methods.
8531
8532         * anonymous.cs: new file.
8533
8534 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8535
8536         * class.cs (Field.Define): Add missing test for pointers and
8537         safety. 
8538
8539 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8540
8541         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8542         we use the stobj opcode.
8543
8544         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8545         since it wasn't the correct fix. 
8546
8547         It still is puzzling that we are required to use stobj for IntPtr
8548         which seems to be a ValueType.
8549
8550 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8551
8552         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8553         during regular simple name resolution.   Now, the trick is that
8554         instead of returning for processing the simplename, we do a
8555         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8556         contextual lookup type).   If a match is found, return that, if
8557         not, return for further composition.
8558
8559         This fixes long-standing 30485.
8560
8561         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8562         using the address to initialize an object, do an Stobj instead of
8563         using the regular Stelem.
8564
8565         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8566         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8567         Because if we are a BaseIndexerAccess that value will be true.
8568         Fixes 43643.
8569
8570         * statement.cs (GotoCase.Resolve): Return after reporting an
8571         error, do not attempt to continue. 
8572
8573         * expression.cs (PointerArithmetic.Emit): If our operand is a
8574         long, convert our constants to match the operand before
8575         multiplying.  Convert to I type before adding.   Fixes 43670.
8576
8577 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8578
8579         * enum.cs (ImplicitConversionExists) : Rename to
8580         ImplicitEnumConversionExists to remove ambiguity. 
8581
8582         * ecore.cs (NullCast): New type of cast expression class which
8583         basically is very similar to EmptyCast with the difference being
8584         it still is a constant since it is used only to cast a null to
8585         something else
8586         (eg. (string) null)
8587
8588         * convert.cs (ImplicitReferenceConversion): When casting a null
8589         literal, we return a NullCast.
8590
8591         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8592         should be around anymore.
8593
8594         The renaming (reported was slightly wrong). Corrections:
8595
8596         ConvertImplicitStandard -> ImplicitConversionStandard
8597         ConvertExplicitStandard -> ExplicitConversionStandard
8598
8599         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8600         before passing them in !
8601
8602         * convert.cs (ImplicitConversionStandard): When comparing for
8603         equal expr and target types, ensure that expr is not a
8604         NullLiteral.
8605
8606         In general, we must not be checking (expr_type ==
8607         target_type) in the top level conversion methods
8608         (ImplicitConversion, ExplicitConversion etc). This checking is
8609         done in the methods that they delegate to.
8610
8611 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8612
8613         * convert.cs: Move Error_CannotConvertType,
8614         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8615         ImplicitNumericConversion, ImplicitConversionExists,
8616         ImplicitUserConversionExists, StandardConversionExists,
8617         FindMostEncompassedType, FindMostSpecificSource,
8618         FindMostSpecificTarget, ImplicitUserConversion,
8619         ExplicitUserConversion, GetConversionOperators,
8620         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8621         TryImplicitIntConversion, Error_CannotConvertImplicit,
8622         ConvertImplicitRequired, ConvertNumericExplicit,
8623         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8624         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8625         its own file.
8626
8627         Perform the following renames:
8628
8629         StandardConversionExists -> ImplicitStandardConversionExists
8630         ConvertImplicit -> ImplicitConversion
8631         ConvertImplicitStandard -> ImplicitStandardConversion
8632         TryImplicitIntConversion -> ImplicitIntConversion
8633         ConvertImplicitRequired -> ImplicitConversionRequired
8634         ConvertNumericExplicit -> ExplicitNumericConversion
8635         ConvertReferenceExplicit -> ExplicitReferenceConversion
8636         ConvertExplicit -> ExplicitConversion
8637         ConvertExplicitStandard -> ExplicitStandardConversion
8638
8639 2003-05-19  Martin Baulig  <martin@ximian.com>
8640
8641         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8642         (TypeInfo): Added support for structs having structs as fields.
8643
8644         * ecore.cs (FieldExpr): Implement IVariable.
8645         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8646         VariableInfo for the field.
8647
8648 2003-05-18  Martin Baulig  <martin@ximian.com>
8649
8650         * expression.cs (This.DoResolve): Report a CS0027 if we're
8651         emitting a field initializer.
8652
8653 2003-05-18  Martin Baulig  <martin@ximian.com>
8654
8655         * expression.cs (This.ResolveBase): New public function.
8656         (This.DoResolve): Check for CS0188.
8657
8658         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8659         This.Resolve().
8660
8661         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8662         `instance_expression' to null if we don't have any non-static
8663         methods.
8664
8665 2003-05-18  Martin Baulig  <martin@ximian.com>
8666
8667         Reworked the way how local variables and parameters are handled by
8668         the flow analysis code.
8669
8670         * statement.cs (TypeInfo, VariableMap): New public classes.
8671         (VariableInfo): New public class.  This is now responsible for
8672         checking whether a variable has been assigned.  It is used for
8673         parameters and local variables.
8674         (Block.EmitMeta): Take the InternalParameters as argument; compute
8675         the layout of the flow vectors here.
8676         (Block.LocalMap, Block.ParameterMap): New public properties.
8677         (FlowBranching): The .ctor doesn't get the InternalParameters
8678         anymore since Block.EmitMeta() now computes the layout of the flow
8679         vector.
8680         (MyStructInfo): This class is now known as `StructInfo' and nested
8681         in `TypeInfo'; we don't access this directly anymore.
8682
8683         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8684         property and removed IsAssigned(), IsFieldAssigned(),
8685         SetAssigned() and SetFieldAssigned(); we now call them on the
8686         VariableInfo so we don't need to duplicate this code everywhere.
8687
8688         * expression.cs (ParameterReference): Added `Block block' argument
8689         to the .ctor.
8690         (LocalVariableReference, ParameterReference, This): The new
8691         VariableInfo class is now responsible for all the definite
8692         assignment stuff.
8693
8694         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8695         IsParameterAssigned, SetParameterAssigned): Removed.
8696
8697 2003-05-18  Martin Baulig  <martin@ximian.com>
8698
8699         * typemanager.cs (InitCoreTypes): Try calling
8700         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8701         the 3-args-version.  Corlib now also needs our `void_type'.
8702         (GetMethod): Added overloaded version which takes an optional
8703         `bool report_errors' to allow lookups of optional methods.
8704
8705 2003-05-12  Martin Baulig  <martin@ximian.com>
8706
8707         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8708         only used for locals and not for parameters.
8709
8710 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8711
8712         * support.cs (InternalParameters.ParameterType): Return the
8713         ExternalType of the parameter.
8714
8715         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8716         they were unused.
8717
8718 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8719
8720         * class.cs (MethodData.Define): Do not set the `newslot' on
8721         interface members, if they are also flagged as "override".
8722
8723         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8724         better code for ++i and i++.  This only works for static fields
8725         and local variables.
8726
8727         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8728         want to pull the DeclSpace out of the builder_to_declspace instead
8729         of the TypeBuilder (like in TypeContainer.FindMembers).
8730
8731         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8732         instead of LookupTypeContainer.  Fixes the crash on .NET for
8733         looking up interface members.
8734
8735         * const.cs: Create our own emit context during the Definition
8736         stage, so that constants are evaluated in the proper context, when
8737         a recursive definition happens.
8738
8739 2003-05-11  Martin Baulig  <martin@ximian.com>
8740
8741         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8742         new block for a switch section.
8743         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8744         the adding/lookup in the switch block.  Fixes #39828.
8745
8746 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8747
8748         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8749         functionality: I needed to convert the data after I had performed
8750         the add/sub operation into the operands type size.
8751
8752         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8753         pass the type for the box operation, otherwise the resulting
8754         object would have been of type object.
8755
8756         (BoxedCast): Add constructor to specify the type to box as.
8757
8758 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8759
8760         * iterators.cs: I was reusing the `count' variable inadvertently,
8761         take steps to not allow this to happen.
8762
8763 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8764
8765         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8766         by creating an array at the point where the params starts and
8767         putting all those arguments there, then adjusting the size of the
8768         array.
8769
8770 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8771
8772         * expression.cs (New.AddressOf): Implement interface
8773         IMemoryLocation.  This is used when the `new' operator is used in
8774         the context of an invocation to a method on a value type.
8775
8776         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8777         example. 
8778
8779         * namespace.cs: Also check the using aliases here.
8780
8781         * driver.cs: Move the test for using validity after the types have
8782         been entered, so we do a single pass that also includes the using
8783         aliases. 
8784
8785         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8786         in the regular case.   CreateSiblingForFinally is doing extra
8787         error checking.
8788
8789         * attribute.cs (GetAttributeArgumentExpression): Store the result
8790         on an out value, and use the return value to indicate failure
8791         instead of using null (which is a valid return for Constant.GetValue).
8792
8793         * statement.cs: Perform the analysis flow for the increment
8794         portion after the statement, because this will be the real flow of
8795         execution.  Fixes #42385
8796
8797         * codegen.cs (EmitContext.EmitArgument,
8798         EmitContext.EmitStoreArgument): New helper functions when the
8799         RemapToProxy flag is set.
8800
8801         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8802         function.
8803
8804         Add support for remapping parameters. 
8805
8806         * iterators.cs: Propagate parameter values;  Store parameter
8807         values in the proxy classes.
8808
8809 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8810
8811         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8812         need a proxy reference;  I do not know what I was thinking
8813
8814         * cs-parser.jay (constructor_initializer): catch another error,
8815         and display nice message.
8816
8817         (field_declaration): catch void field declaration
8818         to flag a better error. 
8819
8820         * class.cs (MemberBase.CheckBase): Report an error instead of a
8821         warning if a new protected member is declared in a struct. 
8822         (Field.Define): catch the error of readonly/volatile.
8823
8824         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8825
8826         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8827         volatile variable is taken
8828
8829 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8830
8831         * statement.cs (Fixed.Resolve): Report an error if we are not in
8832         an unsafe context.
8833
8834 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8835
8836         * typemanager.cs: reuse the code that handles type clashes for
8837         delegates and enumerations.
8838
8839         * class.cs (Report28): Always report.
8840
8841         * expression.cs (EncodeAsAttribute): Allow nulls here.
8842
8843 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8844
8845         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8846         the functionality for testing whether an expression is valid for
8847         an attribute here.  Also handle the case of arrays of elements
8848         being stored. 
8849
8850         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8851         encoding a linear array into an array of objects that are suitable
8852         to be passed to an CustomAttributeBuilder.
8853
8854         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8855
8856         * ecore.cs: (FieldExpr): Handle field remapping here.
8857
8858         * iteratators.cs: Pass the instance variable (if the method is an
8859         instance method) to the constructors, so we can access the field
8860         variables on the class.
8861
8862         TODO: Test this with structs.  I think the THIS variable on
8863         structs might have to be a pointer, and not a refenrece
8864
8865 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8866
8867         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8868         local variables to fields in a proxy class.
8869
8870         * iterators.cs (PopulateProxy): Rename our internal fields to
8871         <XXX>.  
8872         Create a <THIS> field if we are an instance method, so we can
8873         reference our parent container variables.
8874         (MapVariable): Called back from the EmitContext code to enter a
8875         new variable to field mapping into the proxy class (we just create
8876         a FieldBuilder).
8877
8878         * expression.cs
8879         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8880         for using the remapped locals to fields.
8881
8882         I placed the code here, because that gives the same semantics to
8883         local variables, and only changes the Emit code.
8884
8885         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8886         statements inside iterators.
8887         (VariableInfo): Add a FieldBuilder for the cases when we are
8888         remapping local variables to fields in a proxy class
8889
8890         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8891         current_block != null.
8892
8893         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8894         not cope with strings, as it has been moved to the
8895         TableSwitchEmit.  Fixed bug in switch generation.
8896
8897         * expression.cs (New.DoResolve): Provide more context for the user
8898         when reporting an error.
8899
8900         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8901         pointers. 
8902
8903         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8904         check the permissions for it.  Note than in a type-resolution
8905         context the check was already present in DeclSpace.ResolveType,
8906         but was missing from the MemberAccess.
8907
8908         (ArrayCreation.CheckIndices): warn if the user has
8909         more nested levels of expressions, but there are no more
8910         dimensions specified.  Avoids crash on bug 41906.
8911
8912 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8913
8914         * statement.cs (Block): replace Implicit bool, for a generic
8915         flags.   
8916         New flag: `Unchecked'.  This is used during the EmitMeta phase
8917         (which is out-of-line with the regular Resolve/Emit process for a
8918         statement, as this is done ahead of time, but still gets a chance
8919         to call constant resolve).
8920
8921         (Block.Flags): new enum for adding a new flag.
8922
8923         (Block.EmitMeta): track the state of unchecked.
8924
8925         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8926         to enable constant resolution to work there as well.
8927
8928 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8929
8930         * typemanager.cs (ienumerable_type): Also look up
8931         System.Collections.IEnumerable. 
8932
8933 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8934
8935         TODO: Test more than one conditional per method.
8936
8937         * class.cs (Indexer.Define): Report the location where the user is
8938         referencing the unsupported feature.
8939
8940         (MethodData): Overload the use of `conditionals' to
8941         minimize the creation of needless ArrayLists.   This saves roughly
8942         212kb on my machine.
8943
8944         (Method): Implement the new IIteratorContainer interface.
8945         (Method.SetYields): Implement the method by setting the ModFlags
8946         to contain METHOD_YIELDS.
8947
8948         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8949         which just got set to null.
8950
8951         * iterators.cs: New file.
8952
8953         (Yield, YieldBreak): New statements.
8954
8955         * statement.cs (Return.Resolve): Flag an error if we are used in
8956         an iterator method.
8957
8958         * codegen.cs (InIterator): New flag set if the code is being
8959         compiled in an iterator method.
8960
8961         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8962         internal modifier, and we just use it to avoid adding extra
8963         fields, as this is seldom used.  
8964
8965         * cs-parser.jay: Add yield_statement (yield and yield break).
8966
8967         * driver.cs: New flag -v2 to turn on version 2 features. 
8968
8969         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8970         hashtable when v2 is enabled.
8971
8972 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8973
8974         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8975         there is already a namespace defined with this name.
8976
8977         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8978         people upgraded their corlibs.
8979
8980         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8981         always use fully qualified types, no need to use the compiler
8982         front end.
8983
8984         (TypeManager.IsNamespace): Use binarysearch.
8985
8986         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8987         AddDelegate): I did not quite use the new IsValid API properly: I
8988         have to pass the short-name and the fullname.  I was passing only
8989         the basename instead of the fullname sometimes. 
8990
8991         (TypeContainer.DefineType): call NamespaceClash.
8992
8993         * interface.cs (Interface.DefineType): use NamespaceClash before
8994         defining the type.
8995
8996         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8997         defining the type.
8998
8999         * enum.cs: (Enum.DefineType): use NamespaceClash before
9000         defining the type.
9001
9002         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9003         speed increase.  First, use the negative_hits cache when we get a
9004         negative.  Second, add the type with its full original name
9005         instead of the new . and + encoded name (reflection uses + to
9006         separate type from a nested type).  Use LookupTypeReflection
9007         directly which bypasses the type->name hashtable (that we already
9008         know does not contain the type.
9009
9010         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9011         location/container type. 
9012
9013         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9014
9015 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9016
9017         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9018
9019         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9020         method is being referenced in the method group from a static
9021         context, and report error 120 if so.
9022
9023         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9024         Error118. 
9025
9026         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9027         is created, we create the A namespace).
9028
9029         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9030         Fixes #41591
9031
9032 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9033
9034         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9035         invocation to ModuleBuilder.GetType with the same values will
9036         return a new type instance, so we need to cache its return
9037         values. 
9038
9039         * expression.cs (Binary.ResolveOperator): Only allow the compare
9040         operators on enums if they are of the same type.
9041
9042         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9043         types of ValueType on their own case.  Before we were giving them
9044         the same treatment as objects.
9045
9046         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9047         fullname.  Short name is used to compare against container name.
9048         Fullname is used to check against defined namespace names.
9049
9050         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9051         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9052
9053         (Method.CheckBase): Call parent.
9054         (MemberBase.CheckBase): Check for protected members on sealed
9055         classes.
9056         (PropertyBase.CheckBase): Call parent.
9057         (Field.Define): Call parent.
9058
9059         * report.cs: Negative error codes are now mapped to 8000 - code,
9060         so that the display is render more nicely.
9061
9062         * typemanager.cs: Do not use try/catch, instead report a regular
9063         error. 
9064
9065         (GetPointerType, GetReferenceType): These methods provide
9066         mechanisms to obtain the T* and T& from a T.  We had the code
9067         previously scattered around the code base, and it also used
9068         TypeManager.LookupType that would go through plenty of caches.
9069         This one goes directly to the type source.
9070
9071         In some places we did the Type.GetType followed by
9072         ModuleBuilder.GetType, but not in others, so this unifies the
9073         processing as well.
9074
9075         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9076         statements now that we have namespace information.
9077
9078         * typemanager.cs (IsNamespace): New method, returns whether the
9079         string presented is a namespace or not.
9080
9081         (ComputeNamespaces): New public entry point, computes the list of
9082         available namespaces, using the GetNamespaces API call in Mono, or
9083         the slower version in MS.NET.   
9084
9085         Now before we start the semantic analysis phase, we have a
9086         complete list of namespaces including everything that the user has
9087         provided.
9088
9089         Deleted old code to cache namespaces in .nsc files.
9090
9091 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9092
9093         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9094         class/struct location definition Location for the implicit
9095         constructor location.
9096
9097         (Operator.Define): Use the location of the operator for the
9098         implicit Method definition.
9099
9100         (Constructor.Emit): use the constructor location for the implicit
9101         base initializer constructor.
9102
9103         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9104         and the Expression class now contains two new methods:
9105
9106         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9107         isolate type lookup from the rest of the resolution process.
9108
9109         Since we use Expressions to hold type definitions due to the way
9110         we parse the input we have historically overloaded Resolve to
9111         perform the Type lookups if a special flag is passed.  Now this is
9112         eliminated and two methods take their place. 
9113
9114         The differences in the two methods between xStep and xTerminal is
9115         that xStep is involved in our current lookup system that uses
9116         SimpleNames to compose a name, while xTerminal is used just to
9117         catch the case where the simplename lookup failed.
9118
9119 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9120
9121         * expression.cs (ResolveMemberAccess): Remove redundant code.
9122         TypeExpr expressions are always born fully resolved.
9123
9124         * interface.cs (PopulateMethod): Do not lookup the types twice.
9125         We were doing it once during SemanticAnalysis and once during
9126         PopulateMethod.
9127
9128         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9129         in local variable type definitions, were being returned as a
9130         SimpleName (we decomposed everything into a string), that is
9131         because primary_expression was being used instead of a type in the
9132         grammar (reduce/reduce conflicts).
9133
9134         The part that was wrong is that we converted the expression into a
9135         string (an oversimplification in one hand, compounded with primary
9136         expressions doing string concatenation).
9137
9138         So things like:
9139
9140         A.B.C [] x;
9141
9142         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9143         using clauses from working on this particular context.  And a type
9144         was being matched directly against "A.B.C[]".
9145
9146         We now use the correct approach, and allow for ComposedCast to be
9147         part of the unary expression.  So the "A.B.C []" become a composed
9148         cast of "A.B.C" (as a nested group of MemberAccess with a
9149         SimpleName at the end) plus the rank composition "[]". 
9150
9151         Also fixes 35567
9152
9153 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9154
9155         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9156         for the access level checking.
9157
9158         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9159         `TypeContainer container', because I kept getting confused when I
9160         was debugging this code.
9161
9162         * expression.cs (Indexers): Instead of tracking getters/setters,
9163         we now track them in parallel.  We create one arraylist less, but
9164         most importantly it is possible now for the LValue code to find a
9165         matching get for a set.
9166
9167         (IndexerAccess.DoResolveLValue): Update the code.
9168         GetIndexersForType has been modified already to extract all the
9169         indexers from a type.  The code assumed it did not.
9170
9171         Also make the code set the correct return type for the indexer.
9172         This was fixed a long time ago for properties, but was missing for
9173         indexers.  It used to be void_type.
9174
9175         (Binary.Emit): Test first for doubles instead of
9176         floats, as they are more common.
9177
9178         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9179         when dealing with floats and the <=, >= operators.  This fixes bug
9180         #39314 
9181
9182         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9183         to load the array value by emitting a load on the foreach variable
9184         type.  This was incorrect.  
9185
9186         We now emit the code to load an element using the the array
9187         variable type, and then we emit the conversion operator.
9188
9189         Fixed #40176
9190
9191 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9192
9193         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9194
9195 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9196
9197         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9198         test for protection before we test for signatures. 
9199
9200         (MethodSignature.ToString): implement.
9201
9202         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9203         to the case where we reduced into a LongConstant.
9204
9205         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9206         depend on whether the information is acurrate, because the
9207         Microsoft runtime will always claim that the array type is public,
9208         regardless of the real state.
9209
9210         If the type is a pointer, another problem happens: the type is
9211         reported as non-public in Microsoft.  
9212
9213         In both cases we have to call CheckAccessLevel recursively with
9214         the underlying type as the argument to be tested.
9215
9216 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9217
9218         * assign.cs (Assign.Emit): If we are dealing with a compound
9219         assignment expression, we should use the code path that stores the
9220         intermediate result in a temporary value.  This fixes #40903.
9221
9222         *expression.cs (Indirection.ToString): Provide ToString method for
9223         debugging. 
9224
9225 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9226
9227         * class.cs: Null out fields holding references to Block objects so
9228         they can be garbage collected.
9229
9230         * expression.cs (OverloadResolve): Remove unused local.
9231
9232 2003-04-07  Martin Baulig  <martin@ximian.com>
9233
9234         * codegen.cs (EmitContext.CurrentFile): New public field.
9235         (EmitContext.Mark): Use the CurrentFile to check whether the
9236         location is in the correct file.
9237         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9238
9239 2003-04-07  Martin Baulig  <martin@ximian.com>
9240
9241         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9242
9243         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9244         location.  [FIXME: The location argument which gets passed to this
9245         method is sometimes wrong!]
9246
9247 2003-04-07  Nick Drochak <ndrochak@gol.com>
9248
9249         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9250
9251 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9252
9253         * expression.cs (Indirection.EmitAssign): We were using the
9254         temporary, but returning immediately instead of continuing the
9255         EmitAssing flow.
9256
9257 2003-04-06  Martin Baulig  <martin@ximian.com>
9258
9259         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9260         if it's a nested child, but also deriving from the outer class.
9261         See test 190.cs.
9262
9263         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9264         nested child, but also deriving from the outer class.  See
9265         test-190.cs.
9266         (FilterWithClosure): We may access private members of the outer
9267         class if we're a nested child and deriving from the outer class.
9268         (RealMemberLookup): Only set `closure_private_ok' if the
9269         `original_bf' contained BindingFlags.NonPublic.
9270
9271 2003-04-05  Martin Baulig  <martin@ximian.com>
9272
9273         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
9274         probe if its a type parameter, and if so, flag an error.
9275
9276         * decl.cs: Move here the SetParameterInfo code from class.cs.
9277         Handle IsGeneric here.
9278
9279         Handle a variety of errors in the parameter info definition.
9280
9281         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
9282         type parameters here.
9283
9284         * cs-parser.jay (class_declaration): report errors for parameters
9285         here as well.
9286
9287 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
9288
9289         * generic.cs: New file, contains support code for generics.
9290
9291         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
9292         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
9293
9294         Update parser for the above removals.
9295
9296         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
9297         now taken care of in the parser.
9298
9299 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9300
9301         * class.cs (Event.Define): Do not allow abstract events to have
9302         initializers. 
9303
9304 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9305
9306         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9307         block in event declarations.
9308
9309         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9310         value type, get its address.
9311
9312         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9313         leaving a class on the stack instead of a boolean value (int
9314         0/1).  Change the code so we compare against null, and then the
9315         result against zero.
9316
9317         * class.cs (TypeContainer.GetClassBases): We were checking for the
9318         parent class being sealed too late.
9319
9320         * expression.cs (Binary.Emit): For <= and >= when dealing with
9321         floating point values, use cgt.un and clt.un instead of cgt and
9322         clt alone.
9323
9324 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9325
9326         * statement.cs: Apply the same optimization as MS: skip the 
9327         GetEnumerator returning an IEnumerator, and use the one returning a 
9328         CharEnumerator instead. This allows us to avoid the try-finally block 
9329         and the boxing.
9330
9331 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9332
9333         * cs-parser.jay: Attributes cannot be applied to
9334                          namespaces. Fixes #40473
9335
9336 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9337
9338         * class.cs:
9339         (Add*): check if the name is valid using the full name for constants,
9340         fields, properties and events.
9341
9342 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9343
9344         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9345         char constants to be part of the enumeration.
9346
9347         * expression.cs (Conditional.DoResolve): Add support for operator
9348         true. Implements the missing functionality from 14.12
9349
9350         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9351         operator true/false as required by the spec.
9352
9353         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9354         implicit conversion to boolean.
9355
9356         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9357         also one where the type implements `operator true'. 
9358
9359         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9360         get an expression that will invoke operator true based on an
9361         expression.  
9362
9363         (GetConversionOperators): Removed the hack that called op_True
9364         here.  
9365
9366         (Expression.ResolveBoolean): Move this from Statement.
9367
9368 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9369
9370         * ecore.cs (FieldExpr): do not allow initialization of initonly
9371         fields on derived classes
9372
9373 2003-03-13  Martin Baulig  <martin@ximian.com>
9374
9375         * statement.cs (Block.Emit): Call ig.BeginScope() and
9376         ig.EndScope() when compiling with debugging info; call
9377         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9378
9379 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9380
9381         * expression.cs (Indexers): Do not construct immediately, allow
9382         for new members to be appended as we go.  Fixes 38143
9383
9384 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9385
9386         * expression.cs: save/restore context when resolving an unchecked
9387         expression.
9388
9389 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9390
9391         * cfold.cs: Catch division by zero in modulus operator during
9392         constant folding.
9393
9394 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9395
9396         * interface.cs (Interface.DefineMembers): Avoid defining members
9397         twice. 
9398
9399 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9400
9401         * driver.cs: handle the +/- options for -noconfig
9402
9403         * statement.cs (Unckeched.Resolve): Also track the state of
9404         unchecked in the Resolve phase.
9405
9406 2003-02-27  Martin Baulig  <martin@ximian.com>
9407
9408         * ecore.cs (Expression.MemberLookup): Don't create a
9409         MethodGroupExpr for something which is not a method.  Fixes #38291.
9410
9411 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9412
9413         * class.cs (MemberBase.CheckParameters): Also check that the type
9414         is unmanaged if it is a pointer.
9415
9416         * expression.cs (SizeOf.Resolve): Add location information.
9417
9418         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9419         a managed type is declared.
9420
9421         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9422         parameter modifiers as well.  Fixes bug 38606
9423
9424         * class.cs: Very sad.  Am backing out the speed up changes
9425         introduced by the ArrayList -> Array in the TypeContainer, as they
9426         were not actually that much faster, and introduced a bug (no error
9427         reports on duplicated methods).
9428
9429         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9430         source first, this will guarantee that we have a valid expression
9431         before calling in lower levels functions that will require a
9432         resolved object.  Then use this original_source in the
9433         target.ResolveLValue instead of the original source that was
9434         passed to us.
9435
9436         Another change.  Use target.Resolve instead of LValueResolve.
9437         Although we are resolving for LValues, we will let the Assign code
9438         take care of that (it will be called again from Resolve).  This
9439         basically allows code like this:
9440
9441         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9442         class Y { void A (X x) { x [0] += o; }
9443
9444         The problem was that the indexer was trying to resolve for
9445         set_Item (idx, object o) and never finding one.  The real set_Item
9446         was set_Item (idx, X).  By delaying the process we get the right
9447         semantics. 
9448
9449         Fixes bug 36505
9450
9451 2003-02-23  Martin Baulig  <martin@ximian.com>
9452
9453         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9454         while calling DoEmit ().
9455
9456         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9457         source files; if you use the #line directive inside a method, the
9458         compiler stops emitting line numbers for the debugger until it
9459         reaches the end of the method or another #line directive which
9460         restores the original file.
9461
9462 2003-02-23  Martin Baulig  <martin@ximian.com>
9463
9464         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9465
9466 2003-02-23  Martin Baulig  <martin@ximian.com>
9467
9468         * statement.cs (Block.AddChildVariableNames): We need to call this
9469         recursively, not just for our immediate children.
9470
9471 2003-02-23  Martin Baulig  <martin@ximian.com>
9472
9473         * class.cs (Event.Define): Always make the field private, like csc does.
9474
9475         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9476         actually work, fixes bug #37521.
9477
9478 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9479
9480         * delegate.cs: When creating the various temporary "Parameters"
9481         classes, make sure that we call the ComputeAndDefineParameterTypes
9482         on those new parameters (just like we do with the formal ones), to
9483         allow them to be resolved in the context of the DeclSpace.
9484
9485         This fixes the bug that Dick observed in Bugzilla #38530.
9486
9487 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9488
9489         * expression.cs (ResolveMemberAccess): When resolving a constant,
9490         do not attempt to pull a constant if the value was not able to
9491         generate a valid constant.
9492
9493         * const.cs (LookupConstantValue): Do not report more errors than required.
9494
9495 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9496
9497         * expression.cs: fixes bug #38328.
9498
9499 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9500
9501         * class.cs: Changed all the various members that can be part of a
9502         class from being an ArrayList to be an Array of the right type.
9503         During the DefineType type_list, interface_list, delegate_list and
9504         enum_list are turned into types, interfaces, delegates and enums
9505         arrays.  
9506
9507         And during the member population, indexer_list, event_list,
9508         constant_list, field_list, instance_constructor_list, method_list,
9509         operator_list and property_list are turned into their real arrays.
9510
9511         Although we could probably perform this operation earlier, for
9512         good error reporting we need to keep the lists and remove the
9513         lists for longer than required.
9514
9515         This optimization was triggered by Paolo profiling the compiler
9516         speed on the output of `gen-sample-program.pl' perl script. 
9517
9518         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9519         not crash in methods like MemberLookupFailed that use this field.  
9520
9521         This problem arises when the compiler fails to resolve a type
9522         during interface type definition for example.
9523
9524 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9525
9526         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9527         inherit from System.Object, so we have to stop at null, not only
9528         when reaching System.Object.
9529
9530 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9531
9532         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9533         DeclaredOnly because the parent indexer might have had a different
9534         name, but did not loop until the top of the hierarchy was reached.
9535
9536         The problem this one fixes is 35492: when a class implemented an
9537         indexer from an interface, we were getting the interface method
9538         (which was abstract) and we were flagging an error (can not invoke
9539         abstract method).
9540
9541         This also keeps bug 33089 functioning, and test-148 functioning.
9542
9543         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9544         out if a method is special is to see if it is declared in a
9545         property or event, or whether it is one of the predefined operator
9546         names.   This should fix correctly #36804.
9547
9548 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9549
9550         The goal here is to remove the dependency on EmptyCast.Peel ().
9551         Killing it completely.
9552
9553         The problem is that currently in a number of places where
9554         constants are expected, we have to "probe" for an EmptyCast, and
9555         Peel, which is not the correct thing to do, as this will be
9556         repetitive and will likely lead to errors. 
9557
9558         The idea is to remove any EmptyCasts that are used in casts that
9559         can be reduced to constants, so we only have to cope with
9560         constants. 
9561
9562         This bug hunt was triggered by Bug 37363 and the desire to remove
9563         the duplicate pattern where we were "peeling" emptycasts to check
9564         whether they were constants.  Now constants will always be
9565         constants.
9566
9567         * ecore.cs: Use an enumconstant here instead of wrapping with
9568         EmptyCast.  
9569
9570         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9571         throwing me off.  By handling this we can get rid of a few hacks.
9572
9573         * statement.cs (Switch): Removed Peel() code.
9574
9575 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9576
9577         * class.cs: Location information for error 508
9578
9579         * expression.cs (New.DoResolve): Add a guard against double
9580         resolution of an expression.  
9581
9582         The New DoResolve might be called twice when initializing field
9583         expressions (see EmitFieldInitializers, the call to
9584         GetInitializerExpression will perform a resolve on the expression,
9585         and later the assign will trigger another resolution
9586
9587         This leads to bugs (#37014)
9588
9589         * delegate.cs: The signature for EndInvoke should contain any ref
9590         or out parameters as well.  We were not doing this in the past. 
9591
9592         * class.cs (Field.Define): Do not overwrite the type definition
9593         inside the `volatile' group.  Turns out that volatile enumerations
9594         were changing the type here to perform a validity test, which
9595         broke conversions. 
9596
9597 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9598
9599         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9600         and structs, we do not want to load the instance variable
9601
9602         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9603         enum_type has to be handled like an object reference (implicit
9604         conversions exists from this to object), but the regular IsClass
9605         and IsValueType tests will never return true for this one.
9606
9607         Also we use TypeManager.IsValueType instead of type.IsValueType,
9608         just for consistency with the rest of the code (this is only
9609         needed if we ever use the construct exposed by test-180.cs inside
9610         corlib, which we dont today).
9611
9612 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9613
9614         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9615         just InternalCall.
9616
9617 2003-02-09  Martin Baulig  <martin@ximian.com>
9618
9619         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9620         (Namespace.DefineNamespaces): New static public method; this is
9621         called when we're compiling with debugging to add all namespaces
9622         to the symbol file.
9623
9624         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9625         pass it to the Namespace's .ctor.
9626
9627         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9628         and MethodBase arguments; pass the namespace ID to the symwriter;
9629         pass the MethodBase instead of the token to the symwriter.
9630         (SymbolWriter.DefineNamespace): New method to add a namespace to
9631         the symbol file.
9632
9633 2003-02-09  Martin Baulig  <martin@ximian.com>
9634
9635         * symbolwriter.cs: New file.  This is a wrapper around
9636         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9637         methods here in near future.
9638
9639 2003-02-09  Martin Baulig  <martin@ximian.com>
9640
9641         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9642         ILGenerator.MarkSequencePoint() which are actually used by the
9643         symbol writer.
9644
9645 2003-02-09  Martin Baulig  <martin@ximian.com>
9646
9647         * location.cs (SourceFile): New public sealed class.  This
9648         contains the name and an index which is used in the location's token.
9649         (Location): Reserve an appropriate number of bits in the token for
9650         the source file instead of walking over that list, this gives us a
9651         really huge performance improvement when compiling with debugging.
9652
9653         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9654         `SourceFile' argument instead of a string.
9655         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9656         but don't parse/tokenize here, we need to generate the list of all
9657         source files before we do that.
9658         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9659         the files.
9660
9661         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9662         instead of a string.
9663
9664         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9665         of a string.
9666
9667 2003-02-09  Martin Baulig  <martin@ximian.com>
9668
9669         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9670         filename on `#line default'.
9671
9672 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9673
9674         * statement.cs: don't clear the pinned var when the fixed statement
9675         returns from the method (fixes bug#37752).
9676
9677 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9678
9679         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9680         to IsValueType.
9681
9682 2003-02-07  Martin Baulig  <martin@ximian.com>
9683
9684         * driver.cs: Removed the `--debug-args' command line argument.
9685
9686         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9687         automatically by the AsssemblyBuilder.
9688         (CodeGen.InitializeSymbolWriter): We don't need to call any
9689         initialization function on the symbol writer anymore.  This method
9690         doesn't take any arguments.
9691
9692 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9693
9694         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9695         from referenced assemblies as well.
9696
9697 2003-02-02  Martin Baulig  <martin@ximian.com>
9698
9699         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9700
9701 2003-02-02  Martin Baulig  <martin@ximian.com>
9702
9703         * class.cs (Constructor.Emit): Open the symbol writer before
9704         emitting the constructor initializer.
9705         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9706         single-stepping through constructor initializers.
9707
9708 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9709
9710         * class.cs: Handle error 549: do not allow virtual methods in
9711         sealed classes. 
9712
9713 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9714
9715         * decl.cs: Check access levels when resolving types
9716
9717 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9718
9719         * statement.cs: Add parameters and locals set in catch blocks that might 
9720         return to set vector
9721
9722 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9723
9724         * class.cs (Operator): Set the SpecialName flags for operators.
9725
9726         * expression.cs (Invocation.DoResolve): Only block calls to
9727         accessors and operators on SpecialName methods.
9728
9729         (Cast.TryReduce): Handle conversions from char constants.
9730
9731
9732 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9733
9734         * statement.cs: small memory and time optimization in FlowBranching.
9735
9736 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9737
9738         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9739         problem that the last fix but in the other sid (Set).
9740
9741         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9742         access when there is no indexer in the hierarchy.
9743
9744 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9745
9746         * class.cs: Combine some if statements.
9747
9748 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9749
9750         * driver.cs: fixed bug #37187.
9751
9752 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9753
9754         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9755         any indexer, it's needed to build a list with all the indexers in the
9756         hierarchy (AllGetters), else we have problems. Fixes #35653.
9757
9758 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9759
9760         * class.cs (MethodData.Define): It is wrong for an interface
9761         implementation to be static in both cases: explicit and implicit.
9762         We were only handling this in one case.
9763
9764         Improve the if situation there to not have negations.
9765
9766         * class.cs (Field.Define): Turns out that we do not need to check
9767         the unsafe bit on field definition, only on usage.  Remove the test.
9768
9769 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9770
9771         * driver.cs: use assembly.Location instead of Codebase (the latest
9772         patch made mcs fail when using MS assemblies).
9773
9774 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9775
9776         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9777         get the path to *corlib.dll.
9778
9779 2003-01-21  Nick Drochak <ndrochak@gol.com>
9780
9781         * cs-tokenizer.cs:
9782         * pending.cs:
9783         * typemanager.cs: Remove compiler warnings
9784
9785 2003-01-20  Duncan Mak  <duncan@ximian.com>
9786
9787         * AssemblyInfo.cs: Bump the version number to 0.19.
9788
9789 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9790
9791         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9792
9793 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9794
9795         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9796
9797 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9798
9799         * cs-parser.jay: Small fix: we were not comparing the constructor
9800         name correctly.   Thanks to Zoltan for the initial pointer.
9801
9802 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9803
9804         * cs-tokenizer.cs: Set file name when specified with #line
9805
9806 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9807
9808         * cs-parser.jay: Only perform the constructor checks here if we
9809         are named like the class;  This will help provider a better
9810         error.  The constructor path is taken when a type definition is
9811         not found, but most likely the user forgot to add the type, so
9812         report that rather than the constructor error.
9813
9814 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9815
9816         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9817         allocations.
9818
9819 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9820
9821         * cs-parser.jay: Add cleanup call.
9822
9823 2003-01-13  Duncan Mak  <duncan@ximian.com>
9824
9825         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9826         consistent with other methods.
9827
9828 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9829
9830         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9831
9832 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9833
9834         * attribute.cs: only set GuidAttr to true when we have a
9835         GuidAttribute.
9836
9837 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9838
9839         * ecore.cs:
9840         * expression.cs:
9841         * typemanager.cs: fixes to allow mcs compile corlib with the new
9842         Type.IsSubclassOf fix.
9843
9844 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9845
9846         * expression.cs (LocalVariableReference.DoResolve): Classify a
9847         constant as a value, not as a variable.   Also, set the type for
9848         the variable.
9849
9850         * cs-parser.jay (fixed_statement): take a type instead of a
9851         pointer_type, so we can produce a better error message later.
9852
9853         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9854         as an error.  
9855
9856         (For.DoEmit): Make inifinite loops have a
9857         non-conditional branch back.
9858
9859         (Fixed.DoEmit): First populate the pinned variables, then emit the
9860         statement, then clear the variables.  Before I was emitting the
9861         code once for each fixed piece.
9862
9863
9864 2003-01-08  Martin Baulig  <martin@ximian.com>
9865
9866         * statement.cs (FlowBranching.MergeChild): A break in a
9867         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9868
9869 2003-01-08  Martin Baulig  <martin@ximian.com>
9870
9871         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9872         lives in the same number space than `param_map'.  Fixes #36154.
9873
9874 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9875
9876         * cs-parser.jay (constructor_declaration): Set the
9877         Constructor.ModFlags before probing for it.  This makes the
9878         compiler report 514, 515 and 132 (the code was there, but got
9879         broken). 
9880
9881         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9882         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9883         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9884
9885 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9886
9887         * enum.cs: create the enum static fields using the enum type.
9888
9889 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9890
9891         * class.cs: don't try to create the ParamBuilder for the return
9892         type if it's not needed (and handle it breaking for the ms runtime
9893         anyway).
9894
9895 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9896
9897         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9898
9899 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9900
9901         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9902         the command.   This showed up while compiling the JANET source
9903         code, which used \r as its only newline separator.
9904
9905 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9906
9907         * class.cs (Method.Define): If we are an operator (because it
9908         reuses our code), then set the SpecialName and HideBySig.  #36128
9909
9910 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9911
9912         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9913         exception, report error 120 `object reference required'.
9914
9915         * driver.cs: Add --pause option, used during to measure the size
9916         of the process as it goes with --timestamp.
9917
9918         * expression.cs (Invocation.DoResolve): Do not allow methods with
9919         SpecialName to be invoked.
9920
9921 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9922
9923         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9924         number before adding it.
9925
9926 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9927
9928         * ecore.cs (StandardImplicitConversion): When in an unsafe
9929         context, we allow conversion between void * to any other pointer
9930         type. This fixes bug #35973.
9931
9932 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9933
9934         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9935         is not thrown when extensionless outputs are used 
9936
9937 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9938
9939         * rootcontext.cs: fixed compilation of corlib.
9940
9941 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9942
9943         * attribute.cs (Attributes.Contains): Add new method.
9944
9945         * class.cs (MethodCore.LabelParameters): if the parameter is an
9946         `out' parameter, check that no attribute `[In]' has been passed.
9947
9948         * enum.cs: Handle the `value__' name in an enumeration.
9949
9950 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9951
9952         * decl.cs: Added special case to allow overrides on "protected
9953         internal" methods
9954
9955 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9956
9957         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9958         since it makes much more sense.
9959
9960         (Attributes.ctor): Don't require a Location parameter.
9961
9962         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9963
9964         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9965         since we already have that information per attribute.
9966
9967         * everywhere : make appropriate changes.
9968
9969         * class.cs (LabelParameters): Write the code which actually
9970         applies attributes to the return type. We can't do this on the MS
9971         .NET runtime so we flag a warning in the case an exception is
9972         thrown.
9973
9974 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9975
9976         * const.cs: Handle implicit null conversions here too.
9977
9978 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9979
9980         * class.cs (MethodCore.LabelParameters): Remove the extra
9981         Type [] parameter since it is completely unnecessary. Instead
9982         pass in the method's attributes so that we can extract
9983         the "return" attribute.
9984
9985 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9986
9987         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9988         of ignoring it and letting the compile continue.
9989
9990         * typemanager.cs (ChangeType): use an extra argument to return an
9991         error condition instead of throwing an exception.
9992
9993 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9994
9995         * expression.cs (Unary.TryReduce): mimic the code for the regular
9996         code path.  Perform an implicit cast in the cases where we can
9997         implicitly convert to one of the integral types, and then reduce
9998         based on that constant.   This fixes bug #35483.
9999
10000 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10001
10002         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10003
10004 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10005
10006         * namespace.cs: fixed bug #35489.
10007
10008 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10009
10010         * class.cs: Remove some dead code.
10011
10012         * cs-parser.jay: Estimate the number of methods needed
10013         (RootContext.MethodCount);
10014
10015         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10016         numbers instead of StringBuilders.
10017
10018         * support.cs (PtrHashtable): Add constructor with initial size;
10019         We can now reduce reallocations of the method table.
10020
10021 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10022
10023         * attribute.cs (ApplyAttributes): Keep track of the emitted
10024         attributes on a per-target basis. This fixes bug #35413.
10025
10026 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10027
10028         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10029         default to the Windows 1252 encoding.
10030
10031         (UnixParseOption): Support version, thanks to Alp for the missing
10032         pointer. 
10033
10034         * AssemblyInfo.cs: Add nice assembly information.
10035
10036         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10037         (bug 35169).
10038
10039         * cs-parser.jay: Allow a trailing comma before the close bracked
10040         in the attribute_section production.
10041
10042         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10043         address of the instance was being taken, I will take this out,
10044         because we take the address of the object immediately here.
10045
10046 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10047
10048         * typemanager.cs (AreMultipleAllowed): Take care of the most
10049         obvious case where attribute type is not in the current assembly -
10050         stupid me ;-)
10051
10052 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10053
10054         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10055         definitions, instead of doing that afterwards.  
10056
10057         Also we use a nice little hack, depending on the constructor, we
10058         know if we are a "composed" name or a simple name.  Hence, we
10059         avoid the IndexOf test, and we avoid 
10060
10061         * codegen.cs: Add code to assist in a bug reporter to track down
10062         the source of a compiler crash. 
10063
10064 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10065
10066         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10067         types have been emitted for a given element and flag an error
10068         if something which does not have AllowMultiple set is used more
10069         than once.
10070
10071         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10072         attribute types and their corresponding AllowMultiple properties
10073
10074         (AreMultipleAllowed): Check the property for a given type.
10075
10076         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10077         property in the case we have a TypeContainer.
10078
10079         (Attributes.AddAttribute): Detect duplicates and just skip on
10080         adding them. This trivial fix catches a pretty gross error in our
10081         attribute emission - global attributes were being emitted twice!
10082
10083         Bugzilla bug #33187 is now fixed.
10084
10085 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10086
10087         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10088         instead of pp_and).
10089
10090         * expression.cs (Binary.ResolveOperator): I can only use the
10091         Concat (string, string, string) and Concat (string, string,
10092         string, string) if the child is actually a concatenation of
10093         strings. 
10094
10095 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10096
10097         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10098         context where we need a 2-character lookahead.
10099
10100         * pending.cs (PendingImplementation): Rework so we can keep track
10101         of interface types all the time, and flag those which were
10102         implemented by parents as optional.
10103
10104 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10105
10106         * expression.cs (Binary.ResolveOperator): Use
10107         String.Concat(string,string,string) or
10108         String.Concat(string,string,string,string) when possible. 
10109
10110         * typemanager: More helper methods.
10111
10112
10113 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10114
10115         * pending.cs: remove the bogus return from GetMissingInterfaces()
10116         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10117
10118 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10119
10120         * namespace.cs: avoid duplicated 'using xxx' being added to
10121         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10122         when we get more than one 'using' statement for the same namespace.
10123         Report a CS0105 warning for it.
10124
10125 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10126
10127         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10128         of calling getChar/putback, uses internal knowledge of it.    
10129
10130         (xtoken): Reorder tokenizer so most common patterns are checked
10131         first.  This reduces the compilation time in another 5% (from 8.11s
10132         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10133
10134         The parsing time is 22% of the compilation in mcs, and from that
10135         64% is spent on the tokenization process.  
10136
10137         I tried using a binary search for keywords, but this is slower
10138         than the hashtable.  Another option would be to do a couple of
10139         things:
10140
10141                 * Not use a StringBuilder, instead use an array of chars,
10142                   with a set value.  Notice that this way we could catch
10143                   the 645 error without having to do it *afterwards*.
10144
10145                 * We could write a hand-parser to avoid the hashtable
10146                   compares altogether.
10147
10148         The identifier consumption process takes 37% of the tokenization
10149         time.  Another 15% is spent on is_number.  56% of the time spent
10150         on is_number is spent on Int64.Parse:
10151
10152                 * We could probably choose based on the string length to
10153                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10154                   computations. 
10155
10156         Another 3% is spend on wrapping `xtoken' in the `token' function.
10157
10158         Handle 0xa0 as whitespace (#34752)
10159
10160 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10161
10162         * typemanager.cs (IsCLRType): New routine to tell whether a type
10163         is one of the builtin types.  
10164
10165         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10166         typecode in more places instead of doing pointer comparissions.
10167         We could leverage some knowledge about the way the typecodes are
10168         laid out.
10169
10170         New code to cache namespaces in assemblies, it is currently not
10171         invoked, to be used soon.
10172
10173         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10174
10175         * expression.cs (Binary.ResolveOperator): specially handle
10176         strings, and do not perform user-defined operator overloading for
10177         built-in types.
10178
10179 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10180
10181         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10182         internalcall as it is a pretty simple operation;  Avoid whenever
10183         possible to call Char.IsLetter.
10184
10185         (consume_identifier): Cut by half the number of
10186         hashtable calls by merging the is_keyword and GetKeyword behavior.
10187
10188         Do not short-circuit, because if we do, we
10189         report errors (ie, #if false && true would produce an invalid
10190         directive error);
10191
10192
10193 2002-11-24  Martin Baulig  <martin@ximian.com>
10194
10195         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10196         check constant ranges and report a CS0221.  Fixes #33186.
10197
10198 2002-11-24  Martin Baulig  <martin@ximian.com>
10199
10200         * cs-parser.jay: Make this work for uninitialized variable
10201         declarations in the `for' initializer.  Fixes #32416.
10202
10203 2002-11-24  Martin Baulig  <martin@ximian.com>
10204
10205         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10206         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10207
10208 2002-11-24  Martin Baulig  <martin@ximian.com>
10209
10210         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10211         argument; if true, we also check for user-defined conversions.
10212         This is only needed if both arguments are of a user-defined type.
10213         Fixes #30443, added test-175.cs.
10214         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10215
10216         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10217
10218 2002-11-24  Martin Baulig  <martin@ximian.com>
10219
10220         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10221         function to get the store opcode.
10222         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10223         only emit the Ldelema if the store opcode is Stobj.  You must run
10224         both test-34 and test-167 to test this.  Fixes #34529.
10225
10226 2002-11-23  Martin Baulig  <martin@ximian.com>
10227
10228         * ecore.cs (Expression.MemberLookup): Added additional
10229         `qualifier_type' argument which is used when we're being called
10230         from MemberAccess.DoResolve() and null if we're called from a
10231         SimpleName lookup.
10232         (Expression.MemberLookupFailed): New method to report errors; this
10233         does the CS1540 check and reports the correct error message.
10234
10235         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10236         argument for the CS1540 check and redone the way how we're dealing
10237         with private members.  See the comment in the source code for details.
10238         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10239         `closure_start_type' to `closure_qualifier_type' and check whether
10240         it's not null.  It was not this filter being broken, it was just
10241         being called with the wrong arguments.
10242
10243         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10244         and pass it the correct `qualifier_type'; this also does the error
10245         handling for us.
10246
10247 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10248
10249         * expression.cs (Invocation.EmitParams): If the we are dealing
10250         with a non-built-in value type, load its address as well.
10251
10252         (ArrayCreation): Use a a pretty constant instead
10253         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10254         static initializers.  
10255
10256         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10257         because they are not really value types, just glorified integers. 
10258
10259         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10260
10261         * ecore.cs: Remove redundant code for enumerations, make them use
10262         the same code path as everything else, fixes the casting issue
10263         with enumerations in Windows.Forms.
10264
10265         * attribute.cs: Do only cast to string if it is a string, the
10266         validation happens later.
10267
10268         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10269         people upgrade their corlibs.
10270
10271         * ecore.cs: Oops, enumerations were not following the entire code path
10272
10273 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10274
10275         * typemanager.cs (FilterWithClosure): Commented out the test for
10276         1540 in typemanager.cs, as it has problems when accessing
10277         protected methods from a parent class (see test-174.cs). 
10278
10279         * attribute.cs (Attribute.ValidateGuid): new method.
10280         (Attribute.Resolve): Use above.
10281
10282 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10283
10284         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10285
10286         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10287         handling for enumerations, as we only needed the TypeContainer
10288         functionality to begin with (this is required for the fix below to
10289         work for enums that reference constants in a container class for
10290         example). 
10291
10292         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10293
10294         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10295         a valid TypeBuilder to perform lookups on.o
10296
10297         * class.cs (InheritableMemberSignatureCompare): Use true in the
10298         call to GetGetMethod and GetSetMethod, because we are comparing
10299         the signature, and we need to get the methods *even* if they are
10300         private. 
10301
10302         (PropertyBase.CheckBase): ditto.
10303
10304         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10305         GotoCase.Resolve): Use Peel on EmpytCasts.
10306
10307         * ecore.cs (EmptyCast): drop child, add Peel method.
10308
10309 2002-11-17  Martin Baulig  <martin@ximian.com>
10310
10311         * ecore.cs (EmptyCast.Child): New public property.
10312
10313         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10314         label resolved to an EmptyCast.  Fixes #34162.
10315         (GotoCase.Resolve): Likewise.
10316         (Block.EmitMeta): Likewise.
10317
10318 2002-11-17  Martin Baulig  <martin@ximian.com>
10319
10320         * expression.cs (Invocation.BetterConversion): Prefer int over
10321         uint; short over ushort; long over ulong for integer literals.
10322         Use ImplicitConversionExists instead of StandardConversionExists
10323         since we also need to check for user-defined implicit conversions.
10324         Fixes #34165.  Added test-173.cs.
10325
10326 2002-11-16  Martin Baulig  <martin@ximian.com>
10327
10328         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10329         with the `true' and `false' literals.  Fixes #33151.
10330
10331 2002-11-16  Martin Baulig  <martin@ximian.com>
10332
10333         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10334         October 22nd; don't do the cs1540 check for static members.
10335
10336         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10337         now using our own filter here and doing the cs1540 check again.
10338
10339 2002-11-16  Martin Baulig  <martin@ximian.com>
10340
10341         * support.cs (InternalParameters): Don't crash if we don't have
10342         any fixed parameters.  Fixes #33532.
10343
10344 2002-11-16  Martin Baulig  <martin@ximian.com>
10345
10346         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10347         when looking up static methods to make this work on Windows.
10348         Fixes #33773.
10349
10350 2002-11-16  Martin Baulig  <martin@ximian.com>
10351
10352         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10353         a setter rather than using PropertyInfo.CanWrite.
10354
10355 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10356
10357         * class.cs: Allow acces to block member by subclasses. Fixes build
10358         breaker.
10359
10360 2002-11-14  Martin Baulig  <martin@ximian.com>
10361
10362         * class.cs (Constructor.Emit): Added the extern/block check.
10363         Fixes bug #33678.
10364
10365 2002-11-14  Martin Baulig  <martin@ximian.com>
10366
10367         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10368         iteration while looking for indexers, this is needed because the
10369         indexer may have a different name in our base classes.  Fixed the
10370         error reporting (no indexers at all, not get accessor, no
10371         overloaded match).  Fixes bug #33089.
10372         (IndexerAccess.DoResolveLValue): Likewise.
10373
10374 2002-11-14  Martin Baulig  <martin@ximian.com>
10375
10376         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10377         indexers.  Fixes the first part of bug #33089.
10378         (MethodSignature.InheritableMemberSignatureCompare): Added support
10379         for properties.
10380
10381 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10382
10383         * attribute.cs (Attribute.Resolve): Catch the
10384         NullReferenceException and report it since it isn't supposed to
10385         happen. 
10386
10387 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10388
10389         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10390         LogicalOr and LogicalAnd that can benefit from recursively
10391         handling EmitBranchable.  The code now should be nice for Paolo.
10392
10393 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10394
10395         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10396         the Type lookups, as we perform quite a number of lookups on
10397         non-Types.  This can be removed once we can deterministically tell
10398         whether we have a type or a namespace in advance.
10399
10400         But this might require special hacks from our corlib.
10401
10402         * TODO: updated.
10403
10404         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10405         and double which avoids a conversion from an integer to a double.
10406
10407         * expression.cs: tiny optimization, avoid calling IsConstant,
10408         because it effectively performs the lookup twice.
10409
10410 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10411
10412         But a bogus return here to keep the semantics of the old code
10413         until the Mono runtime is fixed.
10414
10415         * pending.cs (GetMissingInterfaces): New method used to remove all
10416         the interfaces that are already implemented by our parent
10417         classes from the list of pending methods. 
10418
10419         * interface.cs: Add checks for calls after ResolveTypeExpr.
10420
10421 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10422
10423         * class.cs (Class.Emit): Report warning 67: event not used if the
10424         warning level is beyond 3.
10425
10426         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10427         being a NullLiteral.
10428
10429         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10430         specifiers. 
10431
10432         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10433         path that might fail if a type can not be resolved.
10434
10435         * expression.cs (Binary.Emit): Emit unsigned versions of the
10436         operators. 
10437
10438         * driver.cs: use error 5.
10439
10440 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10441
10442         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10443
10444 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10445
10446         * cs-parser.jay (switch_section): A beautiful patch from Martin
10447         Baulig that fixed 33094.
10448
10449 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10450
10451         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10452         Check whether the base is abstract and report an error if so.
10453
10454         * expression.cs (IndexerAccess.DoResolveLValue,
10455         IndexerAccess.DoResolve): ditto. 
10456
10457         (Invocation.DoResolve): ditto.
10458
10459         (Invocation.FullMethodDesc): Improve the report string.
10460
10461         * statement.cs (Block): Eliminate IsVariableDefined as it is
10462         basically just a wrapper for GetVariableInfo.
10463
10464         * ecore.cs (SimpleName): Use new 
10465
10466         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10467         type, as we return the actual parameter ref/unref state on a
10468         different call.
10469
10470 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10471
10472         * support.cs: Return proper flags REF/OUT fixing the previous
10473         commit.  
10474
10475         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10476         not used to mean `ref' but `ref or out' in ParameterReference
10477
10478         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10479         full type signature instead of calling TypeManger.CSharpName
10480         ourselves. 
10481
10482         * support.cs (InternalParameters.ParameterDesc): Do not compare
10483         directly to the modflags, because REF/OUT will actually be bitsets
10484         if set. 
10485
10486         * delegate.cs (VerifyMethod): Check also the modifiers.
10487
10488         * cs-tokenizer.cs: Fix bug where floating point values with an
10489         exponent where a sign was missing was ignored.
10490
10491         * driver.cs: Allow multiple assemblies to be specified in a single
10492         /r: argument
10493
10494 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10495
10496         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10497         because identifiers after a parenthesis would end up in this kind
10498         of production, and we needed to desamiguate it for having casts
10499         like:
10500
10501                 (UserDefinedType *) xxx
10502
10503 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10504
10505         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10506         we should set on the Bindingflags.NonPublic, but not turn on
10507         private_ok.  private_ok controls whether a Private member is
10508         returned (this is chekced on the filter routine), while the
10509         BindingFlags.NonPublic just controls whether private/protected
10510         will be allowed.   This fixes the problem part of the problem of
10511         private properties being allowed to be used in derived classes.
10512
10513         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10514         so we can call the children DoResolveLValue method (this will
10515         properly signal errors on lvalue assignments to base properties)
10516
10517         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10518         getter are null, and we have a property info, we know that this
10519         happened because the lookup failed, so we report an error 122 for
10520         protection level violation.
10521
10522         We also silently return if setter and getter are null in the
10523         resolve functions, this condition only happens if we have flagged
10524         the error before.  This is the other half of the problem. 
10525
10526         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10527         not have accessibility information, that is why we were returning
10528         true in the filter function in typemanager.cs.
10529
10530         To properly report 122 (property is inaccessible because of its
10531         protection level) correctly, we report this error in ResolveAccess
10532         by failing if both the setter and the getter are lacking (ie, the
10533         lookup failed). 
10534
10535         DoResolve and DoLResolve have been modified to check for both
10536         setter/getter being null and returning silently, the reason being
10537         that I did not want to put the knowledge about this error in upper
10538         layers, like:
10539
10540         int old = Report.Errors;
10541         x = new PropertyExpr (...);
10542         if (old != Report.Errors)
10543                 return null;
10544         else
10545                 return x;
10546
10547         So the property expr is returned, but it is invalid, so the error
10548         will be flagged during the resolve process. 
10549
10550         * class.cs: Remove InheritablePropertySignatureCompare from the
10551         class, as we no longer depend on the property signature to compute
10552         whether it is possible to implement a method or not.
10553
10554         The reason is that calling PropertyInfo.GetGetMethod will return
10555         null (in .NET, in Mono it works, and we should change this), in
10556         cases where the Get Method does not exist in that particular
10557         class.
10558
10559         So this code:
10560
10561         class X { public virtual int A { get { return 1; } } }
10562         class Y : X { }
10563         class Z : Y { public override int A { get { return 2; } } }
10564
10565         Would fail in Z because the parent (Y) would not have the property
10566         defined.  So we avoid this completely now (because the alternative
10567         fix was ugly and slow), and we now depend exclusively on the
10568         method names.
10569
10570         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10571         reference method, instead of using the property.
10572
10573         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10574         routines are gone now.
10575
10576         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10577         names, they were incorrectly named.
10578
10579         * cs-tokenizer.cs: Return are more gentle token on failure. 
10580
10581         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10582         had an out-of-sync index variable, which caused it to remove from
10583         the list of pending methods the wrong method sometimes.
10584
10585 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10586
10587         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10588         CanWrite, because those refer to this particular instance of the
10589         property, and do not take into account the fact that we can
10590         override single members of a property.
10591
10592         Constructor requires an EmitContext.  The resolution process does
10593         not happen here, but we need to compute the accessors before,
10594         because the resolution does not always happen for properties.
10595
10596         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10597         subclass, before we did not update this flag, but we did update
10598         bindingflags. 
10599
10600         (GetAccessors): Drop this routine, as it did not work in the
10601         presence of partially overwritten set/get methods. 
10602
10603         Notice that this broke the cs1540 detection, but that will require
10604         more thinking. 
10605
10606 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10607
10608         * class.cs:
10609         * codegen.cs:
10610         * driver.cs: issue a warning instead of an error if we don't support
10611         debugging for the platform. Also ignore a couple of errors that may
10612         arise when trying to write the symbols. Undo my previous patch.
10613
10614 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10615
10616         * driver.cs: ignore /debug switch except for Unix platforms.
10617
10618 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10619
10620         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10621
10622 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10623
10624         * driver.cs: Do not make mcs-debug conditional, so we do not break
10625         builds that use it.
10626
10627         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10628         review this patch.  But basically after all the children variables
10629         have been merged, the value of "Breaks" was not being set to
10630         new_breaks for Switch blocks.  I think that it should be set after
10631         it has executed.  Currently I set this to the value of new_breaks,
10632         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10633         conservative, but I do not understand this code very well.
10634
10635         I did not break anything in the build, so that is good ;-)
10636
10637         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10638
10639 2002-10-20  Mark Crichton  <crichton@gimp.org>
10640
10641         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10642
10643 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10644
10645         * cfold.cs: Fixed compile blocker.
10646
10647 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10648
10649         * driver.cs: I was chekcing the key, not the file.
10650
10651 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10652
10653         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10654         message that we were generating - we just need to silently return
10655         a null.
10656
10657 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10658
10659         * class.cs (Event.Define): Change my previous commit, as this
10660         breaks the debugger.  This is a temporary hack, as it seems like
10661         the compiler is generating events incorrectly to begin with.
10662
10663         * expression.cs (Binary.ResolveOperator): Added support for 
10664         "U operator - (E x, E y)"
10665
10666         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10667         y)".
10668
10669         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10670         init-only variables, but this path did not take into account that
10671         there might be also instance readonly variables.  Correct this
10672         problem. 
10673
10674         This fixes bug 32253
10675
10676         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10677         delegates as well.
10678
10679         * driver.cs: Change the extension for modules to `netmodule'
10680
10681         * cs-parser.jay: Improved slightly the location tracking for
10682         the debugger symbols.
10683
10684         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10685         modifiers that were specified instead of the hardcoded value
10686         (FamAndAssem).  This was basically ignoring the static modifier,
10687         and others.  Fixes 32429.
10688
10689         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10690         fixed a bug in the process (32476)
10691
10692         * expression.cs (ArrayAccess.EmitAssign): Patch from
10693         hwang_rob@yahoo.ca that fixes bug 31834.3
10694
10695 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10696
10697         * driver.cs: Make the module extension .netmodule.
10698
10699 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10700
10701         * driver.cs: Report an error if the resource file is not found
10702         instead of crashing.
10703
10704         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10705         false, like Emit does.
10706
10707 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10708
10709         * typemanager.cs: Remove unused private member.  Also reported mcs
10710         bug to report this as a warning like csc.
10711
10712 2002-10-15  Martin Baulig  <martin@gnome.org>
10713
10714         * statement.cs (Statement.Emit): Made this a virtual method; emits
10715         the line number info and calls DoEmit().
10716         (Statement.DoEmit): New protected abstract method, formerly knows
10717         as Statement.Emit().
10718
10719         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10720
10721 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10722
10723         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10724         have fixed a remaining problem: not every AddXXXX was adding a
10725         fully qualified name.  
10726
10727         Now everyone registers a fully qualified name in the DeclSpace as
10728         being defined instead of the partial name.  
10729
10730         Downsides: we are slower than we need to be due to the excess
10731         copies and the names being registered this way.  
10732
10733         The reason for this is that we currently depend (on the corlib
10734         bootstrap for instance) that types are fully qualified, because
10735         we dump all the types in the namespace, and we should really have
10736         types inserted into the proper namespace, so we can only store the
10737         basenames in the defined_names array.
10738
10739 2002-10-10  Martin Baulig  <martin@gnome.org>
10740
10741         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10742         from bug #31834, see the bug report for a testcase which is
10743         miscompiled.
10744
10745 2002-10-10  Martin Baulig  <martin@gnome.org>
10746
10747         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10748         flow analysis code for this.
10749
10750         * statement.cs (Do, While, For): Tell the flow analysis code about
10751         infinite loops.
10752         (FlowBranching.UsageVector): Added support for infinite loops.
10753         (Block.Resolve): Moved the dead code elimination here and use flow
10754         analysis to do it.
10755
10756 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10757
10758         * class.cs (Field.Define): Catch cycles on struct type
10759         definitions. 
10760
10761         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10762         fields if the fields are static.  We only need to check instance
10763         fields. 
10764
10765         * expression.cs (As.DoResolve): Test for reference type.
10766
10767         * statement.cs (Using.ResolveExpression): Use
10768         ConvertImplicitRequired, not ConvertImplicit which reports an
10769         error on failture
10770         (Using.ResolveLocalVariableDecls): ditto.
10771
10772         * expression.cs (Binary.ResolveOperator): Report errors in a few
10773         places where we had to.
10774
10775         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10776
10777 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10778
10779         * expression.cs: Use StoreFromPtr instead of extracting the type
10780         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10781
10782         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10783         an enumeration value to a System.Enum, but System.Enum is not a
10784         value type, but an class type, so we need to box.
10785
10786         (Expression.ConvertExplicit): One codepath could return
10787         errors but not flag them.  Fix this.  Fixes #31853
10788
10789         * parameter.cs (Resolve): Do not allow void as a parameter type.
10790
10791 2002-10-06  Martin Baulig  <martin@gnome.org>
10792
10793         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10794         if it's a class type and not a struct.  Fixes #31815.
10795
10796 2002-10-06  Martin Baulig  <martin@gnome.org>
10797
10798         * statement.cs: Reworked the flow analysis code a bit to make it
10799         usable for dead code elimination.
10800
10801 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10802
10803         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10804
10805 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10806
10807         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10808         to fix the test 165, will investigate deeper.
10809
10810 2002-10-04  Martin Baulig  <martin@gnome.org>
10811
10812         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10813         finally blocks actually work.
10814         (Try.Resolve): We don't need to create a sibling for `finally' if
10815         there is no finally block.
10816
10817 2002-10-04  Martin Baulig  <martin@gnome.org>
10818
10819         * class.cs (Constructor.Define): The default accessibility for a
10820         non-default constructor is private, not public.
10821
10822 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10823
10824         * class.cs (Constructor): Make AllowedModifiers public, add
10825         EXTERN.
10826
10827         * cs-parser.jay: Perform the modifiers test here, as the
10828         constructor for the Constructor class usually receives a zero
10829         because of the way we create it (first we create, later we
10830         customize, and we were never checking the modifiers).
10831
10832         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10833         is a version of LookupTypeReflection that includes the type-name
10834         cache.  This can be used as a fast path for functions that know
10835         the fully qualified name and are only calling into *.GetType() to
10836         obtain a composed type.
10837
10838         This is also used by TypeManager.LookupType during its type
10839         composition.
10840
10841         (LookupType): We now also track the real type name, as sometimes
10842         we can get a quey for the real type name from things like
10843         ComposedCast.  This fixes bug 31422.
10844
10845         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10846         complete type fullname, it does not have to go through the type
10847         resolution system to obtain the composed version of the type (for
10848         obtaining arrays or pointers).
10849
10850         (Conditional.Emit): Use the EmitBoolExpression to
10851         generate nicer code, as requested by Paolo.
10852
10853         (ArrayCreation.CheckIndices): Use the patch from
10854         hwang_rob@yahoo.ca to validate the array initializers. 
10855
10856 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10857
10858         * class.cs (ConstructorInitializer.Emit): simplify code by using
10859         Invocation.EmitCall, and at the same time, fix the bugs in calling
10860         parent constructors that took variable arguments. 
10861
10862         * ecore.cs (Expression.ConvertNumericExplicit,
10863         Expression.ImplicitNumericConversion): Remove the code that
10864         manually wrapped decimal (InternalTypeConstructor call is now gone
10865         as well).
10866
10867         * expression.cs (Cast.TryReduce): Also handle decimal types when
10868         trying to perform a constant fold on the type.
10869
10870         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10871
10872         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10873         that only turned off an error report, and did nothing else. 
10874
10875 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10876
10877         * driver.cs: Handle and ignore /fullpaths
10878
10879 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10880
10881         * expression.cs (Binary.ResolveOperator): Catch the case where
10882         DoNumericPromotions returns true, 
10883
10884         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10885
10886 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10887
10888         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10889         report error 70.
10890
10891 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10892
10893         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10894         conversion exists, but it is also required that the conversion be
10895         performed.  This manifested in "(Type64Enum) 2".  
10896
10897         * class.cs (TypeManager.AddMethod): The fix is not to change
10898         AddEnum, because that one was using a fully qualified name (every
10899         DeclSpace derivative does), but to change the AddMethod routine
10900         that was using an un-namespaced name.  This now correctly reports
10901         the duplicated name.
10902
10903         Revert patch until I can properly fix it.  The issue
10904         is that we have a shared Type space across all namespaces
10905         currently, which is wrong.
10906
10907         Options include making the Namespace a DeclSpace, and merge
10908         current_namespace/current_container in the parser.
10909
10910 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10911
10912         * cs-parser.jay: Improve error reporting when we get a different
10913         kind of expression in local_variable_type and
10914         local_variable_pointer_type. 
10915
10916         Propagate this to avoid missleading errors being reported.
10917
10918         * ecore.cs (ImplicitReferenceConversion): treat
10919         TypeManager.value_type as a target just like object_type.   As
10920         code like this:
10921
10922         ValueType v = 1;
10923
10924         Is valid, and needs to result in the int 1 being boxed before it
10925         is assigned to the value type v.
10926
10927         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10928         to validate the enumeration name.
10929
10930         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10931         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10932         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10933
10934         * ecore.cs (TryImplicitIntConversion): When doing an
10935         implicit-enumeration-conversion, check if the type is 64-bits and
10936         perform a conversion before passing to EnumConstant.
10937
10938 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10939
10940         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10941         report ambiguous type references.  Unlike the MS version, we
10942         report what the ambiguity is.   Innovation at work ;-)
10943
10944         (DeclSpace.FindType): Require a location argument to
10945         display when we display an ambiguous error.
10946
10947         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10948
10949         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10950
10951         * expression.cs (EmitDynamicInitializers): Apply patch from
10952         hwang_rob@yahoo.ca that fixes the order in which we emit our
10953         initializers. 
10954
10955 2002-09-21  Martin Baulig  <martin@gnome.org>
10956
10957         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10958         delegate takes no arguments.
10959
10960 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10961
10962         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10963         from integers.
10964
10965         * expression.cs: Extract the underlying type.
10966
10967         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10968
10969         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10970
10971 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10972
10973         * class.cs (TypeContainer.DefineType): We can not use the nice
10974         PackingSize with the size set to 1 DefineType method, because it
10975         will not allow us to define the interfaces that the struct
10976         implements.
10977
10978         This completes the fixing of bug 27287
10979
10980         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10981         means also structs.  This fixes part of the problem. 
10982         (Expresion.ImplicitReferenceConversionExists): ditto.
10983
10984         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10985         error if there were no errors reported during the type lookup
10986         process, to avoid duplicates or redundant errors.  Without this
10987         you would get an ambiguous errors plus a type not found.  We have
10988         beaten the user enough with the first error.  
10989
10990         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10991         reference. 
10992
10993         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10994         during the resolution process, stop the lookup, this avoids
10995         repeated error reports (same error twice).
10996
10997         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10998
10999         * typemanager.cs (LookupType): Redo the type lookup code to match
11000         the needs of System.Reflection.  
11001
11002         The issue is that System.Reflection requires references to nested
11003         types to begin with a "+" sign instead of a dot.  So toplevel
11004         types look like: "NameSpace.TopLevelClass", and nested ones look
11005         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11006         levels. 
11007
11008 2002-09-19  Martin Baulig  <martin@gnome.org>
11009
11010         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11011         says that a method always returns or always throws an exception,
11012         don't report the CS0161.
11013
11014         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11015         set `Returns = new_returns'.
11016
11017 2002-09-19  Martin Baulig  <martin@gnome.org>
11018
11019         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11020         to an enum constant, check for a CS0176.
11021
11022 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11023
11024         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11025         for operators that must be in pairs and report errors.
11026
11027         * ecore.cs (SimpleName.DoResolveType): During the initial type
11028         resolution process, when we define types recursively, we must
11029         check first for types in our current scope before we perform
11030         lookups in the enclosing scopes.
11031
11032         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11033
11034         (Invocation.VerifyArgumentsCompat): Call
11035         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11036         I thought we were supposed to always call this, but there are a
11037         few places in the code where we dont do it.
11038
11039 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11040
11041         * driver.cs: Add support in -linkres and -resource to specify the
11042         name of the identifier.
11043
11044 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11045
11046         * ecore.cs (StandardConversionExists): Sync with the conversion
11047         code: allow anything-* to void* conversions.
11048
11049         (FindMostSpecificSource): Use an Expression argument
11050         instead of a Type, because we might be handed over a Literal which
11051         gets a few more implicit conversions that plain types do not.  So
11052         this information was being lost.
11053
11054         Also, we drop the temporary type-holder expression when not
11055         required.
11056
11057 2002-09-17  Martin Baulig  <martin@gnome.org>
11058
11059         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11060         this is an explicit interface implementation.
11061
11062 2002-09-17  Martin Baulig  <martin@gnome.org>
11063
11064         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11065         different `IndexerName' attributes.
11066
11067         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11068         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11069         virtual CommonResolve().
11070
11071 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11072
11073         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11074         and convert that to the UnderlyingType.
11075
11076         * statement.cs (Foreach.Resolve): Indexers are just like variables
11077         or PropertyAccesses.
11078
11079         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11080         inside quoted strings, we were not doing this before.
11081
11082 2002-09-16  Martin Baulig  <martin@gnome.org>
11083
11084         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11085         resolve it.  This is needed for the definite assignment check of the
11086         instance expression, fixes bug #29846.
11087         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11088
11089 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11090
11091         * parameter.cs: Fix compile error.  Cannot reference static member
11092         from an instance object.  Is this an mcs bug?
11093
11094 2002-09-14  Martin Baulig  <martin@gnome.org>
11095
11096         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11097         multiple times.  Fixes bug #30295, added test-166.cs.
11098
11099 2002-09-14  Martin Baulig  <martin@gnome.org>
11100
11101         * statement.cs (Block.Emit): Don't emit unreachable code.
11102         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11103         `break' statements.
11104         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11105
11106 2002-09-14  Martin Baulig  <martin@gnome.org>
11107
11108         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11109         is set.
11110
11111 2002-09-14  Martin Baulig  <martin@gnome.org>
11112
11113         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11114         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11115         be false on the ms runtime.
11116
11117 2002-09-13  Martin Baulig  <martin@gnome.org>
11118
11119         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11120         the CS0038 error message.
11121
11122 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11123
11124         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11125         constant inside, return it.
11126
11127 2002-09-12  Martin Baulig  <martin@gnome.org>
11128
11129         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11130         implicit conversion can be done between enum types.
11131
11132         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11133         check whether an implicit conversion to the current enum's UnderlyingType
11134         exists and report an error if not.
11135
11136         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11137         without debugging support.
11138
11139         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11140         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11141
11142 2002-09-12  Martin Baulig  <martin@gnome.org>
11143
11144         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11145
11146         * ecore.cs (IMemberExpr.DeclaringType): New property.
11147         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11148         nonstatic member of an outer type (CS0038).
11149
11150 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11151
11152         * driver.cs: Activate the using-error detector at warning level
11153         4 (at least for MS-compatible APIs).
11154
11155         * namespace.cs (VerifyUsing): Small buglett fix.
11156
11157         * pending.cs (PendingImplementation): pass the container pointer. 
11158
11159         * interface.cs (GetMethods): Allow for recursive definition.  Long
11160         term, I would like to move every type to support recursive
11161         definitions, not the current ordering mechanism that we have right
11162         now.
11163
11164         The situation is this: Attributes are handled before interfaces,
11165         so we can apply attributes to interfaces.  But some attributes
11166         implement interfaces, we will now handle the simple cases
11167         (recursive definitions will just get an error).  
11168
11169         * parameter.cs: Only invalidate types at the end if we fail to
11170         lookup all types.  
11171
11172 2002-09-09  Martin Baulig  <martin@gnome.org>
11173
11174         * ecore.cs (PropertyExpr.Emit): Also check for
11175         TypeManager.system_int_array_get_length so this'll also work when
11176         compiling corlib.  Fixes #30003.
11177
11178 2002-09-09  Martin Baulig  <martin@gnome.org>
11179
11180         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11181         and throw an exception if we can't get the type's size.  Fixed #30040,
11182         added test-165.cs.
11183
11184 2002-09-09  Martin Baulig  <martin@gnome.org>
11185
11186         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11187
11188         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11189         context.  Fixes bug #30027.
11190
11191         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11192         virtual functions.  Fixes bug #30043, added test-164.cs.
11193
11194 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11195
11196         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11197
11198 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11199
11200         * driver.cs: Use an object to get the windows codepage since it's not a
11201         static property.
11202
11203 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11204
11205         * statement.cs (For.Emit): for infinite loops (test == null)
11206         return whether there is a break inside, not always "true".
11207
11208         * namespace.cs (UsingEntry): New struct to hold the name of the
11209         using definition, the location where it is defined, and whether it
11210         has been used in a successful type lookup.
11211
11212         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11213         strings.
11214
11215         * decl.cs: ditto.
11216
11217 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11218
11219         * attribute.cs : Fix incorrect code which relied on catching
11220         a NullReferenceException to detect a null being passed in
11221         where an object was expected.
11222
11223 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11224
11225         * statement.cs (Try): flag the catch variable as assigned
11226
11227         * expression.cs (Cast): Simplified by using ResolveType instead of
11228         manually resolving.
11229
11230         * statement.cs (Catch): Fix bug by using ResolveType.
11231
11232 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11233
11234         * expression.cs (BetterConversion): Special case for when we have
11235         a NullLiteral as the argument and we have to choose between string
11236         and object types - we choose string the way csc does.
11237
11238         * attribute.cs (Attribute.Resolve): Catch the
11239         NullReferenceException and report error #182 since the Mono
11240         runtime no more has the bug and having this exception raised means
11241         we tried to select a constructor which takes an object and is
11242         passed a null.
11243
11244 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11245
11246         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11247         message (1502, 1503) when we can't locate a method after overload
11248         resolution. This is much more informative and closes the bug
11249         Miguel reported.
11250
11251         * interface.cs (PopulateMethod): Return if there are no argument
11252         types. Fixes a NullReferenceException bug.
11253
11254         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11255         expressions too. Previously we were checking only in one place for
11256         positional arguments leaving out named arguments.
11257
11258         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11259         type to the enum type is not allowed. Remove code corresponding to
11260         that.
11261
11262         (ConvertNumericExplicit): Allow explicit conversions from
11263         the underlying type to enum type. This precisely follows the spec
11264         and closes a bug filed by Gonzalo.
11265
11266 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11267
11268         * compiler.csproj:
11269         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11270
11271 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11272
11273         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11274         it was important that we stored the right value after the
11275         reduction in `converted'.
11276
11277 2002-09-04  Martin Baulig  <martin@gnome.org>
11278
11279         * location.cs (Location.SymbolDocument): Use full pathnames for the
11280         source files.
11281
11282 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11283
11284         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11285         of the expression resolve mechanism, because that will catch the
11286         SimpleName error failures.
11287
11288         (Conditional): If we can not resolve the
11289         expression, return, do not crash.
11290
11291 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11292
11293         * cs-tokenizer.cs:
11294         (location): display token name instead of its number.
11295
11296 2002-08-28  Martin Baulig  <martin@gnome.org>
11297
11298         * expression.cs (Binary.ResolveOperator): Don't silently return
11299         but return an error if an operator cannot be applied between two
11300         enum types.
11301
11302 2002-08-28  Martin Baulig  <martin@gnome.org>
11303
11304         * class.cs (Constructor.Define): Set the permission attributes
11305         correctly instead of making all constructors public.
11306
11307 2002-08-28  Martin Baulig  <martin@gnome.org>
11308
11309         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11310         for private members before reporting a CS0103; if we find anything,
11311         it's a CS0122.
11312
11313 2002-08-28  Martin Baulig  <martin@gnome.org>
11314
11315         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11316         to check whether `closure_start_type == closure_invocation_type',
11317         we also need to check whether `m.DeclaringType == closure_invocation_type'
11318         before bypassing the permission checks.  We might be accessing
11319         protected/private members from the base class.
11320         (TypeManager.RealMemberLookup): Only set private_ok if private
11321         members were requested via BindingFlags.NonPublic.
11322
11323         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11324
11325         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11326         MethodGroupExpr.IsExplicitImpl if appropriate.
11327         (Invocation.DoResolve): Don't report the CS0120 for explicit
11328         interface implementations.
11329
11330 2002-08-27  Martin Baulig  <martin@gnome.org>
11331
11332         * expression.cs (Invocation.DoResolve): If this is a static
11333         method and we don't have an InstanceExpression, we must report
11334         a CS0120.
11335
11336 2002-08-25  Martin Baulig  <martin@gnome.org>
11337
11338         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11339         `==' between a valuetype and an object.
11340
11341 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11342
11343         * ecore.cs (TypeExpr): Provide a ToString method.
11344
11345 2002-08-24  Martin Baulig  <martin@gnome.org>
11346
11347         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11348         now called proggie.dbg and it's a binary file.
11349
11350 2002-08-23  Martin Baulig  <martin@gnome.org>
11351
11352         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11353
11354 2002-08-23  Martin Baulig  <martin@gnome.org>
11355
11356         * struct.cs (MyStructInfo.ctor): Make this work with empty
11357         structs; it's not allowed to use foreach() on null.
11358
11359 2002-08-23  Martin Baulig  <martin@gnome.org>
11360
11361         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11362         writer the full pathname of the generated assembly.
11363
11364 2002-08-23  Martin Baulig  <martin@gnome.org>
11365
11366         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11367         A `finally' block never returns or breaks; improved handling of
11368         unreachable code.
11369
11370 2002-08-23  Martin Baulig  <martin@gnome.org>
11371
11372         * statement.cs (Throw.Resolve): Allow `throw null'.
11373
11374 2002-08-23  Martin Baulig  <martin@gnome.org>
11375
11376         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11377         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11378         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11379         MemberLookup would return a wrong event if this is an explicit
11380         interface implementation and the class has an event with the same
11381         name.
11382
11383 2002-08-23  Martin Baulig  <martin@gnome.org>
11384
11385         * statement.cs (Block.AddChildVariableNames): New public method.
11386         (Block.AddChildVariableName): Likewise.
11387         (Block.IsVariableNameUsedInChildBlock): Likewise.
11388         (Block.AddVariable): Check whether a variable name has already
11389         been used in a child block.
11390
11391         * cs-parser.jay (declare_local_variables): Mark all variable names
11392         from the current block as being used in a child block in the
11393         implicit block.
11394
11395 2002-08-23  Martin Baulig  <martin@gnome.org>
11396
11397         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11398         find the symbol writer.
11399
11400         * driver.cs: csc also allows the arguments to /define being
11401         separated by commas, not only by semicolons.
11402
11403 2002-08-23  Martin Baulig  <martin@gnome.org>
11404
11405         * interface.cs (Interface.GetMembers): Added static check for events.
11406
11407 2002-08-15  Martin Baulig  <martin@gnome.org>
11408
11409         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11410         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11411
11412         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11413         why the MethodData.EmitDestructor() change was necessary.
11414
11415 2002-08-20  Martin Baulig  <martin@gnome.org>
11416
11417         * class.cs (TypeContainer.FindMembers): Added static check for events.
11418
11419         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11420
11421         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11422         use Type.GetEvents(), not Type.FindMembers().
11423
11424 2002-08-20  Martin Baulig  <martin@gnome.org>
11425
11426         * decl.cs (MemberCache): Added a special method cache which will
11427         be used for method-only searched.  This ensures that a method
11428         search will return a MethodInfo with the correct ReflectedType for
11429         inherited methods.      
11430
11431 2002-08-20  Martin Baulig  <martin@gnome.org>
11432
11433         * decl.cs (DeclSpace.FindMembers): Made this public.
11434
11435 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11436
11437         * delegate.cs: fixed build on windows.
11438         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11439
11440 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11441
11442         * ecore.cs (StandardConversionExists): Return a false
11443         if we are trying to convert the void type to anything else
11444         since that is not allowed.
11445
11446         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11447         we flag error 70 in the event an event is trying to be accessed
11448         directly from outside the declaring type.
11449
11450 2002-08-20  Martin Baulig  <martin@gnome.org>
11451
11452         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11453         MemberCache from typemanager.cs to decl.cs.
11454
11455 2002-08-19  Martin Baulig  <martin@gnome.org>
11456
11457         * class.cs (TypeContainer): Implement IMemberContainer.
11458         (TypeContainer.DefineMembers): Create the MemberCache.
11459         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11460         return public members if BindingFlags.Public was given, check
11461         whether members are static.
11462
11463 2002-08-16  Martin Baulig  <martin@gnome.org>
11464
11465         * decl.cs (DeclSpace.Define): Splitted this in Define and
11466         DefineMembers.  DefineMembers is called first and initializes the
11467         MemberCache.
11468
11469         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11470         DefineMembers() on all our DeclSpaces.
11471
11472         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11473         but call DefineMembers() on all nested interfaces.  We call their
11474         Define() in our new Define() function.
11475
11476         * interface.cs (Interface): Implement IMemberContainer.
11477         (Interface.Define): Moved all code except the attribute stuf to
11478         DefineMembers().
11479         (Interface.DefineMembers): Initialize the member cache.
11480
11481         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11482         need this anymore since we can use MemberCache.FindMembers directly.
11483
11484 2002-08-19  Martin Baulig  <martin@gnome.org>
11485
11486         * typemanager.cs (MemberCache): When creating the cache for an
11487         interface type, add all inherited members.
11488         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11489         to `out bool used_cache' and documented it.
11490         (TypeManager.MemberLookup): If we already used the cache in the first
11491         iteration, we don't need to do the interfaces check.
11492
11493 2002-08-19  Martin Baulig  <martin@gnome.org>
11494
11495         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11496         here from IMemberFinder and don't implement this interface anymore.
11497         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11498
11499         * typemanager.cs (IMemberFinder): This interface is now only used by
11500         classes which actually support the member cache.
11501         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11502         since we only put DeclSpaces into this Hashtable.
11503         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11504         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11505
11506 2002-08-16  Martin Baulig  <martin@gnome.org>
11507
11508         * typemanager.cs (ICachingMemberFinder): Removed.
11509         (IMemberFinder.MemberCache): New property.
11510         (TypeManager.FindMembers): Merged this with RealFindMembers().
11511         This function will never be called from TypeManager.MemberLookup()
11512         so we can't use the cache here, just the IMemberFinder.
11513         (TypeManager.MemberLookup_FindMembers): Check whether the
11514         IMemberFinder has a MemberCache and call the cache's FindMembers
11515         function.
11516         (MemberCache): Rewrote larger parts of this yet another time and
11517         cleaned it up a bit.
11518
11519 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11520
11521         * driver.cs (LoadArgs): Support quoting.
11522
11523         (Usage): Show the CSC-like command line arguments.
11524
11525         Improved a few error messages.
11526
11527 2002-08-15  Martin Baulig  <martin@gnome.org>
11528
11529         * typemanager.cs (IMemberContainer.Type): New property.
11530         (IMemberContainer.IsInterface): New property.
11531
11532         The following changes are conditional to BROKEN_RUNTIME, which is
11533         defined at the top of the file.
11534
11535         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11536         class'es members, but add all members from TypeHandle.ObjectType
11537         if we're an interface.
11538         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11539         is the current type.
11540         (MemberCache.CacheEntry.Container): Removed this field.
11541         (TypeHandle.GetMembers): Include inherited members.
11542
11543 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11544
11545         * typemanager.cs: fixed compilation and added a comment on a field that
11546         is never used.
11547
11548 2002-08-15  Martin Baulig  <martin@gnome.org>
11549
11550         * class.cs (ConstructorInitializer.Resolve): In the
11551         Expression.MemberLookup call, use the queried_type as
11552         invocation_type.
11553
11554         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11555         declared' attribute, it's always true.
11556         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11557         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11558         temporary wrapper for FindMembers which tells MemberLookup whether
11559         members from the base classes are included in the return value.
11560         This will go away soon.
11561         (TypeManager.MemberLookup): Use this temporary hack here; once the
11562         new MemberCache is completed, we don't need to do the DeclaredOnly
11563         looping here anymore since the MemberCache will take care of this.
11564         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11565         (MemberCache): When creating the MemberCache for a class, get
11566         members from the current class and all its base classes.
11567         (MemberCache.CacheEntry.Container): New field.  This is a
11568         temporary hack until the Mono runtime is fixed to distinguish
11569         between ReflectedType and DeclaringType.  It allows us to use MCS
11570         with both the MS runtime and the unfixed Mono runtime without
11571         problems and without accecting performance.
11572         (MemberCache.SearchMembers): The DeclaredOnly looping from
11573         TypeManager.MemberLookup is now done here.      
11574
11575 2002-08-14  Martin Baulig  <martin@gnome.org>
11576
11577         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11578         Type.GetFields on dynamic types but get the fields from the
11579         corresponding TypeContainer.
11580         (MyStructInfo.GetStructInfo): Added check for enum types.
11581
11582         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11583         (MemberList.SyncRoot): Implemented.
11584         (TypeManager.FilterWithClosure): No need to check permissions if
11585         closure_start_type == closure_invocation_type, don't crash if
11586         closure_invocation_type is null.
11587
11588 2002-08-13  Martin Baulig  <martin@gnome.org>
11589
11590         Rewrote TypeContainer.FindMembers to use a member cache.  This
11591         gives us a speed increase of about 35% for the self-hosting MCS
11592         build and of about 15-20% for the class libs (both on GNU/Linux).
11593
11594         * report.cs (Timer): New class to get enhanced profiling.  This
11595         whole class is "TIMER" conditional since it remarkably slows down
11596         compilation speed.
11597
11598         * class.cs (MemberList): New class.  This is an IList wrapper
11599         which we're now using instead of passing MemberInfo[]'s around to
11600         avoid copying this array unnecessarily.
11601         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11602         (ICachingMemberFinder, IMemberContainer): New interface.
11603         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11604         has already been checked, otherwise use it for the name comparision.
11605         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11606         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11607         if possible.  Returns a MemberList, not a MemberInfo [].
11608         (TypeHandle): New class, implements IMemberContainer.  We create
11609         one instance of this class per type, it contains a MemberCache
11610         which is used to do the member lookups.
11611         (MemberCache): New class.  Each instance of this class contains
11612         all members of a type and a name-based hash table.
11613         (MemberCache.FindMembers): This is our new member lookup
11614         function.  First, it looks up all members of the requested name in
11615         the hash table.  Then, it walks this list and sorts out all
11616         applicable members and returns them.
11617
11618 2002-08-13  Martin Baulig  <martin@gnome.org>
11619
11620         In addition to a nice code cleanup, this gives us a performance
11621         increase of about 1.4% on GNU/Linux - not much, but it's already
11622         half a second for the self-hosting MCS compilation.
11623
11624         * typemanager.cs (IMemberFinder): New interface.  It is used by
11625         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11626         Enum, Delegate or Interface.
11627         (TypeManager.finder_to_member_finder): New PtrHashtable.
11628         (TypeManager.finder_to_container): Removed.
11629         (TypeManager.finder_to_delegate): Removed.
11630         (TypeManager.finder_to_interface): Removed.
11631         (TypeManager.finder_to_enum): Removed.
11632
11633         * interface.cs (Interface): Implement IMemberFinder.
11634
11635         * delegate.cs (Delegate): Implement IMemberFinder.
11636
11637         * enum.cs (Enum): Implement IMemberFinder.
11638
11639         * class.cs (TypeContainer): Implement IMemberFinder.
11640
11641 2002-08-12  Martin Baulig  <martin@gnome.org>
11642
11643         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11644
11645 2002-08-12  Martin Baulig  <martin@gnome.org>
11646
11647         * ecore.cs (ITypeExpression): New interface for expressions which
11648         resolve to a type.
11649         (TypeExpression): Renamed to TypeLookupExpression.
11650         (Expression.DoResolve): If we're doing a types-only lookup, the
11651         expression must implement the ITypeExpression interface and we
11652         call DoResolveType() on it.
11653         (SimpleName): Implement the new ITypeExpression interface.
11654         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11655         hack, the situation that we're only looking up types can't happen
11656         anymore when this method is called.  Moved the type lookup code to
11657         DoResolveType() and call it.
11658         (SimpleName.DoResolveType): This ITypeExpression interface method
11659         is now doing the types-only lookup.
11660         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11661         (ResolveFlags): Added MaskExprClass.
11662
11663         * expression.cs (MemberAccess): Implement the ITypeExpression
11664         interface.
11665         (MemberAccess.DoResolve): Added support for a types-only lookup
11666         when we're called via ITypeExpression.DoResolveType().
11667         (ComposedCast): Implement the ITypeExpression interface.
11668
11669         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11670         Expression.Resolve() with ResolveFlags.Type instead.
11671
11672 2002-08-12  Martin Baulig  <martin@gnome.org>
11673
11674         * interface.cs (Interface.Define): Apply attributes.
11675
11676         * attribute.cs (Attribute.ApplyAttributes): Added support for
11677         interface attributes.
11678
11679 2002-08-11  Martin Baulig  <martin@gnome.org>
11680
11681         * statement.cs (Block.Emit): Only check the "this" variable if we
11682         do not always throw an exception.
11683
11684         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11685         whether the property has a set accessor.
11686
11687 2002-08-11  Martin Baulig  <martin@gnome.org>
11688
11689         Added control flow analysis support for structs.
11690
11691         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11692         with control flow analysis turned off.
11693         (IVariable): New interface.
11694         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11695         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11696         (FieldExpr.DoResolve): Resolve the instance expression with flow
11697         analysis turned off and do the definite assignment check after the
11698         resolving when we know what the expression will resolve to.
11699
11700         * expression.cs (LocalVariableReference, ParameterReference):
11701         Implement the new IVariable interface, only call the flow analysis
11702         code if ec.DoFlowAnalysis is true.
11703         (This): Added constructor which takes a Block argument.  Implement
11704         the new IVariable interface.
11705         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11706         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11707         This does the definite assignment checks for struct members.
11708
11709         * class.cs (Constructor.Emit): If this is a non-static `struct'
11710         constructor which doesn't have any initializer, call
11711         Block.AddThisVariable() to tell the flow analysis code that all
11712         struct elements must be initialized before control returns from
11713         the constructor.
11714
11715         * statement.cs (MyStructInfo): New public class.
11716         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11717         argument to this indexer.  If non-zero, check an individual struct
11718         member, not the whole struct.
11719         (FlowBranching.CheckOutParameters): Check struct members.
11720         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11721         overloaded versions of these methods which take an additional
11722         `int field_idx' argument to check struct members.
11723         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11724         overloaded versions of these methods which take an additional
11725         `string field_name' argument to check struct member.s
11726         (VariableInfo): Implement the IVariable interface.
11727         (VariableInfo.StructInfo): New public property.  Returns the
11728         MyStructInfo instance of the variable if it's a struct or null.
11729         (Block.AddThisVariable): New public method.  This is called from
11730         Constructor.Emit() for non-static `struct' constructor which do
11731         not have any initializer.  It creates a special variable for the
11732         "this" instance variable which will be checked by the flow
11733         analysis code to ensure that all of the struct's fields are
11734         initialized before control returns from the constructor.
11735         (UsageVector): Added support for struct members.  If a
11736         variable/parameter is a struct with N members, we reserve a slot
11737         in the usage vector for each member.  A struct is considered fully
11738         initialized if either the struct itself (slot 0) or all its
11739         members are initialized.
11740
11741 2002-08-08  Martin Baulig  <martin@gnome.org>
11742
11743         * driver.cs (Driver.MainDriver): Only report an error CS5001
11744         if there were no compilation errors.
11745
11746         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11747         `UnsafeContext' property to determine whether the parent is in
11748         unsafe context rather than checking the parent's ModFlags:
11749         classes nested in an unsafe class are unsafe as well.
11750
11751 2002-08-08  Martin Baulig  <martin@gnome.org>
11752
11753         * statement.cs (UsageVector.MergeChildren): Distinguish between
11754         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11755         we return.  Added test17() and test18() to test-154.cs.
11756
11757 2002-08-08  Martin Baulig  <martin@gnome.org>
11758
11759         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11760         Family access, make sure the invoking type isn't a subclass of the
11761         queried type (that'd be a CS1540).
11762
11763         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11764         this method which takes an additional `Type invocation_type'.
11765
11766         * expression.cs (BaseAccess.DoResolve): Use the base type as
11767         invocation and query type.
11768         (MemberAccess.DoResolve): If the lookup failed and we're about to
11769         report a CS0122, try a lookup with the ec.ContainerType - if this
11770         succeeds, we must report a CS1540.
11771
11772 2002-08-08  Martin Baulig  <martin@gnome.org>
11773
11774         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11775         (MethodGroupExpr): Implement the IMemberExpr interface.
11776
11777         * expression (MemberAccess.ResolveMemberAccess): No need to have
11778         any special code for MethodGroupExprs anymore, they're now
11779         IMemberExprs.   
11780
11781 2002-08-08  Martin Baulig  <martin@gnome.org>
11782
11783         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11784         Family, FamANDAssem and FamORAssem permissions.
11785         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11786
11787 2002-08-08  Martin Baulig  <martin@gnome.org>
11788
11789         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11790         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11791         or loop block.
11792
11793 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11794
11795         * driver.cs: implemented /resource option to embed managed resources.
11796
11797 2002-08-07  Martin Baulig  <martin@gnome.org>
11798
11799         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11800         (FieldBase.HasFieldInitializer): New public property.
11801         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11802         returns the field initializer and makes sure it is only resolved once.
11803         (TypeContainer.EmitFieldInitializers): Call
11804         FieldBase.GetInitializerExpression to get the initializer, this ensures
11805         that it isn't resolved multiple times.
11806
11807         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11808         the resolving process (SimpleName/MemberLookup) that we're currently
11809         emitting a field initializer (which must not access any instance members,
11810         this is an error CS0236).
11811
11812         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11813         argument, if the `IsFieldInitializer' flag is set, we must report and
11814         error CS0236 and not an error CS0120.   
11815
11816 2002-08-07  Martin Baulig  <martin@gnome.org>
11817
11818         * ecore.cs (IMemberExpr): New public interface.
11819         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11820         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11821         if the expression is an IMemberExpr.
11822
11823         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11824         to be null, implicitly default to `this' if we're non-static in
11825         this case.  Simplified the code a lot by using the new IMemberExpr
11826         interface.  Also fixed bug #28176 here.
11827
11828 2002-08-06  Martin Baulig  <martin@gnome.org>
11829
11830         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11831         ParameterReferences during semantic analysis so that we can do a
11832         type-only search when resolving Cast, TypeOf and SizeOf.
11833         (block): Pass the `current_local_parameters' to the Block's
11834         constructor.
11835
11836         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11837         argument to the constructor.
11838         (ConstructorInitializer.Resolve): Create a temporary implicit
11839         block with the parameters.
11840
11841         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11842         references here if we aren't doing a type-only search.
11843
11844         * statement.cs (Block): Added constructor which takes a
11845         `Parameters parameters' argument.
11846         (Block.Parameters): New public property.
11847
11848         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11849         to `Parameters' and made it public readonly.
11850
11851 2002-08-06  Martin Baulig  <martin@gnome.org>
11852
11853         * ecore.cs (Expression.Warning): Made this public as well.
11854
11855         * report.cs (Report.Debug): Print the contents of collections.
11856
11857 2002-08-06  Martin Baulig  <martin@gnome.org>
11858
11859         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11860         used to tell Resolve() which kinds of expressions it may return.
11861         (Expression.Resolve): Added overloaded version of this method which
11862         takes a `ResolveFlags flags' argument.  This can be used to tell
11863         Resolve() which kinds of expressions it may return.  Reports a
11864         CS0118 on error.
11865         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11866         ResolveFlags.SimpleName.
11867         (Expression.Error118): Added overloaded version of this method which
11868         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11869         which kinds of expressions are allowed.
11870
11871         * expression.cs (Argument.ResolveMethodGroup): New public method.
11872         Resolves an argument, but allows a MethodGroup to be returned.
11873         This is used when invoking a delegate.
11874
11875         * TODO: Updated a bit.
11876
11877 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11878
11879         Fixed compilation with csc.
11880
11881         * ecore.cs: Expression.Error made public. Is this correct? Should
11882         Warning be made public too?
11883
11884         * expression.cs: use ea.Location instead of ea.loc.
11885         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11886
11887 2002-08-06  Martin Baulig  <martin@gnome.org>
11888
11889         * ecore.cs (Expression.loc): Moved the location here instead of
11890         duplicating it in all derived classes.
11891         (Expression.Location): New public property.
11892         (Expression.Error, Expression.Warning): Made them non-static and
11893         removed the location argument.
11894         (Expression.Warning): Added overloaded version which takes an
11895         `int level' argument.
11896         (Expression.Error118): Make this non-static and removed the
11897         expression and location arguments.
11898         (TypeExpr): Added location argument to the constructor.
11899
11900         * expression.cs (StaticCallExpr): Added location argument to
11901         the constructor.
11902         (Indirection, PointerArithmetic): Likewise.
11903         (CheckedExpr, UnCheckedExpr): Likewise.
11904         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11905         (StringPtr): Likewise.
11906
11907
11908 2002-08-05  Martin Baulig  <martin@gnome.org>
11909
11910         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11911
11912         * assign.cs (Assign.DoResolve): Check whether the source
11913         expression is a value or variable.
11914
11915         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11916         while resolving the corresponding blocks.
11917
11918         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11919         an error, don't silently return null.
11920
11921         * statement.cs (Block.AddVariable): Do the error reporting here
11922         and distinguish between CS0128 and CS0136.
11923         (Block.DoResolve): Report all unused labels (warning CS0164).
11924         (LabeledStatement): Pass the location to the constructor.
11925         (LabeledStatement.HasBeenReferenced): New property.
11926         (LabeledStatement.Resolve): Set it to true here.
11927
11928         * statement.cs (Return.Emit): Return success even after reporting
11929         a type mismatch error (CS0126 or CS0127), this is what csc does and
11930         it avoids confusing the users with any consecutive errors.
11931
11932 2002-08-05  Martin Baulig  <martin@gnome.org>
11933
11934         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11935
11936         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11937
11938         * expression.cs (MemberAccess.DoResolve): Silently return if an
11939         error has already been reported.
11940
11941         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11942         error has already been reported.
11943
11944 2002-08-05  Martin Baulig  <martin@gnome.org>
11945
11946         * statement.cs (UsageVector): Only initialize the `parameters'
11947         vector if we actually have any "out" parameters.
11948
11949 2002-08-05  Martin Baulig  <martin@gnome.org>
11950
11951         * expression.cs (Binary.ResolveOperator): When combining delegates,
11952         they must have the same type.
11953
11954 2002-08-05  Martin Baulig  <martin@gnome.org>
11955
11956         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11957         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11958         work with the ms runtime and we also don't need it: if we're a
11959         PropertyBuilder and not in the `indexer_arguments' hash, then we
11960         are a property and not an indexer.
11961
11962         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11963         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11964         since the latter one doesn't work with the ms runtime.
11965
11966 2002-08-03  Martin Baulig  <martin@gnome.org>
11967
11968         Fixed bugs #27998 and #22735.
11969
11970         * class.cs (Method.IsOperator): New public field.
11971         (Method.CheckBase): Report CS0111 if there's already a method
11972         with the same parameters in the current class.  Report CS0508 when
11973         attempting to change the return type of an inherited method.
11974         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11975         and it's not marked abstract or extern.
11976         (PropertyBase): New abstract base class for Property and Indexer.
11977         (PropertyBase.CheckBase): Moved here from Property and made it work
11978         for indexers.
11979         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11980         the same so we can reuse it there.
11981         (Property, Indexer): Derive from PropertyBase.
11982         (MethodSignature.inheritable_property_signature_filter): New delegate
11983         to find properties and indexers.
11984
11985         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11986         argument and improved error reporting.
11987
11988         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11989         EmptyReadOnlyParameters and made it a property.
11990
11991         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11992         version of this method which takes a `PropertyInfo indexer'.
11993         (TypeManager.RegisterIndexer): New method.
11994
11995         * class.cs: Added myself as author of this file :-)
11996
11997 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11998
11999         * class.cs: fixed compilation on windoze.
12000
12001 2002-08-03  Martin Baulig  <martin@gnome.org>
12002
12003         * interface.cs (Interface.GetInterfaceBases): Check whether all
12004         base interfaces are at least as accessible than the current one.
12005
12006         * class.cs (TypeContainer.GetClassBases): Check whether base types
12007         are at least as accessible than the current type.
12008         (TypeContainer.AsAccessible): Implemented and made non-static.
12009         (MemberBase.CheckParameters): Report errors if the accessibility
12010         checks fail.
12011
12012         * delegate.cs (Delegate.Delegate): The default visibility is
12013         internal for top-level types and private for nested types.
12014         (Delegate.Define): Report errors if the accessibility checks fail.
12015
12016         * enum.cs (Enum.Enum): The default visibility is internal for
12017         top-level types and private for nested types.
12018         (Enum.DefineType): Compute the correct visibility.
12019
12020         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12021         function which takes a `bool is_toplevel' instead of a TypeContainer.
12022
12023         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12024         builtin type.
12025
12026 2002-08-02  Martin Baulig  <martin@gnome.org>
12027
12028         * expression.cs (LocalVariableReferenc): Added constructor which
12029         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12030         (LocalVariableReference.IsReadOnly): New property.
12031         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12032         variable is readonly, use our own readonly flag to do this; you can
12033         use the new constructor to get a writable reference to a read-only
12034         variable.
12035
12036         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12037         reference to the local variable.
12038
12039 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12040
12041         * rootcontext.cs (ResolveCore): Also include System.Exception
12042
12043         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12044         we reach an EmptyStatement.
12045
12046         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12047         is also fine.
12048
12049         * expression.cs (Binary.ResolveOperator): Check error result in
12050         two places.
12051
12052         use brtrue/brfalse directly and avoid compares to null.
12053
12054 2002-08-02  Martin Baulig  <martin@gnome.org>
12055
12056         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12057         Fixes bug #28407, added test-155.cs.
12058
12059 2002-08-01  Martin Baulig  <martin@gnome.org>
12060
12061         * class.cs (Event.EmitDefaultMethod): Make this work with static
12062         events.  Fixes #28311, added verify-3.cs.
12063
12064 2002-08-01  Martin Baulig  <martin@gnome.org>
12065
12066         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12067         `is_disposable' fields.
12068         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12069         `hm.is_disposable' if we're using the collection pattern.
12070         (Foreach.EmitCollectionForeach): Use the correct type for the
12071         enumerator's local variable, only emit the try/finally block if
12072         necessary (fixes #27713).
12073
12074 2002-08-01  Martin Baulig  <martin@gnome.org>
12075
12076         * ecore.cs (Expression.report118): Renamed to Error118 and made
12077         it public static.
12078
12079         * statement.cs (Throw.Resolve): Check whether the expression is of
12080         the correct type (CS0118) and whether the type derives from
12081         System.Exception (CS0155).
12082         (Catch.Resolve): New method.  Do the type lookup here and check
12083         whether it derives from System.Exception (CS0155).
12084         (Catch.CatchType, Catch.IsGeneral): New public properties.
12085
12086         * typemanager.cs (TypeManager.exception_type): Added.
12087
12088 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12089
12090         * driver.cs: Updated About function.
12091
12092 2002-07-31  Martin Baulig  <martin@gnome.org>
12093
12094         Implemented Control Flow Analysis.
12095
12096         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12097         (EmitContext.CurrentBranching): Added.
12098         (EmitContext.StartFlowBranching): Added.
12099         (EmitContext.EndFlowBranching): Added.
12100         (EmitContext.KillFlowBranching): Added.
12101         (EmitContext.IsVariableAssigned): Added.
12102         (EmitContext.SetVariableAssigned): Added.
12103         (EmitContext.IsParameterAssigned): Added.
12104         (EmitContext.SetParameterAssigned): Added.
12105         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12106         Added control flow analysis stuff here.
12107
12108         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12109         resolve the expression as lvalue.
12110         (LocalVariableReference.DoResolve): Check whether the variable has
12111         already been assigned.
12112         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12113         the parameter as assigned here.
12114         (ParameterReference.DoResolve): Check whether the parameter has already
12115         been assigned.
12116         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12117         expression as lvalue.
12118
12119         * statement.cs (FlowBranching): New class for the flow analysis code.
12120         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12121         (LabeledStatement.IsDefined): New public property.
12122         (LabeledStatement.AddUsageVector): New public method to tell flow
12123         analyis that the label may be reached via a forward jump.
12124         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12125         flow analysis.
12126         (VariableInfo.Number): New public field.  This is used by flow analysis
12127         to number all locals of a block.
12128         (Block.CountVariables): New public property.  This is the number of
12129         local variables in this block (including the locals from all parent
12130         blocks).
12131         (Block.EmitMeta): Number all the variables.
12132
12133         * statement.cs: Added flow analysis support to all classes.
12134
12135 2002-07-31  Martin Baulig  <martin@gnome.org>
12136
12137         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12138         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12139         then use this argument.
12140
12141         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12142
12143         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12144         use this to specify /define options.
12145
12146 2002-07-29  Martin Baulig  <martin@gnome.org>
12147
12148         * statement.cs (Fixed): Moved all code that does variable lookups
12149         and resolvings from Emit to Resolve.
12150
12151         * statement.cs (For): Moved all code that does variable lookups
12152         and resolvings from Emit to Resolve.
12153
12154         * statement.cs (Using): Moved all code that does variable lookups
12155         and resolvings from Emit to Resolve.
12156
12157 2002-07-29  Martin Baulig  <martin@gnome.org>
12158
12159         * attribute.cs (Attribute.Resolve): Explicitly catch a
12160         System.NullReferenceException when creating the
12161         CustromAttributeBuilder and report a different warning message.
12162
12163 2002-07-29  Martin Baulig  <martin@gnome.org>
12164
12165         * support.cs (ParameterData.ParameterName): Added method to
12166         get the name of a parameter.
12167
12168         * typemanager.cs (TypeManager.IsValueType): New public method.
12169
12170 2002-07-29  Martin Baulig  <martin@gnome.org>
12171
12172         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12173         is a flag which specifies that it's either ref or out.
12174         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12175         the out parameter to `out Parameter.Modifier mod', also set the
12176         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12177
12178         * support.cs (InternalParameters.ParameterModifier): Distinguish
12179         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12180         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12181
12182         * expression.cs (Argument.GetParameterModifier): Distinguish
12183         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12184         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12185
12186 2002-07-29  Martin Baulig  <martin@gnome.org>
12187
12188         * expression.cs (ParameterReference.ParameterReference): Added
12189         `Location loc' argument to the constructor.
12190
12191         * cs-parser.jay: Pass location to ParameterReference.
12192
12193 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12194
12195         * statement.cs (Try): Initialize the location.
12196
12197         * cs-parser.jay: pass location to Try.
12198
12199         * expression.cs (Unary.Reduce): Change the prototype to return
12200         whether a constant fold could be performed or not.  The result is
12201         returned in an out parameters.  In the case of Indirection and
12202         AddressOf, we want to perform the full tests.
12203
12204 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12205
12206         * statement.cs (Statement.Emit): Flag dead code.
12207
12208 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12209
12210         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12211
12212 2002-07-27  Martin Baulig  <martin@gnome.org>
12213
12214         * class.cs (MethodData.Define): Put back call to
12215         TypeManager.AddMethod(), accidentally commented this out.
12216
12217         * report.cs (Debug): New public method to print debugging information,
12218         this is `[Conditional ("DEBUG")]'.
12219
12220 2002-07-26  Martin Baulig  <martin@gnome.org>
12221
12222         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12223         (switch_statement): Push the current_block to the switch_stack and
12224         pop it again when we're done with the switch.
12225         (switch_section): The new block is a child of the current_block.
12226         Fixes bug #24007, added test-152.cs.
12227
12228 2002-07-27  Martin Baulig  <martin@gnome.org>
12229
12230         * expression.cs (Invocation.EmitArguments): When calling a varargs
12231         function with only its fixed arguments, we need to pass an empty
12232         array.
12233
12234 2002-07-27  Martin Baulig  <martin@gnome.org>
12235
12236         Mono 0.13 has been released.
12237
12238 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12239
12240         * driver.cs: Rename --resource to --linkres, because that is what
12241         we do currently, we dont support --resource yet.
12242
12243         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12244
12245 2002-07-25  Martin Baulig  <martin@gnome.org>
12246
12247         * class.cs (MethodData): New public class.  This is a `method builder'
12248         class for a method or one accessor of a Property/Indexer/Event.
12249         (MethodData.GetMethodFlags): Moved here from MemberBase.
12250         (MethodData.ApplyAttributes): Likewise.
12251         (MethodData.ApplyObsoleteAttribute): Likewise.
12252         (MethodData.ApplyConditionalAttribute): Likewise.
12253         (MethodData.ApplyDllImportAttribute): Likewise.
12254         (MethodData.CheckAbstractAndExternal): Likewise.
12255         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12256         (MethodData.Emit): Formerly known as Method.Emit().
12257         (MemberBase): Moved everything which was specific to a single
12258         accessor/method to MethodData.
12259         (Method): Create a new MethodData and call Define() and Emit() on it.
12260         (Property, Indexer, Event): Create a new MethodData objects for each
12261         accessor and call Define() and Emit() on them.
12262
12263 2002-07-25  Martin Baulig  <martin@gnome.org>
12264
12265         Made MethodCore derive from MemberBase to reuse the code from there.
12266         MemberBase now also checks for attributes.
12267
12268         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12269         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12270         as virtual.
12271         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12272         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12273         (MemberBase.ApplyAttributes): New virtual method; applies the
12274         attributes to a method or accessor.
12275         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12276         (MemberBase.ApplyConditionalAttribute): Likewise.
12277         (MemberBase.ApplyDllImportAttribute): Likewise.
12278         (MemberBase.CheckAbstractAndExternal): Likewise.
12279         (MethodCore.ParameterTypes): This is now a property instead of a
12280         method, it's initialized from DoDefineParameters().
12281         (MethodCore.ParameterInfo): Removed the set accessor.
12282         (MethodCore.DoDefineParameters): New protected virtual method to
12283         initialize ParameterTypes and ParameterInfo.
12284         (Method.GetReturnType): We can now simply return the MemberType.
12285         (Method.GetMethodFlags): Override the MemberBase version and add
12286         the conditional flags.
12287         (Method.CheckBase): Moved some code from Define() here, call
12288         DoDefineParameters() here.
12289         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12290         here to avoid some larger code duplication.
12291         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12292         ensure that abstract and external accessors don't declare a body.
12293
12294         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12295         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12296         lookup in the attribute's parent classes, so we need to abort as soon
12297         as we found the first match.
12298         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12299         the attribute has no arguments.
12300
12301         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12302         of a Method.
12303
12304 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12305
12306         * cs-parser.jay: reverted previous patch.
12307
12308 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12309
12310         * cs-parser.jay: fixed bug #22119.
12311
12312 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12313
12314         * attribute.cs: fixed compilation. The error was:
12315         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12316         be assigned to before control leaves the current method."
12317         [FIXME:  Filed as bug #28186: MCS must report this error.]
12318
12319 2002-07-25  Martin Baulig  <martin@gnome.org>
12320
12321         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12322         method to pull the condition name ouf of a Conditional attribute.
12323         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12324         the obsolete message and error flag out of an Obsolete attribute.
12325
12326         * class.cs (Method.GetMethodFlags): New public method to get the
12327         TypeManager.MethodFlags for this method.
12328         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12329         private methods.
12330         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12331         if we're overriding a virtual function, set the new private variable
12332         `parent_method'; call the new TypeManager.AddMethod().
12333
12334         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12335         the MethodBuilder and the Method in a PtrHashtable.
12336         (TypeManager.builder_to_method): Added for this purpose.
12337         (TypeManager.MethodFlags): Added IsObsoleteError.
12338         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12339         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12340         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12341         the message from the attribute.
12342
12343 2002-07-24  Martin Baulig  <martin@gnome.org>
12344
12345         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12346         preprocessor directives, ensure that the argument to #define/#undef is
12347         exactly one identifier and that it's actually an identifier.
12348
12349         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12350         did not work ....
12351
12352 2002-07-24  Martin Baulig  <martin@gnome.org>
12353
12354         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12355         initialize it to TypeManager.object_type in the constructor.
12356         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12357         of the `hm.get_current' method if we're using the collection pattern.
12358         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12359         for the explicit conversion to make it work when we're using the collection
12360         pattern and the `Current' property has a different return type than `object'.
12361         Fixes #27713.
12362
12363 2002-07-24  Martin Baulig  <martin@gnome.org>
12364
12365         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12366         does not match, but don't report any errors.  This method is called in
12367         order for all methods in a MethodGroupExpr until a matching method is
12368         found, so we don't want to bail out if the first method doesn't match.
12369         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12370         matches, report the 123.  Fixes #28070.
12371
12372 2002-07-24  Martin Baulig  <martin@gnome.org>
12373
12374         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12375         TypeManager.TypeToCoreType() to the top of the method so the
12376         following equality checks will work.  Fixes #28107.
12377
12378 2002-07-24  Martin Baulig  <martin@gnome.org>
12379
12380         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12381         operand is of type uint, and the other operand is of type sbyte,
12382         short or int, the operands are converted to type long." -
12383         Actually do what this comment already told us.  Fixes bug #28106,
12384         added test-150.cs.
12385
12386 2002-07-24  Martin Baulig  <martin@gnome.org>
12387
12388         * class.cs (MethodBase): New abstract class.  This is now a base
12389         class for Property, Indexer and Event to avoid some code duplication
12390         in their Define() and DefineMethods() methods.
12391         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12392         generic methods for Define() and DefineMethods().
12393         (FieldBase): Derive from MemberBase, not MemberCore.
12394         (Property): Derive from MemberBase, not MemberCore.
12395         (Property.DefineMethod): Moved all the code from this method to the
12396         new MethodBase.DefineAccessor(), just call it with appropriate
12397         argumetnts.
12398         (Property.Define): Call the new Property.DoDefine(), this does some
12399         sanity checks and we don't need to duplicate the code everywhere.
12400         (Event): Derive from MemberBase, not MemberCore.
12401         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12402         accessors, this will also make them work with interface events.
12403         (Indexer): Derive from MemberBase, not MemberCore.
12404         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12405         (Indexer.Define): Use the new MethodBase functions.
12406
12407         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12408         argument to the constructor.
12409         (Interface.FindMembers): Added support for interface events.
12410         (Interface.PopluateEvent): Implemented.
12411
12412         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12413
12414 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12415
12416         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12417         but this is required to check for a method name being the same as
12418         the containing class.  
12419
12420         Handle this now.
12421
12422 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12423
12424         * interface.cs: initialize variable.
12425
12426 2002-07-23  Martin Baulig  <martin@gnome.org>
12427
12428         Implemented the IndexerName attribute in interfaces.
12429
12430         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12431         name if this is an explicit interface implementation.
12432         (Indexer.InterfaceIndexerName): New public variable.  If we're
12433         implementing an interface indexer, this is the IndexerName in that
12434         interface.  Otherwise, it's the IndexerName.
12435         (Indexer.DefineMethod): If we're implementing interface indexer,
12436         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12437         and Pending.ImplementIndexer methods.
12438         (Indexer.Define): Also define the PropertyBuilder if we're
12439         implementing an interface indexer and this is neither an explicit
12440         interface implementation nor do the IndexerName match the one in
12441         the interface.
12442
12443         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12444         If a method is defined here, then we always need to create a proxy
12445         for it.  This is used when implementing interface indexers.
12446         (Pending.IsInterfaceIndexer): New public method.
12447         (Pending.ImplementIndexer): New public method.
12448         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12449         This is used when implementing interface indexers to define a proxy
12450         if necessary.
12451         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12452         define a proxy if necessary.
12453
12454         * interface.cs (Interface.IndexerName): New public variable.
12455         (Interface.PopulateIndexer): Set the IndexerName.
12456         (Interface.DefineIndexers): New private method.  Populate all the
12457         indexers and make sure their IndexerNames match.
12458
12459         * typemanager.cs (IndexerPropertyName): Added support for interface
12460         indexers.
12461
12462 2002-07-22  Martin Baulig  <martin@gnome.org>
12463
12464         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12465         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12466         ret if HasReturnLabel.
12467         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12468         variables.
12469
12470         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12471         and set the ec.LoopBeginTryCatchLevel.
12472         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12473         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12474         the current ec.TryCatchLevel, the branch goes out of an exception
12475         block.  In this case, we need to use Leave and not Br.
12476
12477 2002-07-22  Martin Baulig  <martin@gnome.org>
12478
12479         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12480         block unless the block does not always return or it is contained in
12481         another try { ... } catch { ... } block.  Fixes bug #26506.
12482         Added verify-1.cs to the test suite.
12483
12484 2002-07-22  Martin Baulig  <martin@gnome.org>
12485
12486         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12487         then we do not always return.  Fixes bug #24985.
12488
12489 2002-07-22  Martin Baulig  <martin@gnome.org>
12490
12491         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12492         lookup on a per-class level; ie. walk up the class hierarchy until we
12493         found at least one applicable method, then choose the best among them.
12494         Fixes bug #24463 and test-29.cs.
12495
12496 2002-07-22  Martin Baulig  <martin@gnome.org>
12497
12498         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12499         return types of the methods.  The return type is not part of the
12500         signature and we must not check it to make the `new' modifier work.
12501         Fixes bug #27999, also added test-147.cs.
12502         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12503
12504         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12505         on the method's return type.
12506
12507 2002-07-21  Martin Baulig  <martin@gnome.org>
12508
12509         * assign.cs: Make this work if the rightmost source is a constant and
12510         we need to do an implicit type conversion.  Also adding a few more tests
12511         to test-38.cs which should have caught this.
12512
12513         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12514         target in the makefile for this.  The makefile.gnu is primarily intended
12515         for end-users who don't want to debug the compiler.
12516
12517 2002-07-21  Martin Baulig  <martin@gnome.org>
12518
12519         * assign.cs: Improved the Assign class so it can now handle embedded
12520         assignments (X = Y = Z = something).  As a side-effect this'll now also
12521         consume less local variables.  test-38.cs now passes with MCS, added
12522         a few new test cases to that test.
12523
12524 2002-07-20  Martin Baulig  <martin@gnome.org>
12525
12526         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12527         instructions.  Fixes bug #27977, also added test-146.cs.
12528
12529 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12530
12531         * cs-tokenizer.cs: fixed getHex ().
12532
12533 2002-07-19  Martin Baulig  <martin@gnome.org>
12534
12535         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12536         not Type.GetType() to lookup the array type.  This is needed when
12537         we're constructing an array of a user-defined type.
12538         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12539         single-dimensional arrays, but also for single-dimensial arrays of
12540         type decimal.
12541
12542 2002-07-19  Martin Baulig  <martin@gnome.org>
12543
12544         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12545         this function is called, it's not allowed to share LocalBuilders
12546         among ILGenerators.
12547
12548 2002-07-19  Martin Baulig  <martin@gnome.org>
12549
12550         * expression.cs (Argument.Resolve): Report an error 118 when trying
12551         to pass a type as argument.
12552
12553 2002-07-18  Martin Baulig  <martin@gnome.org>
12554
12555         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12556         Conv_R_Un for the signed `long' type.
12557
12558 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12559
12560         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12561         `expr' for the temporary result, as that will fail if we do
12562         multiple resolves on the same expression.
12563
12564 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12565
12566         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12567         ec.TypeContainer for looking up aliases. 
12568
12569         * class.cs (TypeContainer): Remove LookupAlias from here.
12570
12571         * decl.cs (DeclSpace); Move here.
12572
12573 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12574
12575         * class.cs (FindMembers): Only call filter if the constructor
12576         bulider is not null.
12577
12578         Also handle delegates in `NestedTypes' now.  Now we will perform
12579         type lookups using the standard resolution process.  This also
12580         fixes a bug.
12581
12582         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12583         This uses Expressions (the limited kind that can be parsed by the
12584         tree) instead of strings.
12585
12586         * expression.cs (ComposedCast.ToString): Implement, used to flag
12587         errors since now we have to render expressions.
12588
12589         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12590         FormArrayType. 
12591
12592         * ecore.cs (SimpleName.ToString): ditto.
12593
12594         * cs-parser.jay: Instead of using strings to assemble types, use
12595         Expressions to assemble the type (using SimpleName, ComposedCast,
12596         MemberAccess).  This should fix the type lookups in declarations,
12597         because we were using a different code path for this.
12598
12599         * statement.cs (Block.Resolve): Continue processing statements
12600         even when there is an error.
12601
12602 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12603
12604         * class.cs (Event.Define): Also remove the `remove' method from
12605         the list of pending items.
12606
12607         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12608         generate more compact code. 
12609
12610 2002-07-17  Martin Baulig  <martin@gnome.org>
12611
12612         * const.cs (Const.LookupConstantValue): Add support for constant
12613         `unchecked' and `checked' expressions.
12614         Also adding test case test-140.cs for this.
12615
12616 2002-07-17  Martin Baulig  <martin@gnome.org>
12617
12618         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12619         check whether mi.ReturnType implements the IEnumerator interface; the
12620         `==' and the IsAssignableFrom() will fail in this situation.
12621
12622 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12623
12624         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12625         here too.
12626
12627 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12628
12629         * expression.cs: fixed bug #27811.
12630
12631 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12632
12633         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12634         Molaro: when we are a ref, the value already contains a pointer
12635         value, do not take the address of it.
12636
12637 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12638         * removed mb-parser.jay and mb-tokenizer.cs
12639
12640 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12641
12642         * expression.cs: check against the building corlib void type.
12643
12644 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12645
12646         * ecore.cs: fix for valuetype static readonly fields: when 
12647         initializing them, we need their address, not the address of a copy.
12648
12649 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12650
12651         * typemanager.cs: register also enum_type in corlib.
12652
12653 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12654
12655         * class.cs: allow calling this (but not base) initializers in structs.
12656
12657 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12658
12659         * ecore.cs: make sure we compare against the building base types
12660         in GetTypeSize ().
12661
12662 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12663
12664         * typemanager.cs: fix TypeToCoreType() to handle void and object
12665         (corlib gets no more typerefs after this change).
12666
12667 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12668
12669         * expression.cs (ArrayCreation.EmitArrayArguments): use
12670         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12671
12672         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12673         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12674         array indexes, the runtime actually forbids them.
12675
12676         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12677         for array arguments here.
12678
12679         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12680         instead of the default for ValueTypes.
12681
12682         (New.DoEmit): Use IsValueType instead of
12683         IsSubclassOf (value_type)
12684         (New.DoResolve): ditto.
12685         (Invocation.EmitCall): ditto.
12686
12687         * assign.cs (Assign): ditto.
12688
12689         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12690         Statements *are* currently doing part of their resolution during
12691         Emit.  
12692
12693         Expressions do always resolve during resolve, but statements are
12694         only required to propagate resolution to their children.
12695
12696 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12697
12698         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12699
12700         (LoadAssembly): Do not add the dll if it is already specified
12701
12702         (MainDriver): Add the System directory to the link path at the end,
12703         after all the other -L arguments. 
12704
12705         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12706         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12707         ldelem.u1) and using the opposite for sbytes.
12708
12709         This fixes Digger, and we can finally run it.
12710
12711         * driver.cs (UnixParseOption): Move the option parsing here.  
12712         (CSCParseOption): Implement CSC-like parsing of options.
12713
12714         We now support both modes of operation, the old Unix way, and the
12715         new CSC-like way.  This should help those who wanted to make cross
12716         platform makefiles.
12717
12718         The only thing broken is that /r:, /reference: and /lib: are not
12719         implemented, because I want to make those have the same semantics
12720         as the CSC compiler has, and kill once and for all the confussion
12721         around this.   Will be doing this tomorrow.
12722
12723         * statement.cs (Unsafe.Resolve): The state is checked during
12724         resolve, not emit, so we have to set the flags for IsUnsfe here.
12725
12726 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12727
12728         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12729         not catch the Error_ObjectRefRequired in SimpleName (as it is
12730         possible to have a class/instance variable name that later gets
12731         deambiguated), we have to check this here.      
12732
12733 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12734
12735         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12736         make static and put into Expression.
12737
12738         (Event.Define): Register the private field of the event with the 
12739         TypeManager so that GetFieldFromEvent can get at it.
12740
12741         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12742         keep track of the private field associated with an event which
12743         has no accessors.
12744
12745         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12746         private field.
12747
12748         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12749
12750 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12751
12752         * expression.cs (Binary.EmitBranchable): this routine emits the
12753         Binary expression in a branchable context.  This basically means:
12754         we need to branch somewhere, not just get the value on the stack.
12755
12756         This works together with Statement.EmitBoolExpression.
12757
12758         * statement.cs (Statement.EmitBoolExpression): Use
12759         EmitBranchable. 
12760
12761 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12762
12763         * statement.cs (For): Reduce the number of jumps in loops.
12764
12765         (For): Implement loop inversion for the For statement.
12766
12767         (Break): We can be breaking out of a Try/Catch controlled section
12768         (foreach might have an implicit try/catch clause), so we need to
12769         use Leave instead of Br.
12770
12771         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12772         now).  If the instace expression supports IMemoryLocation, we use
12773         the AddressOf method from the IMemoryLocation to extract the
12774         address instead of emitting the instance.
12775
12776         This showed up with `This', as we were emitting the instance
12777         always (Emit) instead of the Address of This.  Particularly
12778         interesting when This is a value type, as we dont want the Emit
12779         effect (which was to load the object).
12780
12781 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12782
12783         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12784
12785         * statement.cs (Checked): Set the CheckedState during the resolve
12786         process too, as the ConvCast operations track the checked state on
12787         the resolve process, and not emit.
12788
12789         * cs-parser.jay (namespace_member_declaration): Flag that we have
12790         found a declaration when we do.  This is used to flag error 1529
12791
12792         * driver.cs: Report ok when we display the help only.
12793
12794 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12795
12796         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12797
12798 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12799
12800         * cs-tokenizer.cs (define): We also have to track locally the
12801         defines.  AllDefines is just used for the Conditional Attribute,
12802         but we also need the local defines for the current source code. 
12803
12804 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12805
12806         * statement.cs (While, For, Do): These loops can exit through a
12807         Break statement, use this information to tell whether the
12808         statement is the last piece of code.
12809
12810         (Break): Flag that we break.
12811
12812         * codegen.cs (EmitContexts): New `Breaks' state variable.
12813
12814 2002-07-03  Martin Baulig  <martin@gnome.org>
12815
12816         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12817         modifiers in method declarations in structs.  Otherwise, you won't
12818         be able to override things like Object.Equals().
12819
12820 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12821
12822         * class.cs (Method, Property, Indexer): Do not allow the public
12823         modifier to be used in explicit interface implementations.
12824
12825         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12826         override modifiers in method declarations in structs
12827
12828 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12829
12830         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12831         integer or real overflow, report an error
12832
12833 2002-07-02  Martin Baulig  <martin@gnome.org>
12834
12835         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12836         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12837         to tell the runtime about our newly created System.Object and
12838         System.ValueType types.
12839
12840 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12841
12842         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12843         struct instead of Ldarg/Starg.
12844
12845 2002-07-02  Martin Baulig  <martin@gnome.org>
12846
12847         * expression.cs (Indirection.Indirection): Call
12848         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12849
12850 2002-07-02  Martin Baulig  <martin@gnome.org>
12851
12852         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12853         ValueType, call TypeManager.TypeToCoreType() on it.
12854         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12855         the OpCodes.Newarr argument.
12856
12857 2002-07-02  Martin Baulig  <martin@gnome.org>
12858
12859         * expression.cs (Invocation.EmitCall): When compiling corlib,
12860         replace all calls to the system's System.Array type to calls to
12861         the newly created one.
12862
12863         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12864         System.Array methods.
12865         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12866         from the system's System.Array type which must be replaced.
12867
12868 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12869
12870         * typemanager.cs: load unverifiable_code_ctor so we can build
12871         corlib using the correct type. Avoid using GetTypeCode() with
12872         TypeBuilders.
12873         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12874         TypeManager.object_type to allow building corlib.
12875
12876 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12877
12878         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12879
12880 2002-07-01  Martin Baulig  <martin@gnome.org>
12881
12882         * class.cs: Make the last change actually work, we need to check
12883         whether `ifaces != null' to avoid a crash.
12884
12885 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12886
12887         * class.cs: when we build structs without fields that implement
12888         interfaces, we need to add the interfaces separately, since there is
12889         no API to both set the size and add the interfaces at type creation
12890         time.
12891
12892 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12893
12894         * expression.cs: the dimension arguments to the array constructors
12895         need to be converted if they are a long.
12896
12897 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12898
12899         * class.cs: don't emit ldarg.0 if there is no parent constructor
12900         (fixes showstopper for corlib).
12901
12902 2002-06-29  Martin Baulig  <martin@gnome.org>
12903
12904         MCS now compiles corlib on GNU/Linux :-)
12905
12906         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12907         ie. check for MethodImplOptions.InternalCall.
12908
12909         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12910         and TypeManager.attribute_type are null, so we must explicitly check
12911         whether parent is not null to find out whether it's an attribute type.
12912         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12913         and SetBuilder, not only if the property is neither abstract nor external.
12914         This is necessary to set the MethodImplOptions on the accessor methods.
12915         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12916         SetBuilder, see Property.Emit().
12917
12918         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12919         populate "System.Object", "System.ValueType" and "System.Attribute" since
12920         they've already been populated from BootCorlib_PopulateCoreTypes().
12921
12922 2002-06-29  Martin Baulig  <martin@gnome.org>
12923
12924         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12925         is the NullLiteral, we also need to make sure that target_type is not
12926         an enum type.   
12927
12928 2002-06-29  Martin Baulig  <martin@gnome.org>
12929
12930         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12931         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12932         before calling BootstrapCorlib_ResolveDelegate ().
12933
12934 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12935
12936         * statement.cs: fixed build-breaker. All tests passed ok.
12937
12938 2002-06-27  Martin Baulig  <martin@gnome.org>
12939
12940         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12941         for System.Decimal when compiling corlib.
12942
12943 2002-06-27  Martin Baulig  <martin@gnome.org>
12944
12945         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12946         switch blocks which contain nothing but a default clause.
12947
12948 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12949
12950        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12951
12952 2002-06-27  Martin Baulig  <martin@gnome.org>
12953
12954         * ecore.cs (PropertyExpr.PropertyExpr): Call
12955         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12956
12957         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12958         is already a TypeBuilder.
12959
12960 2002-06-27  Martin Baulig  <martin@gnome.org>
12961
12962         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12963         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12964         the "from an array-type to System.Array" case.  This makes it work
12965         when compiling corlib.
12966
12967 2002-06-27  Martin Baulig  <martin@gnome.org>
12968
12969         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12970         non-static PropertyExpr, set its InstanceExpression.  This makes
12971         the `ICollection.Count' property work in System/Array.cs.
12972
12973 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12974
12975         * driver.cs: Made error handling more consistent.  Errors now
12976         tracked by Report class, so many methods which used to return int
12977         now return void.  Main() now prints success/failure and 
12978         errors/warnings message.
12979
12980         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12981         the magic number return values (123 and 124).  Now, if the
12982         expected error occurs, the compiler exits with success (exit value
12983         0).  If the compilation completes without seeing that particular
12984         error, the compiler exits with failure (exit value 1).  The
12985         makefile in mcs/errors has been changed to handle the new behaviour.
12986
12987         * report.cs: Made 'expected error' number a property and renamed
12988         it from 'Probe' to 'ExpectedError'.
12989
12990         * genericparser.cs: Removed error handling support, since it is
12991         now all done by Report class.
12992
12993         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12994         class, so parse() no longer returns an int.
12995
12996         * namespace.cs: Use Report.Error instead of GenericParser.error
12997
12998 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12999
13000         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13001         TypeContainer.AddOperator): At the front of the list put the
13002         explicit implementations, so they get resolved/defined first. 
13003
13004 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13005
13006         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13007         interface type is implemented by this TypeContainer.  Used during
13008         explicit interface implementation.
13009
13010         (Property.Define, Indexer.Define, Method.Define): Validate that
13011         the given interface in the explicit implementation is one of the
13012         base classes for the containing type.
13013
13014         Also if we are explicitly implementing an interface, but there is
13015         no match in the pending implementation table, report an error.
13016
13017         (Property.Define): Only define the property if we are
13018         not explicitly implementing a property from an interface.  Use the
13019         correct name also for those properties (the same CSC uses,
13020         although that is really not needed).
13021
13022         (Property.Emit): Do not emit attributes for explicitly implemented
13023         properties, as there is no TypeBuilder.
13024
13025         (Indexer.Emit): ditto.
13026
13027         Hiding then means that we do not really *implement* a pending
13028         implementation, which makes code fail.
13029
13030 2002-06-22  Martin Baulig  <martin@gnome.org>
13031
13032         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13033         the return value of Object.GetType().  [FIXME: we need to do this whenever
13034         we get a type back from the reflection library].
13035
13036 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13037
13038         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13039
13040 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13041
13042         * attribute.cs: Return null if we can not look up the type.
13043
13044         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13045         the interface types found.
13046
13047         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13048         interface types found.
13049
13050         * typemanager.cs (GetInterfaces): Make this routine returns alll
13051         the interfaces and work around the lame differences between
13052         System.Type and System.Reflection.Emit.TypeBuilder in the results
13053         result for GetInterfaces.
13054
13055         (ExpandInterfaces): Given an array of interface types, expand and
13056         eliminate repeated ocurrences of an interface.  This expands in
13057         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13058         be IA, IB, IC.
13059
13060 2002-06-21  Martin Baulig  <martin@gnome.org>
13061
13062         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13063         on System.Enum.
13064
13065 2002-06-21  Martin Baulig  <martin@gnome.org>
13066
13067         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13068         and called with one of the core types, return the corresponding typebuilder for
13069         that type.
13070
13071         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13072         element type.
13073
13074 2002-06-21  Martin Baulig  <martin@gnome.org>
13075
13076         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13077         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13078         (Expression.ConvertReferenceExplicit): Likewise.
13079
13080         * expression.cs (ElementAccess.DoResolve): Likewise.
13081         (ElementAccess.DoResolveLValue): Likewise.
13082
13083 2002-06-10  Martin Baulig  <martin@gnome.org>
13084
13085         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13086         add the "value" parameter to the parameter list.
13087
13088         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13089         to our caller.
13090
13091 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13092
13093         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13094         the argument to an int, uint, long or ulong, per the spec.  Also
13095         catch negative constants in array creation.
13096
13097 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13098
13099         * class.cs: do not allow the same interface to appear twice in
13100         the definition list.
13101
13102 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13103
13104         * ecore.cs: don't use ldlen with System.Array.
13105
13106 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13107
13108         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13109
13110 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13111
13112         * modifiers.cs: produce correct field attributes for protected
13113         internal. Easy fix so miguel can work on ther harder stuff:-)
13114
13115 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13116
13117         * pending.cs: New file.  Move the code from class.cs here.
13118         Support clearning the pending flag for all methods (when not doing
13119         explicit interface implementation).
13120
13121 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13122
13123         * rootcontext.cs: added a couple more types needed to bootstrap.
13124
13125 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13126
13127         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13128         constructor in the type, instead of any constructor in the type
13129         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13130         a bug in the Mono runtime when applying the params attribute). 
13131
13132 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13133         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13134
13135 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13136
13137         * expression.cs (Unary.ResolveOperator): Use TypeManager
13138         to resolve the type.
13139
13140 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13141
13142         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13143         attached.
13144
13145         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13146         with each member too.
13147
13148         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13149         field builders too - this takes care of the enum member case.
13150
13151 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13152
13153         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13154         address-of operator on both value types and pointers.
13155
13156 2002-06-10  Martin Baulig  <martin@gnome.org>
13157
13158         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13159         PropertyBuilder to the `property_builders' list.
13160
13161         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13162         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13163         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13164         find any indexers which are inherited from an interface.
13165
13166 2002-06-09  Martin Baulig  <martin@gnome.org>
13167
13168         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13169         the same type as the constant if necessary.  There's also a test-130.cs
13170         for this.
13171
13172         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13173
13174         * typemanager.cs (TypeManager.ChangeType): Previously known as
13175         Enum.ChangeEnumType().
13176
13177 2002-06-09  Martin Baulig  <martin@gnome.org>
13178
13179         * expression.cs (Cast.TryReduce): Added support for consts.
13180
13181 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13182
13183         * class.cs (Accessor): Hold attributes information so we can pass
13184         it along.
13185
13186         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13187         Modify to pass in attributes attached to the methods.
13188
13189         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13190
13191         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13192         to handle the Accessor kind :-)
13193
13194         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13195
13196 2002-06-08  Martin Baulig  <martin@gnome.org>
13197
13198         * expression.cs (Unary.TryReduceNegative): Added support for
13199         ULongConstants.
13200
13201 2002-06-08  Martin Baulig  <martin@gnome.org>
13202
13203         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13204         name can't be found in the `defined_names' - the caller will do a
13205         MemberLookup in this case and thus find methods in System.Enum
13206         such as Enum.IsDefined().
13207
13208 2002-06-08  Martin Baulig  <martin@gnome.org>
13209
13210         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13211         Convert.ChangeType() which works with TypeBuilder created types.
13212         (Enum.LookupEnumValue, Enum.Define): Use it here.
13213
13214         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13215         `TypeBuilder.BaseType != null' check.
13216         (TypeContainer.FindMembers): Only lookup parent members if we
13217         actually have a parent.
13218         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13219         (ConstructorInitializer.Resolve): Likewise.
13220
13221         * interface.cs (Interface.FindMembers): Added
13222         `TypeBuilder.BaseType != null' check.
13223
13224         * rootcontext.cs (RootContext.ResolveCore): Added
13225         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13226         classes_second_stage.
13227
13228         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13229         debug_type and trace_type when compiling with --nostdlib.       
13230
13231 2002-06-07  Martin Baulig  <martin@gnome.org>
13232
13233         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13234         (AddField): Set it to true when adding a non-static field.
13235         (DefineType): Use `have_nonstatic_fields' to find out whether we
13236         have non-static fields, not `Fields != null'.
13237
13238 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13239
13240         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13241         dereferencing a null on the static-field code path)
13242
13243 2002-05-30  Martin Baulig  <martin@gnome.org>
13244
13245         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13246         to take command line arguments.  Use reflection to call the new
13247         custom `Initialize' function on the symbol writer and pass it the
13248         command line arguments.
13249
13250         * driver.cs (--debug-args): New command line argument to pass command
13251         line arguments to the symbol writer.
13252
13253 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13254
13255         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13256         the target type for indexers and properties.  Thanks to Joe for
13257         catching this.
13258
13259 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13260
13261         * typemanager.cs (MethodFlags): returns the method flags
13262         (Obsolete/ShouldIgnore) that control warning emission and whether
13263         the invocation should be made, or ignored. 
13264
13265         * expression.cs (Invocation.Emit): Remove previous hack, we should
13266         not do this on matching a base type, we should do this based on an attribute
13267
13268         Only emit calls to System.Diagnostics.Debug and
13269         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13270         on the command line.
13271
13272         * rootcontext.cs: Global settings for tracing and debugging.
13273
13274         * cs-tokenizer.cs (define): New utility function to track
13275         defines.   Set the global settings for TRACE and DEBUG if found.
13276
13277 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13278
13279         * interface.cs (Populate*): Pass in the TypeContainer as well as
13280         the DeclSpace as parameters so that we can create EmitContexts and
13281         then use that to apply attributes etc.
13282
13283         (PopulateMethod, PopulateEvent, PopulateProperty)
13284         (PopulateIndexer): Apply attributes everywhere.
13285
13286         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13287         etc.
13288
13289         (ApplyAttributes): Update accordingly.
13290
13291         We now apply interface attributes for all members too.
13292
13293 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13294
13295         * class.cs (Indexer.Define); Correctly check if we are explicit
13296         implementation (instead of checking the Name for a ".", we
13297         directly look up if the InterfaceType was specified).
13298
13299         Delay the creation of the PropertyBuilder.
13300
13301         Only create the PropertyBuilder if we are not an explicit
13302         interface implementation.   This means that explicit interface
13303         implementation members do not participate in regular function
13304         lookups, and hence fixes another major ambiguity problem in
13305         overload resolution (that was the visible effect).
13306
13307         (DefineMethod): Return whether we are doing an interface
13308         implementation. 
13309
13310         * typemanager.cs: Temporary hack until we get attributes in
13311         interfaces (Ravi is working on that) and we get IndexerName
13312         support in interfaces.
13313
13314         * interface.cs: Register the indexers as properties.
13315
13316         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13317         warning, I have verified that this is a bug in the .NET runtime
13318         (JavaScript suffers of the same problem).
13319
13320         * typemanager.cs (MemberLookup): When looking up members for
13321         interfaces, the parent of an interface is the implicit
13322         System.Object (so we succeed in searches of Object methods in an
13323         interface method invocation.  Example:  IEnumerable x;  x.ToString
13324         ()) 
13325
13326 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13327
13328         * class.cs (Event): Events should also register if they do
13329         implement the methods that an interface requires.
13330
13331         * typemanager.cs (MemberLookup); use the new GetInterfaces
13332         method. 
13333
13334         (GetInterfaces): The code used to lookup interfaces for a type is
13335         used in more than one place, factor it here. 
13336
13337         * driver.cs: Track the errors at the bottom of the file, we kept
13338         on going.
13339
13340         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13341         instance if the method we are calling is static!
13342
13343 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13344
13345         * attribute.cs (ApplyAttributes): Make this function filter out
13346         the IndexerName attribute (as that attribute in reality is never
13347         applied) and return the string constant for the IndexerName
13348         attribute. 
13349
13350         * class.cs (TypeContainer.Emit): Validate that all the indexers
13351         have the same IndexerName attribute, and if so, set the
13352         DefaultName attribute on the class. 
13353
13354         * typemanager.cs: The return value might contain other stuff (not
13355         only methods).  For instance, consider a method with an "Item"
13356         property and an Item method.
13357
13358         * class.cs: If there is a problem with the parameter types,
13359         return. 
13360
13361 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13362
13363         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13364         looks at user defined conversion after making a call to 
13365         StandardConversionExists - we need this for overload resolution.
13366
13367         * expression.cs : Update accordingly the various method calls.
13368
13369         This fixes 2 bugs filed against implicit user defined conversions 
13370
13371 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13372
13373         * statement.cs: Track the result of the assignment.
13374
13375 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13376
13377         * expression.cs (MemberAccess): Improved error reporting for
13378         inaccessible members.
13379
13380 2002-05-22  Martin Baulig  <martin@gnome.org>
13381
13382         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13383         itself with debugging support.
13384
13385 2002-05-22  Martin Baulig  <martin@gnome.org>
13386
13387         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13388         Removed, this isn't needed anymore.
13389
13390 2002-05-20  Martin Baulig  <martin@gnome.org>
13391
13392         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13393         be underlying type for an enum.
13394
13395 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13396
13397         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13398         that splits out the loading of just the core types.
13399
13400         * rootcontext.cs (ResolveCore): Split the struct resolution in
13401         two, so we can load the enumeration underlying types before any
13402         enums are used.
13403
13404         * expression.cs (Is): Bandaid until we fix properly Switch (see
13405         bug #24985 for details).
13406
13407         * typemanager.cs (ImplementsInterface): The hashtable will contain
13408         a null if there are no interfaces implemented.
13409
13410 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13411
13412         * cs-parser.jay (indexer_declarator): It is fine to have array
13413         parameters
13414
13415 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13416
13417         * typemanager.cs: (RegisterBuilder): New function used to register
13418         TypeBuilders that implement interfaces.  Since
13419         TypeBuilder.GetInterfaces (as usual) does not work with lame
13420         Reflection.Emit. 
13421         (AddUserType): register interfaces.
13422
13423         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13424         dealing with TypeBuilder.  Also, arrays are showing up as
13425         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13426         methods can not be invoked on them!
13427
13428         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13429         (ImplicitReferenceConversionExists): Split out from
13430         StandardConversionExists. 
13431
13432         * expression.cs (As): We were only implementing one of the three
13433         cases for the as operator.  We now implement them all.
13434         (Is): Implement the various other cases for Is as well.
13435
13436         * typemanager.cs (CACHE): New define used to control if we want or
13437         not the FindMembers cache.  Seems to have a negative impact on
13438         performance currently
13439
13440         (MemberLookup): Nested types have full acess to
13441         enclosing type members
13442
13443         Remove code that coped with instance/static returns for events, we
13444         now catch this in RealFindMembers.
13445
13446         (RealFindMembers): only perform static lookup if the instance
13447         lookup did not return a type or an event.  
13448
13449 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13450
13451         * assign.cs (CompoundAssign): We pass more semantic information
13452         now to Compound Assignments than we did before: now we have all
13453         the information at hand, and now we resolve the target *before* we
13454         do the expression expansion, which allows the "CacheValue" method
13455         to have the effect we intended (before, a [x] += 1 would generate
13456         two differen ArrayAccess expressions from the ElementAccess,
13457         during the resolution process).
13458
13459         (CompoundAssign.DoResolve): Resolve target and original_source here.
13460
13461 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13462
13463         * expression.cs (ArrayAccess): dropped debugging information. 
13464
13465         * typemanager.cs: Small bug fix: I was always returning i_members,
13466         instead of one of i_members or s_members (depending on which had
13467         the content).
13468
13469         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13470         method is invoked before any code generation takes place, and it
13471         is a mechanism to inform that the expression will be invoked more
13472         than once, and that the method should use temporary values to
13473         avoid having side effects
13474
13475         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13476
13477         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13478         implementation.
13479
13480         * expression.cs (Indirection, ArrayAccess): Add support for
13481         CacheTemporaries in these two bad boys. 
13482
13483         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13484         ldobj or ldind_ref.  
13485         (StoreFromPtr): Handle stobj as well.
13486
13487         * expression.cs (UnaryMutator): Share more code.
13488
13489         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13490         down: I was not tracking the Filter function as well, which
13491         was affecting the results of the cache.
13492
13493 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13494
13495         * attribute.cs: Remove the hack to handle the CharSet property on
13496         StructLayouts. 
13497
13498 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13499
13500         * attribute.cs (DoResolve): More uglyness, we now only try to
13501         resolve the attribute partially, to extract the CharSet
13502         information (only if we are a StructLayout attribute).  Otherwise 
13503
13504         (GetExtraTypeInfo): Add some code to conditionally kill in the
13505         future this.   I am more and more convinced that the .NET
13506         framework has special code to handle the attribute setting on
13507         certain elements.
13508
13509         * expression.cs (IsParamsMethodApplicable): Revert my previous
13510         foreach change here, it was wrong.
13511
13512 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13513
13514         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13515         (pp_expr): do not abort on unknown input, just return.
13516         (eval): abort if there are pending chars.
13517
13518         * attribute.cs (Attribute.Resolve): Positional parameters are
13519         optional.  Deal with that case.
13520
13521         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13522         the Ansi/Unicode/Auto information for the type.
13523
13524         (TypeContainer.DefineType): instantiate the EmitContext here, as
13525         we will be using it during the type definition (to resolve
13526         attributes) and during the emit phase.
13527
13528         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13529         to pull type information out of the attributes
13530
13531         (Attribute.Resolve): track the constructor builder, and allow for
13532         multiple invocations (structs and classes will use this).
13533
13534         * ecore.cs (MemberLookupFinal): new version with all the
13535         parameters customizable.
13536
13537         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13538         constructors.  Return if the result value is null (as the error
13539         would have been flagged already by MemberLookupFinal)
13540
13541         Do not allow instances of abstract classes or interfaces to be
13542         created.
13543
13544         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13545         We have to compare the assembly property here when dealing with
13546         FamANDAssem and Assembly access modifiers, because we might be
13547         creating an assembly from *modules* (that means that we are not
13548         getting TypeBuilders for types defined in other modules that are
13549         part of this assembly).
13550
13551         (Method.Emit): If the method is marked abstract and has a body,
13552         emit an error. 
13553
13554         (TypeContainer.DefineMembers): If both the defined member and the
13555         parent name match are methods, then do not emit any warnings: let
13556         the Method.Define routine take care of flagging warnings.  But if
13557         there is a mismatch (method overrides something else, or method is
13558         overriwritten by something, then emit warning).
13559
13560         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13561         set to null, this means `do not check for the return type on the
13562         signature'. 
13563
13564         (Method.Define): set the return type for the method signature to
13565         null, so that we get methods with the same name and parameters and
13566         different return types.  This is used to flag warning 114 (you are
13567         hiding a method, and you probably want to use the new/override
13568         keywords instead).
13569
13570         * typemanager.cs (MemberLookup): Implemented proper access
13571         control, closing a long standing set of bug reports.  The problem
13572         was that the Framework only has two bits: Public and NonPublic,
13573         and NonPublic includes private and protected methods, but we need
13574         to enforce the FamANDAssem, FamOrAssem and Family. 
13575
13576 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13577
13578         * statement.cs (GotoCase): Return true: Ammounts to giving up
13579         knowledge on whether we return or not, and letting the other case
13580         be responsible for it.
13581
13582 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13583
13584         * driver.cs: Do not load directories for each file processed, only
13585         do it if there is a pattern.
13586
13587         * ecore.cs: Report readonly assigns here as well, as we might have
13588         been resolved only by MemberAccess.
13589
13590         (SimpleName.SimpleNameResolve): Also be useful for LValue
13591         resolution.   We need this to propagate assign to local readonly variables
13592
13593         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13594         do not want to reuse potential criteria memory.
13595
13596         * class.cs (MyEventBuilder): Set reflected_type;
13597
13598         * ecore.cs (Constantify): Added support for constifying bools.
13599
13600         (RootContext.LookupType): Added a cache for values looked up in
13601         the declaration space.
13602
13603         * typemanager.cs (FindMembers): Now is a front-end to
13604         RealFindMembers, and provides a two-level hashtable-based cache to
13605         the request.  
13606
13607         15% performance improvement: from 22.5 to 19.2 seconds.
13608
13609         * expression.cs (IsParamsMethodApplicable): use foreach.
13610         (Invocation.DoResolve): ditto.
13611         (New.DoResolve): ditto.
13612         (ArrayCreation.DoResolve): ditto.
13613
13614         * ecore.cs (FindMostEncompassingType): use foreach.
13615
13616         * delegate.cs (NewDelegate.DoResolve): Use foreach
13617
13618         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13619         (RemoveMethods): use foreach.
13620
13621         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13622         nested foreach statements instead of for, and also break out of
13623         the inner loop once a match is found.
13624
13625         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13626
13627 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13628
13629         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13630         we actually unwrap the expression to allow for extra information
13631         to be extracted. 
13632
13633         * expression.cs: Use Shr_Un on unsigned operations. 
13634
13635 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13636
13637         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13638         applicable operators was not being considered correctly. This closes
13639         the bug Miguel reported.
13640
13641 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13642
13643         * attribute.cs: check that the type derives from System.Attribute
13644         and report the correct error in that case (moved the duplicate code to
13645         its own method, too).
13646
13647 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13648
13649         * attribute.cs: lookup attribute type name as the spec says: first the
13650         bare attribute name and then name + "Attribute" (nant compiles with
13651         mcs after this fix).
13652
13653 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13654
13655         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13656         Because of the way we parse things, we should try to see if a
13657         UIntConstant can fit in an integer.
13658
13659 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13660
13661         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13662         when we are in an explicit context.
13663
13664         (ConvertReferenceExplicit): When converting from Iface type S to Class
13665         T make sure the rules are implemented as an OR.
13666
13667         * parameter.cs (ParameterType): Make it a property for now although the
13668         purpose really isn't anything immediate.
13669
13670         * expression.cs (Is*Applicable): Do better checking on the parameter type
13671         of a ref/out parameter. The ones from the system assemblies are already 
13672         marked with the correct type so we don't need to do any correction.
13673
13674         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13675         the object type is standard too so include that.
13676
13677 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13678
13679         * ecore.cs (StandardConversionExists): Augment with missing code:
13680         deal with IntConstant, LongConstants and Enumerations.
13681
13682         * assign.cs: Report the error, instead of failing silently
13683
13684         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13685         typecontainer that they are declared, because the
13686         typecontainer/namespace will have the list of using clauses that
13687         need to be applied.
13688
13689         Assembly Attributes were escaping the normal registration
13690         mechanism. 
13691
13692         (EmitCode): Apply attributes within an EmitContext that represents
13693         the container they were declared on.
13694
13695         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13696
13697 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13698
13699         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13700         Revamp completely - make much cleaner as we now operate only
13701         on a set of Types.
13702
13703         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13704         to implement the logic detailed in the spec more correctly.
13705
13706         (UserDefinedConversion): Update accordingly.
13707
13708 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13709
13710         * statement.cs: Return flow analysis information up.
13711
13712         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13713         and the default.
13714
13715         (token): Do not consume an extra character before calling
13716         decimal_digits.
13717
13718 2002-05-06  Piers Haken <piersh@friskit.com>
13719
13720         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13721
13722 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13723
13724         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13725         EmitContext during the instance constructor initializer
13726         resolution, to stop access to instance variables.
13727
13728         This is mandated by the spec, last paragraph of the `constructor
13729         initializers' section. 
13730
13731 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13732
13733         * cs-parser.jay, class.cs (Accessor): new class used to represent
13734         an accessor (get or set).  In the past we used `null' to represent
13735         a missing accessor.  But this is ambiguous because there was no
13736         way to tell in abstract indexers/properties if one of them was
13737         specified.
13738
13739         Now there is a way of addressing that.
13740
13741         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13742         instead of FindMembers.
13743
13744         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13745         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13746
13747         * attribute.cs: Treat indexers and properties as the same in terms
13748         of applying attributes
13749
13750         * ecore.cs (FindMostEncompassedType): Use statically initialized
13751         EmptyExpressions()s like we do elsewhere to avoid creating useless
13752         objects (and we take this out of the tight loop).
13753
13754         (GetConversionOperators): Move the code to extract the actual
13755         operators to a separate routine to clean things up.
13756
13757 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13758
13759         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13760         events are always registered FieldBuilders.
13761
13762         * class.cs (FieldBase): New class shared by Fields 
13763
13764         * delegate.cs: If we are a toplevel delegate, use our full name.
13765         If we are a nested delegate, then only use our tail name.
13766
13767 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13768
13769         * expression.cs (IsApplicable): Ensure that we add the "&" to
13770         ref/out types before comparing it with the type of the argument.
13771
13772         (IsParamsMethodApplicable): Ditto.
13773
13774         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13775         silly me ;-)
13776
13777         * delegate.cs : Handle the case when we have more than one applicable
13778         method. Flag an error only when we finish checking all.
13779
13780 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13781
13782         * expression.cs: Add support for boolean static initializers.
13783
13784 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13785
13786         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13787
13788         * parameter.cs (ComputeParameterTypes,
13789         ComputeAndDefineParameterTypes): Better error handling: now we
13790         clear the `types' cache if we fail during any of the type lookups.
13791         We also return the status code correctly to our caller
13792
13793         * delegate.cs: If we fail to define a delegate, abort the extra
13794         steps. 
13795
13796         * expression.cs (Binary.ResolveOperator): for
13797         operator==(object,object) and operator !=(object, object) we also
13798         have to verify that there is an implicit conversion from one to
13799         the other.
13800
13801         (ArrayAccess.DoResolve): Array Access can operate on
13802         non-variables. 
13803
13804 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13805
13806         * assign.cs (CompoundAssign): A new class used as a "flag" that
13807         the assignment actually is happening as part of a compound
13808         assignment operator.
13809
13810         During compound assignment, a few new rules exist to enable things
13811         like:
13812
13813         byte b |= 1 + 2
13814
13815         From the spec:
13816
13817         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13818         to the type of x) if y is implicitly convertible to the type of x,
13819         and the operator is a builtin operator and the return type of the
13820         operator is explicitly convertible to the type of x. 
13821
13822         * rootcontext.cs: Reset warning level to 2.  4 catches various
13823         "interesting" features in mcs, we must clean this up at some
13824         point, but currently am trying to kill other bugs ;-)
13825
13826         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13827         in container classes as well.  
13828
13829         * expression.cs (Binary.ResolveOperator): Handle string case
13830         before anything else (as operator overloading does emit an error
13831         before doing anything else).
13832
13833         This code could go away when we move to a table driven model, but
13834         i could not come up with a good plan last night.
13835
13836 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13837
13838         * typemanager.cs (CSharpName): reimplementation using regex.
13839         * class.cs: added null check for fields in Emit
13840         * rootcontext.cs: set warninglevel to 4
13841
13842 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13843
13844         * typemanager.cs (CSharpName): reimplemented with Lupus
13845         suggestion.
13846
13847 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13848
13849         * statement.cs (If): correclty implement Resolve, because we were
13850         not catching sem errors in there.  The same process is needed
13851         everywhere else. 
13852         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13853
13854
13855         (Statement.Warning_DeadCodeFound): Factorize code.
13856         (While): Report dead code here too.
13857
13858         (Statement): Added Resolve virtual method to allow
13859         for resolution split from the emit code.
13860
13861 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13862
13863         * statement.cs (EmitBoolExpression): No longer try to resolve the
13864         expression here.    
13865         (MakeBoolean): New utility function that resolve, implicitly
13866         converts to boolean and tags the expression. 
13867
13868
13869         (If, Do): Implement dead code elimination.
13870         (While): Implement loop inversion
13871
13872         (Do, While, For, If): Resolve the expression prior to calling our
13873         code generation.
13874
13875 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13876
13877         * class.cs:
13878           - added method Report28 (warning: program has more than one entry point)
13879           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13880           - modified method Method.Define, the part at the end of the method
13881
13882         * rootcontext.cs: added static public Location EntryPointLocation;
13883           
13884         * ../errors/cs0028.cs : Add test case for the above warning.              
13885
13886         * typemanager.cs:
13887           - modified method CSharpName to allow arrays of primitive type to
13888             be printed nicely (e.g. instead of System.Int32[][] it now prints
13889             int[][])
13890           - added method CSharpSignature: returns the signature of a method
13891             in string format to be used in reporting errors, warnings, etc.
13892
13893         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13894         with String.Empty.
13895
13896 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13897
13898         * delegate.cs (Define): Fix extremely silly bug where I was
13899         setting the type of the 'object' parameter of the BeginInvoke
13900         method to System.IAsyncResult instead of System.Object ;-)
13901
13902 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13903
13904         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13905         here. 
13906
13907         (Constructor.Emit): return if we fail to initialize the
13908         constructor.  Another door closed!  
13909
13910         * expression.cs (New.DoResolve): Improve error message (from -6 to
13911         1501).  Use DeclaredOnly lookup to find the exact constructor.
13912
13913         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13914         loop.  This is useful.
13915
13916         * cs-parser.jay: Adjust the default parameters so that destructors
13917         have the proper signature.
13918
13919 2002-04-26  Martin Baulig  <martin@gnome.org>
13920
13921         * driver.cs (LoadAssembly): If `assembly' contains any characters
13922         which are only valid in path names and not in assembly names
13923         (currently slash, backslash and point), use Assembly.LoadFrom ()
13924         instead of Assembly.Load () on the `assembly' (before iteration
13925         over the link_paths).
13926
13927 2002-04-26  Martin Baulig  <martin@gnome.org>
13928
13929         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13930
13931 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13932
13933         * class.cs (Property): use the new typemanager.MemberLookup
13934
13935         (TypeContainer.MemberLookup): Implement using the
13936         TypeManager.MemberLookup now. 
13937
13938         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13939         and return MemberInfos, so that these can be used without an
13940         EmitContext (what we had before).
13941
13942 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13943
13944         * expression.cs: Fix the case where the argument to params if the
13945         type of the params.  I omitted handling this before.   Fixed
13946
13947 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13948
13949         * driver.cs: Call BootCorlib_PopulateCoreType
13950
13951         * class.cs (Property.CheckBase): Check for properties only, not
13952         for all members. 
13953
13954         * interface.cs: Temporary hack: try/catch around the
13955         CustomAttributeBuilder, because I am getting an exception that I
13956         do not understand.
13957
13958         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13959         types whose definitions are required to be there (attributes are
13960         defined before standard types).
13961
13962         Compute definitions as we boot the various types, as they are used
13963         immediately (value_type class will need object_type, but if we do
13964         not initialize object_type, we will pass a null, which will let
13965         the runtime pick the System.Object from the existing corlib, which
13966         is not what we want).
13967
13968 2002-04-22  Patrik Torstensson <totte@labs2.com>
13969
13970         * cs-tokenizer.cs: fixed a number of trim() issues.
13971
13972 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13973
13974         * expression.cs (Argument.Type): Ensure that we return the correct
13975         type when we have out or ref parameters [in which case we 
13976         append a "&"].
13977
13978 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13979
13980         * class.cs (Property, Indexer): Allow extern modifier in there. 
13981
13982         * typemanager.cs (InitBaseTypes): Initializes object_type and
13983         value_type, since those will be used early on during the bootstrap
13984         process to compile corlib.
13985
13986         (InitCoreTypes): Move code from here to InitBaseTypes.
13987
13988 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13989
13990         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13991         single-dimension arrays as using the ldlen opcode.  
13992
13993         Daniel Lewis discovered this optimization.  
13994
13995         * typemanager.cs: Add signature for System.Array::get_Length
13996
13997 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13998
13999         * statement.cs: report the error when the foreach does not apply to an
14000         array nor a collection.
14001
14002 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14003
14004         * expression.cs: Add implicit conversions to the operator ~.
14005
14006         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14007
14008         * typemanager.cs: Locate the decimal constructor.
14009
14010 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14011
14012         * attribute.cs: use the new property of TypeOf.
14013         * expression.cs: added 'get' property around typearg.
14014
14015         These changes fix a build breaker reported by NickD. Is this the
14016         correct way to fix?  If not, please, revert my changes and make it
14017         work :-).
14018
14019 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14020
14021         * attribute.cs: Add support for typeof in attribute invocations.
14022         I am not sure that this is right though.
14023
14024 2002-04-14  Duncan Mak  <duncan@ximian.com>
14025
14026         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14027         Binary.Operator.Division case.
14028
14029 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14030
14031         * class.cs (DefineType): Ensure that we do a proper check on
14032         attribute types and also register it with the TypeManager.
14033
14034         (TypeContainer.Targets): The default for attribute types is
14035         AttributeTargets.All.
14036
14037         * attribute.cs (ApplyAttributes): Registering the attribute type
14038         is done elsewhere, not when we discover we have a Usage attribute.
14039
14040 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14041
14042         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14043         and get rid of is_delegate parameter.
14044
14045         * everywhere : update.
14046
14047 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14048
14049         * cs-parser.jay (compilation_unit): Revamp completely to use
14050         some new ideas that I got from Rhys' grammar to solve the problems
14051         with assembly level attributes.
14052
14053         (outer_declaration): New grammar production.
14054
14055         (attribute_sections): Add.
14056
14057         (opt_attributes): Base on attribute_sections
14058
14059         (namespace_declaration): Allow opt_attributes to tackle the case
14060         when we have assembly level attributes - we are clever in this
14061         regard now ;-)
14062
14063         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14064         attributes in the non-global context.
14065
14066         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14067         instead of SetGlobalAttributes.
14068
14069         * class.cs, rootcontext.cs : Ensure we define and generate 
14070         attribute types before anything else.
14071
14072         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14073         and flag the new error -20 for the case when the attribute type
14074         does not have valid targets specified. csc does not catch this.
14075
14076         * ../errors/errors.txt : update for error # -20
14077
14078 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14079
14080         * support.cs (InternalParameters.ParameterModifier): Do some null
14081         checking and return sane values.
14082
14083         * class.cs (Method.Define): If we are a PInvoke method, ensure
14084         that we are static and extern. Report error # 601
14085
14086         * ../errors/cs0601.cs : Add test case for the above error.
14087
14088 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14089
14090         * rootcontext.cs (attribute_types): We need to keep type of
14091         all attribute types separately and emit code for them first.
14092
14093         (RegisterAttribute) : Implement.
14094
14095         * class.cs (DefineType): Check if the current Type is a custom
14096         attribute type and register it accordingly.
14097
14098         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14099         adding the first attribute twice and rename to
14100
14101         (SetGlobalAttributes): this.
14102
14103         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14104         lookups.
14105
14106         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14107         if we are processing global arguments. Hmm, I am unsure of this.
14108
14109 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14110
14111         * expression.cs: added static array of strings to avoid calling
14112         Enum.ToString () for Operator in Binary. Significant recover of
14113         performance.
14114
14115 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14116
14117         * class.cs (FindMembers): Allow the Builders of the various
14118         members to be null.  If they are skip them.  This only happens
14119         during the PInvoke declaration.
14120
14121 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14122
14123         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14124         failure, so we do not keep going afterwards.
14125
14126         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14127         wanted to pass `false' as the `is_delegate' argument.  If this is
14128         the case, why not use delegate_type == null to mean `is_delegate =
14129         false' and anything else as is_delegate = true.
14130
14131 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14132
14133         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14134         code for the section, not the beginning of the tests.
14135
14136 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14137
14138         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14139
14140         * expression.cs (Binary): same.  Warn about errors where we have
14141         Enum/Enum in operator + as well.
14142
14143 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14144
14145         * statement.cs:
14146                 - added support for switch(bool)
14147                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14148                 - add TableSwitchEmit() to handle table-based switch statements
14149
14150 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14151
14152         * expression.cs (Invocation.OverloadResolve): Factor out code which
14153         does parameter compatibility checking with arguments so that we can 
14154         re-use the code even from Delegate.VerifyApplicability
14155
14156         (VerifyArgumentsCompat): Move above code here.
14157
14158         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14159         and instead make a call to the above method.
14160
14161 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14162
14163         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14164         We use it to keep track of classes which are attribute types.
14165
14166 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14167
14168         * delegate.cs (Delegate.Define): Correctly define the types in the
14169         presence of fixed and array parameters.
14170
14171         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14172         doing FindMembers.
14173
14174         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14175         include NonPublic after the first iteration.
14176
14177         * class.cs (Indexer.CheckBase): Only check if both parents are
14178         non-null. 
14179
14180         * cs-parser.jay (accessor_body): If empty, set to null.
14181
14182         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14183         same code path here to resolve constants names that we did have in
14184         MemberAccess.DoResolve.  There is too much code duplicated here.
14185
14186 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14187
14188         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14189
14190         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14191         to MakeUnionSet.
14192
14193         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14194         tokens, numbers and strings.
14195
14196         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14197         parenthesis.
14198
14199         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14200         asyncronous parameters and the regular parameters.  
14201
14202         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14203         specify the target directory.
14204
14205         * expression.cs: (This.DoResolve): Simplify
14206         (As.Emit): Optimize, do not generate IsInst if the expression is
14207         always of the given type.
14208
14209         (Is.DoResolve): Bug fix, we were reporting both always/never for
14210         the is expression.
14211
14212         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14213         creating too many unnecessary arrays.
14214
14215 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14216
14217         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14218         fields instead of rolling our own initializer.   Takes care of all
14219         implicit conversions, and drops unnecessary static checks/argument.
14220
14221 2002-03-31  Dick Porter  <dick@ximian.com>
14222
14223         * driver.cs: use the GetDirectories() return values properly, and
14224         use "/" as path separator.
14225
14226 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14227
14228         * expression.cs (Unary): Optimize - - expr into expr.
14229         (Binary): Optimize a + (-b) into a -b.
14230
14231         * codegen.cs (CodeGen): Made all methods static.
14232
14233 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14234
14235         * rootcontext.cs: 
14236
14237         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14238         TypeBuilder property.
14239
14240         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14241         instead. 
14242
14243         * tree.cs: Removed the various RecordXXXX, and replaced with a
14244         single RecordDecl.  Removed all the accessor methods, and just
14245         left a single access point Type 
14246
14247         * enum.cs: Rename DefineEnum to DefineType.
14248
14249         * decl.cs: New abstract method `DefineType' used to unify the
14250         Defines for Enumerations, Interfaces, TypeContainers and
14251         Delegates.
14252
14253         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14254         LookupBaseClasses method that used to live in class.cs and
14255         interface.cs here, and renamed to FindType.
14256
14257         * delegate.cs: Implement DefineType.  Take advantage of the
14258         refactored pattern for locating the parent builder without taking
14259         the parent_builder argument (which we know does not work if we are
14260         nested, and triggering a toplevel definition).
14261
14262 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14263
14264         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14265         accessibility of a member has changed during override and report
14266         an error if so.
14267
14268         * class.cs (Method.Define, Property.Define): Only complain on
14269         overrides if the method is private, any other accessibility is
14270         fine (and since we just checked the permission is the same, we are
14271         good to go).
14272
14273         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14274         and elif are processed always.  The other pre-processing
14275         directives are only processed if we are "taking" the path
14276
14277 2002-03-29  Martin Baulig  <martin@gnome.org>
14278
14279         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14280         current location is not Null.
14281
14282         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14283         a separate method so we can profile it.
14284
14285         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14286         `span.Seconds' are just seconds, but no minutes or hours.
14287         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14288
14289 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14290
14291         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14292         Remove the gratuitous set of Final:
14293
14294                                 // If an interface implementation, then we can set Final.
14295                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14296                                     implementing.DeclaringType.IsInterface)
14297                                         flags |= MethodAttributes.Final;
14298
14299         I do not know what I was smoking when I used that.
14300
14301
14302         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14303         step into fixing the name resolution issues for delegates and
14304         unifying the toplevel name resolution.
14305
14306 2002-03-28  Martin Baulig  <martin@gnome.org>
14307
14308         * class.cs (Method.Emit): If we have a symbol writer, call its
14309         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14310         tell it about the current method.
14311
14312         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14313         writer that we're going to emit the first byte of IL code for a new
14314         statement (a new source line).
14315         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14316         EmitContext.Mark() before emitting any code.
14317
14318         * location.cs (SymbolDocument): Return null when we're Null.
14319
14320         * statement.cs (Statement): Moved the `Location loc' variable here.
14321         (Statement.EmitBoolExpression): If we have a symbol writer, call
14322         ec.Mark() before emitting any code to tell it that we're at the
14323         beginning of a new statement.
14324         (StatementExpression): Added `Location' argument to the constructor.
14325         (Block): Added public readonly variable `StartLocation' and public
14326         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14327         (Block): Added constructor which takes a start and end location.
14328         (Block.SetEndLocation): New method. This sets the end location.
14329         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14330         local variables we create.
14331         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14332         each statement and do also mark the begin and end of the block.
14333
14334         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14335         tell it the current lexer.Location, use Location.Null for the end of the
14336         block.
14337         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14338         current block, set its end location using SetEndLocation().
14339         (statement_expression): StatementExpression constructor now takes the
14340         lexer.Location as additional argument.
14341         (for_statement, declare_local_variables): Likewise.
14342         (declare_local_variables): When creating a new implicit block, use the
14343         new Block constructor and pass it the lexer.Location.
14344
14345 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14346
14347         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14348         members also on the parent interfaces recursively.
14349
14350 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14351
14352         * report.cs: Use new formats, since Gonzalo finished the missing
14353         bits. 
14354
14355         * expression.cs (Binary.ResolveOperator): added missing operator|
14356         operator& and operator^ for bool/bool.
14357
14358         * cs-parser.jay: CheckDef now takes a Location argument that is
14359         used to report errors more precisly (instead of reporting the end
14360         of a definition, we try to track something which is a lot closer
14361         to the source of the problem).
14362
14363         * cs-tokenizer.cs: Track global token use, so we can properly flag
14364         the use of #define/#undef after the first token has been seen.
14365
14366         Also, rename the reportXXXX to Error_DescriptiveName
14367
14368         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14369         TypeContainer, so that Enum and Interface can use this too.
14370
14371         * class.cs (TypeContainer.LookupInterfaceOrClass,
14372         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14373         `builder' argument.  Typically this was used to pass the parent
14374         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14375         the definition).  
14376
14377         The problem is that a nested class could trigger the definition of
14378         a toplevel class, and the builder would be obviously wrong in that
14379         case. 
14380
14381         So we drop this argument, and we compute dynamically the
14382         TypeBuilder/ModuleBuilder (the correct information was available
14383         to us anyways from DeclSpace.Parent)
14384
14385         * interface.cs (Interface.DefineInterface): Drop builder
14386         parameter cleanup like class.cs
14387
14388         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14389         like class.cs
14390
14391         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14392         values. 
14393
14394         (Try.Emit): Propagate the returns value from the statement.
14395
14396         (Return.Emit): Even if we are leavning 
14397
14398         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14399
14400         * modifiers.cs: Fix the computation of MethodAttributes flags.
14401
14402 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14403
14404         * driver.cs: allow compilation of files that start with '/'.
14405         Add a default case when checking the argument of --target.
14406
14407 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14408
14409         * interface.cs: Implement the same search algorithm for types in
14410         the interface code.
14411
14412         * delegate.cs: Do not allow multiple definition.
14413
14414         * Recovered ChangeLog that got accidentally amputated
14415
14416         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14417
14418         * rootcontext.cs: Load manually enum to allow core classes to
14419         contain enumerations.
14420
14421         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14422         Update to new static methods in TypeManager.
14423
14424         * typemanager.cs (GetMethod, GetConstructor): Use our
14425         implementation of FindMembers to find the members, since during
14426         corlib compilation, the types are TypeBuilders and GetMethod and
14427         GetConstructor do not work.
14428
14429         Make all methods in TypeManager static.
14430
14431         (InitCodeHelpers): Split the functionality from
14432         the InitCodeTypes function.
14433
14434         * driver.cs: Call InitCodeHelpers after we have populated the
14435         types. 
14436
14437         * cs-parser.jay (delegate_declaration): we did not used to compute
14438         the delegate name correctly for void delegates.
14439
14440 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14441
14442         * rootcontext.cs (RootContext): Init the interface_resolve_order
14443         and type_container_resolve_order always.
14444
14445         (ResolveCore, BootstrapCorlib_ResolveClass,
14446         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14447         compiler when compiling with --nostdlib
14448
14449         * class.cs (TypeContainer.DefineType): Check that our parent is
14450         not null.  This test is most important when we are bootstraping
14451         the core types.
14452
14453         * codegen.cs: Split out the symbol writing code.
14454
14455 2002-03-25  Martin Baulig  <martin@gnome.org>
14456
14457         * driver.cs (-g): Made -g an alias for --debug.
14458
14459 2002-03-24  Martin Baulig  <martin@gnome.org>
14460
14461         * codegen.cs (SymbolWriter): New public variable. Returns the
14462         current symbol writer.
14463         (CodeGen): Added `bool want_debugging_support' argument to the
14464          constructor. If true, tell the ModuleBuild that we want debugging
14465         support and ask it for the ISymbolWriter.
14466         (Save): If we have a symbol writer, call it's Close() method after
14467         saving the assembly.
14468
14469         * driver.c (--debug): New command line argument to create a
14470         debugger information file.
14471
14472         * location.cs (SymbolDocument): New public property. Returns an
14473         ISymbolDocumentWriter object for the current source file or null
14474         if we don't have a symbol writer.
14475
14476 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14477
14478         * driver.cs (LoadAssembly): Correctly return when all the paths
14479         have been tried and not before.
14480
14481         * statement.cs (Switch.Emit): return the actual coverage for this
14482         statement (returns/not-returns)
14483
14484         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14485         switch of the statement if we are the last switch section.  That
14486         kills two problems: try/catch problems (we used to emit an empty
14487         nop at the end) and switch statements where all branches would
14488         return. 
14489
14490 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14491
14492         * driver.cs: Add default assemblies (the equivalent to the
14493         Microsoft CSC.RSP file)
14494
14495         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14496         also update tokens_seen and set it to false.
14497
14498         * driver.cs: Implement --recurse for Mike.
14499
14500         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14501         correctly splitting out the paths.
14502
14503 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14504
14505         * interface.cs (Interface.PopulateProperty): Instead of using
14506         `parent' as the declaration space for the set parameters, use
14507         `this' 
14508
14509         * support.cs (InternalParameters): InternalParameters constructor
14510         takes a DeclSpace instead of a TypeContainer.
14511
14512         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14513         types are being initialized, load the address of it before calling
14514         the function.  
14515
14516         (New): Provide a mechanism to disable the generation of local
14517         value type temporaries when the caller will be providing us with
14518         an address to store it.
14519
14520         (ArrayCreation.EmitDynamicInitializers): Use it.
14521
14522 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14523
14524         * expression.cs (Invocation.EmitArguments): Only probe for array
14525         property if there is more than one argument.  Sorry about that.
14526
14527         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14528         empty param arrays.
14529
14530         * class.cs (Method.LabelParameters): Fix incorrect code path that
14531         prevented the `ParamArrayAttribute' from being applied to the
14532         params attribute.
14533
14534 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14535
14536         * support.cs (ReflectionParameters): Correctly compute whether the
14537         last argument is a params array.  Fixes the problem with
14538         string.Split ('a')
14539
14540         * typemanager.cs: Make the assemblies array always be non-null
14541         (empty, but non-null)
14542
14543         * tree.cs (RecordDecl): New function that abstracts the recording
14544         of names.  This reports error 101, and provides a pointer to the
14545         previous declaration.  Fixes a crash in the compiler.
14546
14547         * cs-parser.jay (constructor_declaration): Update to new grammar,
14548         and provide a constructor_body that can be empty.
14549
14550 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14551
14552         * driver.cs: Add support for --resources.
14553
14554         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14555         Make all types for the various array helper methods be integer.
14556
14557         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14558         CheckState to ConvCast.
14559
14560         (ConvCast): Now it takes a `checked' state argument, to avoid
14561         depending on the emit context for the conversion, and just using
14562         the resolve time setting.
14563
14564         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14565         instead of Invocation.EmitArguments.  We do not emit the original
14566         arguments, instead we emit those which have been converted to
14567         unsigned int expressions.
14568
14569         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14570
14571         * codegen.cs: ditto.
14572
14573         * expression.cs (LocalVariableReference): Drop the use of the
14574         Store function that depended on the variable index.
14575
14576         * statement.cs (VariableInfo): Drop the `Idx' property from this
14577         class, as this is not taking into account the indexes for
14578         temporaries tat we generate during the execution, getting the
14579         indexes wrong.
14580
14581         * class.cs: First emit class initializers, then call the parent
14582         constructor. 
14583
14584         * expression.cs (Binary): Fix opcode emision.
14585         (UnaryMutator.EmitCode): Support checked code generation
14586
14587         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14588         matches for events for both the Static and Instance scans,
14589         pointing to the same element.   Fix that.
14590
14591 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14592
14593         * rootcontext.cs (ResolveTree): Always set the
14594         interface_resolve_order, because nested interfaces will be calling
14595         into us.
14596
14597         * class.cs (GetInterfaceOrClass): Track the same resolution
14598         process used by TypeManager.LookupType.  This fixes the nested
14599         type lookups in class declarations (separate path from
14600         LookupType). 
14601
14602         (TypeContainer.DefineType): Also define nested interfaces.
14603         (TypeContainer.RegisterOrder): New public function used to
14604         register the order in which child interfaces need to be closed.
14605
14606         Nested interfaces need to be closed after their parents have been
14607         created. 
14608
14609         * interface.cs (InterfaceAttr): Put all the logic for computing
14610         the interface attribute here. 
14611
14612         (DefineInterface): Register our interface order with the
14613         RootContext or with the TypeContainer depending on the case.
14614
14615 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14616
14617         * cs-parser.jay: rework foreach statement to work with the new
14618         changes to the policy on SimpleNames.
14619
14620         * report.cs: support Stacktrace on warnings as well.
14621
14622         * makefile: drop --unsafe and /unsafe from the compile.
14623
14624 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14625
14626         * ecore.cs (StandardConversionExists): Modify to take an Expression
14627         as the first parameter. Ensure we do null -> reference type conversion
14628         checking.
14629
14630         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14631         temporary Expression objects.
14632
14633 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14634
14635         * interface.cs: workaround bug in method overloading resolution
14636         (there is already a bugzilla bug for it).
14637
14638 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14639
14640         We could also solve this problem by having a separate path for
14641         performing type lookups, instead of DoResolve, we could have a
14642         ResolveType entry point, and only participating pieces of the
14643         production (simplename, deref, array) would implement this. 
14644
14645         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14646         signal SimpleName to only resolve type names and not attempt to
14647         resolve anything else.
14648
14649         * expression.cs (Cast): Set the flag.
14650
14651         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14652
14653         * class.cs: Only report 108 if there is no `new' modifier.
14654
14655         * cs-parser.jay: rework foreach statement to work with the new
14656         changes to the policy on SimpleNames.
14657         
14658         * report.cs: support Stacktrace on warnings as well.
14659
14660         * makefile: drop --unsafe and /unsafe from the compile.
14661
14662 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14663
14664         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14665         lookups here, instead of doing that at parse time.  This means
14666         that our grammar will not introduce `LocalVariableReferences' as
14667         expressions at this point.  That solves the problem of code like
14668         this:
14669
14670         class X {
14671            static void Main ()
14672            { int X = 1;
14673             { X x = null }}}
14674
14675         This is only half the fix.  The full fix requires parameters to
14676         also be handled in this way.
14677
14678         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14679         makes the use more obvious of the DeclSpace.  The
14680         ec.TypeContainer.TypeBuilder is now only used to pull the
14681         TypeBuilder for it.
14682
14683         My theory is that I can get rid of the TypeBuilder completely from
14684         the EmitContext, and have typecasts where it is used (from
14685         DeclSpace to where it matters).  
14686
14687         The only pending problem is that the code that implements Aliases
14688         is on TypeContainer, and probably should go in DeclSpace.
14689
14690         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14691         lookups here, instead of doing that at parse time.  This means
14692         that our grammar will not introduce `LocalVariableReferences' as
14693         expressions at this point.  That solves the problem of code like
14694         this:
14695
14696         class X {
14697            static void Main ()
14698            { int X = 1;
14699             { X x = null }}}
14700
14701         This is only half the fix.  The full fix requires parameters to
14702         also be handled in this way.
14703
14704         * class.cs (Property.DefineMethod): When implementing an interface
14705         method, set newslot, when implementing an abstract method, do not
14706         set the flag (before we tried never setting it, or always setting
14707         it, which is the difference).
14708         (Indexer.DefineMethod): same.
14709         (Method.DefineMethod): same.
14710
14711         * ecore.cs: Only set the status used flag if we get back a Field.
14712
14713         * attribute.cs: Temporary hack, so Paolo can keep working.
14714
14715 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14716
14717         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14718         the unmanaged type in the case we have a MarshalAs attribute.
14719
14720         (Resolve): Handle the case when we are parsing the special MarshalAs
14721         attribute [we need to store the unmanaged type to use later]
14722
14723         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14724         MarshalAs Attribute.
14725
14726         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14727         on parameters and accordingly set the marshalling info.
14728
14729 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14730
14731         * class.cs: Optimizing slightly by removing redundant code after
14732         we switched to the `NoTypes' return value.
14733         (Property.DefineMethod): use NoTypes here too.
14734
14735         This fixes the bug I introduced in my last batch of changes.
14736
14737 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14738
14739         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14740
14741         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14742         Enums since those are types too. 
14743
14744         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14745
14746         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14747         thanks to a call during the lookup process.
14748
14749 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14750
14751         * statement.cs (Foreach): Lots of work to accomodate a particular
14752         kind of foreach statement that I had not kept in mind.  It is
14753         possible to have foreachs on classes that provide a GetEnumerator
14754         method that return objects that implement the "pattern" for using
14755         a foreach, there is no need to support GetEnumerator
14756         specifically. 
14757
14758         This is needed to compile nant.
14759
14760         * decl.cs: Only report 114 if the member is not `Finalize' and if
14761         the warning level is at least 2.
14762
14763         * class.cs: Moved the compare function from Method to
14764         MethodSignature. 
14765
14766         (MethodSignature.InheritableMemberSignatureCompare): Add new
14767         filter function that is used to extract inheritable methods from a
14768         class. 
14769
14770         (Method.Define): Use the new `inheritable_method_signature_filter'
14771         delegate
14772
14773         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14774         command. 
14775
14776 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14777
14778         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14779
14780         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14781
14782         * expression.cs: Pass location information to
14783         ConvertImplicitStandard. 
14784
14785         * class.cs: Added debugging code to track return values from
14786         interfaces. 
14787
14788 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14789
14790         * expression.cs (Is.DoResolve): If either side of the `is' is an
14791         interface, do not flag the warning.
14792
14793         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14794         for interfaces
14795
14796         * report.cs: Allow for --fatal to be used with --probe.
14797
14798         * typemanager.cs (NoTypes): Move the definition for the empty Type
14799         array here. 
14800
14801         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14802         properties. 
14803         (TypeContainer.DefineProxy): New function used to proxy to parent
14804         implementations when implementing interfaces.
14805         (TypeContainer.ParentImplements): used to lookup if our parent
14806         implements a public function that is required by an interface.
14807         (TypeContainer.VerifyPendingMethods): Hook this up.
14808
14809         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14810         `modules' and `assemblies' arraylists into arrays.  We only grow
14811         these are the very early start up of the program, so this improves
14812         the speedof LookupType (nicely measured).
14813
14814         * expression.cs (MakeByteBlob): Replaced unsafe code with
14815         BitConverter, as suggested by Paolo.
14816
14817         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14818         folding of string concatenation, but if either side is a string,
14819         and the other is not, then return null, and let the runtime use
14820         the concatenation on the string plus the object (using
14821         `Object.ToString'). 
14822
14823 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14824
14825         Constant Folding has been implemented now.
14826
14827         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14828         the error instead on types that are not supported in one's
14829         complement. 
14830
14831         * constant.cs (Constant and all children): New set of functions to
14832         perform implict and explicit conversions.
14833
14834         * ecore.cs (EnumConstant): Implement the new functions to perform
14835         conversion by proxying to the child expression.
14836
14837         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14838         own separate setting that can not be turned off from the command
14839         line using --unchecked or --checked and is only controlled using
14840         the checked/unchecked statements and expressions.  This setting is
14841         used by the constant folder to flag errors.
14842
14843         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14844         ConstantCheckState as well.   
14845
14846         During Resolve, they also have to flag the state, because the
14847         constant folder runs completely in the Resolve phase.
14848
14849         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14850         well.
14851
14852 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14853
14854         * cfold.cs: New file, this file contains the constant folder.
14855
14856         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14857         argument to track whether we are using the resulting address to
14858         load or store a value and provide better error messages. 
14859
14860         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14861         new AddressOf arguments.
14862
14863         * statement.cs (Foreach.EmitCollectionForeach): Update
14864
14865         * expression.cs (Argument.Emit): Call AddressOf with proper
14866         arguments to track usage.
14867
14868         (New.DoEmit): Call AddressOf with new arguments.
14869
14870         (Unary.Emit): Adjust AddressOf call.
14871
14872 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14873
14874         * cs-parser.jay (member_access): Change the case for pre-defined types
14875         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14876         this suggestion.
14877
14878         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14879         a method body.
14880
14881         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14882         essentially like methods and apply attributes like MethodImplOptions to them too.
14883
14884         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14885         not being null.
14886
14887         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14888         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14889         is the DeclSpace.
14890
14891         * Update code everywhere accordingly.
14892
14893         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14894
14895         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14896
14897 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14898
14899         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14900         try performing lookups against those instead of jumping straight into using
14901         the 'using' clauses.
14902
14903         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14904
14905         (LookupType): Perform lookups in implicit parents too.
14906
14907         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14908         sequence as RootContext.LookupType. 
14909
14910         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14911         the various cases of namespace lookups into this method.
14912
14913 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14914
14915         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14916         in positional arguments)
14917
14918         * class.cs (Operator): Update the AllowedModifiers to contain
14919         extern. 
14920
14921         * cs-parser.jay: Update operator declaration to allow for the
14922         operator body to be empty.
14923
14924         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14925         values. 
14926
14927 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14928
14929         * class.cs (Method.Emit): Label parameters.
14930
14931         * driver.cs: Return 1 or 0 as the program exit code.
14932
14933 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14934
14935         * expression.cs: Special case the `null' object when trying to
14936         auto-compute the type, as anything can be explicitly converted to
14937         that. 
14938
14939         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14940         spotting this Paolo.
14941
14942         (Expression.ImplicitNumericConversion): Perform comparissions of
14943         the type using the underlying type in the case of an enumeration
14944         rather than using the enumeration type for the compare.
14945
14946         Cope with the underlying == type case, which is not possible to
14947         catch before. 
14948
14949         (Expression.ConvertNumericExplicit): Perform comparissions of
14950         the type using the underlying type in the case of an enumeration
14951         rather than using the enumeration type for the compare.
14952
14953         * driver.cs: If the user does not supply an extension, assume .exe
14954
14955         * cs-parser.jay (if_statement): Rewrote so that we can track the
14956         location for the if statement.
14957
14958         * expression.cs (Binary.ConstantFold): Only concat strings when
14959         the operation is "+", not everything ;-)
14960
14961         * statement.cs (Statement.EmitBoolExpression): Take a location
14962         argument. 
14963         (If, While, Do): Track location.
14964
14965         * expression.cs (Binary.ResolveOperator): In the object + string
14966         case, I was missing a call to ConvertImplicit
14967
14968 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14969
14970         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14971         Location arguments. Ensure we use RootContext.LookupType to do our work
14972         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14973
14974         * interface.cs (PopulateMethod): Handle the type of the parameter being
14975         null gracefully.
14976
14977         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14978         have a params method with no fixed arguments and a call is made with no
14979         arguments.
14980
14981 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14982
14983         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14984         the verbatim-string-literal
14985
14986         * support.cs (InternalParameters.ParameterModifier): handle null
14987         fixed parameters.
14988         (InternalParameters.ParameterType): ditto.
14989
14990         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14991         duplicating the name of the variable parameter.
14992         (GetParameterByName): Fix bug where we were not looking up array
14993         paramters if they were the only present (thanks Paolo!).
14994         (GetParameterInfo): We only have an empty set of types if both
14995         fixed and array are set to null.
14996         (GetParameterInfo-idx): Handle FixedParameter == null
14997
14998         * cs-parser.jay: Handle the case where there is no catch
14999         statements (missing null test).
15000
15001 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15002
15003         * driver.cs (MainDriver): Be conservative on our command line
15004         handling.
15005
15006         Catch DirectoryNotFoundException when calling GetFiles.
15007
15008         (SplitPathAndPattern): Used to split the input specification into
15009         a path and a pattern that we can feed to Directory.GetFiles.
15010
15011 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15012
15013         * statement.cs (Fixed): Implement the last case of the Fixed
15014         statement (string handling).
15015
15016         * expression.cs (StringPtr): New class used to return a char * to
15017         a string;  Used by the Fixed statement.
15018
15019         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15020
15021         * expression.cs (Binary.ResolveOperator): Remove redundant
15022         MemberLookup pn parent type.
15023         Optimize union call, we do not need a union if the types are the same.
15024         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15025         type.
15026
15027         Specialize the use of MemberLookup everywhere, instead of using
15028         the default settings. 
15029
15030         (StackAlloc): Implement stackalloc keyword.
15031
15032         * cs-parser.jay: Add rule to parse stackalloc.
15033
15034         * driver.cs: Handle /h, /help, /?
15035
15036         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15037         before we supported unsafe code.
15038
15039         * makefile: add --unsafe to the self compilation of mcs.
15040
15041 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * expression.cs (PointerArithmetic): New class that is used to
15044         perform pointer arithmetic.
15045         (Binary.Resolve): Handle pointer arithmetic
15046         Handle pointer comparission.
15047         (ArrayPtr): Utility expression class that is used to take the
15048         address of an array.
15049
15050         (ElementAccess): Implement array access for pointers
15051
15052         * statement.cs (Fixed): Implement fixed statement for arrays, we
15053         are missing one more case before we are done.
15054
15055         * expression.cs (Indirection): Implement EmitAssign and set the
15056         ExprClass to Variable.  This allows pointer dereferences to be
15057         treated as variables, and to have values assigned to them.
15058
15059         * ecore.cs (Expression.StoreFromPtr): New utility function to
15060         store values dereferencing.
15061
15062 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15063
15064         * expression.cs (Binary.ResolveOperator): Ensure that we are
15065         not trying to operate on a void type - this fixes the reported
15066         bug.
15067
15068         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15069         the parent implementation is sealed.
15070
15071         * ../errors/cs0239.cs : Add.
15072
15073         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15074
15075         * typemanager.cs (unverifiable_code_type): Corresponds to 
15076         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15077         which have unsafe code in them.
15078
15079         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15080         unsafe context.
15081
15082 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15083
15084         * cs-tokenizer.cs: Add support for @"litreal strings"
15085
15086         Make tokenizer accept pre-processor directives
15087         on any column (remove the old C-like limitation). 
15088
15089         * rootcontext.cs (EmitCode): Emit any global attributes.
15090         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15091
15092         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15093
15094         * cs-parser.jay: Add support for global attributes.  
15095
15096 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15097
15098         * expression.cs (Indirection): New helper class.  Unary will
15099         create Indirection classes to be able to implement the
15100         IMemoryLocation interface on it.
15101
15102 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15103
15104         * cs-parser.jay (fixed_statement): reference the right statement.
15105
15106         * statement.cs (Fixed.Emit): Finish implementing the fixed
15107         statement for the &x case.
15108
15109 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15110
15111         * class.cs (Property.Define, Method.Define): Remove newslot when
15112         `implementing'.  
15113
15114         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15115         wrong.  NewSlot should only be used if the `new' keyword is present.
15116
15117         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15118         locating our system dir.  Sorry about this.
15119
15120 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15121
15122         * driver.cs (GetSystemDir): Compute correctly the location of our
15123         system assemblies.  I was using the compiler directory instead of
15124         the library directory.
15125
15126 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15127
15128         * expression.cs (BetterFunction): Put back in what Miguel commented out
15129         since it is the correct fix. The problem is elsewhere ;-)
15130
15131         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15132         parameters of the parms method are themselves compatible or not !
15133
15134         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15135         to check that a class implements an interface before saying that an implicit
15136         conversion was allowed. Use ImplementsInterface to do the checking.
15137
15138 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15139
15140         * class.cs (Method.Define): Track whether we are an explicit
15141         implementation or not.  And only call DefineMethodOverride if we
15142         are an explicit implementation.
15143
15144         (Property.DefineMethod): Ditto.
15145
15146 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15147
15148         * expression.cs (BetterFunction): Catch hideous bug which was
15149          preventing us from detecting ambiguous calls due to implicit casts i.e
15150         cs0121.
15151
15152 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15153
15154         * support.cs (Pair): Remove un-needed method.  I figured why I was
15155         getting the error in cs-parser.jay, the variable in a foreach loop
15156         is readonly, and the compiler does not really treat this as a variable.
15157
15158         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15159         instead of EQUALS in grammar.  
15160
15161         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15162
15163         * expression.cs (Unary.DoResolve): Check whether the argument is
15164         managed or not.
15165
15166 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15167
15168         * support.cs: Api for Pair to set a value.  Despite the fact that
15169         the variables are public the MS C# compiler refuses to compile
15170         code that accesses the field if the variable is part of a foreach
15171         statement. 
15172
15173         * statement.cs (Fixed): Begin implementation of the fixed
15174         statement.
15175
15176         (Block.AddVariable): Return the VariableInfo on success and null
15177         on failure instead of true/false. 
15178
15179         * cs-parser.jay (foreach): Catch errors on variables already
15180         defined (we were ignoring this value before) and properly unwind
15181         the block hierarchy
15182
15183         (fixed_statement): grammar for the fixed statement.
15184
15185 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15186
15187         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15188         pointer types to be incretemented.
15189
15190         (SizeOf): Implement.
15191
15192         * cs-parser.jay (pointer_member_access): Implement
15193         expr->IDENTIFIER production.
15194
15195         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15196         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15197         on safe contexts.
15198
15199         (Unary): Implement indirection.
15200
15201         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15202         use in non-unsafe context).
15203
15204         (SimpleName.DoResolve): Check for pointers in field access on safe
15205         contexts. 
15206
15207         (Expression.LoadFromPtr): Factor the load-indirect code in this
15208         function.  This was duplicated in UnboxCast and ParameterReference
15209
15210 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15211
15212         * expression.cs (ComposedCast): report an error if a pointer cast
15213         is used in a safe region.
15214
15215         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15216         pointer type casts in unsafe context.
15217
15218         * codegen.cs (EmitContext): Set up IsUnsafe.
15219
15220         * cs-parser.jay (non_expression_type): Add productions for pointer
15221         casts. 
15222
15223         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15224         code.  We should not use force into static mode if the method is
15225         not virtual.  Fixes bug in MIS
15226
15227         * statement.cs (Do.Emit, While.Emit, For.Emit,
15228         Statement.EmitBoolExpression): Add support to Do and While to
15229         propagate infinite loop as `I do return' semantics.
15230
15231         Improve the For case to also test for boolean constants.
15232
15233         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15234         to the list of attributes we can add.
15235
15236         Remove `EmitContext' argument.
15237
15238         * class.cs (Method.Define): Apply parameter attributes.
15239         (Constructor.Define): Apply parameter attributes.
15240         (MethodCore.LabelParameters): Move here the core of labeling
15241         parameters. 
15242
15243         * support.cs (ReflectionParameters.ParameterModifier,
15244         InternalParameters.ParameterModifier): Use IsByRef on the type and
15245         only return the OUT bit for these parameters instead of in/out/ref
15246         flags.
15247
15248         This is because I miss-understood things.  The ParameterInfo.IsIn
15249         and IsOut represent whether the parameter has the [In] and [Out]
15250         attributes set.  
15251
15252 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15253
15254         * ecore.cs (FieldExpr.Emit): Release temporaries.
15255
15256         * assign.cs (LocalTemporary.Release): new function.
15257
15258         * codegen.cs (EmitContext.GetTemporaryStorage,
15259         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15260         temporary storage.  Now we can "put back" localbuilders when we
15261         are done with them
15262
15263 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15264
15265         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15266         need to make a copy of the variable to generate verifiable code.
15267
15268 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15269
15270         * driver.cs: Compute dynamically the system directory.
15271
15272         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15273         Slower, but more generally useful.  Used by the abstract
15274         registering implementation. 
15275
15276         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15277         the rules for the special rule on Type/instances.  First check if
15278         we have the same name, and if so, try that special static path
15279         rather than the instance path.
15280
15281 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15282
15283         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15284         for, while and if.
15285
15286         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15287         Enum, ValueType, Delegate or Array for non-corlib compiles.
15288
15289         * cs-tokenizer.cs: Catch long identifiers (645)
15290
15291         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15292         piece of code.
15293
15294         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15295         fix, we were returning too early, so we were not registering
15296         pending methods from abstract classes.
15297
15298         Do not register pending methods if the class is abstract.
15299
15300         * expression.cs (Conditional.DoResolve): Report circular implicit
15301         conversions when we neecd to compute it for conditional
15302         expressions. 
15303
15304         (Is.DoResolve): If the expression is always of the provided type,
15305         flag warning 183.  If the expression can not ever be of the
15306         provided type flag warning 184.
15307
15308         * class.cs: Catch 169 as well.
15309
15310         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15311         read. 
15312
15313 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15314
15315         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15316
15317 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15318
15319         * interface.cs: (PopulateMethod): Check for pointers being defined
15320         only if the unsafe context is active.
15321         (PopulateProperty): ditto.
15322         (PopulateIndexer): ditto.
15323
15324         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15325         specified.  If pointers are present, make sure that they are
15326         present in an unsafe context.
15327         (Constructor, Constructor.Define): ditto.
15328         (Field, Field.Define): ditto.
15329         (Property, Property.Define): ditto.
15330         (Event, Event.Define): ditto.
15331
15332         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15333         hashtable if there are classes or structs defined.
15334
15335         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15336         code, as the constant resolution moved.
15337
15338         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15339         the metadata, so we can flag error 133. 
15340
15341         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15342         pointer is being declared in an unsafe context.
15343
15344 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15345
15346         * modifiers.cs (Modifiers.Check): Require a Location argument.
15347         Report error 227 for Unsafe use.
15348
15349         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15350
15351         * statement.cs (For.Emit): If the test is null, then report that
15352         we do `return', as we wont reach anything afterwards.
15353
15354         (Switch.SwitchGoverningType): Track the expression that matched
15355         the conversion.
15356
15357         * driver.cs: Allow negative numbers as an error code to flag.
15358
15359         * cs-parser.jay: Handle 1551.
15360
15361         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15362
15363 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15364
15365         * cs-parser.jay: Report 1518 (type declaration can only contain
15366         class, struct, interface, enum or delegate)
15367
15368         (switch_label): Report 1523 (keywords `case' or `default' must
15369         preced code)
15370
15371         (opt_switch_sections): Report 1522 (empty switch)
15372
15373         * driver.cs: Report 1515 (response file specified multiple times)
15374         Report 1516 (Source file specified multiple times).
15375
15376         * expression.cs (Argument.Resolve): Signal 1510
15377
15378         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15379         access not allowed in static code)
15380
15381 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15382
15383         * typemanager.cs (IsPointerType): Utility method which we are going
15384         to need a lot.
15385
15386         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15387         the object type, so we take care of that.
15388
15389         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15390
15391         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15392         added to non-params parameters :-)
15393
15394         * typemanager.cs (CSharpName): Include 'void' type too. 
15395
15396         (void_ptr_type): Include in the set of core types.
15397
15398         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15399         duplicating code.
15400
15401         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15402         an unsafe context.
15403
15404         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15405         completely forgotten about it.
15406
15407 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15408
15409         * cs-parser.jay (pointer_type): Add. This begins our implementation
15410         of parsing rules for unsafe code.
15411
15412         (unsafe_statement): Implement.
15413
15414         (embedded_statement): Modify to include the above.
15415
15416         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15417
15418         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15419         if the current context is an unsafe one.
15420
15421         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15422         are handled differently, we need separate rules for them.
15423
15424         (local_variable_declaration): Update to use local_variable_pointer_type
15425         to allow variable declarations of unmanaged pointer types.
15426
15427         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15428         in unsafe contexts.
15429
15430         * ../errors/cs0214.cs : Add.
15431
15432 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15433
15434         * makefile: remove 'response' file when cleaning.
15435
15436 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15437
15438         * cs-parser.jay: Report 1524.
15439
15440 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15441
15442         * typemanager.cs (RegisterMethod): drop checking if we have
15443         registered this from here
15444
15445 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15446
15447         * class.cs (Method.EmitDestructor): Implement calling our base
15448         destructor. 
15449
15450         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15451         value of InFinally.
15452
15453         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15454         this routine and will wrap the call in a try/catch block.  Deal
15455         with the case.
15456
15457 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15458
15459         * ecore.cs (Expression.MemberLookup): instead of taking a
15460         parameter `same_type' that was used to tell whether we could
15461         access private members we compute our containing type from the
15462         EmitContext.
15463
15464         (FieldExpr): Added partial support for volatile fields.  This does
15465         not work for volatile fields exposed from assemblies, as I can not
15466         figure out how to extract the modreq from it.
15467
15468         Updated all the source files to use this.
15469
15470         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15471         because it is referenced by MemberLookup very often. 
15472
15473 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15474
15475         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15476         TypeBuilder.GetCustomAttributes to retrieve what we need.
15477
15478         Get rid of redundant default_member_attr_type as this is the same as
15479         default_member_type which already exists.
15480
15481         * interface.cs, attribute.cs : Update accordingly.
15482
15483 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15484
15485         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15486         work for TYpeBuilders though.  Ravi, can you please fix this?
15487
15488         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15489
15490         * expression.cs (Argument.Emit): Handle the case of ref objects
15491         being passed to ref functions;  
15492
15493         (ParameterReference.EmitLoad): Loads the content of the pointer
15494         without dereferencing.
15495
15496 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15497
15498         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15499
15500 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15501
15502         * class.cs (Indexer.DefineMethod): Incorporate the interface
15503         type in the name of the method if we are doing explicit interface
15504         implementation.
15505
15506         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15507
15508         (BetterConversion): Fix extremely trivial bug where we were referring to
15509         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15510         again !
15511
15512         * ../errors/bug16.cs : Add although we have fixed it.
15513
15514 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15515
15516         * expression.cs (BaseIndexer): Begin implementation.
15517
15518         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15519
15520         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15521         production directly to remove a shift/reduce, and implement
15522         explicit interface implementation.
15523
15524         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15525         after a floating point suffix.
15526
15527         * expression.cs (DoNumericPromotions): Improved the conversion for
15528         uint/uint.  If we have a constant, we avoid doing a typecast to a
15529         larger type.
15530
15531         * class.cs (Indexer): Implement explicit interface implementation
15532         for indexers.
15533
15534 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15535
15536         * class.cs: make the default instance constructor public and hidebysig.
15537
15538 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15539
15540         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15541         so we can call it from elsewhere.
15542
15543         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15544         we emit it internally if the class has a defined indexer; otherwise the user
15545         emits it by decorating the class definition with the DefaultMemberAttribute.
15546
15547         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15548         attribute is not used on a type which defines an indexer.
15549
15550         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15551         character when we skip whitespace.
15552
15553         * ../errors/cs0646.cs : Add.
15554
15555 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15556
15557         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15558         again. 
15559
15560         * makefile: Add practical target `mcs3.exe' which builds the third
15561         generation compiler. 
15562
15563         * expression.cs (New): Fix structures constructor calling.
15564
15565         * class.cs (Property, Method, Indexer): Emit Final flag on the
15566         method if we are an interface implementation and we are not
15567         abstract. 
15568
15569         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15570         whether this property is referencing a `base' method.
15571
15572         * expression.cs (Invocation.EmitCall): take an extra argument:
15573         is_base, this is used to determine whether the `call' or
15574         `callvirt' opcode should be used.
15575
15576
15577         * delegate.cs: update EmitCall.
15578
15579         * class.cs (Method.Define): Set NewSlot for the cases where we are
15580         not implementing an interface method.
15581
15582         (Property.Define): ditto.
15583
15584 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15585
15586         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15587         'r'.  Allows mcs to parse itself fully.
15588
15589 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15590
15591         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15592         of the number of initializers that require the InitializeArray method.
15593
15594         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15595         update the above field where necessary.
15596
15597         (MakeByteBlob): Update accordingly.
15598
15599         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15600         greater than 2.
15601
15602         (EmitDynamicInitializers): Update in accordance with the new optimization.
15603
15604         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15605         same OpCode applies.
15606
15607         * cs-parser.jay : Fix some glaring errors I introduced.
15608
15609 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15610
15611         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15612         so that we can check for name clashes there too.
15613
15614         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15615         for interface indexers.
15616
15617         * interfaces.cs (Define): Emit the default member attribute.
15618
15619         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15620         variable was being referred to while setting the value ;-)
15621
15622 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15623
15624         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15625         byte-by-byte information when we know the data is zero.
15626
15627         Make the block always a multiple of 4, because
15628         DefineInitializedData has a bug.
15629
15630         * assign.cs: Fix, we should assign from the temporary, not from
15631         the source. 
15632
15633         * expression.cs (MakeByteBlob): Fix my incorrect code.
15634
15635 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15636
15637         * typemanager.cs (EnumToUnderlying): This function is used to get
15638         the underlying type from an enumeration, because it does not
15639         always work. 
15640
15641         * constant.cs: Use the I4_S form for values between -128 and 127.
15642
15643         * statement.cs (Block.LookupLabel): Looks up a label.
15644         (Block): Drop support for labeled blocks.
15645
15646         (LabeledStatement): New kind of statement that represents a label
15647         only.
15648
15649         (Goto): Finally implement this bad boy.
15650
15651         * cs-parser.jay: Update to reflect new mechanism to implement
15652         labels.
15653
15654 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15655
15656         * codegen.cs (EmitContext.This): a codegen property that keeps the
15657         a single instance of this instead of creating many different this
15658         instances. 
15659
15660         * delegate.cs (Delegate.DoResolve): Update to use the property;
15661
15662         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15663
15664         * expression.cs (BaseAccess.DoResolve): Ditto.
15665
15666 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15667
15668         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15669         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15670
15671         (InitCoreTypes): Update accordingly.
15672
15673         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15674         so we can quickly store the state.
15675
15676         (ApplyAttributes): Set the correct implementation flags
15677         for InternalCall methods.
15678
15679 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15680
15681         * expression.cs (EmitCall): if a method is not virtual, then do
15682         not use callvirt on it.
15683
15684         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15685         user defined stuff) requires the use of stobj, which takes an
15686         address on the stack instead of an array and an index.  So emit
15687         the Ldelema operation for it.
15688
15689         (EmitStoreOpcode): Use stobj for valuetypes.
15690
15691         (UnaryMutator.EmitCode): Use the right 1 value depending on
15692         whether we are dealing with int64/uint64, float or doubles.
15693
15694         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15695         constructors that I implemented last night.
15696
15697         (Constructor.IsDefault): Fix to work properly for static
15698         constructors.
15699
15700         * cs-parser.jay (CheckDef): report method signature errors.
15701         Update error number 103 to be 132.
15702
15703         * decl.cs: New AdditionResult enumeration value: MethodExists.
15704         Although we do this check for methods later on in the semantic
15705         analysis, catching repeated default constructors is so easy that
15706         we catch these here. 
15707
15708         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15709         promotions code.
15710
15711         (ParameterReference.EmitAssign, Emit): handle
15712         bools as bytes.
15713
15714         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15715         (ArrayAccess.EmitStoreOpcode): ditto.
15716
15717         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15718
15719         * expression.cs (MakeByteBlob): Complete all the missing types
15720         (uint, short, ushort, byte, sbyte)
15721
15722         * class.cs: Only init instance field initializers on instance
15723         constructors. 
15724
15725         Rename `constructors' to instance_constructors. 
15726
15727         (TypeContainer.AddConstructor): Only add constructors to the list
15728         if it is not static.
15729
15730         Make sure that we handle default_static_constructor independently
15731         everywhere where we handle instance_constructors
15732
15733 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15734
15735         * class.cs: Do not lookup or create a base initializer for a
15736         static constructor.
15737
15738         (ConstructorInitializer.Resolve): use the proper type to lookup
15739         for constructors.
15740
15741         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15742
15743         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15744         in DeclSpace. 
15745
15746         * decl.cs: CloseType is now an virtual method, the default
15747         implementation just closes this type.
15748
15749 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15750
15751         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15752         to PreserveSig by default. Also emit HideBySig on such methods.
15753
15754         Basically, set the defaults to standard values.
15755
15756         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15757         argument, if candidate is better, it can't be worse than the best !
15758
15759         (Invocation): Re-write bits to differentiate between methods being
15760         applicable in their expanded form and their normal form - for params
15761         methods of course.
15762
15763         Get rid of use_standard everywhere as only standard conversions are allowed
15764         in overload resolution. 
15765
15766         More spec conformance.
15767
15768 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15769
15770         * driver.cs: Add --timestamp, to see where the compiler spends
15771         most of its time.
15772
15773         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15774         `this' in static code.
15775
15776         (SimpleName.DoResolve): Implement in terms of a helper function
15777         that allows static-references to be passed upstream to
15778         MemberAccess.
15779
15780         (Expression.ResolveWithSimpleName): Resolve specially simple
15781         names when called by MemberAccess to implement the special
15782         semantics. 
15783
15784         (Expression.ImplicitReferenceConversion): Handle conversions from
15785         Null to reference types before others, as Null's type is
15786         System.Object. 
15787
15788         * expression.cs (Invocation.EmitCall): Handle the special case of
15789         calling methods declared on a reference type from a ValueType
15790         (Base classes System.Object and System.Enum)
15791
15792         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15793         the left hand side is a TypeExpr, not on every enumeration. 
15794
15795         (Binary.Resolve): If types are reference types, then do a cast to
15796         object on operators != and == of both arguments.
15797
15798         * typemanager.cs (FindMembers): Extract instance and static
15799         members if requested.
15800
15801         * interface.cs (PopulateProperty): Use void_type instead of null
15802         as the return type for the setter method.
15803
15804         (PopulateIndexer): ditto.
15805
15806 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15807
15808         * support.cs (ReflectionParameters): Fix minor bug where we
15809         were examining the wrong parameter for the ParamArray attribute.
15810
15811         Cope with requests for the type of the parameter at position
15812         greater than the params parameter's. We now return the element
15813         type of the params array as that makes more sense.
15814
15815         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15816         accordingly as we no longer have to extract the element type
15817         ourselves.
15818
15819         (Invocation.OverloadResolve): Update.
15820
15821 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15822
15823         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15824         against IEnumerator, test whether the return value is a descendant
15825         of the IEnumerator interface.
15826
15827         * class.cs (Indexer.Define): Use an auxiliary method to implement
15828         the other bits of the method definition.  Begin support for
15829         explicit interface implementation.
15830
15831         (Property.DefineMethod): Use TypeManager.void_type instead of null
15832         for an empty return value.
15833
15834 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15835
15836         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15837         dealing with a FieldExpr which is composed of a FieldBuilder, in
15838         the code path we did extract the constant, but we should have
15839         obtained the underlying value to be able to cast it (otherwise we
15840         end up in an infinite loop, this is what Ravi was running into).
15841
15842         (ArrayCreation.UpdateIndices): Arrays might be empty.
15843
15844         (MemberAccess.ResolveMemberAccess): Add support for section
15845         14.5.4.1 that deals with the special case of E.I when E is a type
15846         and something else, that I can be a reference to a static member.
15847
15848         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15849         handle a particular array type to create byte blobs, it is just
15850         something we dont generate byteblobs for.
15851
15852         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15853         arguments. 
15854
15855         * location.cs (Push): remove the key from the hashtable that we
15856         are about to add.   This happens for empty files.
15857
15858         * driver.cs: Dispose files after we have parsed them.
15859
15860         (tokenize): new function that only runs the tokenizer on its
15861         input, for speed testing.
15862
15863 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15864
15865         * class.cs (Event.Define): Define the private field only if there
15866         are no accessors defined.
15867
15868         * expression.cs (ResolveMemberAccess): If there is no associated
15869         field with the event, that means we have an event defined with its
15870         own accessors and we should flag error cs0070 since transforming
15871         ourselves into a field is not valid in that case.
15872
15873         * ecore.cs (SimpleName.DoResolve): Same as above.
15874
15875         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15876         and charset to sane values.
15877
15878 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15879
15880         * assign.cs (DoResolve): Perform check on events only if they 
15881         are being accessed outside the declaring type.
15882
15883         * cs-parser.jay (event_declarations): Update rules to correctly
15884         set the type of the implicit parameter etc.
15885
15886         (add_accessor, remove_accessor): Set current local parameters.
15887
15888         * expression.cs (Binary): For delegate addition and subtraction,
15889         cast the return value from the method into the appropriate delegate
15890         type.
15891
15892 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15893
15894         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15895         of these as the workaround is unnecessary.
15896
15897         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15898         delegate data - none of that is needed at all.
15899
15900         Re-write bits to extract the instance expression and the delegate method
15901         correctly.
15902
15903         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15904         on delegates too.
15905
15906         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15907         of attaching attributes instead of duplicating code everywhere.
15908
15909         * everywhere : Update code to do attribute emission using the above method.
15910
15911 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15912
15913         * expression.cs (IsParamsMethodApplicable): if there are not
15914         parameters, return immediately.
15915
15916         * ecore.cs: The 0 literal can be implicity converted to an enum
15917         type. 
15918
15919         (SimpleName.DoResolve): First lookup the type, then lookup the
15920         members. 
15921
15922         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15923         want to get its address.  If the InstanceExpression is not
15924         addressable, store the result in a temporary variable, then get
15925         the address of it.
15926
15927         * codegen.cs: Only display 219 errors on warning level or above. 
15928
15929         * expression.cs (ArrayAccess): Make it implement the
15930         IMemoryLocation interface.
15931
15932         (Binary.DoResolve): handle the operator == (object a, object b)
15933         and operator != (object a, object b) without incurring into a
15934         BoxedCast (because 5 != o should never be performed).
15935
15936         Handle binary enumerator operators.
15937
15938         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15939         value type, otherwise use Ldelem_ref.
15940
15941         Use precomputed names;
15942
15943         (AddressOf): Implement address of
15944
15945         * cs-parser.jay (labeled_statement): Fix recursive block
15946         addition by reworking the production.
15947
15948         * expression.cs (New.DoEmit): New has a special case:
15949                 
15950                  If we are dealing with a ValueType, we have a few
15951                  situations to deal with:
15952                 
15953                     * The target of New is a ValueType variable, that is
15954                       easy, we just pass this as the variable reference
15955                 
15956                     * The target of New is being passed as an argument,
15957                       to a boxing operation or a function that takes a
15958                       ValueType.
15959                 
15960                       In this case, we need to create a temporary variable
15961                       that is the argument of New.
15962
15963
15964 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15965
15966         * rootcontext.cs (LookupType): Check that current_type is not null before
15967         going about looking at nested types.
15968
15969         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15970         not implement the IAssignMethod interface any more.
15971
15972         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15973         where we tranform them into FieldExprs if they are being resolved from within
15974         the declaring type.
15975
15976         * ecore.cs (SimpleName.DoResolve): Do the same here.
15977
15978         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15979
15980         * ../errors/bug10.cs : Add.
15981
15982         * ../errors/cs0070.cs : Add.
15983
15984         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15985
15986         * assign.cs : Get rid of EventIsLocal everywhere.
15987
15988 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15989
15990         * ecore.cs (ConvertIntLiteral): finished the implementation.
15991
15992         * statement.cs (SwitchLabel): Convert the value we are using as a
15993         key before looking up the table.
15994
15995 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15996
15997         * codegen.cs (EmitTopBlock): Require a Location argument now.
15998
15999         * cs-parser.jay (constructor_declarator): We need to setup
16000         current_local_parameters before we parse the
16001         opt_constructor_initializer, to allow the variables to be bound
16002         to the constructor arguments.
16003
16004         * rootcontext.cs (LookupType): First lookup nested classes in our
16005         class and our parents before we go looking outside our class.
16006
16007         * expression.cs (ConstantFold): Extract/debox the values at the
16008         beginnning. 
16009
16010         * rootcontext.cs (EmitCode): Resolve the constants first before we
16011         resolve the types.  This is not really needed, but it helps debugging.
16012
16013         * statement.cs: report location.
16014
16015         * cs-parser.jay: pass location to throw statement.
16016
16017         * driver.cs: Small bug fix.
16018
16019         * report.cs: Updated format to be 4-zero filled digits.
16020
16021 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16022
16023         * expression.cs (CheckIndices): Fix minor bug where the wrong
16024         variable was being referred to ;-)
16025
16026         (DoEmit): Do not call EmitStaticInitializers when the 
16027         underlying type is System.Object.
16028
16029 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16030
16031         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16032         and do the usual workaround for SRE.
16033
16034         * class.cs (MyEventBuilder.EventType): New member to get at the type
16035         of the event, quickly.
16036
16037         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16038
16039         * assign.cs (Assign.DoResolve): Handle the case when the target
16040         is an EventExpr and perform the necessary checks.
16041
16042         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16043         interface.
16044
16045         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16046
16047         (EventExpr): Set the type in the constructor itself since we 
16048         are meant to be born fully resolved.
16049
16050         (EventExpr.Define): Revert code I wrote earlier.
16051                 
16052         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16053         instance expression is null. The instance expression is a This in that case
16054         or a null, depending on whether it is a static method or not.
16055
16056         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16057         refers to more than one method.
16058
16059         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16060         and accordingly flag errors.
16061
16062 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16063
16064         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16065
16066 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16067
16068         * location.cs (ToString): Provide useful rutine.
16069
16070 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16071
16072         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16073         objects, return the actual integral boxed.
16074
16075         * statement.cs (SwitchLabel): define an ILLabel for each
16076         SwitchLabel. 
16077
16078         (Switch.CheckSwitch): If the value is a Literal, extract
16079         the underlying literal.
16080
16081         Also in the unused hashtable we had, add the SwitchLabel so we can
16082         quickly look this value up.
16083
16084         * constant.cs: Implement a bunch of new constants.  Rewrite
16085         Literal based on this.  Made changes everywhere to adapt to this.
16086
16087         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16088         dereferencing array only once, and also copes with enumrations.
16089
16090         bytes are two bytes wide, not one.
16091
16092         (Cast): Perform constant conversions.
16093
16094         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16095         wrappers to the literals here.
16096
16097         * expression.cs (DoNumericPromotions): long literals can converted
16098         to ulong implicity (this is taken care of elsewhere, but I was
16099         missing this spot).
16100
16101         * ecore.cs (Expression.Literalize): Make the return type Literal,
16102         to improve type checking.
16103
16104         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16105
16106 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16107
16108         * literal.cs: Revert code from ravi that checked the bounds.  The
16109         bounds are sane by the definition of the type itself. 
16110
16111         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16112         need to actually look up in our parent hierarchy for interfaces
16113         implemented. 
16114
16115         * const.cs: Use the underlying type for enumerations
16116
16117         * delegate.cs: Compute the basename for the delegate creation,
16118         that should fix the delegate test case, and restore the correct
16119         Type Lookup semantics in rootcontext
16120
16121         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16122         referencing a nested type with the Reflection API is using the "+"
16123         sign. 
16124
16125         * cs-parser.jay: Do not require EOF token at the end.
16126
16127 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16128
16129         * rootcontext.cs (LookupType): Concatenate type names with
16130         a '.' instead of a '+' The test suite passes again.
16131
16132         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16133         field of the enumeration.
16134
16135         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16136         the case when the member is an EventExpr.
16137
16138         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16139         static has an associated instance expression.
16140
16141         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16142
16143         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16144
16145         * class.cs (Event.Define): Register event and perform appropriate checks
16146         for error #111.
16147
16148         We define the Add and Remove methods even if the use provides none because
16149         in that case, we provide default implementations ourselves.
16150
16151         Define a private field of the type of the event. This is done by the CSC compiler
16152         and we should be doing it too ;-)
16153
16154         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16155         More methods we use in code we generate.
16156
16157         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16158         is important.
16159
16160         (InitCoreTypes): Update accordingly for the above.
16161
16162         * class.cs (Event.Emit): Generate code for default accessors that we provide
16163
16164         (EmitDefaultMethod): Do the job in the above.
16165
16166         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16167         appropriate place.
16168
16169 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16170
16171         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16172         builders even if we were missing one.
16173
16174         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16175         pass the Basename as our class name instead of the Name.  The
16176         basename will be correctly composed for us.
16177
16178         * parameter.cs (Paramters): Now takes a Location argument.
16179
16180         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16181         make all the code call directly LookupType in RootContext and take
16182         this chance to pass the Location information everywhere.
16183
16184         * Everywhere: pass Location information.
16185
16186 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16187
16188         * class.cs (Constructor.Define): Updated way of detecting the
16189         length of the parameters.
16190
16191         (TypeContainer.DefineType): Use basename as the type name for
16192         nested types.
16193
16194         (TypeContainer.Define): Do not recursively define types here, as
16195         definition is taken care in order by the RootContext.
16196
16197         * tree.cs: Keep track of namespaces in a per-file basis.
16198
16199         * parameter.cs (Parameter.ComputeSignature): Update to use
16200         DeclSpace. 
16201
16202         (Parameters.GetSignature): ditto.
16203
16204         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16205         instead of a TypeContainer.
16206
16207         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16208         resolve names.  Because we need to be resolve in our context, not
16209         our parents.
16210
16211         * driver.cs: Implement response files.
16212
16213         * class.cs (TypeContainer.DefineType): If we are defined, do not
16214         redefine ourselves.
16215
16216         (Event.Emit): Emit the code for add/remove handlers.
16217         (Event.Define): Save the MethodBuilders for add/remove.
16218
16219         * typemanager.cs: Use pair here too.
16220
16221         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16222         DictionaryEntry requires the first argument to be non-null.  
16223
16224         (enum_declaration): Compute full name for registering the
16225         enumeration.
16226
16227         (delegate_declaration): Instead of using
16228         formal_parameter_list, use opt_formal_parameter_list as the list
16229         can be empty.
16230
16231         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16232         (EventParsing): New property that controls whether `add' and
16233         `remove' are returned as tokens or identifiers (for events);
16234
16235 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16236
16237         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16238         use MyEventBuilder only and let it wrap the real builder for us.
16239
16240         (MyEventBuilder): Revamp constructor etc.
16241
16242         Implement all operations that we perform on EventBuilder in precisely the same
16243         way here too.
16244
16245         (FindMembers): Update to use the EventBuilder member.
16246
16247         (Event.Emit): Update accordingly.
16248
16249 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16250
16251         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16252         by calling the appropriate methods.
16253
16254         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16255         useful.
16256
16257         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16258
16259 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16260
16261         * delegate.cs (Delegate.Populate): Check that the return type
16262         and various parameters types are indeed accessible.
16263
16264         * class.cs (Constructor.Define): Same here.
16265
16266         (Field.Define): Ditto.
16267
16268         (Event.Define): Ditto.
16269
16270         (Operator.Define): Check that the underlying Method defined itself
16271         correctly - so it's MethodBuilder should not be null.
16272
16273         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16274         expression happens to be null.
16275
16276         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16277         members but as of now we don't seem to be able to do anything really useful with it.
16278
16279         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16280         not the EventBuilder.
16281
16282 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16283
16284         * cs-tokenizer.cs: Add support for defines.
16285         Add support for #if, #elif, #else, #endif
16286
16287         (eval_var): evaluates a variable.
16288         (eval): stubbed for evaluating functions.
16289
16290         * cs-parser.jay: Pass the defines information
16291
16292         * driver.cs: Add --define command line option.
16293
16294         * decl.cs: Move MemberCore here.
16295
16296         Make it the base class for DeclSpace.  This allows us to catch and
16297         report 108 and 109 for everything now.
16298
16299         * class.cs (TypeContainer.Define): Extract all the members
16300         before populating and emit the warning 108 (new keyword required
16301         to override) instead of having each member implement this.
16302
16303         (MemberCore.Define): New abstract method, we will be using this in
16304         the warning reporting engine in Populate.
16305
16306         (Operator.Define): Adjust to new MemberCore protocol. 
16307
16308         * const.cs (Const): This does not derive from Expression, it is a
16309         temporary object we use to create fields, it is a MemberCore. 
16310
16311         * class.cs (Method.Define): Allow the entry point to be in a
16312         specific class.
16313
16314         * driver.cs: Rewrite the argument handler to clean it up a bit.
16315
16316         * rootcontext.cs: Made it just an auxiliary namespace feature by
16317         making everything static.
16318
16319         * driver.cs: Adapt code to use RootContext type name instead of
16320         instance variable.
16321
16322         * delegate.cs: Remove RootContext argument.
16323
16324         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16325         argument. 
16326
16327         * class.cs (Event.Define): The lookup can fail.
16328
16329         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16330
16331         * expression.cs: Resolve the this instance before invoking the code.
16332
16333 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16334
16335         * cs-parser.jay: Add a production in element_access that allows
16336         the thing to become a "type" reference.  This way we can parse
16337         things like "(string [])" as a type.
16338
16339         Note that this still does not handle the more complex rules of
16340         casts. 
16341
16342
16343         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16344
16345         * ecore.cs: (CopyNewMethods): new utility function used to
16346         assemble the list of methods from running FindMembers.
16347
16348         (MemberLookup): Rework FindMembers so that 
16349
16350 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16351
16352         * class.cs (TypeContainer): Remove Delegates who fail to be
16353         defined.
16354
16355         * delegate.cs (Populate): Verify that we dont get null return
16356         values.   TODO: Check for AsAccessible.
16357
16358         * cs-parser.jay: Use basename to emit error 574 (destructor should
16359         have the same name as container class), not the full name.
16360
16361         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16362         possible representation.  
16363
16364         Also implements integer type suffixes U and L.
16365
16366 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16367
16368         * expression.cs (ArrayCreation.DoResolve): We need to do the
16369         argument resolution *always*.
16370
16371         * decl.cs: Make this hold the namespace.  Hold the root context as
16372         well.
16373         (LookupType): Move here.
16374
16375         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16376
16377         * location.cs (Row, Name): Fixed the code, it was always returning
16378         references to the first file.
16379
16380         * interface.cs: Register properties defined through interfaces.
16381
16382         * driver.cs: Add support for globbing on the command line
16383
16384         * class.cs (Field): Make it derive from MemberCore as well.
16385         (Event): ditto.
16386
16387 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16388
16389         * class.cs (Event::Define): Check that the type of the event is a delegate
16390         type else flag error #66.
16391
16392         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16393         same.
16394
16395         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16396         values of EntryPoint, CharSet etc etc.
16397
16398         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16399
16400         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16401         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16402         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16403         which needs this to do its work.
16404
16405         * ../errors/cs0066.cs : Add.
16406
16407 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16408
16409         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16410         helper functions.
16411
16412         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16413         clears out the parameters field.
16414         (MemberSignatureCompare): Cleanup
16415
16416         (MemberCore): New base class used to share code between MethodCore
16417         and Property.
16418
16419         (RegisterRequiredImplementations) BindingFlags.Public requires
16420         either BindingFlags.Instace or Static.  Use instance here.
16421
16422         (Property): Refactored code to cope better with the full spec.
16423
16424         * parameter.cs (GetParameterInfo): Return an empty array instead
16425         of null on error.
16426
16427         * class.cs (Property): Abstract or extern properties have no bodies.
16428
16429         * parameter.cs (GetParameterInfo): return a zero-sized array.
16430
16431         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16432         method modifier validation to the typecontainer so we can reuse
16433         this on properties.
16434
16435         (MethodCore.ParameterTypes): return an empty sized array of types.
16436
16437         (Property.Define): Test property modifier validity.
16438
16439         Add tests for sealed/override too.
16440
16441         (Method.Emit): abstract or extern methods have no bodies.
16442
16443 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16444
16445         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16446         thing.
16447
16448         (Method::Define, ::Emit): Modify accordingly.
16449
16450         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16451
16452         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16453
16454         * makefile: Pass in /unsafe.
16455
16456 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16457
16458         * class.cs (MakeKey): Kill routine.
16459
16460         * class.cs (TypeContainer.Define): Correctly define explicit
16461         method implementations (they require the full interface name plus
16462         the method name).
16463
16464         * typemanager.cs: Deply the PtrHashtable here and stop using the
16465         lame keys.  Things work so much better.
16466
16467         This of course broke everyone who depended on `RegisterMethod' to
16468         do the `test for existance' test.  This has to be done elsewhere.
16469
16470         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16471         the object stupid Equals method (because, that like fails all over
16472         the place).  We still do not use it.
16473
16474         * class.cs (TypeContainer.SetRequiredInterface,
16475         TypeContainer.RequireMethods): Killed these two routines and moved
16476         all the functionality to RegisterRequiredImplementations.
16477
16478         (TypeContainer.RegisterRequiredImplementations): This routine now
16479         registers all the implementations required in an array for the
16480         interfaces and abstract methods.  We use an array of structures
16481         which can be computed ahead of time to reduce memory usage and we
16482         also assume that lookups are cheap as most classes will not
16483         implement too many interfaces.
16484
16485         We also avoid creating too many MethodSignatures.
16486
16487         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16488         clear the "pending" bit if we find that there are problems with
16489         the declaration.
16490
16491         (TypeContainer.VerifyPendingMethods): Update to report errors of
16492         methods that look like implementations but are not.
16493
16494         (TypeContainer.Define): Add support for explicit interface method
16495         implementation. 
16496
16497 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16498
16499         * typemanager.cs: Keep track of the parameters here instead of
16500         being a feature of the TypeContainer.
16501
16502         * class.cs: Drop the registration of parameters here, as
16503         InterfaceMethods are also interface declarations.
16504
16505         * delegate.cs: Register methods with the TypeManager not only with
16506         the TypeContainer.  This code was buggy.
16507
16508         * interface.cs: Full registation here.
16509
16510 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16511
16512         * expression.cs: Remove reducer for binary expressions, it can not
16513         be done this way.
16514
16515         * const.cs: Put here the code that used to go into constant.cs
16516
16517         * constant.cs: Put here the code for constants, this is a new base
16518         class for Literals.
16519
16520         * literal.cs: Make Literal derive from Constant.
16521
16522 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16523
16524         * statement.cs (Return.Emit): Report error 157 if the user
16525         attempts to return from a finally block.
16526
16527         (Return.Emit): Instead of emitting a return, jump to the end of
16528         the function.
16529
16530         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16531         LocalBuilder to store the result of the function.  ReturnLabel is
16532         the target where we jump.
16533
16534
16535 2001-12-09  Radek Doulik  <rodo@ximian.com>
16536
16537         * cs-parser.jay: remember alias in current namespace
16538
16539         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16540         namespaces
16541
16542         * class.cs (LookupAlias): lookup alias in my_namespace
16543
16544         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16545         aliases hashtable
16546         (LookupAlias): lookup alias in this and if needed in parent
16547         namespaces
16548
16549 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16550
16551         * support.cs: 
16552
16553         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16554         making things static.  I need this to avoid passing the
16555         TypeContainer when calling ParameterType.
16556
16557         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16558         that did string manipulation to compute the type and then call
16559         GetType.  Use Parameter.ParameterType instead.
16560
16561         * cs-tokenizer.cs: Consume the suffix for floating values.
16562
16563         * expression.cs (ParameterReference): figure out whether this is a
16564         reference parameter or not.  Kill an extra variable by computing
16565         the arg_idx during emission.
16566
16567         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16568         function that returns whether a parameter is an out/ref value or not.
16569
16570         (Parameter.ParameterType): The type of the parameter (base,
16571         without ref/out applied).
16572
16573         (Parameter.Resolve): Perform resolution here.
16574         (Parameter.ExternalType): The full type (with ref/out applied).
16575
16576         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16577         support for expressions on the using statement.
16578
16579 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16580
16581         * statement.cs (Using.EmitLocalVariableDecls): Split the
16582         localvariable handling of the using statement.
16583
16584         (Block.EmitMeta): Keep track of variable count across blocks.  We
16585         were reusing slots on separate branches of blocks.
16586
16587         (Try.Emit): Emit the general code block, we were not emitting it. 
16588
16589         Check the type of the declaration to be an IDisposable or
16590         something that can be implicity converted to it. 
16591
16592         Emit conversions if required.
16593
16594         * ecore.cs (EmptyExpression): New utility class.
16595         (Expression.ImplicitConversionExists): New utility function.
16596
16597 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16598
16599         * statement.cs (Using): Implement.
16600
16601         * expression.cs (LocalVariableReference): Support read only variables.
16602
16603         * statement.cs: Remove the explicit emit for the Leave opcode.
16604         (VariableInfo): Add a readonly field.
16605
16606 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * ecore.cs (ConvCast): new class used to encapsulate the various
16609         explicit integer conversions that works in both checked and
16610         unchecked contexts.
16611
16612         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16613         properly generate the overflow opcodes.
16614
16615 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16616
16617         * statement.cs: The correct type for the EmptyExpression is the
16618         element_type, not the variable type.  Ravi pointed this out.
16619
16620 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16621
16622         * class.cs (Method::Define): Handle PInvoke methods specially
16623         by using DefinePInvokeMethod instead of the usual one.
16624
16625         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16626         above to do the task of extracting information and defining the method.
16627
16628 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16629
16630         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16631         of the condition for string type.
16632
16633         (Emit): Move that here. 
16634
16635         (ArrayCreation::CheckIndices): Keep string literals in their expression
16636         form.
16637
16638         (EmitDynamicInitializers): Handle strings appropriately.
16639
16640 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16641
16642         * codegen.cs (EmitContext): Replace multiple variables with a
16643         single pointer to the current Switch statement.
16644
16645         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16646         EmitContext.
16647
16648 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16649
16650         * statement.cs 
16651
16652         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16653         default'.
16654
16655         (Foreach.Emit): Foreach on arrays was not setting
16656         up the loop variables (for break/continue).
16657
16658         (GotoCase): Semi-implented.
16659
16660 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16661
16662         * attribute.cs (CheckAttribute): Handle system attributes by using
16663         Attribute.GetAttributes to examine information we need.
16664
16665         (GetValidPlaces): Same here.
16666
16667         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16668
16669         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16670
16671         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16672
16673         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16674
16675         (Method::Emit): Handle the case when we are a PInvoke method.
16676
16677 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16678
16679         * expression.cs: Use ResolveWithSimpleName on compound names.
16680
16681 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16682
16683         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16684         before trying to reduce it.
16685
16686         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16687
16688         * constant.cs (LookupConstantValue): Implement.
16689
16690         (EmitConstant): Use the above in emitting the constant.
16691
16692         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16693         that are user-defined by doing a LookupConstantValue on them.
16694
16695         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16696         too, like above.
16697
16698 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16699
16700         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16701
16702         (BaseAccess.DoResolve): Implement.
16703
16704         (MemberAccess.DoResolve): Split this routine into a
16705         ResolveMemberAccess routine that can be used independently
16706
16707 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16708
16709         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16710         As that share bits of the implementation.  Is returns a boolean,
16711         while As returns the Type that is being probed.
16712
16713 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16714
16715         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16716         instead of a Literal - much easier.
16717
16718         (EnumInTransit): Remove - utterly useless :-)
16719
16720         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16721
16722         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16723
16724         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16725         chain when we have no associated expression.
16726
16727 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16728
16729         * constant.cs (Define): Use Location while reporting the errror.
16730
16731         Also emit a warning when 'new' is used and there is no inherited
16732         member to hide.
16733
16734         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16735         populated.
16736
16737         (LookupEnumValue): Implement to lookup an enum member's value and define it
16738         if necessary.
16739
16740         (Populate): Re-write accordingly to use the above routine.
16741
16742 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16743
16744         * expression.cs (This): Fix prototype for DoResolveLValue to
16745         override the base class DoResolveLValue.
16746
16747         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16748         declarations) 
16749
16750         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16751         (we need to load the address of the field here).  This fixes
16752         test-22. 
16753
16754         (FieldExpr.DoResolveLValue): Call the DoResolve
16755         function to initialize the Instance expression.
16756
16757         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16758         correctly the GetEnumerator operation on a value type.
16759
16760         * cs-parser.jay: Add more simple parsing error catches.
16761
16762         * statement.cs (Switch): Add support for string switches.
16763         Handle null specially.
16764
16765         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16766
16767 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16768
16769         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16770
16771         (declare_local_constant): New helper function.
16772
16773         * statement.cs (AddConstant): Keep a separate record of constants
16774
16775         (IsConstant): Implement to determine if a variable is a constant.
16776
16777         (GetConstantExpression): Implement.
16778
16779         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16780
16781         * statement.cs (IsVariableDefined): Re-write.
16782
16783 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16784
16785         * class.cs (TypeContainer::FindMembers): Look for constants
16786         in the case when we are looking for MemberTypes.Field
16787
16788         * expression.cs (MemberAccess::DoResolve): Check that in the
16789         case we are a FieldExpr and a Literal, we are not being accessed
16790         by an instance reference.
16791
16792         * cs-parser.jay (local_constant_declaration): Implement.
16793
16794         (declaration_statement): Implement for constant declarations.
16795
16796 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16797
16798         * statement.cs (Switch): Catch double defaults.
16799
16800         (Switch): More work on the switch() statement
16801         implementation.  It works for integral values now, need to finish
16802         string support.
16803
16804
16805 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16806
16807         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16808         integer literals into other integer literals.  To be used by
16809         switch. 
16810
16811 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16812
16813         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16814         some memory.
16815
16816         (EmitDynamicInitializers): Cope with the above since we extract data
16817         directly from ArrayData now.
16818
16819         (ExpectInitializers): Keep track of whether initializers are mandatory
16820         or not.
16821
16822         (Bounds): Make it a hashtable to prevent the same dimension being 
16823         recorded for every element in that dimension.
16824
16825         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16826         from being found.
16827
16828         Also fix bug which was causing the indices to be emitted in the reverse
16829         order.
16830
16831 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16832
16833         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16834         unfinished.  They do not work, because the underlying code is
16835         sloppy.
16836
16837 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16838
16839         * cs-parser.jay: Remove bogus fixme.
16840
16841         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16842         on Switch statement.
16843
16844 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16845
16846         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16847         the same. 
16848
16849         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16850         parameter. Apparently, any expression is allowed. 
16851
16852         (ValidateInitializers): Update accordingly.
16853
16854         (CheckIndices): Fix some tricky bugs thanks to recursion.
16855
16856         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16857         I was being completely brain-dead.
16858
16859         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16860         and re-write acordingly.
16861
16862         (DelegateInvocation): Re-write accordingly.
16863
16864         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16865
16866         (MakeByteBlob): Handle types more correctly.
16867
16868         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16869         initialization from expressions but it is incomplete because I am a complete
16870         Dodo :-|
16871
16872 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16873
16874         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16875         on If.  Basically, we have to return `true' (ie, we do return to
16876         our caller) only if both branches of the if return.
16877
16878         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16879         short-circuit operators, handle them as short circuit operators. 
16880
16881         (Cast.DoResolve): Resolve type.
16882         (Cast.Cast): Take an expression as the target type.
16883
16884         * cs-parser.jay (cast_expression): Remove old hack that only
16885         allowed a limited set of types to be handled.  Now we take a
16886         unary_expression and we resolve to a type during semantic
16887         analysis.
16888
16889         Use the grammar productions from Rhys to handle casts (this is
16890         not complete like Rhys syntax yet, we fail to handle that corner
16891         case that C# has regarding (-x), but we will get there.
16892
16893 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16894
16895         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16896         field which is an array type.
16897
16898         * cs-parser.jay (declare_local_variables): Support array initialization too.
16899
16900         * typemanager.cs (MakeKey): Implement.
16901
16902         (everywhere): Use the above appropriately.
16903
16904         * cs-parser.jay (for_statement): Update for array initialization while
16905         declaring variables.
16906
16907         * ecore.cs : The error message was correct, it's the variable's names that
16908         were misleading ;-) Make the code more readable.
16909
16910         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16911         the correct type etc.
16912
16913         (ConvertExplicit): Handle Enum types by examining the underlying type.
16914
16915 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16916
16917         * parameter.cs (GetCallingConvention): Always return
16918         CallingConventions.Standard for now.
16919
16920 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16921
16922         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16923         and `r' after calling DoNumericPromotions.
16924
16925         * ecore.cs: Fix error message (the types were in the wrong order).
16926
16927         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16928         BindingFlags.Instance as well 
16929
16930         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16931         implicit int literal conversion in an empty cast so that we
16932         propagate the right type upstream.
16933
16934         (UnboxCast): new class used to unbox value types.
16935         (Expression.ConvertExplicit): Add explicit type conversions done
16936         by unboxing.
16937
16938         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16939         the target type before applying the implicit LongLiterals to ULong
16940         literal cast.
16941
16942 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16943
16944         * cs-parser.jay (for_statement): Reworked the way For works: now
16945         we declare manually any variables that are introduced in
16946         for_initializer to solve the problem of having out-of-band code
16947         emition (that is what got for broken).
16948
16949         (declaration_statement): Perform the actual variable declaration
16950         that used to be done in local_variable_declaration here.
16951
16952         (local_variable_declaration): Do not declare anything, just pass
16953         the information on a DictionaryEntry
16954
16955 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16956
16957         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16958         re-write of the logic to now make it recursive.
16959
16960         (UpdateIndices): Re-write accordingly.
16961
16962         Store element data in a separate ArrayData list in the above methods.
16963
16964         (MakeByteBlob): Implement to dump the array data into a byte array.
16965
16966 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16967
16968         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16969         into CheckIndices.
16970
16971         * constant.cs (Define): Implement.
16972
16973         (EmitConstant): Re-write fully.
16974
16975         Pass in location info.
16976
16977         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16978         respectively.
16979
16980         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16981         DictionaryEntry since we need location info too.
16982
16983         (constant_declaration): Update accordingly.
16984
16985         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16986         code into another method : UpdateIndices.
16987
16988 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16989
16990         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16991         some type checking etc.
16992
16993 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16994
16995         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16996         bits to provide dimension info if the user skips doing that.
16997
16998         Update second constructor to store the rank correctly.
16999
17000 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17001
17002         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17003         and try to implement.
17004
17005         * ../errors/cs0150.cs : Add.
17006
17007         * ../errors/cs0178.cs : Add.
17008
17009 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17010
17011         * statement.cs: Implement foreach on multi-dimensional arrays. 
17012
17013         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17014         name of the params argument.
17015
17016         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17017         initializing the array.
17018
17019         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17020         we can use this elsewhere.
17021
17022         * statement.cs: Finish implementation of foreach for single
17023         dimension arrays.
17024
17025         * cs-parser.jay: Use an out-of-band stack to pass information
17026         around, I wonder why I need this.
17027
17028         foreach_block: Make the new foreach_block the current_block.
17029
17030         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17031         function used to return a static Parameters structure.  Used for
17032         empty parameters, as those are created very frequently.
17033
17034         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17035
17036 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17037
17038         * interface.cs : Default modifier is private, not public. The
17039         make verify test passes again.
17040
17041 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17042
17043         * support.cs (ReflectionParameters): Fix logic to determine
17044         whether the last parameter is a params one. Test 9 passes again.
17045
17046         * delegate.cs (Populate): Register the builders we define with
17047         RegisterParameterForBuilder. Test 19 passes again.
17048
17049         * cs-parser.jay (property_declaration): Reference $6 instead
17050         of $$ to get at the location.
17051
17052         (indexer_declaration): Similar stuff.
17053
17054         (attribute): Ditto.
17055
17056         * class.cs (Property): Register parameters for the Get and Set methods
17057         if they exist. Test 23 passes again.
17058
17059         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17060         call to EmitArguments as we are sure there aren't any params arguments. 
17061         Test 32 passes again.
17062
17063         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17064         IndexOutOfRangeException. 
17065
17066         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17067         Test 33 now passes again.
17068
17069 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17070
17071         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17072         broke a bunch of things.  Will have to come up with a better way
17073         of tracking locations.
17074
17075         * statement.cs: Implemented foreach for single dimension arrays.
17076
17077 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17078
17079         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17080         an error.  This removes the lookup from the critical path.
17081
17082         * cs-parser.jay: Removed use of temporary_loc, which is completely
17083         broken. 
17084
17085 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17086
17087         * support.cs (ReflectionParameters.ParameterModifier): Report
17088         whether the argument is a PARAMS argument or not.
17089
17090         * class.cs: Set the attribute `ParamArrayAttribute' on the
17091         parameter argument.
17092
17093         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17094         and cons_param_array_attribute (ConstructorInfo for
17095         ParamArrayAttribute)., 
17096
17097         * codegen.cs: Emit the return using the `Return' statement, that
17098         way we can report the error correctly for missing return values. 
17099
17100         * class.cs (Method.Emit): Clean up.
17101
17102         * expression.cs (Argument.Resolve): Take another argument: the
17103         location where this argument is used.  Notice that this is not
17104         part of the "Argument" class as to reduce the size of the
17105         structure (we know the approximate location anyways).
17106
17107         Test if the argument is a variable-reference, if not, then
17108         complain with a 206.
17109
17110         (Argument.Emit): Emit addresses of variables.
17111
17112         (Argument.FullDesc): Simplify.
17113
17114         (Invocation.DoResolve): Update for Argument.Resolve.
17115
17116         (ElementAccess.DoResolve): ditto.
17117
17118         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17119         method should be virtual, as this method is always virtual.
17120
17121         (NewDelegate.DoResolve): Update for Argument.Resolve.
17122
17123         * class.cs (ConstructorInitializer.DoResolve): ditto.
17124
17125         * attribute.cs (Attribute.Resolve): ditto.
17126
17127 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17130
17131         * expression.cs (ParameterReference): Drop IStackStorage and implement
17132         IAssignMethod instead. 
17133
17134         (LocalVariableReference): ditto.
17135
17136         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17137         IAssignMethod instead. 
17138
17139 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17140
17141         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17142         enumerations that are used in heavily used structures derive from
17143         byte in a laughable and pathetic attempt to reduce memory usage.
17144         This is the kind of pre-optimzations that you should not do at
17145         home without adult supervision.
17146
17147         * expression.cs (UnaryMutator): New class, used to handle ++ and
17148         -- separatedly from the other unary operators.  Cleans up the
17149         code, and kills the ExpressionStatement dependency in Unary.
17150
17151         (Unary): Removed `method' and `Arguments' from this class, making
17152         it smaller, and moving it all to SimpleCall, so I can reuse this
17153         code in other locations and avoid creating a lot of transient data
17154         strucutres when not required.
17155
17156         * cs-parser.jay: Adjust for new changes.
17157
17158 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17159
17160         * enum.cs (Enum.Populate): If there is a failure during
17161         definition, return
17162
17163         * cs-parser.jay (opt_enum_base): we used to catch type errors
17164         here, but this is really incorrect.  The type error should be
17165         catched during semantic analysis.
17166
17167 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17168
17169         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17170         current_local_parameters as expected since I, in my stupidity, had forgotten
17171         to do this :-)
17172
17173         * attribute.cs (GetValidPlaces): Fix stupid bug.
17174
17175         * class.cs (Method::Emit): Perform check on applicability of attributes.
17176
17177         (Constructor::Emit): Ditto.
17178
17179         (Field::Emit): Ditto.
17180
17181         (Field.Location): Store location information.
17182
17183         (Property, Event, Indexer, Operator): Ditto.
17184
17185         * cs-parser.jay (field_declaration): Pass in location for each field.
17186
17187         * ../errors/cs0592.cs : Add.
17188
17189 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17190
17191         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17192
17193         (InitCoreTypes): Update accordingly.
17194
17195         (RegisterAttrType, LookupAttr): Implement.
17196
17197         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17198         info about the same.
17199
17200         (Resolve): Update to populate the above as necessary.
17201
17202         (Error592): Helper.
17203
17204         (GetValidPlaces): Helper to the above.
17205
17206         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17207
17208         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17209
17210 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17211
17212         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17213
17214         * ../errors/cs0617.cs : Add.
17215
17216 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17217
17218         * enum.cs (Emit): Rename to Populate to be more consistent with what
17219         we expect it to do and when exactly it is called.
17220
17221         * class.cs, rootcontext.cs : Update accordingly.
17222
17223         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17224         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17225
17226         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17227
17228         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17229         of a fieldinfo using the above, when dealing with a FieldBuilder.
17230
17231 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17232
17233         * ../errors/cs0031.cs : Add.
17234
17235         * ../errors/cs1008.cs : Add.
17236
17237         * ../errrors/cs0543.cs : Add.
17238
17239         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17240         enum type.
17241
17242         (FindMembers): Implement.
17243
17244         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17245         enums and delegates too.
17246
17247         (enum_types): Rename to builder_to_enum.
17248
17249         (delegate_types): Rename to builder_to_delegate.
17250
17251         * delegate.cs (FindMembers): Implement.
17252
17253 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17254
17255         * typemanager.cs (IsEnumType): Implement.
17256
17257         * enum.cs (Emit): Re-write parts to account for the underlying type
17258         better and perform checking etc.
17259
17260         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17261         of the underlying type.
17262
17263         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17264         value
17265
17266         * enum.cs (error31): Helper to report error #31.
17267
17268         * cs-parser.jay (enum_declaration): Store location of each member too.
17269
17270         * enum.cs (member_to_location): New hashtable. 
17271
17272         (AddEnumMember): Update location hashtable.
17273
17274         (Emit): Use the location of each member while reporting errors.
17275
17276 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17277
17278         * cs-parser.jay: A for_initializer if is a
17279         local_variable_declaration really ammount to have an implicit
17280         block with the variable declaration and no initializer for for.
17281
17282         * statement.cs (For.Emit): Cope with null initializers.
17283
17284         This fixes the infinite loop on for initializers.
17285
17286 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17287
17288         * enum.cs: More cleanup.
17289
17290         * ecore.cs: Remove dead code.
17291
17292         * class.cs (Property.Emit): More simplification.
17293         (Event.Emit): ditto.
17294
17295         Reworked to have less levels of indentation.
17296
17297 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17298
17299         * class.cs (Property): Emit attributes.
17300
17301         (Field): Ditto.
17302
17303         (Event): Ditto.
17304
17305         (Indexer): Ditto.
17306
17307         (Operator): Ditto.
17308
17309         * enum.cs (Emit): Ditto.
17310
17311         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17312         Enums too.
17313
17314         * class.cs (Field, Event, etc.): Move attribute generation into the
17315         Emit method everywhere.
17316
17317         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17318         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17319         as we had no way of defining nested enums !
17320
17321         * rootcontext.cs : Adjust code accordingly.
17322
17323         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17324
17325 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17326
17327         * expression.cs (EvalConstantExpression): Move into ecore.cs
17328
17329         * enum.cs (Enum): Rename some members and make them public and readonly
17330         according to our convention.
17331
17332         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17333         nothing else.
17334
17335         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17336
17337         (Enum::Emit): Write a simple version for now which doesn't try to compute
17338         expressions. I shall modify this to be more robust in just a while.
17339
17340         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17341
17342         (TypeContainer::CloseType): Create the Enum types too.
17343
17344         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17345
17346         * expression.cs (EvalConstantExpression): Get rid of completely.
17347
17348         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17349         user-defined values and other cases.
17350
17351         (IsValidEnumLiteral): Helper function.
17352
17353         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17354         out there in the case we had a literal FieldExpr.
17355
17356         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17357
17358         (Literalize): Revamp a bit to take two arguments.
17359
17360         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17361
17362 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17363
17364         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17365
17366         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17367
17368         (Resolve): Use the above to ensure we have proper initializers.
17369
17370 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17371
17372         * expression.cs (Expression::EvalConstantExpression): New method to 
17373         evaluate constant expressions.
17374
17375         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17376
17377 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17378
17379         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17380         in an array.
17381
17382         (Binary.ResolveOperator): Handle operator != (object a, object b)
17383         and operator == (object a, object b);
17384
17385         (Binary.DoNumericPromotions): Indicate whether the numeric
17386         promotion was possible.
17387
17388         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17389         Implement.  
17390
17391         Made the ArrayAccess implement interface IAssignMethod instead of
17392         IStackStore as the order in which arguments are passed reflects
17393         this.
17394
17395         * assign.cs: Instead of using expr.ExprClass to select the way of
17396         assinging, probe for the IStackStore/IAssignMethod interfaces.
17397
17398         * typemanager.cs: Load InitializeArray definition.
17399
17400         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17401         static data that can be used to initialize arrays. 
17402
17403 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17404
17405         * expression.cs: Handle operator== and operator!= for booleans.
17406
17407         (Conditioal.Reduce): Implement reducer for the ?: operator.
17408
17409         (Conditional.Resolve): Implement dead code elimination.
17410
17411         (Binary.Resolve): Catch string literals and return a new
17412         concatenated string.
17413
17414         (Unary.Reduce): Implement reduction of unary expressions.
17415
17416         * ecore.cs: Split out the expression core handling here.
17417
17418         (Expression.Reduce): New method used to perform constant folding
17419         and CSE.  This is needed to support constant-expressions. 
17420
17421         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17422         targets, and optimize for !x.
17423
17424 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17425
17426         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17427         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17428         set custom atttributes.
17429
17430         * literal.cs (Literal::GetValue): New abstract method to return the actual
17431         value of the literal, cast as an object.
17432
17433         (*Literal): Implement GetValue method.
17434
17435         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17436         expressions to the arraylist but objects of type Argument.
17437
17438         * class.cs (TypeContainer::Emit): Emit our attributes too.
17439
17440         (Method::Emit, Constructor::Emit): Ditto.
17441
17442         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17443         to be ignoring earlier.
17444
17445 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17446
17447         * attribute.cs (AttributeSection::Define): Implement to do the business
17448         of constructing a CustomAttributeBuilder.
17449
17450         (Attribute): New trivial class. Increases readability of code.  
17451
17452         * cs-parser.jay : Update accordingly.
17453
17454         (positional_argument_list, named_argument_list, named_argument): New rules
17455
17456         (attribute_arguments): Use the above so that we are more correct.
17457
17458 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17459
17460         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17461         to perform all checks for a method with a params parameter.
17462
17463         (Invocation::OverloadResolve): Update to use the above method and therefore
17464         cope correctly with params method invocations.
17465
17466         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17467         params too.
17468
17469         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17470         constructors in our parent too because we can't afford to miss out on 
17471         protected ones ;-)
17472
17473         * attribute.cs (AttributeSection): New name for the class Attribute
17474
17475         Other trivial changes to improve readability.
17476
17477         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17478         use the new class names.
17479
17480 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17481
17482         * class.cs (Method::Define): Complete definition for params types too
17483
17484         (Indexer::Define): Ditto.
17485
17486         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17487         Cope everywhere with a request for info about the array parameter.
17488
17489 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17490
17491         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17492
17493         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17494         local_variable_type to extract the string corresponding to the type.
17495
17496         (local_variable_type): Fixup the action to use the new helper method.
17497
17498         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17499         go.
17500
17501         * expression.cs : Clean out code which uses the above.
17502
17503 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17504
17505         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17506         and bale out if necessary by returning a false.
17507
17508         (RegisterProperty): Ditto.
17509
17510         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17511         and print out appropriate error messages.
17512
17513         * interface.cs (everywhere): Ditto.
17514
17515         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17516         location to constructor.
17517
17518         * class.cs (Property, Event, Indexer): Update accordingly.
17519
17520         * ../errors/cs111.cs : Added.
17521
17522         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17523         of a method, as laid down by the spec.
17524
17525         (Invocation::OverloadResolve): Use the above method.
17526
17527 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17528
17529         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17530         now take a TypeContainer and a Parameters object.
17531
17532         (ParameterData): Modify return type of ParameterModifier method to be 
17533         Parameter.Modifier and not a string.
17534
17535         (ReflectionParameters, InternalParameters): Update accordingly.
17536
17537         * expression.cs (Argument::GetParameterModifier): Same here.
17538
17539         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17540         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17541         symbol in it at all so maybe this is only for now.
17542
17543 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17544
17545         * support.cs (InternalParameters): Constructor now takes an extra argument 
17546         which is the actual Parameters class.
17547
17548         (ParameterDesc): Update to provide info on ref/out modifiers.
17549
17550         * class.cs (everywhere): Update call to InternalParameters to pass in
17551         the second argument too.
17552
17553         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17554         to return the modifier info [ref/out etc]
17555
17556         (InternalParameters, ReflectionParameters): Implement the above.
17557
17558         * expression.cs (Argument::ParameterModifier): Similar function to return
17559         info about the argument's modifiers.
17560
17561         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17562         too.
17563
17564         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17565         a new SetFormalParameters object which we pass to InternalParameters.
17566
17567 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17568
17569         * expression.cs (NewArray): Merge into the ArrayCreation class.
17570
17571 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17572
17573         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17574         NewUserdefinedArray into one as there wasn't much of a use in having
17575         two separate ones.
17576
17577         * expression.cs (Argument): Change field's name to ArgType from Type.
17578
17579         (Type): New readonly property which returns the proper type, taking into 
17580         account ref/out modifiers.
17581
17582         (everywhere): Adjust code accordingly for the above.
17583
17584         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17585         whether we are emitting for a ref or out parameter.
17586
17587         * expression.cs (Argument::Emit): Use the above field to set the state.
17588
17589         (LocalVariableReference::Emit): Update to honour the flag and emit the
17590         right stuff.
17591
17592         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17593
17594         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17595
17596         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17597
17598         (ReflectionParameters, InternalParameters): Implement the above method.
17599
17600         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17601         reporting errors.
17602
17603         (Invocation::FullMethodDesc): Ditto. 
17604
17605 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17606
17607         * cs-parser.jay: Add extra production for the second form of array
17608         creation. 
17609
17610         * expression.cs (ArrayCreation): Update to reflect the above
17611         change. 
17612
17613         * Small changes to prepare for Array initialization.
17614
17615 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17616
17617         * typemanager.cs (ImplementsInterface): interface might be null;
17618         Deal with this problem;
17619
17620         Also, we do store negative hits on the cache (null values), so use
17621         this instead of calling t.GetInterfaces on the type everytime.
17622
17623 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17624
17625         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17626
17627         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17628         split functionality out into different classes.
17629
17630         (New::FormArrayType): Move into NewBuiltinArray.
17631
17632         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17633         quite useless.
17634
17635         (NewBuiltinArray): New class to handle creation of built-in arrays.
17636
17637         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17638         account creation of one-dimensional arrays.
17639
17640         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17641
17642         (NewUserdefinedArray::DoResolve): Implement.
17643
17644         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17645
17646         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17647         we maintain inside the TypeManager. This is necessary to perform lookups on the
17648         module builder.
17649
17650         (LookupType): Update to perform GetType on the module builders too.     
17651
17652         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17653
17654         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17655
17656 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17657
17658         * expression.cs (New::DoResolve): Implement guts of array creation.
17659
17660         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17661
17662 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17663
17664         * expression.cs: Fix bug I introduced lsat night that broke
17665         Delegates. 
17666
17667         (Expression.Resolve): Report a 246 error (can not resolve name)
17668         if we find a SimpleName in the stream.
17669
17670         (Expression.ResolveLValue): Ditto.
17671
17672         (Expression.ResolveWithSimpleName): This function is a variant of
17673         ResolveName, this one allows SimpleNames to be returned without a
17674         warning.  The only consumer of SimpleNames is MemberAccess
17675
17676 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17677
17678         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17679         might arrive here.  I have my doubts that this is correct.
17680
17681         * statement.cs (Lock): Implement lock statement.
17682
17683         * cs-parser.jay: Small fixes to support `lock' and `using'
17684
17685         * cs-tokenizer.cs: Remove extra space
17686
17687         * driver.cs: New flag --checked, allows to turn on integer math
17688         checking. 
17689
17690         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17691         Threading.Monitor.Exit 
17692
17693 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17694
17695         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17696         Expression Class to be IndexerAccess.
17697
17698         Notice that Indexer::DoResolve sets the eclass to Value.
17699
17700 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17701
17702         * class.cs (TypeContainer::Emit): Emit code for indexers.
17703
17704         * assign.cs (IAssignMethod): New interface implemented by Indexers
17705         and Properties for handling assignment.
17706
17707         (Assign::Emit): Simplify and reuse code. 
17708
17709         * expression.cs (IndexerAccess, PropertyExpr): Implement
17710         IAssignMethod, clean up old code. 
17711
17712 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17713
17714         * typemanager.cs (ImplementsInterface): New method to determine if a type
17715         implements a given interface. Provides a nice cache too.
17716
17717         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17718         method.
17719
17720         (ConvertReferenceExplicit): Ditto.
17721
17722         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17723         various methods, with correct names etc.
17724
17725         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17726         Operator.UnaryNegation.
17727
17728         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17729         we have a unary plus or minus operator.
17730
17731         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17732         UnaryMinus.
17733
17734         * everywhere : update accordingly.
17735
17736         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17737         respectively.
17738
17739         * class.cs (Method::Define): For the case where we are implementing a method
17740         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17741         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17742
17743 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17744
17745         * interface.cs (FindMembers): Implement to work around S.R.E
17746         lameness.
17747
17748         * typemanager.cs (IsInterfaceType): Implement.
17749
17750         (FindMembers): Update to handle interface types too.
17751
17752         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17753         use IsAssignableFrom as that is not correct - it doesn't work.
17754
17755         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17756         and accordingly override EmitStatement.
17757
17758         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17759         using the correct logic :-)
17760
17761 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17762
17763         * ../errors/cs-11.cs : Add to demonstrate error -11 
17764
17765 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17766
17767         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17768         then pass this as a hint to ResolveLValue.
17769
17770         * expression.cs (FieldExpr): Add Location information
17771
17772         (FieldExpr::LValueResolve): Report assignment to readonly
17773         variable. 
17774
17775         (Expression::ExprClassFromMemberInfo): Pass location information.
17776
17777         (Expression::ResolveLValue): Add new method that resolves an
17778         LValue. 
17779
17780         (Expression::DoResolveLValue): Default invocation calls
17781         DoResolve. 
17782
17783         (Indexers): New class used to keep track of indexers in a given
17784         Type. 
17785
17786         (IStackStore): Renamed from LValue, as it did not really describe
17787         what this did.  Also ResolveLValue is gone from this interface and
17788         now is part of Expression.
17789
17790         (ElementAccess): Depending on the element access type
17791
17792         * typemanager.cs: Add `indexer_name_type' as a Core type
17793         (System.Runtime.CompilerServices.IndexerNameAttribute)
17794
17795         * statement.cs (Goto): Take a location.
17796
17797 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17798
17799         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17800         if two delegates are compatible.
17801
17802         (NewDelegate::DoResolve): Update to take care of the case when
17803         we instantiate a delegate from another delegate.
17804
17805         * typemanager.cs (FindMembers): Don't even try to look up members
17806         of Delegate types for now.
17807
17808 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17809
17810         * delegate.cs (NewDelegate): New class to take care of delegate
17811         instantiation.
17812
17813         * expression.cs (New): Split the delegate related code out into 
17814         the NewDelegate class.
17815
17816         * delegate.cs (DelegateInvocation): New class to handle delegate 
17817         invocation.
17818
17819         * expression.cs (Invocation): Split out delegate related code into
17820         the DelegateInvocation class.
17821
17822 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17823
17824         * expression.cs (New::DoResolve): Implement delegate creation fully
17825         and according to the spec.
17826
17827         (New::DoEmit): Update to handle delegates differently.
17828
17829         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17830         because of which we were printing out arguments in reverse order !
17831
17832         * delegate.cs (VerifyMethod): Implement to check if the given method
17833         matches the delegate.
17834
17835         (FullDelegateDesc): Implement.
17836
17837         (VerifyApplicability): Implement.
17838
17839         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17840         delegate invocations too.
17841
17842         (Invocation::Emit): Ditto.
17843
17844         * ../errors/cs1593.cs : Added.
17845
17846         * ../errors/cs1594.cs : Added.
17847
17848         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17849
17850 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17851
17852         * typemanager.cs (intptr_type): Core type for System.IntPtr
17853
17854         (InitCoreTypes): Update for the same.
17855
17856         (iasyncresult_type, asynccallback_type): Ditto.
17857
17858         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17859         correct.
17860
17861         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17862         too.
17863
17864         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17865         the builders for the 4 members of a delegate type :-)
17866
17867         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17868         type.
17869
17870         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17871
17872         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17873
17874 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17875
17876         * statement.cs (Break::Emit): Implement.   
17877         (Continue::Emit): Implement.
17878
17879         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17880         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17881         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17882         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17883         end loop
17884
17885         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17886         properties that track the label for the current loop (begin of the
17887         loop and end of the loop).
17888
17889 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17890
17891         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17892         use of emitting anything at all.
17893
17894         * class.cs, rootcontext.cs : Get rid of calls to the same.
17895
17896         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17897
17898         (Populate): Define the constructor correctly and set the implementation
17899         attributes.
17900
17901         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17902         have been defined.
17903
17904         (AddDelegateType): Implement.
17905
17906         (IsDelegateType): Implement helper method.
17907
17908         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17909
17910         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17911         and accordingly handle it.
17912
17913         * delegate.cs (Populate): Take TypeContainer argument.
17914         Implement bits to define the Invoke method. However, I still haven't figured out
17915         how to take care of the native int bit :-(
17916
17917         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17918         Qualify the name of the delegate, not its return type !
17919
17920         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17921         conversion.
17922
17923         (StandardConversionExists): Checking for array types turns out to be recursive.
17924
17925         (ConvertReferenceExplicit): Implement array conversion.
17926
17927         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17928
17929 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17930
17931         * cs-parser.jay (delegate_declaration): Store the fully qualified
17932         name as it is a type declaration.
17933
17934         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17935         readonly.
17936
17937         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17938         as TypeContainer::DefineType.
17939
17940         (Populate): Method in which all the definition of the various methods (Invoke)
17941         etc is done.
17942
17943         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17944         see.
17945
17946         (CloseDelegate): Finally creates the delegate.
17947
17948         * class.cs (TypeContainer::DefineType): Update to define delegates.
17949         (Populate, Emit and CloseType): Do the same thing here too.
17950
17951         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17952         delegates in all these operations.
17953
17954 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17955
17956         * expression.cs: LocalTemporary: a new expression used to
17957         reference a temporary that has been created.
17958
17959         * assign.cs: Handle PropertyAccess back here, so that we can
17960         provide the proper semantic access to properties.
17961
17962         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17963         a few more explicit conversions. 
17964
17965         * modifiers.cs: `NEW' modifier maps to HideBySig.
17966
17967         * expression.cs (PropertyExpr): Make this into an
17968         ExpressionStatement, and support the EmitStatement code path. 
17969
17970         Perform get/set error checking, clean up the interface.
17971
17972         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17973         them into toplevel access objects.
17974
17975 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17976
17977         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17978         SRE.
17979
17980         * typemanager.cs: Keep track here of our PropertyBuilders again to
17981         work around lameness in SRE.
17982
17983 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17984
17985         * expression.cs (LValue::LValueResolve): New method in the
17986         interface, used to perform a second resolution pass for LValues. 
17987
17988         (This::DoResolve): Catch the use of this in static methods.
17989
17990         (This::LValueResolve): Implement.
17991
17992         (This::Store): Remove warning, assigning to `this' in structures
17993         is 
17994
17995         (Invocation::Emit): Deal with invocation of
17996         methods on value types.  We need to pass the address to structure
17997         methods rather than the object itself.  (The equivalent code to
17998         emit "this" for structures leaves the entire structure on the
17999         stack instead of a pointer to it). 
18000
18001         (ParameterReference::DoResolve): Compute the real index for the
18002         argument based on whether the method takes or not a `this' pointer
18003         (ie, the method is static).
18004
18005         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18006         value types returned from functions when we need to invoke a
18007         method on the sturcture.
18008
18009
18010 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18011
18012         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18013         defining the type in the Modulebuilder or Typebuilder. This is to take
18014         care of nested types which need to be defined on the TypeBuilder using
18015         DefineNestedMethod.
18016
18017         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18018         methods in RootContext, only ported to be part of TypeContainer.
18019
18020         (TypeContainer::GetInterfaceOrClass): Ditto.
18021
18022         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18023
18024         * interface.cs (Interface::DefineInterface): New method. Does exactly
18025         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18026         too.
18027
18028         (Interface::GetInterfaces): Move from RootContext here and port.
18029
18030         (Interface::GetInterfaceByName): Same here.
18031
18032         * rootcontext.cs (ResolveTree): Re-write.
18033
18034         (PopulateTypes): Re-write.
18035
18036         * class.cs (TypeContainer::Populate): Populate nested types too.
18037         (TypeContainer::Emit): Emit nested members too.
18038
18039         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18040         instead just use the name argument passed in as it is already fully
18041         qualified.
18042
18043         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18044         to TypeContainer mapping to see if a type is user-defined.
18045
18046         * class.cs (TypeContainer::CloseType): Implement. 
18047
18048         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18049         the default constructor.
18050
18051         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18052         twice.
18053
18054         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18055
18056         * interface.cs (CloseType): Create the type here.
18057
18058         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18059         the hierarchy.
18060
18061         Remove all the methods which are now in TypeContainer.
18062
18063 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18064
18065         * delegate.cs (Define): Re-write bits to define the delegate
18066         correctly.
18067
18068 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18069
18070         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18071
18072         * expression.cs (ImplicitReferenceConversion): handle null as well
18073         as a source to convert to any reference type.
18074
18075         * statement.cs (Return): Perform any implicit conversions to
18076         expected return type.  
18077
18078         Validate use of return statement.  
18079
18080         * codegen.cs (EmitContext): Pass the expected return type here.
18081
18082         * class.cs (Method, Constructor, Property): Pass expected return
18083         type to EmitContext.
18084
18085 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18086
18087         * expression.cs: Make DoResolve take an EmitContext instead of a
18088         TypeContainer.
18089
18090         Replaced `l' and `location' for `loc', for consistency.
18091
18092         (Error, Warning): Remove unneeded Tc argument.
18093
18094         * assign.cs, literal.cs, constant.cs: Update to new calling
18095         convention. 
18096
18097         * codegen.cs: EmitContext now contains a flag indicating whether
18098         code is being generated in a static method or not.
18099
18100         * cs-parser.jay: DecomposeQI, new function that replaces the old
18101         QualifiedIdentifier.  Now we always decompose the assembled
18102         strings from qualified_identifier productions into a group of
18103         memberaccesses.
18104
18105 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18106
18107         * rootcontext.cs: Deal with field-less struct types correctly now
18108         by passing the size option to Define Type.
18109
18110         * class.cs: Removed hack that created one static field. 
18111
18112 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18113
18114         * statement.cs: Moved most of the code generation here. 
18115
18116 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18117
18118         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18119         seem very right.
18120
18121         (ElementAccess): Remove useless bits for now - keep checks as the spec
18122         says.
18123
18124 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18125
18126         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18127         and start performing checks according to the spec.
18128
18129 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18130
18131         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18132         rank_specifiers instead.
18133
18134         (rank_specifiers): Change the order in which the rank specifiers are stored
18135
18136         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18137
18138         * expression.cs (ElementAccess): Implement the LValue interface too.
18139
18140 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18141
18142         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18143         except that user defined conversions are not included.
18144
18145         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18146         perform the conversion of the return type, if necessary.
18147
18148         (New::DoResolve): Check whether we are creating an array or an object
18149         and accordingly do the needful.
18150
18151         (New::Emit): Same here.
18152
18153         (New::DoResolve): Implement guts of array creation.
18154
18155         (New::FormLookupType): Helper function.
18156
18157 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18158
18159         * codegen.cs: Removed most of the code generation here, and move the
18160         corresponding code generation bits to the statement classes. 
18161
18162         Added support for try/catch/finalize and throw.
18163
18164         * cs-parser.jay: Added support for try/catch/finalize.
18165
18166         * class.cs: Catch static methods having the flags override,
18167         virtual or abstract.
18168
18169         * expression.cs (UserCast): This user cast was not really doing
18170         what it was supposed to do.  Which is to be born in fully resolved
18171         state.  Parts of the resolution were being performed at Emit time! 
18172
18173         Fixed this code.
18174
18175 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18176
18177         * expression.cs: Implicity convert the result from UserCast.
18178
18179 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18180
18181         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18182         prevented it from working correctly. 
18183
18184         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18185         merely ConvertImplicit.
18186
18187 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18188
18189         * typemanager.cs: Make the LookupTypeContainer function static,
18190         and not per-instance.  
18191
18192         * class.cs: Make static FindMembers (the one that takes a Type
18193         argument). 
18194
18195         * codegen.cs: Add EmitForeach here.
18196
18197         * cs-parser.jay: Make foreach a toplevel object instead of the
18198         inline expansion, as we need to perform semantic analysis on it. 
18199
18200 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18201
18202         * expression.cs (Expression::ImplicitUserConversion): Rename to
18203         UserDefinedConversion.
18204
18205         (Expression::UserDefinedConversion): Take an extra argument specifying 
18206         whether we look for explicit user conversions too.
18207
18208         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18209
18210         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18211
18212         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18213         with the appropriate arguments.
18214
18215         * cs-parser.jay (cast_expression): Record location too.
18216
18217         * expression.cs (Cast): Record location info.
18218
18219         (Expression::ConvertExplicit): Take location argument.
18220
18221         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18222         to determine if we are doing explicit conversions.
18223
18224         (UserCast::Emit): Update accordingly.
18225
18226         (Expression::ConvertExplicit): Report an error if everything fails.
18227
18228         * ../errors/cs0030.cs : Add.
18229
18230 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18231
18232         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18233         virtual and newslot bits. 
18234
18235         * class.cs (TypeContainer::RegisterRequiredImplementations):
18236         Record methods we need.
18237
18238         (TypeContainer::MakeKey): Helper function to make keys for
18239         MethodBases, since the Methodbase key is useless.
18240
18241         (TypeContainer::Populate): Call RegisterRequiredImplementations
18242         before defining the methods.   
18243
18244         Create a mapping for method_builders_to_methods ahead of time
18245         instead of inside a tight loop.
18246
18247         (::RequireMethods):  Accept an object as the data to set into the
18248         hashtable so we can report interface vs abstract method mismatch.
18249
18250 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18251
18252         * report.cs: Make all of it static.
18253
18254         * rootcontext.cs: Drop object_type and value_type computations, as
18255         we have those in the TypeManager anyways.
18256
18257         Drop report instance variable too, now it is a global.
18258
18259         * driver.cs: Use try/catch on command line handling.
18260
18261         Add --probe option to debug the error reporting system with a test
18262         suite. 
18263
18264         * report.cs: Add support for exiting program when a probe
18265         condition is reached.
18266
18267 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18268
18269         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18270         we do a forcible conversion regardless of type, to check if 
18271         ForceConversion returns a null.
18272
18273         (Binary::error19): Use location to report error.
18274
18275         (Unary::error23): Use location here too.
18276
18277         * ../errors/cs0019.cs : Check in.
18278
18279         * ../errors/cs0023.cs : Check in.
18280
18281         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18282         case of a non-null MethodInfo object with a length of 0 !
18283
18284         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18285         an applicable member - according to the spec :-)
18286         Also fix logic to find members in base types.
18287
18288         (Unary::ResolveOperator): Same here.
18289
18290         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18291         as I was getting thoroughly confused between this and error19 :-)
18292
18293         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18294         (::FindMostEncompassedType): Implement.
18295         (::FindMostEncompassingType): Implement.
18296         (::StandardConversionExists): Implement.
18297
18298         (UserImplicitCast): Re-vamp. We now need info about most specific
18299         source and target types so that we can do the necessary conversions.
18300
18301         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18302         mathematical union with no duplicates.
18303
18304 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18305
18306         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18307         in order from base classes to child classes, so that we can in
18308         child classes look up in our parent for method names and
18309         attributes (required for handling abstract, virtual, new, override
18310         constructs: we need to instrospect our base class, and if we dont
18311         populate the classes in order, the introspection might be
18312         incorrect.  For example, a method could query its parent before
18313         the parent has any methods and would determine that the parent has
18314         no abstract methods (while it could have had them)).
18315
18316         (RootContext::CreateType): Record the order in which we define the
18317         classes.
18318
18319 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18320
18321         * class.cs (TypeContainer::Populate): Also method definitions can
18322         fail now, keep track of this.
18323
18324         (TypeContainer::FindMembers): Implement support for
18325         DeclaredOnly/noDeclaredOnly flag.
18326
18327         (Constructor::Emit) Return the ConstructorBuilder.
18328
18329         (Method::Emit) Return the MethodBuilder. 
18330         Check for abstract or virtual methods to be public.
18331
18332         * rootcontext.cs (RootContext::CreateType): Register all the
18333         abstract methods required for the class to be complete and the
18334         interface methods that must be implemented. 
18335
18336         * cs-parser.jay: Report error 501 (method requires body if it is
18337         not marked abstract or extern).
18338
18339         * expression.cs (TypeOf::Emit): Implement.
18340
18341         * typemanager.cs: runtime_handle_type, new global type.
18342
18343         * class.cs (Property::Emit): Generate code for properties.
18344
18345 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18346
18347         * expression.cs (Unary::ResolveOperator): Find operators on base type
18348         too - we now conform exactly to the spec.
18349
18350         (Binary::ResolveOperator): Same here.
18351
18352         * class.cs (Operator::Define): Fix minor quirk in the tests.
18353
18354         * ../errors/cs0215.cs : Added.
18355
18356         * ../errors/cs0556.cs : Added.
18357
18358         * ../errors/cs0555.cs : Added.
18359
18360 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18361
18362         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18363         single integer which is really efficient
18364
18365 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18366
18367         *  expression.cs (Expression::ImplicitUserConversion): Use location
18368         even in the case when we are examining True operators.
18369  
18370         * class.cs (Operator::Define): Perform extensive checks to conform
18371         with the rules for operator overloading in the spec.
18372
18373         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18374         some of the other conversions mentioned in the spec.
18375
18376         * typemanager.cs (array_type): New static member for the System.Array built-in
18377         type.
18378
18379         (cloneable_interface): For System.ICloneable interface.
18380
18381         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18382         we start resolving the tree and populating types.
18383
18384         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18385  
18386 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18387
18388         * expression.cs (Expression::ExprClassFromMemberInfo,
18389         Expression::Literalize): Create literal expressions from
18390         FieldInfos which are literals.
18391
18392         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18393         type casts, because they were wrong.  The test suite in tests
18394         caught these ones.
18395
18396         (ImplicitNumericConversion): ushort to ulong requires a widening
18397         cast. 
18398
18399         Int32 constant to long requires widening cast as well.
18400
18401         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18402         for integers because the type on the stack is not i4.
18403
18404 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18405
18406         * expression.cs (report118): require location argument. 
18407
18408         * parameter.cs: Do not dereference potential null value.
18409
18410         * class.cs: Catch methods that lack the `new' keyword when
18411         overriding a name.  Report warnings when `new' is used without
18412         anything being there to override.
18413
18414         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18415
18416         * class.cs: Only add constructor to hashtable if it is non-null
18417         (as now constructors can fail on define).
18418
18419         (TypeManager, Class, Struct): Take location arguments.
18420
18421         Catch field instance initialization in structs as errors.
18422
18423         accepting_filter: a new filter for FindMembers that is static so
18424         that we dont create an instance per invocation.
18425
18426         (Constructor::Define): Catch errors where a struct constructor is
18427         parameterless 
18428
18429         * cs-parser.jay: Pass location information for various new
18430         constructs. 
18431
18432         * delegate.cs (Delegate): take a location argument.
18433
18434         * driver.cs: Do not call EmitCode if there were problesm in the
18435         Definition of the types, as many Builders wont be there. 
18436
18437         * decl.cs (Decl::Decl): Require a location argument.
18438
18439         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18440         into integers, and find the most appropiate integer for it.
18441
18442         * literal.cs: Implement ULongLiteral.
18443
18444         * rootcontext.cs: Provide better information about the location of
18445         failure when CreateType fails.
18446
18447 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18448
18449         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18450         as well.
18451
18452         * expression.cs (Binary::CheckShiftArguments): Add missing type
18453         computation.
18454         (Binary::ResolveOperator): Add type to the logical and and logical
18455         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18456         before.
18457
18458         (Binary::DoNumericPromotions): In the case where either argument
18459         is ulong (and most signed types combined with ulong cause an
18460         error) perform implicit integer constant conversions as well.
18461
18462 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18463
18464         * expression.cs (UserImplicitCast): Method should always be
18465         non-null. 
18466         (Invocation::BetterConversion): Simplified test for IntLiteral.
18467
18468         (Expression::ImplicitNumericConversion): Split this routine out.
18469         Put the code that performs implicit constant integer conversions
18470         here. 
18471
18472         (Expression::Resolve): Become a wrapper around DoResolve so we can
18473         check eclass and type being set after resolve.
18474
18475         (Invocation::Badness): Remove this dead function
18476
18477         (Binary::ResolveOperator): Do not compute the expensive argumnets
18478         unless we have a union for it.
18479
18480         (Probe::Emit): Is needs to do an isinst and then
18481         compare against null.
18482
18483         (::CanConvert): Added Location argument.  If the Location argument
18484         is null (Location.Null), then we do not report errors.  This is
18485         used by the `probe' mechanism of the Explicit conversion.  We do
18486         not want to generate an error for something that the user
18487         explicitly requested to be casted.  But the pipeline for an
18488         explicit cast first tests for potential implicit casts.
18489
18490         So for now, if the Location is null, it means `Probe only' to
18491         avoid adding another argument.   Might have to revise this
18492         strategy later.
18493
18494         (ClassCast): New class used to type cast objects into arbitrary
18495         classes (used in Explicit Reference Conversions).
18496
18497         Implement `as' as well.
18498
18499         Reverted all the patches from Ravi below: they were broken:
18500
18501                 * The use of `level' as a mechanism to stop recursive
18502                   invocations is wrong.  That was there just to catch the
18503                   bug with a strack trace but not as a way of addressing
18504                   the problem.
18505
18506                   To fix the problem we have to *understand* what is going
18507                   on and the interactions and come up with a plan, not
18508                   just get things going.
18509
18510                 * The use of the type conversion cache that I proposed
18511                   last night had an open topic: How does this work across
18512                   protection domains.  A user defined conversion might not
18513                   be public in the location where we are applying the
18514                   conversion, a different conversion might be selected
18515                   (ie, private A->B (better) but public B->A (worse),
18516                   inside A, A->B applies, but outside it, B->A will
18517                   apply).
18518
18519                 * On top of that (ie, even if the above is solved),
18520                   conversions in a cache need to be abstract.  Ie, `To
18521                   convert from an Int to a Short use an OpcodeCast', not
18522                   `To convert from an Int to a Short use the OpcodeCast on
18523                   the variable 5' (which is what this patch was doing).
18524
18525 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18526
18527         * expression.cs (Invocation::ConversionExists): Re-write to use
18528         the conversion cache
18529
18530         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18531         cache all conversions done, not just user-defined ones.
18532
18533         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18534         to determine if a conversion exists instead of acutually trying to 
18535         perform the conversion. It's faster too.
18536
18537         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18538         and only then attempt the implicit conversion.
18539
18540 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18541
18542         * expression.cs (ConvertImplicit): Use a cache for conversions
18543         already found. Check level of recursion and bail out if necessary.
18544
18545 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18546
18547         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18548         Export standard methods that we expect for string operations.
18549
18550         * statement.cs (Block::UsageWarning): Track usage of variables and
18551         report the errors for not used variables.
18552
18553         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18554         operator. 
18555
18556 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18557
18558         * codegen.cs: remove unnneded code 
18559
18560         * expression.cs: Removed BuiltinTypeAccess class
18561
18562         Fix the order in which implicit conversions are
18563         done.  
18564
18565         The previous fixed dropped support for boxed conversions (adding a
18566         test to the test suite now)
18567
18568         (UserImplicitCast::CanConvert): Remove test for source being null,
18569         that code is broken.  We should not feed a null to begin with, if
18570         we do, then we should track the bug where the problem originates
18571         and not try to cover it up here.
18572
18573         Return a resolved expression of type UserImplicitCast on success
18574         rather than true/false.  Ravi: this is what I was talking about,
18575         the pattern is to use a static method as a "constructor" for
18576         objects. 
18577
18578         Also, do not create arguments until the very last minute,
18579         otherwise we always create the arguments even for lookups that
18580         will never be performed. 
18581
18582         (UserImplicitCast::Resolve): Eliminate, objects of type
18583         UserImplicitCast are born in a fully resolved state. 
18584
18585         * typemanager.cs (InitCoreTypes): Init also value_type
18586         (System.ValueType). 
18587
18588         * expression.cs (Cast::Resolve): First resolve the child expression.
18589
18590         (LValue): Add new method AddressOf to be used by
18591         the `&' operator.  
18592
18593         Change the argument of Store to take an EmitContext instead of an
18594         ILGenerator, because things like FieldExpr need to be able to call
18595         their children expression to generate the instance code. 
18596
18597         (Expression::Error, Expression::Warning): Sugar functions for
18598         reporting errors.
18599
18600         (Expression::MemberLookup): Accept a TypeContainer instead of a
18601         Report as the first argument.
18602
18603         (Expression::ResolvePrimary): Killed.  I still want to improve
18604         this as currently the code is just not right.
18605
18606         (Expression::ResolveMemberAccess): Simplify, but it is still
18607         wrong. 
18608
18609         (Unary::Resolve): Catch errors in AddressOf operators.
18610
18611         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18612         index to a byte for the short-version, or the compiler will choose
18613         the wrong Emit call, which generates the wrong data.
18614
18615         (ParameterReference::Emit, ::Store): same.
18616
18617         (FieldExpr::AddressOf): Implement.
18618
18619         * typemanager.cs: TypeManager: made public variable instead of
18620         property.
18621
18622         * driver.cs: document --fatal.
18623
18624         * report.cs (ErrorMessage, WarningMessage): new names for the old
18625         Error and Warning classes.
18626
18627         * cs-parser.jay (member_access): Turn built-in access to types
18628         into a normal simplename
18629
18630 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18631
18632         * expression.cs (Invocation::BetterConversion): Fix to cope
18633         with q being null, since this was introducing a bug.
18634
18635         * expression.cs (ConvertImplicit): Do built-in conversions first.
18636
18637 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18638
18639         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18640
18641 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18642
18643         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18644         I had introduced long ago (what's new ?).
18645
18646         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18647         the work of all the checking. 
18648         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18649         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18650
18651         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18652         that is the right way. 
18653
18654         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18655         overloading resolution. Use everywhere instead of cutting and pasting code.
18656
18657         (Binary::ResolveOperator): Use MakeUnionSet.
18658
18659         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18660         we have to convert to bool types. Not complete yet.
18661
18662 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18663
18664         * typemanager.cs (TypeManager::CSharpName): support ushort.
18665
18666         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18667         to provide an expression that performsn an implicit constant int
18668         conversion (section 6.1.6).
18669         (Expression::ConvertImplicitRequired): Reworked to include
18670         implicit constant expression conversions.
18671
18672         (Expression::ConvertNumericExplicit): Finished.
18673
18674         (Invocation::Emit): If InstanceExpression is null, then it means
18675         that we perform a call on this.
18676
18677 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18678
18679         * expression.cs (Unary::Emit): Remove some dead code.
18680         (Probe): Implement Resolve and Emit for `is'.
18681         (Expression::ConvertImplicitRequired): Attempt to do constant
18682         expression conversions here.  Maybe should be moved to
18683         ConvertImplicit, but I am not sure.
18684         (Expression::ImplicitLongConstantConversionPossible,
18685         Expression::ImplicitIntConstantConversionPossible): New functions
18686         that tell whether is it possible to apply an implicit constant
18687         expression conversion.
18688
18689         (ConvertNumericExplicit): Started work on explicit numeric
18690         conversions.
18691
18692         * cs-parser.jay: Update operator constants.
18693
18694         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18695         (Parameters::GetSignature): Hook up VerifyArgs here.
18696         (Parameters::VerifyArgs): Verifies that no two arguments have the
18697         same name. 
18698
18699         * class.cs (Operator): Update the operator names to reflect the
18700         ones that the spec expects (as we are just stringizing the
18701         operator names).
18702
18703         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18704         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18705         previous usage did only work for our methods.
18706         (Expression::ConvertImplicit): Handle decimal implicit numeric
18707         conversions as well.
18708         (Expression::InternalTypeConstructor): Used to invoke constructors
18709         on internal types for default promotions.
18710
18711         (Unary::Emit): Implement special handling for the pre/post
18712         increment/decrement for overloaded operators, as they need to have
18713         the same semantics as the other operators.
18714
18715         (Binary::ResolveOperator): ditto.
18716         (Invocation::ConversionExists): ditto.
18717         (UserImplicitCast::Resolve): ditto.
18718
18719 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18720
18721         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18722         operator, return after emitting body. Regression tests pass again !
18723
18724         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18725         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18726         (Invocation::OverloadResolve): Ditto.
18727         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18728
18729         * everywhere : update calls to the above methods accordingly.
18730
18731 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18732
18733         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18734
18735         * expression.cs (ExpressionStatement): New base class used for
18736         expressions that can appear in statements, so that we can provide
18737         an alternate path to generate expression that do not leave a value
18738         on the stack.
18739
18740         (Expression::Emit, and all the derivatives): We no longer return
18741         whether a value is left on the stack or not.  Every expression
18742         after being emitted leaves a single value on the stack.
18743
18744         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18745         facilties of ExpressionStatement if possible.
18746
18747         * cs-parser.jay: Update statement_expression.
18748
18749 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18750
18751         * driver.cs: Change the wording of message
18752
18753 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18754
18755         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18756         the type of the expression to the return type of the method if
18757         we have an overloaded operator match ! The regression tests pass again !
18758         (Unary::ResolveOperator): Ditto.
18759
18760         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18761         to find "op_Implicit", not "implicit" ;-)
18762         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18763         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18764
18765         * everywhere : Correct calls to the above accordingly.
18766
18767         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18768         (ConvertImplicit): Do user-defined conversion if it exists.
18769
18770 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18771
18772         * assign.cs: track location.
18773         (Resolve): Use implicit conversions on assignment.
18774
18775         * literal.cs: Oops.  Not good, Emit of short access values should
18776         pass (Bytes) or the wrong argument will be selected.
18777
18778         * expression.cs (Unary::Emit): Emit code for -expr.
18779
18780         (Unary::ResolveOperator): Handle `Substract' for non-constants
18781         (substract from zero from the non-constants).
18782         Deal with Doubles as well. 
18783
18784         (Expression::ConvertImplicitRequired): New routine that reports an
18785         error if no implicit conversion exists. 
18786
18787         (Invocation::OverloadResolve): Store the converted implicit
18788         expressions if we make them
18789
18790 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18791
18792         * class.cs (ConstructorInitializer): Take a Location argument.
18793         (ConstructorBaseInitializer): Same here.
18794         (ConstructorThisInitializer): Same here.
18795
18796         * cs-parser.jay : Update all calls accordingly.
18797
18798         * expression.cs (Unary, Binary, New): Take location argument.
18799         Update accordingly everywhere.
18800
18801         * cs-parser.jay : Update all calls to the above to take a location
18802         argument.
18803
18804         * class.cs : Ditto.
18805
18806 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18807
18808         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18809         (Invocation::BetterConversion): Same here
18810         (Invocation::ConversionExists): Ditto.
18811
18812         (Invocation::ConversionExists): Implement.
18813
18814 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18815
18816         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18817         Also take an additional TypeContainer argument.
18818
18819         * All over : Pass in TypeContainer as argument to OverloadResolve.
18820
18821         * typemanager.cs (CSharpName): Update to check for the string type and return
18822         that too.
18823
18824         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18825         a given method.
18826
18827 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18828
18829         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18830         (Invocation::BetterFunction): Implement.
18831         (Invocation::BetterConversion): Implement.
18832         (Invocation::ConversionExists): Skeleton, no implementation yet.
18833
18834         Okay, things work fine !
18835
18836 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18837
18838         * typemanager.cs: declare and load enum_type, delegate_type and
18839         void_type. 
18840
18841         * expression.cs (Expression::Emit): Now emit returns a value that
18842         tells whether a value is left on the stack or not.  This strategy
18843         might be reveted tomorrow with a mechanism that would address
18844         multiple assignments.
18845         (Expression::report118): Utility routine to report mismatches on
18846         the ExprClass.
18847
18848         (Unary::Report23): Report impossible type/operator combination
18849         utility function.
18850
18851         (Unary::IsIncrementableNumber): Whether the type can be
18852         incremented or decremented with add.
18853         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18854         complemented. 
18855         (Unary::ResolveOperator): Implement ++, !, ~,
18856
18857         (Invocation::Emit): Deal with new Emit convetion.
18858
18859         * All Expression derivatives: Updated their Emit method to return
18860         whether they leave values on the stack or not.
18861
18862         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18863         stack for expressions that are statements. 
18864
18865 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18866
18867         * expression.cs (LValue): New interface.  Must be implemented by
18868         LValue objects.
18869         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18870         LValue interface.
18871
18872         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18873         interface for generating code, simplifies the code.
18874
18875 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18876
18877         * expression.cs (everywhere): Comment out return statements in ::Resolve
18878         methods to avoid the warnings.
18879
18880 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18881
18882         * driver.cs (parse): Report error 2001 if we can not open the
18883         source file.
18884
18885         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18886         not resolve it.
18887
18888         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18889         object. 
18890
18891         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18892         otherwise nested blocks end up with the same index.
18893
18894         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18895
18896         * expression.cs:  Instead of having FIXMEs in the Resolve
18897         functions, throw exceptions so it is obvious that we are facing a
18898         bug. 
18899
18900         * cs-parser.jay (invocation_expression): Pass Location information.
18901
18902         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18903         Use a basename for those routines because .NET does not like paths
18904         on them. 
18905
18906         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18907         already defined.
18908
18909 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18910
18911         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18912         are loading the correct data types (throws an exception if not).
18913         (TypeManager::InitCoreTypes): Use CoreLookupType
18914
18915         * expression.cs (Unary::ResolveOperator): return the child
18916         expression for expressions which are just +expr.
18917         (Unary::ResolveOperator): Return negative literals for -LITERAL
18918         expressions (otherwise they are Unary {Literal}).
18919         (Invocation::Badness): Take into account `Implicit constant
18920         expression conversions'.
18921
18922         * literal.cs (LongLiteral): Implement long literal class.
18923         (IntLiteral): export the `Value' of the intliteral. 
18924
18925 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18926
18927         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18928
18929         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18930         instead of 'Operator'
18931
18932         * expression.cs (Binary::ResolveOperator): Update accordingly.
18933         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18934         and 'Minus'
18935
18936         * cs-parser.jay (unary_expression): Update to use the new names.
18937
18938         * gen-treedump.cs (GetUnary): Same here.
18939
18940         * expression.cs (Unary::Resolve): Implement.
18941         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18942         operators are found instead of making noise ;-)
18943         (Unary::ResolveOperator): New method to do precisely the same thing which
18944         Binary::ResolveOperator does for Binary expressions.
18945         (Unary.method, .Arguments): Add.
18946         (Unary::OperName): Implement.   
18947         (Unary::ForceConversion): Copy and Paste !
18948
18949         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18950         a unary operator.
18951
18952         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18953         for the inbuilt operators. Only overloading works for now ;-)
18954
18955 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18956
18957         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18958         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18959
18960         * expression.cs (This::Emit): Implement. 
18961         (This::Resolve): Implement.
18962         (TypeOf:Resolve): Implement.
18963         (Expression::ResolveSimpleName): Add an implicit this to instance
18964         field references. 
18965         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18966         Bind instance variable to Field expressions.
18967         (FieldExpr::Instance): New field used to track the expression that
18968         represents the object instance.
18969         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18970         binding 
18971         (FieldExpr::Emit): Implement.
18972
18973         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18974         the last instruction contains a return opcode to avoid generating
18975         the last `ret' instruction (this generates correct code, and it is
18976         nice to pass the peverify output).
18977
18978         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18979         initializer for static and instance variables.
18980         (Constructor::Emit): Allow initializer to be null in the case of
18981         static constructors.  Only emit initializer for instance
18982         constructors. 
18983
18984         (TypeContainer::FindMembers): Return a null array if there are no
18985         matches.
18986
18987         Also fix the code for the MemberTypes.Method branch, as it was not
18988         scanning that for operators (or tried to access null variables before).
18989
18990         * assign.cs (Assign::Emit): Handle instance and static fields. 
18991
18992         * TODO: Updated.
18993
18994         * driver.cs: Stop compilation if there are parse errors.
18995
18996         * cs-parser.jay (constructor_declaration): Provide default base
18997         initializer for non-static constructors.
18998         (constructor_declarator): Do not provide a default base
18999         initializers if none was specified.
19000         Catch the fact that constructors should not have parameters.
19001
19002         * class.cs: Do not emit parent class initializers for static
19003         constructors, that should be flagged as an error.
19004
19005 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19006
19007         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19008         Move back code into TypeContainer::Populate.
19009
19010 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19011
19012         * class.cs (TypeContainer::AddConstructor): Fix the check to
19013         compare against Name, not Basename. 
19014         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19015
19016         * cs-parser.jay : Update accordingly.
19017
19018         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19019         for methods, don't forget to look into the operators too.
19020         (RegisterMethodBuilder): Helper method to take care of this for
19021         methods, constructors and operators.
19022         (Operator::Define): Completely revamp.
19023         (Operator.OperatorMethod, MethodName): New fields.
19024         (TypeContainer::Populate): Move the registering of builders into
19025         RegisterMethodBuilder.
19026         (Operator::Emit): Re-write.
19027
19028         * expression.cs (Binary::Emit): Comment out code path to emit method
19029         invocation stuff for the case when we have a user defined operator. I am
19030         just not able to get it right !
19031
19032 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19033
19034         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19035         argument. 
19036
19037         (Expression::MemberLookup): Provide a version that allows to
19038         specify the MemberTypes and BindingFlags. 
19039
19040         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19041         so it was not fetching variable information from outer blocks.
19042
19043         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19044         Beforefieldinit as it was buggy.
19045
19046         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19047         that Ravi put here.  
19048
19049         * class.cs (Constructor::Emit): Only emit if block is not null.
19050         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19051         deal with this by semantically definining it as if the user had
19052         done it.
19053
19054         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19055         constructors as we now "emit" them at a higher level.
19056
19057         (TypeContainer::DefineDefaultConstructor): Used to define the
19058         default constructors if none was provided.
19059
19060         (ConstructorInitializer): Add methods Resolve and Emit. 
19061
19062         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19063
19064 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19065
19066         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19067         the default constructor builder with our hashtable for methodbuilders
19068         to methodcores.
19069
19070         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19071         and argument_count is 0 in which case we have a match.
19072         (Binary::ResolveOperator): More null checking and miscellaneous coding
19073         style cleanup.
19074
19075 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19076
19077         * rootcontext.cs (IsNameSpace): Compare against null.
19078
19079         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19080
19081         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19082         and Unary::Operator.
19083
19084         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19085         accordingly.
19086
19087         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19088         we have overloaded operators.
19089         (Binary::ResolveOperator): Implement the part which does the operator overload
19090         resolution.
19091
19092         * class.cs (Operator::Emit): Implement.
19093         (TypeContainer::Emit): Emit the operators we have too.
19094
19095         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19096         the case when we have a user-defined operator.
19097
19098 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19099
19100         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19101
19102 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19103
19104         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19105         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19106         (Constructor::Emit): Implement.
19107         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19108         if we have no work to do. 
19109         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19110         Emit method.
19111
19112         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19113         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19114
19115         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19116         of parent.parent.
19117
19118 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19119
19120         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19121         in the source.
19122         (Tree::RecordNamespace): Method to do what the name says ;-)
19123         (Tree::Namespaces): Property to get at the namespaces hashtable.
19124
19125         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19126         keep track.
19127
19128         * rootcontext.cs (IsNamespace): Fixed it :-)
19129
19130 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19131
19132         * class.cs (TypeContainer::FindMembers): Add support for
19133         constructors. 
19134         (MethodCore): New class that encapsulates both the shared aspects
19135         of a Constructor and a Method.  
19136         (Method, Constructor): Factored pieces into MethodCore.
19137
19138         * driver.cs: Added --fatal which makes errors throw exceptions.
19139         Load System assembly as well as part of the standard library.
19140
19141         * report.cs: Allow throwing exceptions on errors for debugging.
19142
19143         * modifiers.cs: Do not use `parent', instead use the real type
19144         container to evaluate permission settings.
19145
19146         * class.cs: Put Ravi's patch back in.  He is right, and we will
19147         have to cope with the
19148
19149 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19150
19151         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19152         FamORAssem, not FamANDAssem.
19153
19154 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19155
19156         * driver.cs: Added --parse option that only parses its input files
19157         and terminates.
19158
19159         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19160         incorrect.  IsTopLevel is not used to tell whether an object is
19161         root_types or not (that can be achieved by testing this ==
19162         root_types).  But to see if this is a top-level *class* (not
19163         necessarly our "toplevel" container). 
19164
19165 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19166
19167         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19168         parent instead of a direct call to GetType.
19169
19170 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19171
19172         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19173         Modifiers.TypeAttr. This should just be a call to that method.
19174
19175         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19176         object so that we can determine if we are top-level or not.
19177
19178         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19179         TypeContainer too.
19180
19181         * enum.cs (Enum::Define): Ditto.
19182
19183         * modifiers.cs (FieldAttr): Re-write.
19184
19185         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19186         (TypeContainer::HaveStaticConstructor): New property to provide access
19187         to precisely that info.
19188
19189         * modifiers.cs (MethodAttr): Re-write.
19190         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19191
19192         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19193         of top-level types as claimed.
19194
19195 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19196
19197         * expression.cs (MemberLookup): Fruitless attempt to lookup
19198         constructors.  Maybe I need to emit default constructors?  That
19199         might be it (currently .NET emits this for me automatically).
19200         (Invocation::OverloadResolve): Cope with Arguments == null.
19201         (Invocation::EmitArguments): new function, shared by the new
19202         constructor and us.
19203         (Invocation::Emit): Handle static and instance methods.  Emit
19204         proper call instruction for virtual or non-virtual invocations.
19205         (New::Emit): Implement.
19206         (New::Resolve): Implement.
19207         (MemberAccess:Resolve): Implement.
19208         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19209         to track instances.
19210         (FieldExpr::Resolve): Set type.
19211
19212         * support.cs: Handle empty arguments.
19213                 
19214         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19215         SimpleLookup): Auxiliary routines to help parse a qualifier
19216         identifier.  
19217
19218         Update qualifier_identifier rule.
19219
19220         * codegen.cs: Removed debugging messages.
19221
19222         * class.cs: Make this a global thing, this acts just as a "key" to
19223         objects that we might have around.
19224
19225         (Populate): Only initialize method_builders_to_methods once.
19226
19227         * expression.cs (PropertyExpr): Initialize type from the
19228         PropertyType. 
19229
19230         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19231         Resolve pattern.  Attempt to implicitly convert value to boolean.
19232         Emit code.
19233
19234         * expression.cs: Set the type for the int32/int32 argument case.
19235         (Binary::ResolveOperator): Set the return type to boolean for
19236         comparission operators
19237
19238         * typemanager.cs: Remove debugging print code.
19239
19240         (Invocation::Resolve): resolve type.
19241
19242         * class.cs: Allocate a MemberInfo of the correct size, as the code
19243         elsewhere depends on the test to reflect the correct contents.
19244
19245         (Method::) Keep track of parameters, due to System.Reflection holes
19246
19247         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19248         mapping here.
19249
19250         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19251         of the exact size and return that.
19252
19253         (Class::LookupMethodByBuilder): New function that maps
19254         MethodBuilders to its methods.  Required to locate the information
19255         on methods because System.Reflection bit us again.
19256
19257         * support.cs: New file, contains an interface ParameterData and
19258         two implementations: ReflectionParameters and InternalParameters
19259         used to access Parameter information.  We will need to grow this
19260         as required.
19261
19262         * expression.cs (Invocation::GetParameterData): implement a cache
19263         and a wrapper around the ParameterData creation for methods. 
19264         (Invocation::OverloadResolve): Use new code.
19265
19266 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19267
19268         * class.cs (TypeContainer::EmitField): Remove and move into 
19269         (Field::Define): here and modify accordingly.
19270         (Field.FieldBuilder): New member.
19271         (TypeContainer::Populate): Update accordingly.
19272         (TypeContainer::FindMembers): Implement.
19273
19274 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19275
19276         * statement.cs: (VariableInfo::VariableType): New field to be
19277         initialized with the full type once it is resolved. 
19278
19279 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19280
19281         * parameter.cs (GetParameterInfo): Use a type cache to compute
19282         things only once, and to reuse this information
19283
19284         * expression.cs (LocalVariableReference::Emit): Implement.
19285         (OpcodeCast::Emit): fix.
19286
19287         (ParameterReference::Resolve): Implement.
19288         (ParameterReference::Emit): Implement.
19289
19290         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19291         that are expressions need to stay as Expressions.
19292
19293         * typemanager.cs (CSharpName): Returns the C# name of a type if
19294         possible. 
19295
19296         * expression.cs (Expression::ConvertImplicit): New function that
19297         implements implicit type conversions.
19298
19299         (Expression::ImplicitReferenceConversion): Implements implicit
19300         reference conversions.
19301
19302         (EmptyCast): New type for transparent casts.
19303
19304         (OpcodeCast): New type for casts of types that are performed with
19305         a sequence of bytecodes.
19306
19307         (BoxedCast): New type used for casting value types into reference
19308         types.  Emits a box opcode.
19309
19310         (Binary::DoNumericPromotions): Implements numeric promotions of
19311         and computation of the Binary::Type.
19312
19313         (Binary::EmitBranchable): Optimization.
19314
19315         (Binary::Emit): Implement code emission for expressions.
19316
19317         * typemanager.cs (TypeManager): Added two new core types: sbyte
19318         and byte.
19319
19320 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19321
19322         * class.cs (TypeContainer::FindMembers): Method which does exactly
19323         what Type.FindMembers does, only we don't have to use reflection. No
19324         implementation yet.
19325
19326         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19327         typecontainer objects as we need to get at them.
19328         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19329
19330         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19331         typecontainer object.
19332
19333         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19334         of just a Report object.
19335
19336 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19337
19338         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19339         "remove_"
19340         (TypeContainer::Populate): Now define the delegates of the type too.
19341         (TypeContainer.Delegates): Property to access the list of delegates defined
19342         in the type.
19343
19344         * delegates.cs (Delegate::Define): Implement partially.
19345
19346         * modifiers.cs (TypeAttr): Handle more flags.
19347
19348 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19349
19350         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19351         and not <=
19352         (Operator::Define): Re-write logic to get types by using the LookupType method
19353         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19354         (Indexer::Define): Ditto.
19355         (Event::Define): Ditto.
19356         (Property::Define): Ditto.
19357
19358 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19359
19360         * class.cs (TypeContainer::Populate): Now define operators too. 
19361         (TypeContainer.Operators): New property to access the list of operators
19362         in a type.
19363         (Operator.OperatorMethodBuilder): New member to hold the method builder
19364         for the operator we are defining.
19365         (Operator::Define): Implement.
19366
19367 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19368
19369         * class.cs (Event::Define): Make the prefixes of the accessor methods
19370         addOn_ and removeOn_ 
19371
19372         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19373         of the location being passed in too. Ideally, this should go later since all
19374         error reporting should be done through the Report object.
19375
19376         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19377         (Populate): Iterate thru the indexers we have and define them too.
19378         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19379         for the get and set accessors.
19380         (Indexer::Define): Implement.
19381
19382 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19383
19384         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19385         my previous implementation, did not work.
19386
19387         * typemanager.cs: Add a couple of missing types (the longs).
19388
19389         * literal.cs: Use TypeManager.bool_type instead of getting it.
19390
19391         * expression.cs (EventExpr): New kind of expressions.
19392         (Expressio::ExprClassFromMemberInfo): finish
19393
19394 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19395
19396         * assign.cs: Emit stores to static fields differently.
19397
19398 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19399
19400         * Merge in changes and adjust code to tackle conflicts. Backed out my
19401         code in Assign::Resolve ;-) 
19402
19403 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19404
19405         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19406         instead Report.Error and also pass in the location.
19407         (CSharpParser::Lexer): New readonly property to return the reference
19408         to the Tokenizer object.
19409         (declare_local_variables): Use Report.Error with location instead of plain 
19410         old error.
19411         (CheckDef): Ditto.
19412
19413         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19414         (Operator.CheckBinaryOperator): Ditto.
19415
19416         * cs-parser.jay (operator_declarator): Update accordingly.
19417
19418         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19419         (CheckBinaryOperator): Same here.
19420
19421         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19422         on the name without any prefixes of namespace names etc. This is because we
19423         already might have something already fully qualified like 
19424         'System.Console.WriteLine'
19425
19426         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19427
19428 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19429
19430         * cs-tokenizer.cs (location): Return a string which also contains
19431         the file name.
19432
19433         * expression.cs (ElementAccess): New class for expressions of the
19434         type 'element access.'
19435         (BaseAccess): New class for expressions of the type 'base access.'
19436         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19437         respectively.
19438
19439         * cs-parser.jay (element_access): Implement action.
19440         (base_access): Implement actions.
19441         (checked_expression, unchecked_expression): Implement.
19442
19443         * cs-parser.jay (local_variable_type): Correct and implement.
19444         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19445
19446         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19447
19448         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19449         name and the specifiers.
19450
19451         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19452
19453         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19454         making them all public ;-)
19455
19456         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19457         class anyways.
19458
19459 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19460
19461         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19462         PropertyExprs.
19463         (FieldExpr, PropertyExprs): New resolved expressions.
19464         (SimpleName::MemberStaticCheck): Perform static checks for access
19465         to non-static fields on static methods. Maybe this should be
19466         generalized for MemberAccesses. 
19467         (SimpleName::ResolveSimpleName): More work on simple name
19468         resolution. 
19469
19470         * cs-parser.jay (primary_expression/qualified_identifier): track
19471         the parameter index.
19472
19473         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19474         (EmitContext::EmitBoolExpression): Chain to expression generation
19475         instead of temporary hack.
19476         (::EmitStatementExpression): Put generic expression code generation.
19477
19478         * assign.cs (Assign::Emit): Implement variable assignments to
19479         local variables, parameters and fields.
19480
19481 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19482
19483         * statement.cs (Block::GetVariableInfo): New method, returns the
19484         VariableInfo for a variable name in a block.
19485         (Block::GetVariableType): Implement in terms of GetVariableInfo
19486
19487         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19488         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19489
19490 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19491
19492         * cs-parser.jay (operator_declaration): Continue on my quest : update
19493         to take attributes argument.
19494         (event_declaration): Ditto.
19495         (enum_declaration): Ditto.
19496         (indexer_declaration): Ditto.
19497
19498         * class.cs (Operator::Operator): Update constructor accordingly.
19499         (Event::Event): Ditto.
19500
19501         * delegate.cs (Delegate::Delegate): Same here.
19502
19503         * enum.cs (Enum::Enum): Same here.
19504
19505 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19506
19507         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19508
19509         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19510
19511         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19512         being passed around as an arraylist.
19513         (Attributes::AddAttribute): Method to add attribute sections.
19514
19515         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19516         (struct_declaration): Update accordingly.
19517         (constant_declaration): Update.
19518         (field_declaration): Update.
19519         (method_header): Update.
19520         (fixed_parameter): Update.
19521         (parameter_array): Ditto.
19522         (property_declaration): Ditto.
19523         (destructor_declaration): Ditto.
19524
19525         * class.cs (Struct::Struct): Update constructors accordingly.
19526         (Class::Class): Ditto.
19527         (Field::Field): Ditto.
19528         (Method::Method): Ditto.
19529         (Property::Property): Ditto.
19530         (TypeContainer::OptAttribute): update property's return type.
19531
19532         * interface.cs (Interface.opt_attributes): New member.
19533         (Interface::Interface): Update to take the extra Attributes argument.
19534
19535         * parameter.cs (Parameter::Parameter): Ditto.
19536
19537         * constant.cs (Constant::Constant): Ditto.
19538
19539         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19540         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19541         the attributes as a parameter.
19542         (InterfaceProperty): Update constructor call.
19543         (InterfaceEvent): Ditto.
19544         (InterfaceMethod): Ditto.
19545         (InterfaceIndexer): Ditto.
19546
19547         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19548         pass the attributes too.
19549         (interface_event_declaration): Ditto.
19550         (interface_property_declaration): Ditto.
19551         (interface_method_declaration): Ditto.
19552         (interface_declaration): Ditto.
19553
19554 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19555
19556         * class.cs (Method::Define): Track the "static Main" definition to
19557         create an entry point. 
19558
19559         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19560         EntryPoint if we find it. 
19561
19562         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19563         (EmitContext::ig): Make this variable public.
19564
19565         * driver.cs: Make the default output file be the first file name
19566         with the .exe extension.  
19567
19568         Detect empty compilations
19569
19570         Handle various kinds of output targets.  Handle --target and
19571         rename -t to --dumper.
19572
19573         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19574         methods inherited from Expression return now an Expression.  This
19575         will is used during the tree rewriting as we resolve them during
19576         semantic analysis.
19577
19578         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19579         the spec.  Missing entirely is the information about
19580         accessability of elements of it.
19581
19582         (Expression::ExprClassFromMemberInfo): New constructor for
19583         Expressions that creates a fully initialized Expression based on
19584         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19585         a Type.
19586
19587         (Invocation::Resolve): Begin implementing resolution of invocations.
19588
19589         * literal.cs (StringLiteral):  Implement Emit.
19590
19591 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19592
19593         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19594         member.
19595
19596 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19597
19598         * cs-parser.jay (attribute_arguments): Implement actions.
19599         (attribute): Fix bug in production. Implement action.
19600         (attribute_list): Implement.
19601         (attribute_target): Implement.
19602         (attribute_target_specifier, opt_target_specifier): Implement
19603         (CheckAttributeTarget): New method to check if the attribute target
19604         is valid.
19605         (attribute_section): Implement.
19606         (opt_attributes): Implement.
19607
19608         * attribute.cs : New file to handle attributes.
19609         (Attribute): Class to hold attribute info.
19610
19611         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19612         (attribute_section): Modify production to use 2 different rules to 
19613         achieve the same thing. 1 s/r conflict down !
19614         Clean out commented, useless, non-reducing dimension_separator rules.
19615
19616         * class.cs (TypeContainer.attributes): New member to hold list
19617         of attributes for a type.
19618         (Struct::Struct): Modify to take one more argument, the attribute list.
19619         (Class::Class): Ditto.
19620         (Field::Field): Ditto.
19621         (Method::Method): Ditto.
19622         (Property::Property): Ditto.
19623
19624         * cs-parser.jay (struct_declaration): Update constructor call to
19625         pass in the attributes too.
19626         (class_declaration): Ditto.
19627         (constant_declaration): Ditto.
19628         (field_declaration): Ditto.
19629         (method_header): Ditto.
19630         (fixed_parameter): Ditto.
19631         (parameter_array): Ditto.
19632         (property_declaration): Ditto.
19633
19634         * constant.cs (Constant::Constant): Update constructor similarly.
19635         Use System.Collections.
19636
19637         * parameter.cs (Parameter::Parameter): Update as above.
19638
19639 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19640
19641         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19642         (TypeContainer.delegates): New member to hold list of delegates.
19643
19644         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19645         this time as I seem to be on crack ;-)
19646
19647 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19648
19649         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19650         tell whether an identifier represents a namespace.
19651
19652         * expression.cs (NamespaceExpr): A namespace expression, used only
19653         temporarly during expression resolution.
19654         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19655         utility functions to resolve names on expressions.
19656
19657 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19658
19659         * codegen.cs: Add hook for StatementExpressions. 
19660
19661         * class.cs: Fix inverted test for static flag in methods.
19662
19663 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19664
19665         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19666         to make it coincide with MS' number.
19667         (Operator::CheckBinaryOperator): Ditto.
19668
19669         * ../errors/errors.txt : Remove error numbers added earlier.
19670
19671         * ../errors/cs1019.cs : Test case for error # 1019
19672
19673         * ../errros/cs1020.cs : Test case for error # 1020
19674
19675         * cs-parser.jay : Clean out commented cruft.
19676         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19677         used anywhere - non-reducing rule.
19678         (namespace_declarations): Non-reducing rule - comment out.
19679
19680         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19681         with TypeContainer::AddEnum.
19682
19683         * delegate.cs : New file for delegate handling classes.
19684         (Delegate): Class for declaring delegates.
19685
19686         * makefile : Update.
19687
19688         * cs-parser.jay (delegate_declaration): Implement.
19689
19690 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19691
19692         * class.cs (Event::Define): Implement.
19693         (Event.EventBuilder): New member.
19694
19695         * class.cs (TypeContainer::Populate): Update to define all enums and events
19696         we have.
19697         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19698         readonly fields for all these cases ?
19699
19700 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19701
19702         * class.cs (Property): Revamp to use the convention of making fields readonly.
19703         Accordingly modify code elsewhere.
19704
19705         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19706         the Define method of the Property class.
19707
19708         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19709         trivial bug.
19710         (TypeContainer::Populate): Update to define all the properties we have. Also
19711         define all enumerations.
19712
19713         * enum.cs (Define): Implement.
19714
19715 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19716
19717         * cs-parser.jay (overloadable_operator): The semantic value is an
19718         enum of the Operator class.
19719         (operator_declarator): Implement actions.
19720         (operator_declaration): Implement.
19721
19722         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19723         validity of definitions.
19724         (Operator::CheckBinaryOperator): Static method to check for binary operators
19725         (TypeContainer::AddOperator): New method to add an operator to a type.
19726
19727         * cs-parser.jay (indexer_declaration): Added line to actually call the
19728         AddIndexer method so it gets added ;-)
19729
19730         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19731         already taken care of by the MS compiler ?  
19732
19733 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19734
19735         * class.cs (Operator): New class for operator declarations.
19736         (Operator::OpType): Enum for the various operators.
19737
19738 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19739
19740         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19741         ostensibly handle this in semantic analysis.
19742
19743         * cs-parser.jay (general_catch_clause): Comment out
19744         (specific_catch_clauses, specific_catch_clause): Ditto.
19745         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19746         (catch_args, opt_catch_args): New productions.
19747         (catch_clause): Rewrite to use the new productions above
19748         (catch_clauses): Modify accordingly.
19749         (opt_catch_clauses): New production to use in try_statement
19750         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19751         and re-write the code in the actions to extract the specific and
19752         general catch clauses by being a little smart ;-)
19753
19754         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19755         Hooray, try and catch statements parse fine !
19756
19757 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19758
19759         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19760         string from the hashtable of variables.
19761
19762         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19763         I end up making that mistake ;-)
19764         (catch_clauses): Fixed gross error which made Key and Value of the 
19765         DictionaryEntry the same : $1 !!
19766
19767 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19768
19769         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19770
19771         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19772         when the add and remove accessors are specified. 
19773
19774 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19775
19776         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19777         information about indexer_declarator.
19778         (indexer_declarator): Implement actions.
19779         (parsing_indexer): New local boolean used to keep track of whether
19780         we are parsing indexers or properties. This is necessary because 
19781         implicit_parameters come into picture even for the get accessor in the 
19782         case of an indexer.
19783         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19784
19785         * class.cs (Indexer): New class for indexer declarations.
19786         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19787         (TypeContainer::indexers): New member to hold list of indexers for the
19788         type.
19789
19790 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19791
19792         * cs-parser.jay (add_accessor_declaration): Implement action.
19793         (remove_accessor_declaration): Implement action.
19794         (event_accessors_declaration): Implement
19795         (variable_declarators): swap statements for first rule - trivial.
19796
19797         * class.cs (Event): New class to hold information about event
19798         declarations.
19799         (TypeContainer::AddEvent): New method to add an event to a type
19800         (TypeContainer::events): New member to hold list of events.
19801
19802         * cs-parser.jay (event_declaration): Implement actions.
19803
19804 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19805
19806         * cs-parser.jay (dim_separators): Implement. Make it a string
19807         concatenating all the commas together, just as they appear.
19808         (opt_dim_separators): Modify accordingly
19809         (rank_specifiers): Update accordingly. Basically do the same
19810         thing - instead, collect the brackets here.
19811         (opt_rank_sepcifiers): Modify accordingly.
19812         (array_type): Modify to actually return the complete type string
19813         instead of ignoring the rank_specifiers.
19814         (expression_list): Implement to collect the expressions
19815         (variable_initializer): Implement. We make it a list of expressions
19816         essentially so that we can handle the array_initializer case neatly too.
19817         (variable_initializer_list): Implement.
19818         (array_initializer): Make it a list of variable_initializers
19819         (opt_array_initializer): Modify accordingly.
19820
19821         * expression.cs (New::NType): Add enumeration to help us
19822         keep track of whether we have an object/delegate creation
19823         or an array creation.
19824         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19825         members to hold data about array creation.
19826         (New:New): Modify to update NewType
19827         (New:New): New Overloaded contructor for the array creation
19828         case.
19829
19830         * cs-parser.jay (array_creation_expression): Implement to call
19831         the overloaded New constructor.
19832
19833 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19834
19835         * class.cs (TypeContainer::Constructors): Return member
19836         constructors instead of returning null.
19837
19838 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19839
19840         * typemanager.cs (InitCoreTypes): Initialize the various core
19841         types after we have populated the type manager with the user
19842         defined types (this distinction will be important later while
19843         compiling corlib.dll)
19844
19845         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19846         on Expression Classification.  Now all expressions have a method
19847         `Resolve' and a method `Emit'.
19848
19849         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19850         generation from working.     Also add some temporary debugging
19851         code. 
19852
19853 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19854
19855         * codegen.cs: Lots of code generation pieces.  This is only the
19856         beginning, will continue tomorrow with more touches of polish.  We
19857         handle the fundamentals of if, while, do, for, return.  Others are
19858         trickier and I need to start working on invocations soon.
19859
19860         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19861         s.InitStatement. 
19862
19863         * codegen.cs (EmitContext): New struct, used during code
19864         emission to keep a context.   Most of the code generation will be
19865         here. 
19866
19867         * cs-parser.jay: Add embedded blocks to the list of statements of
19868         this block.  So code generation proceeds in a top down fashion.
19869
19870 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19871
19872         * statement.cs: Add support for multiple child blocks.
19873
19874 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19875
19876         * codegen.cs (EmitCode): New function, will emit the code for a
19877         Block of code given a TypeContainer and its ILGenerator. 
19878
19879         * statement.cs (Block): Standard public readonly optimization.
19880         (Block::Block constructors): Link children. 
19881         (Block::Child): Child Linker.
19882         (Block::EmitVariables): Emits IL variable declarations.
19883
19884         * class.cs: Drop support for MethodGroups here, delay until
19885         Semantic Analysis.
19886         (Method::): Applied the same simplification that I did before, and
19887         move from Properties to public readonly fields.
19888         (Method::ParameterTypes): Returns the parameter types for the
19889         function, and implements a cache that will be useful later when I
19890         do error checking and the semantic analysis on the methods is
19891         performed.
19892         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19893         and made a method, optional argument tells whether this is a class
19894         or a structure to apply the `has-this' bit.
19895         (Method::GetCallingConvention): Implement, returns the calling
19896         convention. 
19897         (Method::Define): Defines the type, a second pass is performed
19898         later to populate the methods.
19899
19900         (Constructor::ParameterTypes): implement a cache similar to the
19901         one on Method::ParameterTypes, useful later when we do semantic
19902         analysis. 
19903
19904         (TypeContainer::EmitMethod):  New method.  Emits methods.
19905
19906         * expression.cs: Removed MethodGroup class from here.
19907
19908         * parameter.cs (Parameters::GetCallingConvention): new method.
19909
19910 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19911
19912         * class.cs (TypeContainer::Populate): Drop RootContext from the
19913         argument. 
19914
19915         (Constructor::CallingConvention): Returns the calling convention.
19916         (Constructor::ParameterTypes): Returns the constructor parameter
19917         types. 
19918
19919         (TypeContainer::AddConstructor): Keep track of default constructor
19920         and the default static constructor.
19921
19922         (Constructor::) Another class that starts using `public readonly'
19923         instead of properties. 
19924
19925         (Constructor::IsDefault): Whether this is a default constructor. 
19926
19927         (Field::) use readonly public fields instead of properties also.
19928
19929         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19930         track of static constructors;  If none is used, turn on
19931         BeforeFieldInit in the TypeAttributes. 
19932
19933         * cs-parser.jay (opt_argument_list): now the return can be null
19934         for the cases where there are no arguments. 
19935
19936         (constructor_declarator): If there is no implicit `base' or
19937         `this', then invoke the default parent constructor. 
19938
19939         * modifiers.cs (MethodAttr): New static function maps a set of
19940         modifiers flags into a MethodAttributes enum
19941         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19942         MethodAttr, TypeAttr to represent the various mappings where the
19943         modifiers are used.
19944         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19945
19946 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19947
19948         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19949         method arguments.
19950
19951         * interface.cs (PopulateIndexer): Implemented the code generator
19952         for interface indexers.
19953
19954 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19955
19956         * interface.cs (InterfaceMemberBase): Now we track the new status
19957         here.  
19958
19959         (PopulateProperty): Implement property population.  Woohoo!  Got
19960         Methods and Properties going today. 
19961
19962         Removed all the properties for interfaces, and replaced them with
19963         `public readonly' fields. 
19964
19965 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19966
19967         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19968         initialize their hashtables/arraylists only when they are needed
19969         instead of doing this always.
19970
19971         * parameter.cs: Handle refs and out parameters.
19972
19973         * cs-parser.jay: Use an ArrayList to construct the arguments
19974         instead of the ParameterCollection, and then cast that to a
19975         Parameter[] array.
19976
19977         * parameter.cs: Drop the use of ParameterCollection and use
19978         instead arrays of Parameters.
19979
19980         (GetParameterInfo): Use the Type, not the Name when resolving
19981         types. 
19982
19983 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19984
19985         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19986         and instead use public readonly fields.
19987
19988         * class.cs: Put back walking code for type containers.
19989
19990 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19991
19992         * class.cs (MakeConstant): Code to define constants.
19993
19994         * rootcontext.cs (LookupType): New function.  Used to locate types 
19995
19996
19997 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19998
19999         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20000         this System.Reflection code is.  Kudos to Microsoft
20001
20002         * typemanager.cs: Implement a type cache and avoid loading all
20003         types at boot time.  Wrap in LookupType the internals.  This made
20004         the compiler so much faster.  Wow.  I rule!
20005
20006         * driver.cs: Make sure we always load mscorlib first (for
20007         debugging purposes, nothing really important).
20008
20009         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20010         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20011
20012         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20013         on namespaces that have been imported using the `using' keyword.
20014
20015         * class.cs (TypeContainer::TypeAttr): Virtualize.
20016         (Class::TypeAttr): Return attributes suitable for this bad boy.
20017         (Struct::TypeAttr): ditto.
20018         Handle nested classes.
20019         (TypeContainer::) Remove all the type visiting code, it is now
20020         replaced with the rootcontext.cs code
20021
20022         * rootcontext.cs (GetClassBases): Added support for structs. 
20023
20024 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20025
20026         * interface.cs, statement.cs, class.cs, parameter.cs,
20027         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20028         Drop use of TypeRefs, and use strings instead.
20029
20030 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20031
20032         * rootcontext.cs: 
20033
20034         * class.cs (Struct::Struct): set the SEALED flags after
20035         checking the modifiers.
20036         (TypeContainer::TypeAttr): new property, returns the
20037         TypeAttributes for a class.  
20038
20039         * cs-parser.jay (type_list): Oops, list production was creating a
20040         new list of base types.
20041
20042         * rootcontext.cs (StdLib): New property.
20043         (GetInterfaceTypeByName): returns an interface by type name, and
20044         encapsulates error handling here.
20045         (GetInterfaces): simplified.
20046         (ResolveTree): Encapsulated all the tree resolution here.
20047         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20048         types. 
20049
20050         * driver.cs: Add support for --nostdlib, to avoid loading the
20051         default assemblies.
20052         (Main): Do not put tree resolution here. 
20053
20054         * rootcontext.cs: Beginning of the class resolution.
20055
20056 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20057
20058         * rootcontext.cs: Provide better error reporting. 
20059
20060         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20061
20062         * rootcontext.cs (CreateInterface): Handle the case where there
20063         are no parent interfaces.
20064
20065         (CloseTypes): Routine to flush types at the end.
20066         (CreateInterface): Track types.
20067         (GetInterfaces): Returns an array of Types from the list of
20068         defined interfaces.
20069
20070         * typemanager.c (AddUserType): Mechanism to track user types (puts
20071         the type on the global type hash, and allows us to close it at the
20072         end). 
20073
20074 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20075
20076         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20077         RecordInterface instead.
20078
20079         * cs-parser.jay: Updated to reflect changes above.
20080
20081         * decl.cs (Definition): Keep track of the TypeBuilder type that
20082         represents this type here.  Not sure we will use it in the long
20083         run, but wont hurt for now.
20084
20085         * driver.cs: Smaller changes to accomodate the new code.
20086
20087         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20088         when done. 
20089
20090         * rootcontext.cs (CreateInterface):  New method, used to create
20091         the System.TypeBuilder type for interfaces.
20092         (ResolveInterfaces): new entry point to resolve the interface
20093         hierarchy. 
20094         (CodeGen): Property, used to keep track of the code generator.
20095
20096 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20097
20098         * cs-parser.jay: Add a second production for delegate_declaration
20099         with `VOID'.
20100
20101         (enum_body): Put an opt_comma here instead of putting it on
20102         enum_body or enum_member_declarations so we can handle trailing
20103         commas on enumeration members.  Gets rid of a shift/reduce.
20104
20105         (type_list): Need a COMMA in the middle.
20106
20107         (indexer_declaration): Tell tokenizer to recognize get/set
20108
20109         * Remove old targets.
20110
20111         * Re-add the parser target.
20112
20113 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20114
20115         * cs-parser.jay: Add precendence rules for a number of operators
20116         ot reduce the number of shift/reduce conflicts in the grammar.
20117
20118 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20119
20120         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20121         and put it here.
20122
20123         Get rid of old crufty code.
20124
20125         * rootcontext.cs: Use this to keep track of the parsed
20126         representation and the defined types available to the program. 
20127
20128         * gen-treedump.cs: adjust for new convention.
20129
20130         * type.cs: Split out the type manager, and the assembly builder
20131         from here. 
20132
20133         * typemanager.cs: the type manager will live here now.
20134
20135         * cil-codegen.cs: And the code generator here. 
20136
20137 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20138
20139         * makefile: Fixed up for easy making.
20140
20141 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20142
20143         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20144         the 
20145
20146         (unary_expression): Expand pre_increment_expression and
20147         post_decrement_expression to reduce a shift/reduce.
20148
20149 2001-07-11  Simon Cozens
20150
20151         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20152
20153         Improve allow_keyword_as_indent name.
20154
20155 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20156
20157         * Adjustments for Beta2. 
20158
20159 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20160
20161         * decl.cs: Added `Define' abstract method.
20162         (InTransit): new property, used to catch recursive definitions. 
20163
20164         * interface.cs: Implement `Define'. 
20165
20166         * modifiers.cs: Map Modifiers.constants to
20167         System.Reflection.TypeAttribute flags.
20168
20169         * class.cs: Keep track of types and user-defined types.
20170         (BuilderInit): New method for creating an assembly
20171         (ResolveType): New function to launch the resolution process, only
20172         used by interfaces for now.
20173
20174         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20175         that are inserted into the name space. 
20176
20177 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20178
20179         * ARGH.  I have screwed up my tree so many times due to the use of
20180         rsync rather than using CVS.  Going to fix this at once. 
20181
20182         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20183         load types.
20184
20185 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20186
20187         * Experiment successful: Use System.Type rather that our own
20188         version of Type.  
20189
20190 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20191
20192         * cs-parser.jay: Removed nsAliases from here.
20193
20194         Use new namespaces, handle `using XXX;' 
20195
20196         * namespace.cs: Reimplemented namespace handling, use a recursive
20197         definition of the class.  Now we can keep track of using clauses
20198         and catch invalid using clauses.
20199
20200 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20201
20202         * gen-treedump.cs: Adapted for all the renaming.
20203
20204         * expression.cs (Expression): this class now has a Type property
20205         which returns an expression Type.
20206
20207         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20208         `Type', as this has a different meaning now in the base
20209
20210 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20211
20212         * interface.cs, class.cs: Removed from all the sources the
20213         references to signature computation, as we can not do method
20214         signature computation during the parsing time, as we are not
20215         trying to solve at that point distinguishing:
20216
20217         class X {
20218                 void a (Blah x) {}
20219                 void a (NS.Blah x) {}
20220         }
20221
20222         Which depending on the context might be valid or not, as we do not
20223         know if Blah is the same thing as NS.Blah at that point.
20224
20225         * Redid everything so the code uses TypeRefs now instead of
20226         Types.  TypeRefs are just temporary type placeholders, that need
20227         to be resolved.  They initially have a pointer to a string and the
20228         current scope in which they are used.  This is used later by the
20229         compiler to resolve the reference to an actual Type. 
20230
20231         * DeclSpace is no longer a CIR.Type, and neither are
20232         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20233         are all DeclSpaces, but no Types. 
20234
20235         * type.cs (TypeRefManager): This implements the TypeRef manager,
20236         which keeps track of all the types that need to be resolved after
20237         the parsing has finished. 
20238
20239 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20240
20241         * ARGH.  We are going to have to store `foreach' as a class rather
20242         than resolving it, as we need to verify error 1579 after name
20243         resolution.   *OR* we could keep a flag that says `This request to
20244         IEnumerator comes from a foreach statement' which we can then use
20245         to generate the error.
20246
20247 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20248
20249         * class.cs (TypeContainer.AddMethod): we now add methods to the
20250         MethodGroup instead of the method hashtable.  
20251
20252         * expression.cs: Add MethodGroup abstraction, which gets us one
20253         step closer to the specification in the way we handle method
20254         declarations.  
20255
20256         * cs-parser.jay (primary_expression): qualified_identifier now
20257         tried to match up an identifier to a local variable reference or
20258         to a parameter reference.
20259
20260         current_local_parameters is now a parser global variable that
20261         points to the current parameters for the block, used during name
20262         lookup.
20263
20264         (property_declaration): Now creates an implicit `value' argument to
20265         the set accessor.
20266
20267 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20268
20269         * parameter.cs: Do not use `param' arguments as part of the
20270         signature, per the spec.
20271
20272 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20273
20274         * decl.cs: Base class for classes, structs and interfaces.  This
20275         is the "Declaration Space" 
20276
20277         * cs-parser.jay: Use CheckDef for checking declaration errors
20278         instead of having one on each function.
20279
20280         * class.cs: Factor out some code for handling error handling in
20281         accordance to the "Declarations" section in the "Basic Concepts"
20282         chapter in the ECMA C# spec.
20283
20284         * interface.cs: Make all interface member classes derive from
20285         InterfaceMemberBase.
20286
20287 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20288
20289         * Many things: all interfaces are parsed and generated in
20290         gen-treedump.  Support for member variables, constructors,
20291         destructors, properties, constants is there.
20292
20293         Beginning of the IL backend, but very little done, just there for
20294         testing purposes. 
20295
20296 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20297
20298         * cs-parser.jay: Fix labeled statement.
20299
20300         * cs-tokenizer.cs (escape): Escape " and ' always.
20301         ref_line, ref_name: keep track of the line/filename as instructed
20302         by #line by the compiler.
20303         Parse #line.
20304
20305 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20306
20307         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20308         to match the values in System.CodeDOM.
20309
20310         Divid renamed to Divide.
20311
20312         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20313         statements. 
20314         (Statements.set): remove.
20315
20316         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20317         statements. 
20318
20319         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20320         falseStatements always have valid values. 
20321
20322         * cs-parser.jay: Use System.CodeDOM now.
20323