2005-09-05 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / bmcs / ChangeLog
1 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
2
3         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4
5 2005-05-08  Jambunathan K  <kjambunathan.devel@gmail.com>
6
7         * expression.cs (Binary.CheckIsArguments): Added
8         (Binary.Emit, Binary.CheckArguments): Modified to support 'Is'
9         operator.
10         
11 2005-05-08  Jambunathan K  <kjambunathan.devel@gmail.com>
12
13         * convert.cs: 
14         * expression.cs: Miscellaneous fixes relating to
15         type conversions.
16
17 2005-04-10  Jambunathan K  <kjambunathan.devel@gmail.com>
18
19         * First cut changes for suporting Binary Operators. All changes
20         need to be refined and reviewed.
21
22         * expression.cs (Error_OperatorCannotBeAppliedToObjectOperands):
23         (ResolveOperator): Commented out. The method is retained for later
24         reference.
25
26         (ResolveVisualBasicOperator): New method that replaces
27         ResolveOperator. The method takes care of VB.NET semantics for
28         Operator Resolution.
29
30         (DoResolve): Replaced call to ResolveOperator with
31         ResolveVisualBasicOperator.
32
33         (Emit, CheckShiftArguments): Updated to reflect VB.NET semantics
34
35         (HandleObjectOperands, CheckArguments, IsOperatorDefinedForType,
36         ConvertOperatorToDefinedType, GetWiderOfTypes,
37         DoOperandPromotions, IsArithmeticExpression,
38         IsRelationalExpression, IsShiftExpression,
39         IsShortCircuitedLogicalExpression, HelperMethod): New helper
40         routines to support binary operator resolution.
41
42         * mb-parser.jay: Added support for exponentiation operator.
43
44         * typemanager.cs (relative_type_order): Added.
45         (InitCoreTypes, InitCodeHelpers, InitVisualBasicHelperTypes,
46         InitVisualBasicCodeHelpers): Added more helper methods to method
47         cache.
48
49
50 2005-04-09  Jambunathan K  <kjambunathan.devel@gmail.com>
51
52         * convert.cs (ObjectTypeToPrimitiveTypes): Added. Converts an
53         'Object' to a 'Primitive Type'.
54
55         (WideningAndNarrowingConversion): Inserted call to
56         'ObjectTypeToPrimitiveTypes' to convert from 'Object' to a
57         'Primitive Type'.
58
59         * typemanager.cs (InitVisualBasicCodeHelpers): Added helper
60         methods that handles above conversions to the TypeManager's method
61         cache.
62
63 2005-04-02  Jambunathan K  <kjambunathan.devel@gmail.com>
64
65         * Makefile: Added '/r:Microsoft.VisualBasic.dll' to the compile
66         command line.
67
68         * driver.cs (UnixParseOption, CSCParseOption): Added
69         '/optioncompare:[text|binary]' command line option.
70
71         * rootcontext.cs (StringComparisonMode): Added. Keeps track of the
72         '/optioncompare:' command line option.
73
74         * typemanager.cs (InitVisualBasicHelperTypes,
75         InitVisualBasicCodeHelpers): New routines that preload frequently
76         used types and helper methods available in
77         Microsoft.Visualbasic.dll. 
78
79         (IsFixedNumericType, IsFloatingNumericType,IsNumericType): New
80         VB.NET specific helper routines. Added in anticipation of a future
81         use.
82         
83         * ecore.cs (HelperMethodInvocation): Added. Implements the same
84         functionality as the earlier vaguely named class
85         'ImplicitInvocation'. This class uses the 'type cache' of
86         Microsoft.VisualBasic helper methods now available in the
87         TypeManager.
88
89         * convert.cs (WideningConstantConversions): Reimplemented. The
90         earlier implementation was completely topsy-turvy.  Propagated the
91         changes relating to the introduction of 'HelperMethodInvocation'.
92
93         * mb-parser.jay: Added rule and action for 'Like' expression.
94
95         * mb-tokenizer.cs (keywords): Cleaned up the extra space in the
96         'let', 'lib' and 'like' entries.
97
98 2005-03-26  Jambunathan K  <kjambunathan.devel@gmail.com>
99
100         * constant.cs: Added conversions between various constants
101         * literal.cs: Added conversions from Nothing to various primitive constants
102         
103         * convert.cs (NothingToPrimitiveConstants, WideningConstantconversions): Added
104
105         (TryWideningIntConversion): Removed C# specific constant
106         conversions. This functionality is now taken care of by
107         WideningConstantConversions.  
108
109         (WideningReferenceConversion): Added support for conversions from Nothing to ValueTypes
110         (WideningNumericConversion): Call WideningConstantConversions
111
112         * ecore.cs (NullCast.Emit): Conversion from Nothing to ValueType
113
114
115 2005-03-26  Jambunathan K  <kjambunathan.devel@gmail.com>
116
117         * ecore.cs (ImplicitInvocation): Set eclass and type to that of the child
118         
119         * convert.cs (ImplicitVBConversion, ImplicitVBConversionRequired,
120         ExplicitVBConversion): Added
121         (WideningNumericConversion): Added support for converting an enum to
122         it's underlying numeric type or any type that it's underlyinmg
123         type has widening conversion to.
124         
125         * assign.cs (DoAssign): Plugged in ImplicitVBConversionRequired.
126
127 2005-03-26  Jambunathan K  <kjambunathan.devel@gmail.com>
128
129         * expression.cs (Binary.Operator): Added Exponentiation,
130         Concatenation, Like, Is and IntegerDivision opeartors
131
132         * mb-parser.jay: Changes relating to the above changes.
133
134 2005-03-26  Jambunathan K  <kjambunathan.devel@gmail.com>
135
136         * expression.cs (Binary.Operator): Renamed LogicalAnd/LogicalOr to
137         LogicalAndAlso and LogicalOrElse.
138         
139         * cfold.cs, gen-treedump.cs, generic.cs, mb-parser.jay: Changes
140         related to the above renaming.
141
142 2005-03-25  Jambunathan K  <kjambunathan.devel@gmail.com>
143
144         * constant.cs (DateConstant): Added (Borrowed from mbas)
145         * literal.cs (DateLiteral): Added (Borrowed from mbas)
146         * mb-parser.jay: Added support for Date type. (Borrowed from mbas)
147         * typemanager.cs (void_datetime_ctor_ticks_arg):  Added (Borrowed from mbas)
148         * mb-tokenizer.cs (ParseDateLiteral, GobbleWhitespaces): Added afresh
149
150 2005-03-25  Jambunathan K  <kjambunathan.devel@gmail.com>
151         
152         * AssemblyInfo.cs: Set assembly version to 0.1
153
154         * literal.cs (NotDefinedAsPrimitiveType): New class. Unlike C#,
155         VB.NET doesn't understand "signed byte", "unsigned short",
156         "unsigned int" and "unsigned long" as primitive types. This class
157         has been introduced just to "accomodate" this fact. Now we can
158         retain most of the existing gmcs code that test against these
159         types for doing language defined conversions.
160         
161         * typemanager.cs (sbyte_type, short_type, uint32_type,uint64_type): 
162         Converted as static properties that return typeof(NotDefinedAsPrimitiveType). 
163         
164         The existing sbyte_type, short_type, uint32_type, uint64_type are
165         renamed as _sbyte_type, _short_type, _uint32_type,
166         _uint64_type. Their accessibility type is now private.
167
168         * convert.cs (NarrowingNumericConversion, WideningNumericConversion): 
169         Reverted original gmcs code that handle byte type and unsigned
170         numeric types. Remember that all this code is a "nop" because
171         of the introduction of NotDefinedAsPrimitiveType class.
172
173
174 2005-03-23  Jambunathan K  <kjambunathan.devel@gmail.com>
175         * Merged with GMCS trunk 42056
176         
177 2005-02-08  Raja R Harinath  <rharinath@novell.com>
178
179         Fix #72015.
180         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
181         TypeManager.multicast_delegate_type is null, resolve it by looking
182         up "System.MulticastDelegate".
183         * rootcontext.cs (RootContext.ResolveCore): Simplify.
184
185 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
186             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
187             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
188
189         Fix cs0164.cs.
190         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
191         (LabeledStatement.AddReference): New.  Set 'referenced'.
192         (Goto.Resolve): Use it.
193
194 2005-02-05  John Luke  <john.luke@gmail.com>
195
196         * driver.cs: remove duplicate -doc line in Usage ()
197
198 2005-02-04  Raja R Harinath  <rharinath@novell.com>
199
200         * location.cs (Location.AddFile): Fix CS2002 error report.
201
202 2005-02-02  Martin Baulig  <martin@ximian.com>
203
204         * delegate.cs (Delegate.DefineType): Report an internal error if
205         TypeManager.multicast_delegate_type is null.  See bug #72015 for
206         details.        
207
208 2005-02-02  Raja R Harinath  <rharinath@novell.com>
209
210         Fix a crasher in a variant of #31984.
211         * const.cs (Constant.CheckBase): New override that defers the
212         new-or-override check in case the base type hasn't been populated
213         yet.
214         (Constant.Define): Ensure the new-or-override check is performed.
215
216 2005-02-01  Duncan Mak  <duncan@ximian.com>
217
218         * const.cs (LookupConstantValue): Check that `ce' is not null
219         before calling GetValue ().
220
221 2005-02-01  Raja R Harinath  <rharinath@novell.com>
222
223         Fix test-334.cs (#69519).
224         * cs-parser.jay (using_alias_directive): Pass in an expression to
225         NamespaceEntry.UsingAlias.
226         (using_namespace_directive): Pass in an expression to
227         NamespaceEntry.Using.
228         (namespace_name): Don't flatten to a string.
229         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
230         (NamespaceEntry.AliasEntry.Resolve): Lookup using
231         ResolveAsTypeStep.
232         (NamespaceEntry.UsingEntry): Likewise.
233         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
234         changes.
235         (NamespaceEntry.LookupForUsing): Remove.
236         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
237         names.
238         (NamespaceEntry.Lookup): Remove support for dotted names.
239
240 2005-02-01  Raja R Harinath  <rharinath@novell.com>
241
242         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
243         split into two.
244         (NamespaceEntry.ImplicitParent): Compute on demand.
245         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
246         parallels the current.
247         (NamespaceEntry.LookupForUsing): Use it.
248         (NamespaceEntry.Lookup): If the current namespace-entry is
249         implicit, don't search aliases and using tables.
250
251 2005-02-01  Raja R Harinath  <rharinath@novell.com>
252
253         Fix #31984.
254         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
255         BaseCache here.
256         (TypeContainer.BaseCache): Compute on demand.
257         (TypeContainer.FindMembers): Define constants and types if they're
258         not already created.
259         (FieldMember.Define): Move resetting of ec.InUnsafe before error
260         check.
261         * const.cs (Constant.Define): Make idempotent.
262
263 2005-01-29  Miguel de Icaza  <miguel@novell.com>
264
265         * pending.cs: Produce better code (no nops produced by using Ldarg
266         + value).
267         
268         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
269         i - 1' it should be arg + 1.
270
271         Fixes bug #71819.
272
273 2005-01-28  Raja R Harinath  <rharinath@novell.com>
274
275         * attribute.cs (Attribute.CheckAttributeType): Make private
276         non-virtual.
277         (Attribute.ResolveType): Make virtual.
278         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
279         handling of RootContext.Tree.Types.
280
281 2005-01-27  Raja R Harinath  <rharinath@novell.com>
282
283         Update attribute-handling to use the SimpleName/MemberAccess
284         mechanisms.
285         * cs-parser.jay (attribute): Pass in an expression to the
286         constructors of Attribute and GlobalAttribute.
287         * attribute.cs (Attribute): Take an expression for the name.
288         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
289         passed in attribute name expression.
290         (Attribute.CheckAttributeType): Use it.
291         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
292         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
293         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
294         argument to prevent error messages if the lookup fails.
295
296 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
297
298         * expression.cs (Indirection): Implemented IVariable interface
299         to support indirection in AddressOf operator.
300         (PointerArithmetic.Emit): Add optimalization for case where
301         result can be precomputed.
302
303 2005-01-26  Martin Baulig  <martin@ximian.com>
304
305         * class.cs (TypeContainer.AttributeTargets): Return the correct
306         AttributeTargets depending on our `Kind' instead of throwing an
307         exception; fixes #71632.
308
309 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
310
311         Fix #71257
312         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
313         constant members.
314
315 2005-03-17  Martin Baulig  <martin@ximian.com>
316
317         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
318         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
319
320 2005-03-17  Martin Baulig  <martin@ximian.com>
321
322         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
323         to bool so we can return an error condition.
324         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
325         returned an error.
326
327 2005-03-17  Martin Baulig  <martin@ximian.com>
328
329         * generic.cs (TypeMananager.IsIEnumerable): New public method.
330
331         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
332         converting from an array-type of T to `IEnumerable<T>'.
333
334 2005-03-16  Martin Baulig  <martin@ximian.com>
335
336         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
337         (Nullable.LiftedUnaryMutator): New public class.
338
339         * expression.cs (UnaryMutator.DoResolve): Added support for
340         Nullable Types.
341
342 2005-03-14  Martin Baulig  <martin@ximian.com>
343
344         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
345
346 2005-03-14  Martin Baulig  <martin@ximian.com>
347
348         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
349         the comparision operators `<', `>', `<=' and `>='.
350
351 2005-03-13  Martin Baulig  <martin@ximian.com>
352
353         * generic.cs
354         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
355         avoid confusion with the `NullLiteral'.
356         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
357
358 2005-03-13  Martin Baulig  <martin@ximian.com>
359
360         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
361         comparing arbitrary types with the null literal.
362
363 2005-03-13  Martin Baulig  <martin@ximian.com>
364
365         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
366         boolean operators '&&', '||', '&' and '|'.
367         (Nullable.OperatorTrueOrFalse): New public class.
368
369         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
370         instead of a `StaticCallExpr'; added support for nullables.
371
372 2005-03-10  Martin Baulig  <martin@ximian.com>
373
374         * expression.cs
375         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
376         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
377
378 2005-03-07  Martin Baulig  <martin@ximian.com>
379
380         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
381         it work if `expr' is not an IMemoryLocation.
382         (Nullable.Lifted): Implement IMemoryLocation.
383         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
384         target type.
385
386 2005-03-05  Martin Baulig  <martin@ximian.com>
387
388         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
389         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
390         (Nullable): Added support for lifted unary and binary operators.
391
392         * expression.cs (Unary.DoResolve): Added support for nullable types.
393         (Binary.DoResolve): Likewise.
394         (Conditional.DoResolve): Likewise.
395
396 2005-03-02  Martin Baulig  <martin@ximian.com>
397
398         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
399
400         * class.cs (ClassPart.SetParameterInfo): Override this.
401         (PartialContainer.SetParameterInfo): Override this.
402         (TypeContainer.CheckConstraints): New protected method.
403         (PartialContainer.CheckConstraints): Override this and check
404         whether the same contraints were specified in all parts of a
405         partial generic type definition.
406         (PartialContainer.UpdateConstraints): New public method.
407
408         * generic.cs (TypeParameter.UpdateConstraints): New public method.
409
410 2005-03-02  Martin Baulig  <martin@ximian.com>
411
412         Committing a patch from Carlos Alberto Cortez to fix #72887.
413
414         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
415         casts from `T []' to `int []'.
416
417 2005-03-02  Martin Baulig  <martin@ximian.com>
418
419         * generic.cs (TypeManager.IsEqual): Make this symmetric.
420
421         * expression.cs (Binary.ResolveOperator): When resolving a
422         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
423         `=='.  Fixes #71866.  See gen-127.cs.
424
425 2005-03-02  Martin Baulig  <martin@ximian.com>
426
427         * class.cs (TypeContainer.DoDefineMembers): We also need a default
428         static constructor in static classes.
429
430 2005-03-02  Martin Baulig  <martin@ximian.com>
431
432         * generic.cs
433         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
434         (Nullable.LiftedConversion): Added support for user-defined
435         conversions.
436
437         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
438
439         * cs-parser.jay: Use ComposedCast everywhere instead of
440         NullableType, so we don't need to check for NullableType
441         everywhere.
442         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
443         case where we'll be resolved into a `parenthesized_expression_0'
444         afterwards.
445
446         * convert.cs
447         (Convert.UserDefinedConversion): Added nullable conversions.
448
449 2005-02-28  Martin Baulig  <martin@ximian.com>
450
451         * generic.cs (TypeManager.IsNullableType): New static method.
452         (Nullable): New abstract class.
453         (Nullable.NullLiteral): New public class.
454         (Nullable.LiftedConversion): New public class.
455
456         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
457         `builtin_types opt_nullable'.
458
459         * convert.cs
460         (Convert.ImplicitConversionStandard): Added nullable conversions.
461         (Convert.ExplicitConversionStandard): Likewise.
462         (Convert.ExplicitConversion): Likewise.
463
464 2005-02-26  Martin Baulig  <martin@ximian.com>
465
466         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
467         begin with a "?", for instance "?[]".  Don't do a type lookup if
468         `dim' is empty.
469
470 2005-02-25  Martin Baulig  <martin@ximian.com>
471
472         The first part of Nullable Types :-)
473
474         * generic.cs (NullableType): New public class.
475         (NullCoalescingOperator): New public class.
476         (TypeArguments.Resolve): Add a CS0306 check.
477
478         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
479         (opt_nullable): New rule.
480         (type): Added `opt_nullable' to `namespace_or_type_name',
481         `builtin_types' and `pointer_type'.
482         (array_type): Added `opt_nullable'.
483         (opt_rank_specifier_or_nullable): New rule; this is the
484         combination of `opt_rank_specifier' and `opt_nullable'.
485         (opt_error): New rule; catch errors here.
486         (nullable_type_or_conditional): New rule; we use this to check for
487         nullable and still detect the conditional operator.
488         (local_variable_type): Use `opt_rank_specifier_or_nullable'
489         instead `opt_rank_specifier'.
490
491         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
492         for nullables.
493
494 2005-02-24  Martin Baulig  <martin@ximian.com>
495
496         * README, README.Changes: Removed; they're old and obsolete.
497
498 2005-02-22  Martin Baulig  <martin@ximian.com>
499
500         * generic.cs (TypeParameter.Resolve): If resolving the constraints
501         returned an error, set `constraints' to null to avoid a crash
502         later on.
503         (TypeParameter.ResolveType): Likewise.
504
505 2005-02-22  Martin Baulig  <martin@ximian.com>
506
507         * generic.cs
508         (Constraints.ResolveTypes): Protect against being called twice.
509         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
510         (TypeParameter.ResolveType): New public method; calls
511         constraints.ResolveTypes().
512         (TypeParameter.DefineType): Moved constraints.ResolveType() out
513         into the new ResolveType().
514         (GenericMethod.Define): Call ResolveType() on all our
515         TypeParameter's.        
516
517 2005-02-21  Martin Baulig  <martin@ximian.com>
518
519         * generic.cs
520         (TypeManager.generic_nullable_type): New static public field.
521         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
522
523         * rootcontext.cs
524         (RootContext.ResolveCore): Resolve "System.Nullable`1".
525
526 2005-02-15  Martin Baulig  <martin@ximian.com>
527
528         * generic.cs (ConstructedType.Constraints): Correctly check
529         constraints if the argument type is a type parameter; fixes
530         #72326. 
531
532
533 2005-03-01  Jambunathan K  <kjambunathan.devel@gmail.com>
534
535         * ecore.cs (ImplicitInvocation, ImplicitNew, FloatingToFixedCast): Added
536         * expression.cs (ImplicitInvocation, ImplicitNew): Removed
537
538         * driver.cs, rootcontext.cs: Added the 'removeintchecks' and
539         'optionstrict' command line options
540
541         * convert.cs (WideningNumericConversion,
542         NarrowingNumericConversion): Updated to refelct VB.NET semantics.
543
544 2005-03-01  Jambunathan K  <kjambunathan.devel@gmail.com>
545
546         * convert.cs: Added the following conversion routines:
547         BooleanConversions, WideningStringConversions,
548         NarrowingStringConversions.
549
550         * ecore.cs: Added following helper classes: BooleanToNumericCast,
551         NumericToBooleanCast
552         
553         * typemanager.cs: Added System.DateTime to the cached types.
554
555 2005-02-28  Jambunathan K  <kjambunathan.devel@gmail.com>
556
557         * ecore.cs (StringToExpression):
558         * expression.cs (ImplicitInvocation, ImplicitNew): VB.NET specific
559         helper classes and methods.
560
561 2005-02-28  Jambunathan K  <kjambunathan.devel@gmail.com>
562
563         * assign.cs, attribute.cs, cfold.cs, const.cs, constant.cs,
564         * convert.cs, ecore.cs, enum.cs, expression.cs, generic.cs,
565         * iterator.cs, statement.cs : Broadly, what C# spec terms as
566         "Implicit" & "Explicit", VB.NET spec terms as "Widening" &
567         "Narrowing" respectively. So renamed exisiting methods to reflect
568         the VB.NET nomenclature. These are just first renamings.
569         
570 2005-02-28  Jambunathan K  <kjambunathan.devel@gmail.com>
571
572         * convert.cs :
573         * expression.cs :       
574         * statement.cs: VB.NET has no notion of User defined
575         conversions. Assuming that UserDefinedConversion() returns null,
576         propagated the resulting changes upstream. 
577
578 2005-02-02  Martin Baulig  <martin@ximian.com>
579
580         * delegate.cs (Delegate.DefineType): Report an internal error if
581         TypeManager.multicast_delegate_type is null.  See bug #72015 for
582         details.        
583
584 2005-01-29  Miguel de Icaza  <miguel@novell.com>
585
586         * pending.cs: Produce better code (no nops produced by using Ldarg
587         + value).
588         
589         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
590         i - 1' it should be arg + 1.
591
592         Fixes bug #71819.
593         
594 2005-01-26  Martin Baulig  <martin@ximian.com>
595
596         * cs-parser.jay (indexer_declarator): Don't report an error if we
597         have type parameters since we can be an explicit interface
598         implementation; fixes #71449.
599
600 2005-01-26  Martin Baulig  <martin@ximian.com>
601
602         * class.cs (TypeContainer.AttributeTargets): Return the correct
603         AttributeTargets depending on our `Kind' instead of throwing an
604         exception; fixes #71632.
605
606 2005-01-26  Martin Baulig  <martin@ximian.com>
607
608         * delegate.cs (Delegate.DefineType): Correctly define our type
609         parameters.  Fixes #71483.
610
611 2005-01-25  Raja R Harinath  <rharinath@novell.com>
612
613         Fix #71602.
614         * expression.cs (MemberAccess.DoResolve): Don't complain with
615         cs0572 when the LHS of a member access has identical name and type
616         name.
617
618 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
619
620         Fix #71651, #71675
621         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
622         CreatePermission.
623         Create custom PermissionSet only for PermissionSetAttribute.
624
625 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
626
627         Fix #71649
628         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
629         delegates in static class.
630
631 2005-01-24  Martin Baulig  <martin@ximian.com>
632
633         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
634         merging an implicit block, just use its reachability.
635
636         * statement.cs (Block.Resolve): Make the unreachable code check
637         work wrt. implicit blocks; see test-337 from #63842.
638
639 2005-01-21  Alp Toker  <alp@atoker.com>
640  
641         * cs-parser.jay: destructor_declaration's container is PartialContainer
642         not Class when partial types are used, so use Kind prop instead of
643         'is'.
644         
645 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
646
647         * cs-parser.jay: Improve error reporting when an interface
648         declares new types.
649
650 2005-01-20  Dick Porter  <dick@ximian.com>
651
652         * support.cs: SeekableStreamReader fix from Sandor Dobos
653         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
654         chars are read.  Fixes bug 70369.
655
656 2005-01-20  Raja R Harinath  <rharinath@novell.com>
657
658         * cs-parser.jay (catch_clause): Simplify current_block handling
659         somewhat.
660
661 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
662
663         * convert.cs (ImplicitStandardConversionExists): Synchronize the
664         code with ImplicitStandardConversion to handle the implicit
665         conversion of method groups into valid delegate invocations. 
666
667         The problem is that in parameter handling we were using this code
668         path.  Fixes bug #64698
669
670 2005-01-19  Raja R Harinath  <rharinath@novell.com>
671
672         * cs-parser.jay: Fix several infelicities.
673         - Avoid assigning to the parser value stack.  Code like 
674           '$3 = null' is unclean.  Synthesize a value for the code block
675           instead. 
676         - Avoid using oob_stack for storing location information.  Use ...
677         (_mark_): ... this.  New (empty) rule.  Saves the current location
678         in $$.
679         (foreach_statement): Avoid using oob_stack for current_block
680         handling.  Use technique used in for_statement and
681         using_statement.  Synthesize a value for the code block to store
682         additional intermediate information.
683
684 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
685
686         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
687         of a different type is only allowed to private fields of a
688         containing type, not on fields of a base class.
689
690         See test-174.cs and error cs0122-9.cs
691
692 2005-01-13  Raja R Harinath  <rharinath@novell.com>
693
694         Fix test-335.cs (bug #58126).
695         * cs-parser.jay (argument): Split out non-expression parts of the
696         rule into 'non_simple_argument'.
697         (invocation_expression): Support parenthesized invocations with
698         multiple arguments, and with single non-simple arguments.
699
700 2005-01-13  Raja R Harinath  <rharinath@novell.com>
701
702         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
703         places.
704
705 2005-01-12  Raja R Harinath  <rharinath@novell.com>
706
707         Fix cs0038-1.cs, cs1640-6.cs.
708         * ecore.cs (Expression.Resolve): Remove special-case for
709         SimpleName in error-handling.
710         (Expression.almostMatchedMembers): Relax access permission to
711         protected.
712         (Expression.MemberLookupFailed): Handle duplicates in
713         almostMatchedMembers list.
714         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
715         * expression.cs (New.DoResolve): Report CS1540 for more cases.
716         * typemanager.cs (GetFullNameSignature): Use the MethodBase
717         overload if the passed in MemberInfo is a MethodBase.
718
719 2005-01-25  Martin Baulig  <martin@ximian.com>
720
721         * doc.cs
722         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
723
724 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
725
726         Fix #70749
727         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
728         for non-CAS & merge permission sets properly.
729
730 2005-01-11  Raja R Harinath  <rharinath@novell.com>
731
732         Improve standard-compliance of simple name and member access 
733         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
734         * ecore.cs (FullNamedExpression): New abstract base class 
735         for Namespaces and TypeExpressions.
736         (ResolveFlags.SimpleName): Remove.
737         (SimpleName): Remove support for dotted names.
738         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
739         DeclSpace.FindType and DeclSpace.LookupType.
740         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
741         (Expression.ExprClassName): Make member function.
742         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
743         a namespace.  Remove creation of dotted "SimpleName"s.
744         (MemberAccess.DoResolve): Likewise.
745         * decl.cs (DeclSpace.Cache): Make private.
746         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
747         (DeclSpace.FindType): Update.
748         (DeclSpace.LookupType): Move here from RootContext.  Return a 
749         FullNamedExpression.
750         * namespace.cs (Namespace): Derive from FullNamedExpression
751         so that it can be part of expression resolution.
752         (Namespace.Lookup): Return an FullNamedExpression.
753         (NamespaceEntry.LookupAlias): Lookup aliases only in current
754         namespace.
755         * rootcontext.cs (NamespaceLookup): Remove.
756         (LookupType): Move to DeclSpace.
757         * attribute.cs (CheckAttributeType): Update.
758         * doc.cs (FindDocumentedType): Remove allowAlias argument.
759         (FindDocumentedTypeNonArray): Likewise.
760
761 2005-01-11  Raja R Harinath  <rharinath@novell.com>
762
763         Fix cs0509.cs, cs1632.cs.
764         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
765         is the same as IsInterface.
766         (TypeContainer.GetClassBases): Likewise.
767         * statement.cs (LabeledStatement.ig): New field.
768         (LabeledStatement.LabelTarget): Save ILGenerator which created the
769         label.
770         (LabeledStatement.DoEmit): Check that the label was created with
771         the same ILGenerator.
772
773 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
774
775         Fix #71058
776         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
777         accessors to its properties.
778
779         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
780         from accessors to property.
781         
782 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
783
784         Fix #70722
785         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
786         only for overrides.
787         
788 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
789
790         * attribute.cs: Check for null and empty strings.  
791
792         I have lost another battle to Paolo.
793
794 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
795
796         Fix #70942
797         * class.cs (PropertyMethod): Set Parent field in ctors.
798         (SetMethod.InternalParameters): Add unsafe switch hack.
799         Override MarkForDuplicationCheck where it is appropriate.
800
801         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
802         It says whether container allows members with the same name.
803         Base default is no.
804         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
805         Removed is_method parameter.
806
807 2005-01-06  Duncan Mak  <duncan@ximian.com>
808
809         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
810         because the previous change led to incorrect reporting of CS1032
811         ("Cannot define/undefine preprocessor symbols after first token in
812         file"). Instead of using `tokens_seen' as the only flag that
813         triggers CS1040, introduce `comments_seen'. This new flag is used
814         to signify having seen comments on the current line, so it is
815         unset after a newline.
816
817 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
818
819         * doc.cs : When searching for a type, find nested type too.
820           This fixes bug #71040.
821
822 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
823
824         * doc.cs :
825           - Warn missing member comment on those classes which also does not
826             have doc comments. Fixed bug #71041.
827           - Don't warn missing doc comment on default constructor.
828             Fixed bug #71042.
829
830 2005-01-06  Duncan Mak  <duncan@ximian.com>
831
832         * cs-tokenizer.cs (xtoken): After handling traditional C-style
833         comments, set `tokens_seen' to true. This allows us to detect
834         misplaced preprocessor directives (i.e. not at the beginning of
835         the a line, nor after whitespaces). In that case, report error
836         CS1040. This fixes bug #56460.
837
838         * cs-parser.jay (interface_member_declaration): Add checks for
839         IsExplicitImpl, and report CS0541 error if an interface member is
840         defined as an explicit interface declaration.
841
842 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
843
844         Fix #70817
845         * class.cs (PropertyMethod): Set Parent field in ctors.
846         (SetMethod.InternalParameters): Add unsafe switch hack.
847         
848         * decl.cs (MemberCore.Parent): Cannot be readonly.
849
850 2005-01-06  Raja R Harinath  <rharinath@novell.com>
851
852         * decl.cs (DeclSpace.ResolveType): Remove.
853         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
854         Merge in code from ...
855         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
856         * class.cs, enum.cs: Update to changes.
857
858 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
859
860         * anonymous.cs: Ensure that we init the scope of our parent if it
861         has not been initialized yet.
862
863 2004-12-30  Duncan Mak  <duncan@ximian.com>
864
865         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
866         if field.FieldBuilder is null. Fixes #70758.
867
868         * convert.cs: Fixed some typos and updated some of the comments.
869         (ImplicitStandardConversionExists):
870         (TryImplicitIntConversion): If `target_type' is an interface and
871         the type of `ic' implements this interface, return true or a new
872         BoxedCast instead of null. This fixes #70468.
873
874 2004-12-29  Duncan Mak  <duncan@ximian.com>
875
876         * expression.cs (Argument.Emit): Check that Expr is
877         IMemoryLocation before casting to it, and report CS1510 otherwise.
878
879         This fixes #70402.
880
881 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
882
883         * statement.cs (Block.ThisVariable): remove the recursion here, to
884         make the --profile more sane.
885
886 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
887
888         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
889         assembly, by JB Evain.
890
891 2004-12-17  Raja R Harinath  <rharinath@novell.com>
892
893         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
894           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
895         "parent" refers to enclosing type/class.  "base" refers to superclass.
896
897 2004-12-17  Raja R Harinath  <rharinath@novell.com>
898
899         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
900         Ensure that we only have GlobalAttributes.
901         * attribute.cs (Attribute.Emit): Make non-virtual.
902         (GlobalAttribute.Emit): Remove.
903         (Attribute.Resolve): Make virtual.
904         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
905         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
906         the argument. Don't create one.
907         (Attribute.GetObsoleteAttribute): Likewise.
908         (Attribute.GetClsCompliantAttributeValue): Likewise.
909         * class.cs, decl.cs: Update to changes.
910
911 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
912
913         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
914         
915         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
916         
917         * statement.cs (Foreach.Resolve): Add error 186 report.
918
919 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
920
921         * expression.cs (Conditional.DoResolve): Add warning 429.
922         
923         * statement.cs (If.Resolve): Add warning 665.
924
925 2004-12-16  Raja R Harinath  <rharinath@novell.com>
926
927         New invariant: RootContext.Tree.Types.NamespaceEntry == null
928         except when in the parser, and in GlobalAttribute.
929         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
930         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
931         RootContext.Tree.Types.NamespaceEntry once work is done.
932         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
933         and resets RootContext.Tree.Types.NamespaceEntry.
934
935 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
936
937         * cs-parser.jay: Don't create a block for every variable.
938
939 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
940
941         * location.cs: Provide extra information.
942
943         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
944         variables from the captured environment, it is the ldarg_0.
945
946 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
947
948         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
949         find a conclusion.
950         
951         * class.cs: Changed warning level for 169 to avoid developer
952         displeasure from warning flooding. It will be changed back when they
953         fix most of current BCL warnings.
954         
955         * RootContext.cs: Pushed default WarningLevel to 3.
956         
957         * statement.cs: Removed unused variable.
958
959 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
960
961         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
962         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
963         Add error 502 report.
964         (StaticClass.DefineType): Add error 441 report.
965         (Class.AllowedModifiersProp): New virtual property as temporary
966         extension to AllowedModifiers.
967         (Class.DefineType): Add error 418 report. Moved ModFlags check here
968         to share implementation with StaticClass and don't call virtual
969         methods from ctor.
970         
971         * driver.cs (MainDriver): Add error 1558 test.
972
973         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
974         report. Moved error 36 test here.
975
976         * statement.cs (Throw.Resolve): Add error 724 report.
977
978         * typemanager.cs: Add out_attribute_type core type.
979         
980 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
981
982         * class.cs (TypeContainer.VerifyClsCompliance): Add error
983         3018 report.
984         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
985
986         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
987         3017 report.
988         
989         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
990
991         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
992         Add error 3023 report.
993         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
994
995         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
996         implementation.
997
998 2004-12-12  John Luke  <john.luke@gmail.com>
999
1000         * driver.cs (AddArgs): take -- into account when
1001         adding arguments, fixes bug 65710 
1002
1003 2004-12-12  Martin Baulig  <martin@ximian.com>
1004
1005         * expression.cs (Unary.TryReduceNegative): Added support for
1006         SByteConstant and ByteConstant.
1007         (Unary.Reduce): Check error values from TryReduceNegative().
1008
1009 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
1010
1011         * attributes.cs (Attribute.Resolve): Avoid multiple error report
1012         and report exception as error 182.
1013
1014 2004-12-10  Raja R Harinath  <rharinath@novell.com>
1015
1016         * driver.cs (Main): Fix message when there are warnings.
1017
1018 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
1019
1020         * delegate.cs: Fixed my fix from yesterday, sorry about that.
1021
1022 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
1023
1024         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
1025         Reduced number of warnings.
1026         
1027         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
1028
1029 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
1030
1031         * driver.cs: Removed message.
1032
1033         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
1034
1035 2004-12-08    <vargaz@freemail.hu>
1036
1037         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1038
1039 2004-12-08  Martin Baulig  <martin@ximian.com>
1040
1041         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1042         instead of a CS3002 for properties and indexer.
1043
1044 2004-12-08  Martin Baulig  <martin@ximian.com>
1045
1046         * decl.cs (MemberName.ToString): Make this work again.
1047
1048 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
1049
1050         * attribute.cs (Resolve): Add error 591 detection.
1051
1052         * class.cs (FieldMember.Define): Add error 1547 detection.
1053         (Indexer.Define): Add error 620 detection.
1054         (Operator.Define): Add error 590 detection.
1055
1056         * ecore.cs: Missing argument for error 79.
1057
1058         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1059         detection.
1060
1061 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1062
1063         Fix #70106
1064         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1065         only.
1066
1067 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1068
1069         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1070           Some operator comments were suppressed.
1071         * doc.cs : Implicit/explicit operator name in doc comments are like
1072           "op_Explicit(type)~returnType", so added suffix handling.
1073
1074 2005-01-21  Alp Toker  <alp@atoker.com>
1075
1076         * cs-parser.jay: destructor_declaration's container is PartialContainer
1077         not Class when partial types are used, so use Kind prop instead of 'is'.
1078
1079 2004-12-12  Martin Baulig  <martin@ximian.com>
1080
1081         * expression.cs (Unary.TryReduceNegative): Added support for
1082         SByteConstant and ByteConstant.
1083         (Unary.Reduce): Check error values from TryReduceNegative().
1084
1085 2004-12-11  Martin Baulig  <martin@ximian.com>
1086
1087         * support.cs (ReflectionParameters.ParameterName): If we have a
1088         `gpd', call `ParameterName' on it.
1089
1090         * parameter.cs (Parameter.GetParameterAttributes): New static method.
1091
1092         * pending.cs (PendingImplementation.DefineProxy): Call
1093         DefineParameter() for all of the MethodBuilder's arguments.
1094
1095 2004-12-09  Martin Baulig  <martin@ximian.com>
1096
1097         * doc.cs (DocUtil): Make this a static class.
1098
1099 2004-12-09  Martin Baulig  <martin@ximian.com>
1100
1101         * expression.cs (Invocation.InferType): Moved the type inference
1102         implementation into TypeManager.
1103
1104         * generics.cs (TypeManager): Moved the type inference
1105         implementation here.
1106
1107 2004-12-09  Martin Baulig  <martin@ximian.com>
1108
1109         * typemanager.cs (TypeManager): Make this a partial class.
1110
1111         * generics.cs
1112         (TypeManager): Move the generics part of `TypeManager' here.
1113
1114 2004-12-08  Martin Baulig  <martin@ximian.com>
1115
1116         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1117         instead of a CS3002 for properties and indexer.  Added CS3024
1118         check for generic interfaces.
1119
1120         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
1121         instances are not CLS-compliant.
1122
1123 2004-12-08  Martin Baulig  <martin@ximian.com>
1124
1125         * cs-parser.jay
1126         (void_pointer_expression): New rule for `void*', `void**' etc.
1127         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
1128
1129 2004-12-08  Martin Baulig  <martin@ximian.com>
1130
1131         * expression.cs (Invocation.InferType): Removed the hack for
1132         MethodCore.MayUnify().  
1133
1134         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
1135         this actually work.
1136
1137         * class.cs (MethodCore.MayUnify): Use
1138         TypeManager.MayBecomeEqualGenericTypes().       
1139
1140 2004-12-08  Martin Baulig  <martin@ximian.com>
1141
1142         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
1143         parameter, box it.  Fixes #69233.
1144
1145 2004-12-08  Martin Baulig  <martin@ximian.com>
1146
1147         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
1148         have the ctor constraint.  Fixes #68326.
1149
1150 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1151
1152         * cs-parser.jay : interface comment was not consumed because of
1153           extra opt_semicolon before doc handling.
1154
1155 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1156
1157         Fix test-327.cs, test-328.cs, and put in early infrastructure
1158         for eventually fixing #52697.
1159         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1160         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1161         from other methods.
1162         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1163         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1164         (VerifyUsing, error246): Update.
1165         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1166         'NamespaceEntry.LookupNamespaceOrType'.
1167
1168 2004-12-07  Martin Baulig  <martin@ximian.com>
1169
1170         * driver.cs: Call it "BETA SOFTWARE" :-)
1171
1172 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1173
1174         Fix crash on cs0657-17.cs.
1175         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1176         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1177         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1178         the case where the NamespaceEntry gets overwritten.
1179
1180 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1181
1182         Fixed #69195, #56821
1183         * ecore.cs (ResolveBoolean): Tiny refactoring.
1184
1185         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1186         of right expression resolving when left is false constant and
1187         operator is LogicalAnd OR true constant and operator is LogicalOr.
1188
1189         * statement.cs (ResolveUnreachable): Always reports warning.
1190
1191 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1192
1193         * class.cs: Distinguish between 1721 and 1722 (just a little help
1194         for the programmer).
1195
1196 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1197
1198         * delegate.cs: Only allow this on new versions of the language. 
1199
1200 2004-12-02  Duncan Mak  <duncan@ximian.com>
1201
1202         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1203         Expression class.
1204         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1205         here as a static method. Take an additional bool out parameter
1206         `must_do_cs1540_check' for signaling to InstanceResolve.
1207         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1208         member field from PropertyExpr class and made it an argument of
1209         the method instead.
1210         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1211         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1212         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1213         and `remove_accessor' as well as InstanceResolve: report CS0122
1214         where applicable.
1215
1216         Fixes #70129.
1217
1218 2004-12-07  Martin Baulig  <martin@ximian.com>
1219
1220         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
1221         and CS0692 where appropriate.
1222
1223 2004-12-06  Martin Baulig  <martin@ximian.com>
1224
1225         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
1226         IsDuplicateImplementation() and improved it.
1227
1228         * expression.cs (Invocation.InferTypeArguments): Added
1229         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
1230         and removed the "ref" modifier from `infered_types'.
1231
1232         * decl.cs (MemberName.ToString): Removed the exception.
1233
1234 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1235
1236         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1237           comments are allowed.
1238
1239 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1240
1241         * delegate.cs: Add checks for subtypes in paramaters and return values
1242         in VerifyMethod () to add support for Covariance/Contravariance
1243         in delegates.
1244         
1245 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1246
1247         * report.cs: Remove extra closing parenthesis.
1248
1249         * convert.cs (Error_CannotImplicitConversion): If the name of the
1250         types are the same, provide some extra information.
1251
1252 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1253
1254         Fix bug #70102
1255         * attribute.cs (Resolve): Improved implementation of params
1256         attribute arguments.
1257
1258         * support.cs (ParameterData): Add HasParams to be faster.
1259
1260 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1261
1262         all things are for /doc support:
1263
1264         * doc.cs: new file that supports XML documentation generation.
1265         * mcs.exe.sources: added doc.cs.
1266         * driver.cs:
1267           Handle /doc command line option.
1268           Report error 2006 instead of 5 for missing file name for /doc.
1269           Generate XML documentation when required, after type resolution.
1270         * cs-tokenizer.cs:
1271           Added support for picking up documentation (/// and /** ... */),
1272           including a new XmlCommentState enumeration.
1273         * cs-parser.jay:
1274           Added lines to fill Documentation element for field, constant,
1275           property, indexer, method, constructor, destructor, operator, event
1276           and class, struct, interface, delegate, enum.
1277           Added lines to warn incorrect comment.
1278         * rootcontext.cs :
1279           Added Documentation field (passed only when /doc was specified).
1280         * decl.cs:
1281           Added DocComment, DocCommentHeader, GenerateDocComment() and
1282           OnGenerateDocComment() and some supporting private members for
1283           /doc feature to MemberCore.
1284         * class.cs:
1285           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1286         * delegate.cs:
1287           Added overriden DocCommentHeader.
1288         * enum.cs:
1289           Added overriden DocCommentHeader and GenerateDocComment().
1290
1291 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1292
1293         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1294         unwrapping the enumeration values, chain to
1295         DoConstantNumericPromotions again, so we can promote things to the
1296         fundamental types (takes care of enums that are bytes, sbytes).
1297
1298         Fixes bug #62054.
1299
1300 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1301
1302         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1303         Fix long-standing bug in type-lookup.  Use FindType instead of
1304         LookupType when ec.ResolvingTypeTree.
1305         (Attribute.ResolveType, Attribute.Resolve)
1306         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1307         Update to changes.
1308         (Attributes.Search): Remove internal version.  Update.
1309         (Attributes.SearchMulti): Update.
1310         (Attributes.GetClsCompliantAttribute): Remove.
1311         (Attributes.GetIndexerNameAttribute): Remove.
1312         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1313         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1314         * class.cs (Indexer.Define): Likewise.
1315
1316 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1317
1318         Fix bug #68790
1319         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1320         MarshallByReference members access.
1321
1322         * expression.cs: Use CheckMarshallByRefAccess;
1323         Better error CS0197 message.
1324
1325         * report.cs: Print whole related error message.
1326
1327 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1328
1329         * class (GetClassBases): Better error 60 report.
1330         (EventProperty): Disabled warning 67 detection.
1331
1332 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1333
1334         Fix bug #60324
1335         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1336
1337         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1338         precise values.
1339
1340 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1341
1342         Fix bug #49488
1343         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1344
1345         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1346
1347 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
1348
1349         * attribute.cs (Attribute.Resolve): Refine error reporting and
1350         report a cs0117 if the identifier does not exist, to distinguish
1351         from 0617 which is a miss-use of the actual identifier.
1352
1353         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1354         between cs0070 and cs0079.
1355
1356         * class.cs (MemberBase.DoDefine): When reporting a wrong
1357         accessibility level, we use MethodCore to compare instead of
1358         Method (this was a regression in some refactoring effort).
1359
1360         So now we correctly report cs0056 again.
1361
1362         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1363         testing the target_type (which was known to be object_type) and
1364         not the source type (which is anonymous_method).
1365
1366         Fixed reporting of error cs1660.
1367
1368         * expression.cs (UserCast.Source): Expose the underlying cast.
1369
1370         * statement.cs (Switch.SwitchGoverningType): Sort the list of
1371         allowed types to find a match to int32 first (most common).
1372
1373         In addition, it ignores any ImplicitUserConversions that did an
1374         internal implicit conversion (as the switch statement allows only
1375         one integral conversion to exist).
1376
1377         * class.cs (PartialContainer.Create): rename `name' to
1378         `member_name' for clarity.  Then replace the string calls with a
1379         call to MemberName.GetPartialName, as now using
1380         MemberName.ToString is an error (this is due to the side effects
1381         it had, that were fixed in the past).
1382
1383         This will restore the error reporting on a number of partial class
1384         errors that were missusing this (and getting an exception as a
1385         results, which is now just a plain textual warning, because
1386         yyparse debug output would crash otherwise).
1387
1388 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1389
1390         * Makefile (PROGRAM_INSTALL_DIR): Remove.
1391
1392 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1393
1394         * rootcontext.cs (LookupType): Make sure to cache lookups that
1395         don't give us a negative result. This saves about 5% of corlib
1396         compilation time.
1397
1398 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1399
1400         * report.cs (AbstractMessage.Print): messages are sent to stderr
1401
1402         * class.cs (TypeContainer.GetClassBases): It is an error to have a
1403         non-interface in the list of interfaces (at this point, either
1404         parent was properly set, or a base class is being listed in the
1405         interfaces section).
1406
1407         This flags error 1722, and resolves the crash from bug 69259.
1408
1409 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1410
1411         * statement.cs (Using.EmitExpressionFinally): make this work right
1412         for valuetypes. Fixes 69926.
1413
1414 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1415
1416         * const.cs (Const.ChangeType): Cope with the "0 literal can be
1417         converted to an enum" here, before we try to change the underlying
1418         type.  This code exists, but it is a different code path than the
1419         one used while encoding constants.
1420
1421         (ImplicitReferenceConversionExists): In addition, resynchronized
1422         the code here, so it matches the same code in
1423         ImplicitReferenceConversionExists for the `from any class-type S
1424         to any interface-type T'.       
1425
1426 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
1427
1428         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1429
1430 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
1431
1432         * cs-parser.jay: Use verbosity accordingly. 
1433
1434 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1435
1436         * expression.cs (Unary.ResolveOperator): Do not report warning;
1437         AddressOf reads from variable.
1438         
1439         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1440
1441 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1442
1443         Fix bug #69462
1444
1445         * attribute.cs (Attributable): Removed CheckTargets.
1446         (Attributes.Emit): Explicit attribute targets are tested here.
1447
1448         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1449         not enabled for interfaces.
1450
1451         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1452         (GetAssemblyName): Ouch next bug there.
1453
1454 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1455
1456         * expression.cs: Error 275 added.
1457         
1458 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1459
1460         Fix bug #69177 (Implemented decimal constant support)
1461
1462         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1463         (BinaryFold): Add DecimalConstant.
1464
1465         * const.cs (Define): Decimal constant 
1466         (is not constant.
1467         (ChangeType): Add decimal type handling.
1468         (LookupConstantValue): Don't set value for decimal type but
1469         emit DecimalConstantAttribute. Needed for constant optimization.
1470
1471         * constant.cs (ToDecimal): New method.
1472         (ConvertToDecimal): New method.
1473         (IntConstant): Implemented ConvertToDecimal.
1474         (DecimalConstant.Emit): Emit optimized version for decimals in
1475         int range.
1476
1477         * expression.cs (ResolveOperator): Changed order of constant
1478         reduction to work correctly with native types which have
1479         overloaded operators.
1480         (ResolveMemberAccess): Extract constant value from attribute
1481         for decimal type.
1482
1483         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1484
1485         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1486         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1487         (ChangeType): Decimal is special.
1488         (TypeToCoreType): Add decimal type.
1489
1490 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1491
1492         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1493         decimal types.
1494
1495 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1496
1497         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1498         test cs1667-5.cs.
1499
1500 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1501
1502         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1503
1504         * pending.cs (PendingImplementation): Grab only interfaces.
1505
1506 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1507
1508         * statement.cs (ForeachHelperMethods): Add location member and
1509         error 202 detection.
1510
1511 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1512
1513         * expression.cs (DoResolveBase): Fixed wrong warning for out
1514         variables.
1515
1516 2004-12-04  Martin Baulig  <martin@ximian.com>
1517
1518         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
1519         to check whether the conversion is ok.
1520
1521         * typemanager.cs (TypeManager.GetTypeArguments): Just return
1522         `Type.EmptyTypes' if we're not a generic TypeContainer.
1523
1524 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1525
1526         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1527         old bug: when converting from the null literal to a pointer,
1528         return an EmptyCast, not the NullLiteral.
1529
1530         This fixes #69921, the recent null_type changes probably made this
1531         bug more prominent.
1532
1533 2004-12-03  Martin Baulig  <martin@ximian.com>
1534
1535         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1536         method as our child, call AnonymousMethod.Compatible() on it.
1537
1538 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1539
1540         * class.cs (FieldBase): Use an unused bit field from the field to
1541         encode the `has_offset' property from the FieldMember.  This saves
1542         a couple of Ks on bootstrap compilation.
1543
1544         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1545         method as our child, return the AnonymousMethod resolved
1546         expression.
1547
1548         * expression.cs (New.DoResolve): Allow return values from
1549         NewDelegate to also include AnonymousMethods.
1550
1551         Fixes #70150.
1552
1553 2004-11-29  Raja R Harinath  <rharinath@novell.com>
1554
1555         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
1556         cs1648 report.
1557         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
1558         System.Runtime.InteropServices._Exception, since it's a base
1559         interface of the core type System.Exception in the net_2_0 profile.
1560
1561 2004-11-27  Martin Baulig  <martin@ximian.com>
1562
1563         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
1564
1565 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1566
1567         * Makefile: Convert to use executable.make.
1568         * gmcs.exe.sources: New.
1569
1570 2004-11-25  Martin Baulig  <martin@ximian.com>
1571
1572         * expression.cs (Invocation.InferType): Added support for byref types.
1573
1574 2004-11-25  Martin Baulig  <martin@ximian.com>
1575
1576         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1577         in TypeManager.TypeToCoreType().
1578
1579 2004-11-25  Martin Baulig  <martin@ximian.com>
1580
1581         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1582         "Dispose" method from the `current_type'.
1583         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1584         DoDefineMembers() instead of using the MethodBuilder; this is
1585         required for generic iterators.
1586
1587         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1588
1589 2004-11-24  Martin Baulig  <martin@ximian.com>
1590
1591         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1592
1593 2004-11-20  Martin Baulig  <martin@ximian.com>
1594
1595         * expression.cs (Invocation.InferType): Correctly infer generic
1596         instances; see gen-103.cs.
1597         (Invocation.InferTypeArguments): If a generic method doesn't have
1598         any unbound type parameters, we don't need to infer anything.
1599
1600 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1601
1602         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1603
1604 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1605
1606         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1607         (TypeHandle.GetMemberCache): New.
1608         (TypeHandle.TypeHandle): Update.
1609         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1610         (TypeManager.LookupParentInterfacesCache):
1611         Rename from LookupInterfaceCache.  Optimize slightly.
1612         (TypeManager.MemberLookup_FindMembers): Update.
1613         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1614         multi-type variant.
1615         (AddCacheContents): Rename from AddHashtable.
1616         * class.cs (TypeContainer.parent_container): Remove.
1617         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1618         (TypeContainer.DoDefineMembers): Don't initialize it.
1619         Update to name changes.
1620         
1621 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1622
1623         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1624         that factors the code to check access modifiers on override.  
1625
1626         (PropertyBase): Use the code here.
1627
1628         Patch from Lluis S'anchez, fixes bug #69361.
1629
1630 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1631
1632         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1633         routine that is used to report the use of a captured variable
1634         whose address has been taken.
1635
1636         There are two checks: one when variables are being captured and
1637         the other check is when the address of a variable is taken. 
1638         
1639         (because an anonymous methods might be resolved before *or* after
1640         the address has been taken) and 
1641
1642         * expression.cs (Conditional.DoResolve): Remove the special
1643         casing that Martin added to trueExpr and falseExpr being both
1644         NullLiteral.  We get the right behavior now just by introducing
1645         the null_type into the compiler. 
1646
1647         * convert.cs (ExplicitConversion): Change the code to use
1648         null_type instead of testing `expr is NullLiteral'.
1649         (ImplicitConversionStandard): use null_type too.
1650         (ImplicitReferenceConversionExists): use null_type too.
1651         (ImplicitReferenceConversion): use null_type too.
1652
1653         * literal.cs: The type of `NullLiteral' is now null_type instead
1654         of object_type. 
1655         (Resolve): Set the type here.
1656
1657         * typemanager.cs: Introduce null_type.
1658
1659 2004-11-18  Martin Baulig  <martin@ximian.com>
1660
1661         * rootcontext.cs
1662         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1663
1664 2004-11-18  Martin Baulig  <martin@ximian.com>
1665
1666         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1667
1668 2004-11-18  Martin Baulig  <martin@ximian.com>
1669
1670         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1671         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1672         call ResolveConstructedType() on it to resolve it without checking
1673         constraints.
1674         (Constraints.ResolveTypes): Check them here.
1675         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1676         but don't check constraints.
1677         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1678         check constraints here.
1679         (ConstructedType.ResolveConstructedType): New public method.  This
1680         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1681         resolve ourselves without checking constraints.
1682
1683         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1684
1685 2004-11-18  Martin Baulig  <martin@ximian.com>
1686
1687         * decl.cs
1688         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1689
1690         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1691
1692 2004-11-18  Martin Baulig  <martin@ximian.com>
1693
1694         * ecore.cs (TypeExpr.ResolveType): Removed.
1695         (Expression.ResolveAsTypeTerminal): We always return a fully
1696         resolved `TypeExpr', so we can just access its `Type'.
1697
1698         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1699
1700 2004-11-17  Martin Baulig  <martin@ximian.com>
1701
1702         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1703         sure we don't return any unresolved TypeExpr's.
1704         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1705         a `TypeExpr'.
1706         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1707
1708         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1709         unresolved `ConstructedType's.
1710
1711 2004-11-17  Martin Baulig  <martin@ximian.com>
1712
1713         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1714
1715 2004-11-17  Martin Baulig  <martin@ximian.com>
1716
1717         * ecore.cs
1718         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1719
1720         * decl.cs (DeclSpace.ResolveType): Removed.
1721         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1722
1723 2004-11-17  Martin Baulig  <martin@ximian.com>
1724
1725         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1726         direction, like FindMembers() does.  Fixes #69546, testcase is in
1727         test-315.cs.    
1728
1729 2004-11-16  Martin Baulig  <martin@ximian.com>
1730
1731         This is based on a patch from Marek Safar, see bug #69082.
1732         Fixes bugs #63705 and #67130.
1733
1734         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1735         method; create a MemberCache for an interface type and cache the
1736         result.
1737
1738         * decl.cs (IMemberContainer.ParentContainer): Removed.
1739         (IMemberContainer.ParentCache): New property.
1740         (MemberCache.SetupCacheForInterface): Removed.
1741         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1742         to create a cache for an interface's "parent".
1743
1744         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1745         interfaces too.
1746
1747 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1748
1749         * statement.cs: Avoid adding bools to a hashtable.
1750
1751 2004-11-15  Martin Baulig  <martin@ximian.com>
1752
1753         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1754
1755 2004-11-11  Martin Baulig  <martin@ximian.com>
1756
1757         * typemanager.cs (TypeManager.GetMethodName): New method.
1758
1759         * class.cs (MethodData.Define): Include the generic arity in the
1760         name of an explicit interface; also add it to the method name.
1761
1762         * pending.cs (PendingImplementation.InterfaceMethod): The method
1763         name now includes the generic arity.
1764
1765 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1766
1767         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1768         calling an unsafe method from a safe location.
1769
1770 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1771
1772         Fix #69167
1773         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1774
1775 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1776
1777         * namespace.cs (VerifyUsing): use GetPartialName instead of
1778         ToString. 
1779
1780 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1781
1782         * statement.cs (Return.Resolve): Fix regression in typo: if
1783         `in_exc', we have to request a NeedReturnLabel, this was a typo
1784         introduced in the anonymous method check-in.  Fixes #69131.
1785
1786         * Indexers were using the ShortName when defining themselves,
1787         causing a regression in the compiler bootstrap when applying the
1788         patch from 2004-11-02 (first part), now they use their full name
1789         and the bug is gone.
1790
1791 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1792
1793         * driver.cs: Strip the path from the names of embedded resources. Fixes
1794         #68519.
1795
1796 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1797
1798         Fix error message regression: cs0104-2.cs.
1799         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1800         (AliasEntry.Resolve): Update.
1801         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1802         'silent' flag.
1803         (RootContext.LookupType): Update.
1804
1805 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1806
1807         * cs-parser.jay: Add support for handling accessor modifiers
1808         * class: Add support port accessor modifiers and error checking,
1809         define PropertyMethod.Define as virtual (not abstract anymore)
1810         * ecore.cs: Add checking for proeprties access with access modifiers
1811         * iterators.cs: Modify Accessor constructor call based in the modified
1812         constructor
1813 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1814
1815         * expression.cs (StringConcat): Handle being called twice,
1816         as when we have a concat in a field init with more than two
1817         ctors in the class
1818
1819 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1820
1821         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1822         special case explicit implementations, we should always produce
1823         the .property or .event declaration.
1824         
1825         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1826         since it will not return correct data if people use this
1827         unresolved in the presence of using statements (see test-313).
1828
1829         * class.cs (MethodData.Define): If we are an explicit interface
1830         implementation, set the method name to the full name of the
1831         interface plus the name of the method.  
1832
1833         Notice that using the method.MethodName.GetFullName() does not
1834         work, as it will only contain the name as declared on the source
1835         file (it can be a shorthand in the presence of using statements)
1836         and not the fully qualifed type name, for example:
1837
1838         using System;
1839
1840         class D : ICloneable {
1841                 object ICloneable.Clone ()  {
1842                 }
1843         }
1844
1845         Would produce a method called `ICloneable.Clone' instead of
1846         `System.ICloneable.Clone'.
1847
1848         * namespace.cs (Alias.Resolve): Use GetPartialName.
1849         
1850 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1851
1852         * cs-parser.jay: Add error 1055 report.
1853
1854 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1855
1856         * assign.cs (Assign.DoResolve): Only do the transform of
1857         assignment into a New if the types are compatible, if not, fall
1858         through and let the implicit code deal with the errors and with
1859         the necessary conversions. 
1860
1861 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1862
1863         * cs-parser.jay: Add error 1031 report.
1864
1865         * cs-tokenizer.cs: Add location for error 1038.
1866
1867 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1868
1869         * cs-parser.jay: Add error 1016 report.
1870
1871 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1872
1873         * cs-parser.jay: Add errors 1575,1611 report.
1874
1875 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1876
1877         * cs-parser.jay: Add error 1001 report.
1878
1879 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1880
1881         Fix #68850
1882         * attribute.cs (GetMarshal): Add method argument for
1883         caller identification.
1884
1885         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1886         agument for GetMarshal and RuntimeMissingSupport.
1887
1888 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1889
1890         * attribute.cs (ExtractSecurityPermissionSet): Removed
1891         TypeManager.code_access_permission_type.
1892
1893         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1894
1895 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1896
1897         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1898         for obsolete use of a variable here.   Fixes regression on errors
1899         cs0619-25 and cs0619-26.
1900
1901 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1902
1903         Fix #62358, implemented security attribute encoding.
1904
1905         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1906         Tests permitted SecurityAction for assembly or other types.
1907         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1908         data from SecurityPermissionAttribute to PermisionSet class.
1909
1910         * class.cs (ApplyAttributeBuilder): Added special handling
1911         for System.Security.Permissions.SecurityAttribute based types.
1912
1913         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1914         special handling for System.Security.Permissions.SecurityAttribute
1915         based types.
1916
1917         * enum.cs (ApplyAttributeBuilder): Added special handling
1918         for System.Security.Permissions.SecurityAttribute based types.
1919
1920         * parameter.cs (ApplyAttributeBuilder): Added special handling
1921         for System.Security.Permissions.SecurityAttribute based types.
1922
1923         * rootcontext.cs: Next 2 core types.
1924
1925         * typemanager.cs (TypeManager.security_permission_attr_type):
1926         Built in type for the SecurityPermission Attribute.
1927         (code_access_permission_type): Build in type.
1928
1929 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1930
1931         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1932         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1933         all of this information into
1934         EmitContext.EmitCapturedVariableInstance.
1935         
1936         * codegen.cs (EmitCapturedVariableInstance): move here the
1937         funcionality of emitting an ldarg.0 in the presence of a
1938         remapping.   This centralizes the instance emit code.
1939
1940         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1941         then emit a load of this: it means that we have reached the
1942         topmost ScopeInfo: the one that contains the pointer to the
1943         instance of the class hosting the anonymous method.
1944
1945         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1946         captures to the topmost CaptureContext.
1947
1948 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1949
1950         * expression.cs (LocalVariableReference): Move the knowledge about
1951         the iterators into codegen's EmitCapturedVariableInstance.
1952
1953 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1954
1955         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1956         all code paths return a value from an anonymous method (it is the
1957         same as the 161 error, but for anonymous methods).
1958
1959 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1960
1961         The introduction of anonymous methods in the compiler changed
1962         various ways of doing things in the compiler.  The most
1963         significant one is the hard split between the resolution phase
1964         and the emission phases of the compiler.
1965
1966         For instance, routines that referenced local variables no
1967         longer can safely create temporary variables during the
1968         resolution phase: they must do so from the emission phase,
1969         since the variable might have been "captured", hence access to
1970         it can not be done with the local-variable operations from the runtime.
1971         
1972         * statement.cs 
1973
1974         (Block.Flags): New flag `IsTopLevel' to indicate that this block
1975         is a toplevel block.
1976
1977         (ToplevelBlock): A new kind of Block, these are the blocks that
1978         are created by the parser for all toplevel method bodies.  These
1979         include methods, accessors and anonymous methods.
1980
1981         These contain some extra information not found in regular blocks:
1982         A pointer to an optional CaptureContext (for tracking captured
1983         local variables and parameters).  A pointer to the parent
1984         ToplevelBlock.
1985         
1986         (Return.Resolve): Catch missmatches when returning a value from an
1987         anonymous method (error 1662).
1988         Invoke NeedReturnLabel from the Resolve phase instead of the emit
1989         phase.
1990
1991         (Break.Resolve): ditto.
1992
1993         (SwitchLabel): instead of defining the labels during the
1994         resolution phase, we now turned the public ILLabel and ILLabelCode
1995         labels into methods called GetILLabelCode() and GetILLabel() that
1996         only define the label during the Emit phase.
1997
1998         (GotoCase): Track the SwitchLabel instead of the computed label
1999         (its contained therein).  Emit the code by using
2000         SwitchLabel.GetILLabelCode ().
2001
2002         (LocalInfo.Flags.Captured): A new flag has been introduce to track
2003         whether the Local has been captured or not.
2004
2005         (LocalInfo.IsCaptured): New property, used to tell whether the
2006         local has been captured.
2007         
2008         * anonymous.cs: Vastly updated to contain the anonymous method
2009         support.
2010
2011         The main classes here are: CaptureContext which tracks any
2012         captured information for a toplevel block and ScopeInfo used to
2013         track the activation frames for various local variables.   
2014
2015         Each toplevel block has an optional capture context associated
2016         with it.  When a method contains an anonymous method both the
2017         toplevel method and the anonymous method will create a capture
2018         context.   When variables or parameters are captured, they are
2019         recorded on the CaptureContext that owns them, for example:
2020
2021         void Demo () {
2022              int a;
2023              MyDelegate d = delegate {
2024                  a = 1;
2025              }
2026         }
2027
2028         Here `a' will be recorded as captured on the toplevel
2029         CapturedContext, the inner captured context will not have anything
2030         (it will only have data if local variables or parameters from it
2031         are captured in a nested anonymous method.
2032
2033         The ScopeInfo is used to track the activation frames for local
2034         variables, for example:
2035
2036         for (int i = 0; i < 10; i++)
2037                 for (int j = 0; j < 10; j++){
2038                    MyDelegate d = delegate {
2039                         call (i, j);
2040                    }
2041                 }
2042
2043         At runtime this captures a single captured variable `i', but it
2044         captures 10 different versions of the variable `j'.  The variable
2045         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2046         recorded on a child.  
2047
2048         The toplevel ScopeInfo will also track information like the `this'
2049         pointer if instance variables were referenced (this is necessary
2050         as the anonymous method lives inside a nested class in the host
2051         type of the method). 
2052
2053         (AnonymousMethod): Expanded to track the Toplevel, implement
2054         `AnonymousMethod.Compatible' to tell whether an anonymous method
2055         can be converted to a target delegate type. 
2056
2057         The routine now also produces the anonymous method content
2058
2059         (AnonymousDelegate): A helper class that derives from
2060         DelegateCreation, this is used to generate the code necessary to
2061         produce the delegate for the anonymous method that was created. 
2062
2063         * assign.cs: API adjustments for new changes in
2064         Convert.ImplicitStandardConversionExists.
2065
2066         * class.cs: Adjustments to cope with the fact that now toplevel
2067         blocks are of type `ToplevelBlock'. 
2068
2069         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2070         insteda of standard blocks.
2071
2072         Flag errors if params arguments are passed to anonymous methods.
2073
2074         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2075         `CurrentAnonymousMethod' which points to the current Anonymous
2076         Method.  The variable points to the AnonymousMethod class that
2077         holds the code being compiled.  It is set in the new EmitContext
2078         created for the anonymous method.
2079
2080         (EmitContext.Phase): Introduce a variable and an enumeration to
2081         assist in enforcing some rules about when and where we are allowed
2082         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2083         only one that enfonces this right now).
2084
2085         (EmitContext.HaveCaptureInfo): new helper method that returns
2086         whether we have a CapturedContext initialized.
2087
2088         (EmitContext.CaptureVariable): New method used to register that a
2089         LocalInfo must be flagged for capturing. 
2090
2091         (EmitContext.CapturedParameter): New method used to register that a
2092         parameters must be flagged for capturing. 
2093         
2094         (EmitContext.CapturedField): New method used to register that a
2095         field must be flagged for capturing. 
2096
2097         (EmitContext.HaveCapturedVariables,
2098         EmitContext.HaveCapturedFields): Return whether there are captured
2099         variables or fields. 
2100
2101         (EmitContext.EmitMethodHostInstance): This is used to emit the
2102         instance for the anonymous method.  The instance might be null
2103         (static methods), this (for anonymous methods that capture nothing
2104         and happen to live side-by-side with the current method body) or a
2105         more complicated expression if the method has a CaptureContext.
2106
2107         (EmitContext.EmitTopBlock): Routine that drives the emission of
2108         code: it will first resolve the top block, then emit any metadata
2109         and then emit the code.  The split is done so that we can extract
2110         any anonymous methods and flag any captured variables/parameters.
2111         
2112         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2113         during this phase, the ILGenerator should not be used as labels
2114         and local variables declared here might not be accessible to any
2115         code that is part of an anonymous method.  
2116
2117         Exceptions to this include the temporary variables that are
2118         created by some statements internally for holding temporary
2119         variables. 
2120         
2121         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2122         metadata for a cb
2123
2124         (EmitContext.TemporaryReturn): This method is typically called
2125         from the Emit phase, and its the only place where we allow the
2126         ReturnLabel to be defined other than the EmitMeta.  The reason is
2127         that otherwise we would have to duplicate a lot of logic in the
2128         Resolve phases of various methods that today is on the Emit
2129         phase. 
2130
2131         (EmitContext.NeedReturnLabel): This no longer creates the label,
2132         as the ILGenerator is not valid during the resolve phase.
2133
2134         (EmitContext.EmitThis): Extended the knowledge in this class to
2135         work in anonymous methods in addition to iterators. 
2136
2137         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2138         code is necessary on the stack to access the instance to a local
2139         variable (the variable will be accessed as a field).
2140
2141         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2142         EmitContext.EmitAddressOfParameter): Routines to support
2143         parameters (not completed at this point). 
2144         
2145         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2146         will also remove the parameters.
2147
2148         * convert.cs (Convert): Define a `ConstantEC' which points to a
2149         null.  This is just to prefity some code that uses
2150         ImplicitStandardConversion code and do not have an EmitContext
2151         handy.
2152
2153         The idea is to flag explicitly that at that point in time, it is
2154         known that the conversion will not trigger the delegate checking
2155         code in implicit conversions (which requires a valid
2156         EmitContext). 
2157
2158         Everywhere: pass new EmitContext parameter since
2159         ImplicitStandardConversionExists now requires it to check for
2160         anonymous method conversions. 
2161
2162         (Convert.ImplicitStandardConversionExists): If the type of an
2163         expression is the anonymous_method_type, and the type is a
2164         delegate, we invoke the AnonymousMethod.Compatible method to check
2165         whether an implicit conversion is possible. 
2166
2167         (Convert.ImplicitConversionStandard): Only do implicit method
2168         group conversions if the language level is not ISO_1.
2169
2170         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2171         MethodInfo for the Invoke method.  used by Delegate and
2172         AnonymousDelegate.
2173
2174         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2175         method conversions if the target type is a delegate.
2176
2177         Removed extra debugging nops.
2178
2179         (LocalVariableReference): Turn the `local_info' into a public
2180         field. 
2181
2182         Add `prepared' field, the same hack used for FieldExprs to cope
2183         with composed assignments, as Local variables do not necessarily
2184         operate purely on the stack as they used to: they can be captured
2185         fields. 
2186
2187         Add `temp' for a temporary result, like fields.
2188
2189         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2190
2191         It now copes with Local variables that are captured and emits the
2192         proper instance variable to load it from a field in the captured
2193         case. 
2194
2195         (ParameterReference.DoResolveBase): During the resolve phase,
2196         capture parameters if we are in an anonymous method.
2197
2198         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2199         anonymous method, use the EmitContext helper routines to emit the
2200         parameter reference.
2201
2202         * iterators.cs: Set RemapToProxy to true/false during the
2203         EmitDispose class.
2204
2205         * parameters.cs (GetParameterByName): New helper method. 
2206
2207         * typemanager.cs (anonymous_method_type) a new type that
2208         represents an anonyous method.  This is always an internal type,
2209         used as a fencepost to test against the anonymous-methodness of an
2210         expression. 
2211         
2212 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2213
2214         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2215         561 report.
2216         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2217
2218 2004-11-10  Martin Baulig  <martin@ximian.com>
2219
2220         * expression.cs (Invocation.BetterFunction): If two methods have
2221         equal parameter types, but only one of them is generic, the
2222         non-generic one wins.
2223         (New.DoResolve): Don't set `is_struct' to false if we're a generic
2224         instance; just use `Type.IsValueType' to determine whether
2225         something is a struct or not.
2226         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
2227         so we can be called multiple times.
2228
2229 2004-11-10  Martin Baulig  <martin@ximian.com>
2230
2231         * generic.cs (TypeParameter.DefineConstraints): New public method.
2232         (TypeParameter.CheckAccessLevel): Override this and return true.
2233         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
2234         override ResolveType() anymore.
2235         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
2236
2237 2004-11-10  Martin Baulig  <martin@ximian.com>
2238
2239         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
2240         call DeclSpace.ResolveNestedType() on it.
2241
2242 2004-11-10  Martin Baulig  <martin@ximian.com>
2243
2244         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
2245         non-null, call ParameterModifier() on it.
2246
2247 2004-11-10  Martin Baulig  <martin@ximian.com>
2248
2249         * iterators.cs
2250         (Iterators): Added `current_type' and `this_type' fields.
2251         (Iterators.DefineIterator): Create a new EmitContext and store it
2252         in `ec'; compute `this_type'.
2253
2254 2004-11-10  Martin Baulig  <martin@ximian.com>
2255
2256         * typemanager.cs
2257         (TypeManager.IsPrivateAccessible): New public method.
2258         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
2259
2260 2004-11-10  Martin Baulig  <martin@ximian.com>
2261
2262         * class.cs (TypeContainer.DefineType): Call
2263         TypeBuilder.DefineGenericParameters() before resolving the type
2264         parameters.
2265         (MethodData.parent_method): New protected field.
2266         (MethodData..ctor): Added `MethodInfo parent_method' argument.
2267         (MethodData.Define): Compute `parent_method'.
2268
2269         * decl.cs
2270         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2271         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2272         (DeclSpace.ec): New protected field; store the EmitContext here.
2273         (DeclSpace.EmitContext): New public property.
2274         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
2275         (DeclSpace.ResolveNestedType): New public method.
2276         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
2277         (DeclSpace.NestedAccessible): Added `Type tb' argument.
2278         (DeclSpace.FamilyAccessible): Likewise.
2279         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
2280         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2281         EmitContext.
2282
2283         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
2284         field.
2285
2286         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2287         (Enum.Emit): Don't create a new EmitContext.
2288
2289 2004-10-18  Martin Baulig  <martin@ximian.com>
2290
2291         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2292         `Type' directly, but call ResolveType() on it.
2293         (Catch.Resolve): Likewise.
2294         (Foreach.Resolve): Likewise.
2295
2296 2004-10-18  Martin Baulig  <martin@ximian.com>
2297
2298         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2299         `Type' directly, but call ResolveType() on it.
2300         (Probe.DoResolve): Likewise.
2301         (ArrayCreation.LookupType): Likewise.
2302         (TypeOf.DoResolve): Likewise.
2303         (SizeOf.DoResolve): Likewise.
2304
2305 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2306
2307         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2308         the ResolveType.
2309
2310 2004-10-17  John Luke  <john.luke@gmail.com>
2311
2312         * class.cs (Operator.GetSignatureForError): use CSharpName
2313
2314         * parameter.cs (Parameter.GetSignatureForError): Returns
2315         correct name even if was not defined.
2316
2317 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2318
2319         Fix #65816.
2320         * class.cs (TypeContainer.EmitContext): New property.
2321         (DefineNestedTypes): Create an emitcontext for each part.
2322         (MethodCore.DoDefineParameters): Use container's emitcontext.
2323         Pass type array to InternalParameters.
2324         (MemberBase.DoDefine): Use container's emitcontext.
2325         (FieldMember.Define): Likewise.
2326         (Event.Define): Likewise.
2327         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2328         Pass type array to InternalParameters.
2329         (SetIndexerMethod.GetParameterInfo): Likewise.
2330         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2331         * delegate.cs (Define): Pass emitcontext to
2332         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2333         array to InternalParameters.
2334         * expression.cs (ParameterReference.DoResolveBase): Pass
2335         emitcontext to GetParameterInfo.
2336         (ComposedCast.DoResolveAsTypeStep): Remove check on
2337         ec.ResolvingTypeTree.
2338         * parameter.cs (Parameter.Resolve): Change argument to
2339         EmitContext.  Use ResolveAsTypeTerminal.
2340         (Parameter.GetSignature): Change argument to EmitContext.
2341         (Parameters.ComputeSignature): Likewise.
2342         (Parameters.ComputeParameterTypes): Likewise.
2343         (Parameters.GetParameterInfo): Likewise.
2344         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2345         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2346         * support.cs (InternalParameters..ctor): Remove variant that takes
2347         a DeclSpace.
2348         * typemanager.cs (system_intptr_expr): New.
2349         (InitExpressionTypes): Initialize it.
2350
2351 2004-10-12  Chris Toshok  <toshok@ximian.com>
2352
2353         * cs-parser.jay: fix location for try_statement and catch_clause.
2354
2355 2004-10-18  Martin Baulig  <martin@ximian.com>
2356
2357         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2358         `Type' directly, but call ResolveType() on it.
2359         (MemberBase.DoDefine): Likewise.
2360
2361         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2362         `Type' directly, but call ResolveType() on it.
2363         (ComposedCast.DoResolveAsTypeStep): Likewise.
2364
2365         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2366         `Type' directly, but call ResolveType() on it.
2367
2368 2004-10-17  John Luke  <john.luke@gmail.com>
2369
2370         * class.cs (Operator.GetSignatureForError): use CSharpName
2371
2372         * parameter.cs (Parameter.GetSignatureForError): Returns
2373         correct name even if was not defined.
2374
2375 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2376
2377         Fix #65816.
2378         * class.cs (TypeContainer.EmitContext): New property.
2379         (DefineNestedTypes): Create an emitcontext for each part.
2380         (MethodCore.DoDefineParameters): Use container's emitcontext.
2381         Pass type array to InternalParameters.
2382         (MemberBase.DoDefine): Use container's emitcontext.
2383         (FieldMember.Define): Likewise.
2384         (Event.Define): Likewise.
2385         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2386         Pass type array to InternalParameters.
2387         (SetIndexerMethod.GetParameterInfo): Likewise.
2388         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2389         * delegate.cs (Define): Pass emitcontext to
2390         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2391         array to InternalParameters.
2392         * expression.cs (ParameterReference.DoResolveBase): Pass
2393         emitcontext to GetParameterInfo.
2394         (ComposedCast.DoResolveAsTypeStep): Remove check on
2395         ec.ResolvingTypeTree.
2396         * parameter.cs (Parameter.Resolve): Change argument to
2397         EmitContext.  Use ResolveAsTypeTerminal.
2398         (Parameter.GetSignature): Change argument to EmitContext.
2399         (Parameters.ComputeSignature): Likewise.
2400         (Parameters.ComputeParameterTypes): Likewise.
2401         (Parameters.GetParameterInfo): Likewise.
2402         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2403         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2404         * support.cs (InternalParameters..ctor): Remove variant that takes
2405         a DeclSpace.
2406         * typemanager.cs (system_intptr_expr): New.
2407         (InitExpressionTypes): Initialize it.
2408
2409 2004-10-12  Chris Toshok  <toshok@ximian.com>
2410
2411         * cs-parser.jay: fix location for try_statement and catch_clause.
2412
2413 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2414
2415         More DeclSpace.ResolveType avoidance.
2416         * decl.cs (MemberCore.InUnsafe): New property.
2417         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2418         with newly created EmitContext.
2419         (FieldMember.Define): Likewise.
2420         * delegate.cs (Delegate.Define): Likewise.
2421         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2422         only if normal name-lookup fails.
2423         (TypeExpr.DoResolve): Enable error-checking.
2424         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2425         (SizeOf.DoResolve): Likewise.
2426         (ComposedCast.DoResolveAsTypeStep): Likewise.
2427         (StackAlloc.DoResolve): Likewise.
2428         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2429         (Block.Unsafe): New property.
2430         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2431         (Unsafe): Set 'unsafe' flag of contained block.
2432         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2433         (Fixed.Resolve): Likewise.
2434         (Catch.Resolve): Likewise.
2435         (Using.ResolveLocalVariableDecls): Likewise.
2436         (Foreach.Resolve): Likewise.
2437
2438 2004-10-05  John Luke <john.luke@gmail.com>
2439
2440         * cs-parser.jay: add location to error CS0175
2441
2442 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2443
2444         * ecore.cs (Expression.Constantity): Add support for turning null
2445         into a constant.
2446
2447         * const.cs (Const.Define): Allow constants to be reference types
2448         as long as the value is Null.
2449
2450 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2451
2452         * namespace.cs (NamespaceEntry.Using): No matter which warning
2453         level is set, check if this namespace name has already been added.
2454
2455 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2456
2457         * expression.cs: reftype [!=]= null should always use br[true,false].
2458         # 67410
2459
2460 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2461
2462         Fix #67108
2463         * attribute.cs: Enum conversion moved to 
2464         GetAttributeArgumentExpression to be applied to the all
2465         expressions.
2466
2467 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2468
2469         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2470         * class.c (TypeContainer.DefineType): Flag error if
2471         base types aren't accessible due to access permissions.
2472         * decl.cs (DeclSpace.ResolveType): Move logic to
2473         Expression.ResolveAsTypeTerminal.
2474         (DeclSpace.ResolveTypeExpr): Thin layer over
2475         Expression.ResolveAsTypeTerminal.
2476         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2477         Refactor code into NestedAccess.  Use it.
2478         (DeclSpace.NestedAccess): New.
2479         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2480         argument to silence errors.  Check access permissions.
2481         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2482         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2483         (Cast.DoResolve): Likewise.
2484         (New.DoResolve): Likewise.
2485         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2486         (TypeOf.DoResolve): Likewise.
2487
2488         * expression.cs (Invocation.BetterConversion): Return the Type of
2489         the better conversion.  Implement section 14.4.2.3 more faithfully.
2490         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2491         section 14.4.2.2 explicit.
2492         (Invocation.OverloadResolve): Update.
2493         (Invocation): Remove is_base field.
2494         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2495         (Invocation.Emit): Likewise.
2496
2497 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2498
2499         * cs-parser.jay: Reverted 642 warning fix.
2500
2501 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2502
2503         Fix bug #66615
2504         * decl.cs (FindMemberWithSameName): Indexer can have more than
2505         1 argument.
2506
2507 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2508
2509         * expression.cs (LocalVariableReference.DoResolveLValue):
2510         Do not report warning 219 for out values.
2511         (EmptyExpression.Null): New member to avoid extra allocations.
2512
2513 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2514
2515         * cs-parser.jay: Fix wrong warning 642 report.
2516
2517         * cs-tokenizer.cs (CheckNextToken): New helper;
2518         Inspect next character if is same as expected.
2519
2520 2004-09-23  Martin Baulig  <martin@ximian.com>
2521
2522         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2523         (Convert.ImplicitReferenceConversionExists): Likewise.
2524
2525 2004-11-09  Raja R Harinath  <rharinath@novell.com>
2526
2527         * Makefile (DISTFILES): Comment out a few missing files.
2528
2529 2004-10-29  Raja R Harinath  <rharinath@novell.com>
2530
2531         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
2532         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
2533         (gmcs.exe): Invoke bootstrap-libs.
2534         (clean-local): Clean the net_2_0_bootstrap profile too.
2535         (PROGRAM_INSTALL_DIR): New.
2536         (install-local): Use it.
2537
2538 2004-10-13  Martin Baulig  <martin@ximian.com>
2539
2540         * generic.cs (TypeManager.InflatedConstraints): New nested class.
2541         (TypeParameter.DefineType): If we're a method type parameter and
2542         that method is overriding something, "inflate" its constraints.
2543
2544 2004-10-12  Martin Baulig  <martin@ximian.com>
2545
2546         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
2547         and have type arguments, create and resolve a ConstructedType.
2548
2549 2004-10-12  Martin Baulig  <martin@ximian.com>
2550
2551         * decl.cs (MemberCache.FindMemberToOverride): Use
2552         TypeManager.IsEqual() to compare the parameters and Type.Equals()
2553         to compare the invocationType.
2554
2555         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
2556         When comparing two type parameters, only do the signature-only
2557         comparision for method type parameters.
2558
2559 2004-10-11  Martin Baulig  <martin@ximian.com>
2560
2561         * report.cs: Don't make --fatal abort on warnings, we have
2562         -warnaserror for that.
2563
2564 2004-10-11  Martin Baulig  <martin@ximian.com>
2565
2566         * typemanager.cs
2567         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
2568         (TypeManager.IsEqual): Call ourself recursively instead of using
2569         Type.IsEqual(). 
2570
2571 2004-10-11  Martin Baulig  <martin@ximian.com>
2572
2573         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2574         on our own type parameters, not on the ones we inherit from a containing
2575         class.
2576
2577         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2578         the comparision.
2579
2580         * generic.cs (TypeParameter.Define): We may only be called once.
2581
2582         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2583         instead of TypeManager.IsEqual().
2584
2585 2004-09-28  Martin Baulig  <martin@ximian.com>
2586
2587         * generic.cs
2588         (GenericConstraints.EffectiveBaseClass): New public property.
2589         (TypeParameter.GenericConstraints): New public property.
2590         (ConstructedType.CheckConstraints): Improved.
2591
2592         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2593         (Convert.TypeParameterConversion): New private method; use this in
2594         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2595         for all conversions related to type parameters.
2596
2597 2004-09-24  Martin Baulig  <martin@ximian.com>
2598
2599         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2600         type parameter conversions for type parameters which are known to
2601         be reference types.
2602
2603 2004-09-24  Martin Baulig  <martin@ximian.com>
2604
2605         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2606         `IsValueType' properties.
2607
2608         * support.cs (ReflectionConstraints): Use
2609         Type.GetGenericParameterConstraints() instead of the old hack.
2610
2611 2004-09-24  Martin Baulig  <martin@ximian.com>
2612
2613         * generic.cs (GenericConstraints): Moved here and made it an
2614         abstract class.
2615
2616         * support.cs (GenericConstraints): Moved to generic.cs.
2617
2618 2004-09-24  Martin Baulig  <martin@ximian.com>
2619
2620         * support.cs
2621         (ReflectionConstraints): Un-nested this class and made it public.
2622
2623         * typemanager.cs
2624         (TypeManager.GetTypeParameterConstraints): New public method.
2625         (TypeManager.HasConstructorConstraint): Use the attributes.
2626
2627 2004-09-24  Martin Baulig  <martin@ximian.com>
2628
2629         * support.cs (GenericConstraints): Replaced `HasConstructor',
2630         `IsReferenceType' and `IsValueType' with `Attributes'.
2631         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2632         method and made the .ctor public.
2633
2634         * generic.cs (Constraints.Attributes): New public property.
2635         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2636         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2637         `IsValueType' -> `HasValueTypeConstraint'.
2638
2639 2004-09-23  Martin Baulig  <martin@ximian.com>
2640
2641         * generic.cs (Constraints): Reflect latest runtime changes.
2642
2643 2004-09-23  Martin Baulig  <martin@ximian.com>
2644
2645         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2646         (Convert.ImplicitReferenceConversionExists): Likewise.
2647
2648 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2649
2650         * class.cs (Operator.Define): Add error 448 and 559 report.
2651         
2652 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2653
2654         * class.cs (MemberBase.IsTypePermitted): New protected
2655         method for checking error CS0610.
2656
2657 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2658
2659         * class.cs (TypeContainer.HasExplicitLayout): New property
2660         Returns whether container has StructLayout attribute set Explicit.
2661         (FieldMember): New abstract class for consts and fields.
2662         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2663         (Field): Reuse FieldMember.
2664
2665         * const.cs (Const): Reuse FieldMember.
2666
2667         * rootcontext.cs: EmitConstants call moved to class.
2668
2669 2004-09-22  Martin Baulig  <martin@ximian.com>
2670
2671         Marek and me just fixed one of our oldest bugs: #28562 :-)
2672
2673         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2674
2675         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2676         we're an EnumConstant, just return that.
2677         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2678         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2679         to get the value which'll actually be written into the attribute.
2680         However, we have to use GetValue() to access the attribute's value
2681         in the compiler.        
2682
2683 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2684
2685         * constant.cs (Constant.IsNegative): New abstract property
2686         IsNegative.
2687
2688         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2689         (StackAlloc.DoResolve): Reused IsNegative.
2690
2691 2004-09-22  Martin Baulig  <martin@ximian.com>
2692
2693         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2694         public method; like LookupTypeContainer, but also works for
2695         generic instances.
2696
2697         * report.cs (Report.SymbolRelatedToPreviousError): Use
2698         TypeManager.LookupGenericTypeContainer().       
2699
2700 2004-09-22  Martin Baulig  <martin@ximian.com>
2701
2702         Thanks to Peter Sestoft for this bug report.
2703
2704         * expression.cs (Conditional): If both the `trueExpr' and the
2705         `falseExpr' is a NullLiteral, return a NullLiteral.
2706
2707 2004-09-22  Martin Baulig  <martin@ximian.com>
2708
2709         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2710         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2711         for the "get_Current" call.
2712
2713 2004-09-21  Martin Baulig  <martin@ximian.com>
2714
2715         * convert.cs (Convert.ImplicitReferenceConversion): When
2716         converting to an interface type, first check whether we're
2717         converting from a reference type.
2718
2719 2004-09-14  Martin Baulig  <martin@ximian.com>
2720
2721         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2722
2723 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2724
2725         Fixed bug #61902
2726         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2727         called and is obsolete then this member suppress message
2728         when call is inside next [Obsolete] method or type.
2729
2730         * expression.cs: Use TestObsoleteMethodUsage member.
2731
2732 2004-09-14  Martin Baulig  <martin@ximian.com>
2733
2734         * genericparser.cs: Removed.
2735
2736 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2737
2738         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2739
2740 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2741
2742         * attribute.cs (Attribute.Resolve): Add error 653 report.
2743
2744         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2745         report.
2746         (Method.ApplyAttributeBuilder): Add error 685 report.
2747         (Operator.Define): Add error 564 report.
2748
2749         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2750
2751         * expression.cs (Invocation.DoResolve): Add error
2752         245 and 250 report.
2753
2754         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2755         error 674 report.
2756
2757 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2758
2759         * class.cs (ConstructorInitializer.Resolve):
2760         Wrong error number (515->516).
2761
2762 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2763
2764         * class.cs (Indexer.Define): Add error 631 report.
2765
2766 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2767
2768         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2769
2770 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2771
2772         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2773
2774 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2775
2776         * cs-parser.jay: Added error CS0241 report.
2777
2778 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2779
2780         * cs-parser.jay (fixed_statement): Introduce a scope for the
2781         declaration in the 'fixed' statement.
2782
2783 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2784
2785         * cs-parser.jay: Added CS0230 error report.
2786
2787 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2788
2789         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2790
2791 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2792
2793         * expression.cs (Argument.Resolve): Added error CS0192 and
2794         CS0199 report.
2795
2796 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2797
2798         C# 2.0 #pragma warning feature
2799
2800         * cs-tokenizer.cs (PreProcessPragma): New method; 
2801         Handles #pragma directive.
2802
2803         * report.cs (WarningRegions): New class; Support
2804         class for #pragma warning directive. It tests whether
2805         warning is enabled for a given line.
2806
2807 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2808
2809         * const.cs: Add more descriptive error report, tahnks to
2810         Sebastien. 
2811
2812 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2813
2814         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2815
2816 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2817
2818         * expression.cs: Apply patch from Ben: Remove dead code from
2819         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2820         as that code just threw an exception anwyays.
2821
2822         * const.cs: Remove the call to the turnintoconstant, for details
2823         see bug: #63144
2824         
2825         * literal.cs: The type of the null-literal is the null type;  So
2826         we use a placeholder type (literal.cs:System.Null, defined here)
2827         for it.
2828
2829         * expression.cs (Conditional.DoResolve): Remove some old code that
2830         is no longer needed, conversions have been fixed.
2831
2832         (ArrayCreationExpression.DoResolve): Return false if we fail to
2833         resolve the inner expression.
2834
2835 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2836
2837         Fix test-290.cs.
2838         * cs-parser.jay (delegate_declaration): Record a delegate
2839         declaration as a type declaration.
2840         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2841
2842 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2843
2844         * parameter.cs: Do not crash if the type can not be resolved. 
2845
2846         * expression.cs: Report errors with unsafe pointers, fixes #64896
2847
2848 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2849
2850         * expression.cs: Pointer arith always needs to do a conv.i
2851         if the operand is a long. fix 65320
2852
2853 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2854
2855         Fixed cs0619-37.cs, cs0619-38.cs
2856
2857         * enum.cs (GetObsoleteAttribute): Removed.
2858
2859         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2860         on Enum member is double staged. The first is tested member
2861         and then enum.
2862
2863 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2864
2865         Fixed #56986, #63631, #65231
2866
2867         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2868         adds member to name container.
2869         (TypeContainer.AddToTypeContainer): New method, adds type to
2870         name container.
2871         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2872         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2873         AddOperator): Simplified by reusing AddToMemberContainer.
2874         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2875         instead of field.
2876         (Method.CheckForDuplications): Fixed implementation to test all
2877         possibilities.
2878         (MemberBase): Detection whether member is explicit interface
2879         implementation is now in constructor.
2880         (MemberBase.UpdateMemberName): Handles IndexerName.
2881         (Accessor): Changed to keep also location information.
2882         (AbstractPropertyEventMethod): Is derived from MemberCore.
2883         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2884         will be emited or not.
2885         (PropertyBase.AreAccessorsDuplicateImplementation):
2886         Tests whether accessors are not in collision with some method.
2887         (Operator): Is derived from MethodCore to simplify common
2888         operations.
2889
2890         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2891         must be performed.
2892         (DeclSpace.AddToContainer): Adds the member to defined_names
2893         table. It tests for duplications and enclosing name conflicts.
2894
2895         * enum.cs (EnumMember): Clean up to reuse the base structures
2896
2897 2004-09-03  Martin Baulig  <martin@ximian.com>
2898
2899         Merged latest changes into gmcs.  Please keep this comment in
2900         here, it makes it easier for me to see what changed in MCS since
2901         the last time I merged.
2902
2903 2004-09-03  Martin Baulig  <martin@ximian.com>
2904
2905         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2906         into TypeContainer, to make partial classes work again.
2907
2908 2004-09-03  Martin Baulig  <martin@ximian.com>
2909
2910         * rootcontext.cs (RootContext.V2): Removed.
2911
2912 2004-03-23  Martin Baulig  <martin@ximian.com>
2913
2914         * expression.cs (Invocation.OverloadResolve): Added `bool
2915         may_fail' argument and use it instead of the Location.IsNull() hack.
2916
2917 2004-09-09  Martin Baulig  <martin@ximian.com>
2918
2919         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2920
2921 2004-09-09  Martin Baulig  <martin@ximian.com>
2922
2923         * generic.cs (TypeParameter.DefineType): Added support for
2924         explicit interface methods.
2925
2926 2004-09-09  Martin Baulig  <martin@ximian.com>
2927
2928         * README.Changes: New document.  Started to list important changes
2929         between MCS and GMCS here.
2930
2931 2004-09-08  Martin Baulig  <martin@ximian.com>
2932
2933         * class.cs
2934         (TypeContainer.CheckRecursiveDefinition): New protected method.
2935         (TypeContainer.DefineType): Move the CS0146 check into
2936         CheckRecursiveDefinition().     
2937
2938 2004-09-06  Martin Baulig  <martin@ximian.com>
2939
2940         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2941         types for the constructor constraint.
2942
2943 2004-09-03  Martin Baulig  <martin@ximian.com>
2944
2945         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2946         into TypeContainer, to make partial classes work again.
2947
2948 2004-09-03  Martin Baulig  <martin@ximian.com>
2949
2950         * rootcontext.cs (RootContext.V2): Removed.
2951
2952 2004-03-23  Martin Baulig  <martin@ximian.com>
2953
2954         * expression.cs (Invocation.OverloadResolve): Added `bool
2955         may_fail' argument and use it instead of the Location.IsNull() hack.
2956
2957 2004-09-03  Martin Baulig  <martin@ximian.com>
2958
2959         Merged latest changes into gmcs.  Please keep this comment in
2960         here, it makes it easier for me to see what changed in MCS since
2961         the last time I merged.
2962
2963 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2964
2965         Fix #61128.
2966         * expression.cs (BetterConversion): Don't allow either conversion 
2967         to be null.  Remove redundant implicit conversion test when 'q ==
2968         null' -- when this function is invoked, we already know that the
2969         implicit conversion exists.
2970         (BetterFunction): Assume that 'best' is non-null.  Remove
2971         redundant reimplementation of IsApplicable when 'best' is null.
2972         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2973         number of arguments.
2974         (IsAncestralType): Extract from OverloadResolve.
2975         (OverloadResolve): Make robust to the MethodGroupExpr being
2976         unsorted.  Implement all the logic of Section 14.5.5.1, and
2977         support overloading of methods from multiple applicable types.
2978         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
2979
2980         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2981         (RealError, Warning): Append type of report to related symbol.
2982
2983 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
2984
2985         * enum.cs: Fixed CLS-Compliance checks for enum members.
2986         Error tests cs3008-8.cs, cs3014-8.cs
2987
2988 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2989
2990         Fixed bug #62342, #63102
2991         * class.cs: ImplementIndexer uses member.IsExplicitImpl
2992         like ImplementMethod.
2993
2994 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2995
2996         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2997         Fixed bug #65170.
2998
2999 2004-09-02  Martin Baulig  <martin@ximian.com>
3000
3001         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3002         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3003         on the MethodBase.
3004
3005 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
3006
3007         C# 2.0 Static classes implemented
3008
3009         * class.cs (TypeContainer): instance_constructors,
3010         initialized_fields, initialized_static_fields,
3011         default_constructor, base_inteface_types are protected to be
3012         accessible from StaticClass.
3013         (TypeContainer.DefineDefaultConstructor): New virtual method
3014         for custom default constructor generating
3015         (StaticClass): New class to handle "Static classes" feature.
3016
3017         * cs-parser.jay: Handle static keyword on class like instance
3018         of StaticClass.
3019
3020         * driver.cs: Added "/langversion" command line switch with two
3021         options (iso-1, default).
3022
3023 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
3024
3025         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
3026
3027 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
3028
3029         * delegate.cs: Style.
3030
3031 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3032
3033         * delegate.cs: Add seperate instance expr field for miguel.
3034
3035 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3036
3037         * PointerArithmetic (Resolve): make sure we are not doing
3038         pointer arith on void*. Also, make sure we are resolved
3039         by not setting eclass until resolve.
3040
3041         All callers: Make sure that PointerArithmetic gets resolved.
3042
3043 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3044
3045         * ArrayCreation (LookupType): If the type does not resolve 
3046         to an array, give an error.
3047
3048 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
3049
3050         * statement.cs (Try.Resolve): Fixed bug #64222
3051
3052 2004-08-27  Martin Baulig  <martin@ximian.com>
3053
3054         * class.cs
3055         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3056         crash here.     
3057
3058 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3059
3060         * ecore.cs (Constantify): Get underlying type via
3061         System.Enum.GetUnderlyingType to avoid StackOverflow on the
3062         Windows in special cases.
3063
3064 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3065
3066         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3067         for obtaining also private methods.
3068         (GetRemoveMethod): Used GetRemoveMethod (true)
3069         for obtaining also private methods.
3070
3071 2004-09-02  Martin Baulig  <martin@ximian.com>
3072
3073         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3074         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3075         on the MethodBase.
3076
3077 2004-08-27  Martin Baulig  <martin@ximian.com>
3078
3079         * class.cs
3080         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3081         crash here.     
3082
3083 2004-08-25  Martin Baulig  <martin@ximian.com>
3084
3085         * support.cs (ReflectionParameters..ctor): If this is a generic
3086         method, retrieve and store its type parameters.
3087         (InternalParameters..ctor): Added `TypeParameter[]' argument.
3088         (ReflectionParameters.GenericConstraints): The argument specifies
3089         the type parameter, not the method parameter.
3090         (InternalParameters.GenericConstraints): Likewise.
3091
3092         * generic.cs (TypeParameter.DefineType): Correctly handle
3093         constraints wrt. generic methods in interfaces and their
3094         implementations.        
3095
3096 2004-08-24  Martin Baulig  <martin@ximian.com>
3097
3098         * generic.cs (TypeParameter.IsSubclassOf): New public method.
3099         (Constraints.IsSubclassOf): New internal method.
3100
3101         * typemanager.cs (TypeManager.FindMembers): Added special support
3102         for GenericTypeParameterBuilder's.      
3103         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
3104         type parameters.
3105
3106 2004-08-24  Martin Baulig  <martin@ximian.com>
3107
3108         * typemanager.cs
3109         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3110         this for accessibility checks.
3111         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3112         IsNestedFamilyAccessible.
3113         (TypeManager.IsSubclassOf): New method, do what the name actually
3114         says.   
3115
3116 2004-08-24  Martin Baulig  <martin@ximian.com>
3117
3118         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
3119         as a SimpleName, include the generic arity.
3120
3121 2004-08-24  Martin Baulig  <martin@ximian.com>
3122
3123         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3124         MethodAttributes.HideBySig for operators.
3125
3126 2004-08-23  Martin Baulig  <martin@ximian.com>
3127
3128         Back to the old error reporting system :-)
3129
3130         * report.cs (Message): Removed.
3131         (Report.MessageData, ErrorData, WarningData): Removed.
3132         (Report.Error, Warning): Back to the old system.
3133
3134 2004-08-23  Martin Baulig  <martin@ximian.com>
3135
3136         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3137
3138         * class.cs (TypeContainer.ParentContainer): New public virtual
3139         method; replaces the explicit interface implementation.
3140         (ClassPart.ParentContainer): Override.
3141
3142 2004-08-23  Martin Baulig  <martin@ximian.com>
3143
3144         * statement.cs (Switch): Added support for constant switches; see
3145         #59428 or test-285.cs.
3146
3147 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3148
3149         Fixed bug #62740.
3150         * statement.cs (GetEnumeratorFilter): Removed useless
3151         logic because C# specs is strict. GetEnumerator must be
3152         public.
3153
3154 2004-08-22  Martin Baulig  <martin@ximian.com>
3155
3156         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3157         a switch and may break, reset the barrier.  Fixes #59867.
3158
3159 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3160
3161         CLS-Compliance speed up (~5% for corlib)
3162
3163         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3164         New method. Tests container for CLS-Compliant names
3165
3166         * class.cs (TypeContainer.VerifyClsName): New method.
3167         Checks whether container name is CLS Compliant.
3168         (Constructor): Implements IMethodData.
3169
3170         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3171         low-case table for CLS Compliance test.
3172         (MemberCache.VerifyClsParameterConflict): New method.
3173         Checks method parameters for CS3006 error.
3174
3175         * enum.cs (EnumMember): Is derived from MemberCore.
3176         (Enum.VerifyClsName): Optimized for better performance.
3177
3178 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3179
3180         * report.cs: Renamed Error_T to Error and changed all
3181         references.
3182
3183 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3184
3185         * class.cs (TypeContainer.IndexerArrayList): New inner class
3186         container for indexers.
3187         (TypeContainer.DefaultIndexerName): New constant for default
3188         indexer name. Replaced all "Item" with this constant.
3189         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3190
3191         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3192         DefaultMemberAttribute constructor.
3193
3194 2004-08-05  Martin Baulig  <martin@ximian.com>
3195
3196         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3197         Fix bug #59429.
3198
3199 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3200
3201         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3202         multi platforms problem.
3203
3204         * compiler.csproj: Included shared files.
3205
3206 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3207
3208         Fix bug 60333, 55971 in the more general way
3209         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3210         Added arg_type argument for constant conversion.
3211         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3212
3213 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3214
3215         Fix bug #59760
3216         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3217         OperatorArrayList, MethodCoreArrayList for typecontainer
3218         containers. Changed class member types to these new types.
3219         (MethodArrayList.DefineMembers): Added test for CS0659.
3220
3221 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3222
3223         * cfold.cs: Synchronize the folding with the code in expression.cs
3224         Binary.DoNumericPromotions for uint operands.
3225
3226         * attribute.cs: Revert patch from Raja, it introduced a regression
3227         while building Blam-1.2.1 (hard to isolate a test case).
3228
3229 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3230
3231         Fix for #55382
3232         * class.cs:
3233         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3234         name collision.
3235         (MethodCore.parent_method): New member. The method we're overriding
3236         if this is an override method.
3237         (MethodCore.CheckBase): Moved from Method class and made common.
3238         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3239         private.
3240         (MethodCore.CheckForDuplications): New abstract method. For custom
3241         member duplication search in a container
3242         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3243         method and its return type.
3244         (Event.conflict_symbol): New member. Symbol with same name in the
3245         parent class.
3246
3247         * decl.cs:
3248         (MemberCache.FindMemberWithSameName): New method. The method
3249         is looking for conflict with inherited symbols.
3250
3251 2004-08-04  Martin Baulig  <martin@ximian.com>
3252
3253         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3254
3255         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3256
3257 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3258
3259         * report.cs (Message): New enum for better error, warning reference in
3260         the code.
3261         (MessageData): New inner abstract class. It generally handles printing of
3262         error and warning messages.
3263         Removed unused Error, Warning, Message methods.
3264
3265 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3266
3267         Fix for cs0592-8.cs test
3268         * attribute.cs
3269         (Attributable.ValidAttributeTargets): Made public.
3270         (Attribute.ExplicitTarget): New member for explicit target value.
3271         (Attribute.CheckTargets): Now we translate explicit attribute
3272         target to Target here.
3273
3274 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3275
3276         * ecore.cs (MethodGroupExpr): new IsBase property.
3277
3278         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3279
3280         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3281         rather than an instance expr.
3282
3283         (DelegateCreation.Emit): Use the method group rather than
3284         the instance expression. Also, if you have base.Foo as the
3285         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3286
3287         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3288
3289         (NewDelegate.DoResolve): Only check for the existance of Invoke
3290         if the method is going to be needed. Use MethodGroupExpr.
3291
3292         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3293
3294         * expression.cs: For pointer arith., make sure to use
3295         the size of the type, not the size of the pointer to
3296         the type.
3297
3298 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3299
3300         Fix for #60722
3301         * class.cs (Class): Added error CS0502 test.
3302
3303 2004-08-03  John Luke  <jluke@cfl.rr.com>
3304             Raja R Harinath  <rharinath@novell.com>
3305
3306         Fix for #60997.
3307         * attribute.cs (Attribute.complained_before): New flag.
3308         (Attribute.ResolveType, Attribute.Resolve),
3309         (Attribute.DefinePInvokeMethod): Set it.
3310         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3311         
3312 2004-08-03  Martin Baulig  <martin@ximian.com>
3313
3314         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3315         use a user-defined operator; we still need to do numeric
3316         promotions in case one argument is a builtin type and the other
3317         one has an implicit conversion to that type.  Fixes #62322.
3318
3319 2004-08-18  Martin Baulig  <martin@ximian.com>
3320
3321         * class.cs (Method.Define): Use the correct method name when
3322         creating the MethodBuilder for a generic method.
3323
3324 2004-08-17  Martin Baulig  <martin@ximian.com>
3325
3326         * generic.cs (Constraints): Support type parameter constraints.
3327
3328 2004-08-16  Martin Baulig  <martin@ximian.com>
3329
3330         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
3331         (Token.GENERIC_DIMENSION): New token; this is returned if we
3332         encounter an unbound generic type in a typeof() expression.
3333
3334         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
3335         this token is only generated while parsing a typeof() expression.
3336         (typeof_expression): Removed the old unbound_type hack.
3337
3338         * generic.cs (TypeArguments.IsUnbound): New public property.
3339
3340         * decl.cs (MemberName): Added support for unbound types.
3341
3342 2004-08-14  Martin Baulig  <martin@ximian.com>
3343
3344         * typemanager.cs
3345         (TypeManager.IsEqualGenericInstance): New static method.
3346         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
3347         just used to check accessibility, so follow the rules of 26.1.6.        
3348
3349         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
3350         ConstructedType instead of a TypeExpression if we have type arguments.
3351
3352         * cs-parser.jay (typeof_expression): Support unbound generic types.
3353
3354         * ecore.cs (UnboundTypeExpression): New public class.
3355
3356 2004-08-12  Martin Baulig  <martin@ximian.com>
3357
3358         * typemanager.cs (TypeManager.IsNestedChildOf): Use
3359         TypeManager.IsEqual() rather than `=='.
3360
3361         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
3362         generic instances as well.
3363
3364 2004-08-12  Martin Baulig  <martin@ximian.com>
3365
3366         * expression.cs (Invocation.InferType): We can only infer method
3367         type parameters.  Fixes #62647.
3368
3369 2004-08-11  Martin Baulig  <martin@ximian.com>
3370
3371         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
3372         before resolving the base classes.
3373
3374 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3375
3376         * Makefile: install .mdb file too.
3377
3378 2004-08-05  Martin Baulig  <martin@ximian.com>
3379
3380         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
3381         initializer, the current type is just the TypeBuilder, not the
3382         instantiated generic type.
3383         (FieldExpr.IsFieldInitializer): New public property.
3384
3385 2004-08-04  Martin Baulig  <martin@ximian.com>
3386
3387         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3388
3389         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3390
3391 2004-08-03  Martin Baulig  <martin@ximian.com>
3392
3393         * class.cs (MethodData.Define): If we're an explicit
3394         implementation, remove the generic arity from the type name.
3395
3396 2004-08-03  Martin Baulig  <martin@ximian.com>
3397
3398         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3399         use a user-defined operator; we still need to do numeric
3400         promotions in case one argument is a builtin type and the other
3401         one has an implicit conversion to that type.  Fixes #62322.
3402
3403 2004-08-02  Martin Baulig  <martin@ximian.com>
3404
3405         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
3406         `TypeExpr[]' array.
3407         (TypeContainer.GetClassBases): Return the unexpanded list of
3408         interfaces; we expand them later.
3409         (TypeContainer.DefineType): After creating the TypeBuilder, call
3410         TypeManager.ExpandInterfaces() to get an expanded and resolved
3411         list of interfaces.
3412
3413         * ecore.cs (TypeExpr.GetInterfaces): Removed
3414
3415         * generics.cs (Constraints.InterfaceConstraints): Remove.
3416         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
3417         register the interface constraints.
3418
3419         * typemanager.cs
3420         (TypeManager.AddUserType): Removed the `ifaces' argument.
3421         (TypeManager.AddTypeParameter): Likewise.
3422         (TypeManager.AddUserInterface): Removed, was unused.
3423         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
3424         `TypeExpr[]' array for the interfaces.
3425         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
3426         has been defined, returns a list of the resolved interfaces types.
3427         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
3428         (TypeManager.GetExplicitInterfaces): Likewise.  
3429
3430 2004-08-02  Martin Baulig  <martin@ximian.com>
3431
3432         * expression.cs (Invocation.EmitCall): If we're invoking a method
3433         on a type parameter, use the new `Constrained' prefix opcode.
3434
3435 2004-08-02  Martin Baulig  <martin@ximian.com>
3436
3437         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3438         (LocalInfo.IsThis): New public property.
3439         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3440
3441 2004-08-01  Martin Baulig  <martin@ximian.com>
3442
3443         * class.cs (TypeContainer.GetClassBases): Don't set the default
3444         here since we may get called from GetPartialBases().
3445         (TypeContainer.DefineType): If GetClassBases() didn't return a
3446         parent, use the default one.
3447
3448 2004-07-30  Martin Baulig  <martin@ximian.com>
3449
3450         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3451
3452         * class.cs (SourceMethod): New public class, derive from the
3453         symbol writer's ISourceMethod.
3454         (Method): Use the new symbol writer API.
3455
3456         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3457         as argument and use the new symbol writer.
3458
3459         * location.cs
3460         (SourceFile): Implement the symbol writer's ISourceFile.
3461         (Location.SymbolDocument): Removed.
3462         (Location.SourceFile): New public property.
3463
3464         * symbolwriter.cs: Use the new symbol writer API.
3465
3466 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3467
3468         * Makefile (install-local): Remove.  Functionality moved to
3469         executable.make.
3470
3471 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3472
3473         * Makefile: Install mcs.exe.config file together with mcs.exe.
3474         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3475         correct runtime version.
3476         
3477 2004-07-25  Martin Baulig  <martin@ximian.com>
3478
3479         * class.cs
3480         (TypeContainer.RegisterOrder): Removed, this was unused.
3481         (TypeContainer, interface_order): Removed.
3482         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3483         TypeContainer as argument since we can also be called with a
3484         `PartialContainer' for a partial class/struct/interface.
3485         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3486         of checking whether we're an `Interface' - we could be a
3487         `PartialContainer'.
3488         (PartialContainer.Register): Override; call
3489         AddClass()/AddStruct()/AddInterface() on our parent.
3490
3491         * cs-parser.jay (interface_member_declaration): Add things to the
3492         `current_container', not the `current_class'.
3493
3494         * rootcontext.cs (RegisterOrder): The overloaded version which
3495         takes an `Interface' was unused, removed.
3496
3497         * typemanager.cs (TypeManager.LookupInterface): Return a
3498         `TypeContainer', not an `Interface'.
3499         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3500         contain a `PartialContainer' for an interface, so check it's
3501         `Kind' to figure out what it is.
3502
3503 2004-07-25  Martin Baulig  <martin@ximian.com>
3504
3505         * class.cs (Class.DefaultTypeAttributes): New public constant.
3506         (Struct.DefaultTypeAttributes): Likewise.
3507         (Interface.DefaultTypeAttributes): Likewise.
3508         (PartialContainer.TypeAttr): Override this and add the
3509         DefaultTypeAttributes.
3510
3511 2004-07-25  Martin Baulig  <martin@ximian.com>
3512
3513         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3514         we can just use the `Parent' field instead.
3515
3516 2004-07-25  Martin Baulig  <martin@ximian.com>
3517
3518         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3519
3520 2004-07-25  Martin Baulig  <martin@ximian.com>
3521
3522         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3523         our parts before defining any methods.
3524         (TypeContainer.VerifyImplements): Make this virtual.
3525         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3526         on our PartialContainer.
3527
3528 2004-07-25  Martin Baulig  <martin@ximian.com>
3529
3530         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3531
3532         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3533         argument, we can just use the `Parent' field instead.
3534
3535         * class.cs
3536         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3537         (MemberBase.DoDefine): Likewise.
3538
3539 2004-07-24  Martin Baulig  <martin@ximian.com>
3540
3541         * decl.cs (MemberCore.Parent): New public field.
3542         (DeclSpace.Parent): Moved to MemberCore.
3543
3544         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3545         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3546         parent's .ctor.
3547         (FieldBase, Field, Operator): Likewise.
3548         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3549         (EventField, Event): Likewise.
3550
3551 2004-07-23  Martin Baulig  <martin@ximian.com>
3552
3553         * class.cs (PartialContainer): New public class.
3554         (ClassPart): New public class.
3555         (TypeContainer): Added support for partial classes.
3556         (TypeContainer.GetClassBases): Splitted some of the functionality
3557         out into GetNormalBases() and GetPartialBases().
3558
3559         * cs-tokenizer.cs (Token.PARTIAL): New token.
3560         (Tokenizer.consume_identifier): Added some hacks to recognize
3561         `partial', but only if it's immediately followed by `class',
3562         `struct' or `interface'.
3563
3564         * cs-parser.jay: Added support for partial clases.
3565
3566 2004-07-23  Martin Baulig  <martin@ximian.com>
3567
3568         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3569         a `DeclSpace' and also made it readonly.
3570         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3571         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3572         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3573
3574         * cs-parser.jay: Pass the `current_class', not the
3575         `current_container' (at the moment, this is still the same thing)
3576         to a new Method, Property, Event, Indexer or Constructor.
3577
3578 2004-07-23  Martin Baulig  <martin@ximian.com>
3579
3580         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3581         and removed the `current_interface' one.
3582         (struct_declaration, class_declaration, interface_declaration):
3583         Set `current_class' to the newly created class/struct/interface;
3584         set their `Bases' and call Register() before parsing their body.
3585
3586 2004-07-23  Martin Baulig  <martin@ximian.com>
3587
3588         * class.cs (Kind): New public enum.
3589         (TypeContainer): Made this class abstract.
3590         (TypeContainer.Kind): New public readonly field.
3591         (TypeContainer.CheckDef): New public method; moved here from
3592         cs-parser.jay.
3593         (TypeContainer.Register): New public abstract method.
3594         (TypeContainer.GetPendingImplementations): New public abstract
3595         method.
3596         (TypeContainer.GetClassBases): Removed the `is_class' and
3597         `is_iface' parameters.
3598         (TypeContainer.DefineNestedTypes): Formerly known as
3599         DoDefineType().
3600         (ClassOrStruct): Made this class abstract.
3601
3602         * tree.cs (RootTypes): New public type. 
3603
3604 2004-07-20  Martin Baulig  <martin@ximian.com>
3605
3606         * tree.cs (Tree.RecordNamespace): Removed.
3607         (Tree.Namespaces): Removed.
3608
3609         * rootcontext.cs (RootContext.IsNamespace): Removed.
3610
3611         * cs-parser.jay (namespace_declaration): Just create a new
3612         NamespaceEntry here.
3613
3614 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3615
3616         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3617         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3618         entry to make sure it runs in the correct runtime version.
3619         
3620 2004-07-18  Martin Baulig  <martin@ximian.com>
3621
3622         * generic.cs (ConstructedType.CheckConstraints): Improved
3623         constraints checking.
3624
3625 2004-07-18  Martin Baulig  <martin@ximian.com>
3626
3627         * expression.cs (Invocation.BetterMethod): Call
3628         TypeManager.TypeToCoreType() on all types and removed my previous
3629         hack; we're already doig the right thing here.
3630
3631 2004-07-17  Martin Baulig  <martin@ximian.com>
3632
3633         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3634
3635 2004-07-16  Martin Baulig  <martin@ximian.com>
3636
3637         * iterators.cs: Added generics support.
3638
3639 2004-07-16  Martin Baulig  <martin@ximian.com>
3640
3641         * iterators.cs: Rewrote this.  We're now using one single Proxy
3642         class for both the IEnumerable and the IEnumerator interface and
3643         `Iterator' derives from Class so we can use the high-level API.
3644
3645         * class.cs (TypeContainer.AddIterator): New method.
3646         (TypeContainer.DoDefineType): New protected virtual method, which
3647         is called from DefineType().
3648         (TypeContainer.DoDefineMembers): Call DefineType() and
3649         DefineMembers() on all our iterators.
3650         (TypeContainer.Emit): Call Emit() on all our iterators.
3651         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3652
3653         * codegen.cs (EmitContext.CurrentIterator): New public field.
3654
3655 2004-07-15  Martin Baulig  <martin@ximian.com>
3656
3657         * typemanager.cs
3658         (TypeManager.not_supported_exception_type): New type.   
3659
3660 2004-07-14  Martin Baulig  <martin@ximian.com>
3661
3662         * typemanager.cs
3663         (TypeManager.generic_ienumerable_type): New type.
3664         (TypeManager.generic_ienumerator_type): New type.
3665
3666         * rootcontext.cs
3667         (RootContext.interfaces_first_stage): Added
3668         "System.Collections.Generic.IEnumerator`1" and
3669         "System.Collections.Generic.IEnumerable`1".     
3670
3671 2004-07-14  Martin Baulig  <martin@ximian.com>
3672
3673         * iterators.cs: Use real error numbers.
3674
3675 2004-07-14  Martin Baulig  <martin@ximian.com>
3676
3677         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3678         requires this to be a System.Collection.IEnumerable and not a
3679         class implementing that interface.
3680         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3681
3682 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3683
3684         * class.cs: Fixed previous fix, it broke some error tests.
3685
3686 2004-07-12  Martin Baulig  <martin@ximian.com>
3687
3688         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3689         Fixes #61293.
3690
3691 2004-07-14  Martin Baulig  <martin@ximian.com>
3692
3693         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3694         an exclamation mark (!) for the generic arity to reflect the
3695         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3696
3697 2004-07-13  Martin Baulig  <martin@ximian.com>
3698
3699         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3700         specifiers being part of a type argument.
3701
3702 2004-07-13  Martin Baulig  <martin@ximian.com>
3703
3704         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3705         name for generic types.
3706
3707 2004-07-13  Martin Baulig  <martin@ximian.com>
3708
3709         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3710         bit to fix #60119.
3711
3712 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3713
3714         * assign.cs (LocalTemporary): Add new argument: is_address,If
3715         `is_address' is true, then the value that we store is the address
3716         to the real value, and not the value itself.
3717         
3718         * ecore.cs (PropertyExpr): use the new local temporary
3719         stuff to allow us to handle X.Y += z (where X is a struct)
3720
3721 2004-07-08  Martin Baulig  <martin@ximian.com>
3722
3723         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3724         not always return, just like we're doing in Using.Resolve().
3725
3726 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3727
3728         * cs-parser.jay (fixed_statement): flag this as Pinned.
3729
3730 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3731
3732         * typemanager.cs (TypeManager): Removed MakePinned method, this
3733         mechanism is replaced with the .NET 2.x compatible mechanism of
3734         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3735
3736         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3737         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3738         `IsFixed' property which has a different meaning.
3739
3740 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3741
3742         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3743         visible from inside a nested class, not just the names of the
3744         immediately enclosing class.
3745         Fix for bug #60730.
3746
3747 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3748
3749         * expression.cs (BetterConversion): Remove buggy special-case
3750         handling of "implicit constant expression conversions".  At this
3751         point, we already know that the conversion is possible -- we're
3752         only checking to see which is better.
3753
3754 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3755
3756         * cs-parser.jay: Added error CS0210 test.
3757
3758 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3759
3760         * cs-parser.jay: Added error CS0134 test.
3761
3762 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3763
3764         Fix bug #52507
3765         * cs-parser.jay: Added error CS0145 test.
3766
3767 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3768
3769         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3770
3771 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3772         
3773         * expression.cs (StackAlloc.Resolve): The argument may not
3774         be a constant; deal with this case.
3775         
3776 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3777
3778         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3779         GetIndexerAttributeValue.
3780         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3781
3782         * class.cs (Indexer.Define): Added error tests for CS0415,
3783         CS0609.
3784
3785 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3786
3787         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3788         property code.
3789
3790 2004-06-23  Martin Baulig  <martin@ximian.com>
3791
3792         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3793         neither return nor throw, reset the barrier as well.  Fixes #60457.
3794
3795 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3796
3797         * class.cs : EventAttributes is now set to None by default.
3798           This fixes bug #60459.
3799
3800 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3801
3802         Fix bug #60219
3803         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3804         Don't throw exception but return null (it's sufficient now).
3805
3806 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3807
3808         * typemanager.cs (GetArgumentTypes): Faster implementation.
3809
3810 2004-06-18  Martin Baulig  <martin@ximian.com>
3811
3812         * attribute.cs (Attribute.Resolve): Check whether we're an
3813         EmptyCast which a Constant child.  Fixes #60333.
3814
3815 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3816
3817         * statement.cs (EmitCollectionForeach): Account for the fact that
3818         not all valuetypes are in areas which we can take the address of.
3819         For these variables, we store to a temporary variable. Also, make
3820         sure that we dont emit a `callvirt' on a valuetype method.
3821
3822 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3823
3824         * expression.cs (StackAlloc.DoReSolve): Added test for
3825         negative parameter (CS0247).
3826
3827 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3828
3829         Fix bug #59792
3830         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3831
3832 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3833
3834         Fix bug #59781
3835         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3836         ulong.
3837
3838 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3839
3840         Fix bug #58254 & cs1555.cs, cs1556.cs
3841         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3842
3843 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3844
3845         * cs-parser.jay: Added error CS1669 test for indexers.
3846
3847 2004-06-18  Martin Baulig  <martin@ximian.com>
3848
3849         * generics.cs (GenericMethod.ctor): Don't take an Attributes
3850         argument.  Fixes #60441.
3851
3852 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
3853         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3854         The name needs to have the actual name of the method in order
3855         for other tests (such as the one in OverloadResolve for Invoke
3856         on a delegate) to work. As well, it does not really help
3857         error reporting because the method group had multiple methods.
3858         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3859         Make profiling work.
3860         
3861 2004-06-13  Martin Baulig  <martin@ximian.com>
3862
3863         * cs-parser.jay: Don't allow generic attributes.
3864
3865 2004-06-13  Martin Baulig  <martin@ximian.com>
3866
3867         * class.cs (MemberBase.DoDefineBase): New protected method.
3868         (MemberBase.DoDefine): Compute the `flags' in the new
3869         DoDefineBase() which must be called first.
3870         (Method.Define): Call DoDefineBase() first so we have the flags
3871         when defining the generic method.
3872
3873         * cs-parser.jay (interface_method_declaration): Support generic methods.
3874
3875 2004-06-13  Martin Baulig  <martin@ximian.com>
3876
3877         * decl.cs (TypeName): Removed.
3878         (MemberName): Removed TypeName and MemberNow; now we just have
3879         MemberName.
3880
3881         * cs-parser.jay: Don't distinguish between type arguments and type
3882         parameters in the grammar and simplified the rules a bit.  The
3883         reduce/reduce conflicts are now gone (except the one we inherited
3884         from mcs).
3885
3886 2004-06-11  Martin Baulig  <martin@ximian.com>
3887
3888         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3889         call this twice: for params and varargs methods.
3890
3891 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3892
3893         * class.cs:
3894         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3895
3896 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3897
3898         * attribute.cs (Attribute.GetValidTargets): Made public.
3899
3900         * class.cs: 
3901         (AbstractPropertyEventMethod): New class for better code sharing.
3902         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3903         CS1667 report.
3904         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3905
3906 2004-06-09  Martin Baulig  <martin@ximian.com>
3907
3908         * cs-parser.jay: Removed a reduce/reduce conflict.
3909
3910 2004-06-03  Martin Baulig  <martin@ximian.com>
3911
3912         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3913         GetSimpleName() and return a SimpleName.
3914
3915         * ecore.cs (SimpleName.Arguments): New public field.
3916         (SimpleName): Added overloaded ctor which takes an additional
3917         TypeArguments argument.
3918         (SimpleName.SimpleNameResolve): Added support for generic methods.
3919         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
3920         formerly in MemberAccess.DoResolve(), but we also need it in
3921         SimpleNameResolve().
3922
3923         * expression.cs (MemberAccess.DoResolve): Use the new
3924         MethodGroupExpr.ResolveGeneric().       
3925
3926 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3927
3928         * decl.cs: If possible, use lookuptypedirect here. We can only do
3929         this if there is no `.' after the namespace. Avoids using
3930         LookupType, which does lots of slow processing.
3931         (FindNestedType) New method, does what it says :-).
3932         * namespace.cs: use LookupTypeDirect.
3933         * rootcontext.cs: use membercache, if possible.
3934         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3935
3936 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3937
3938         * expression.cs:
3939         According to the spec, 
3940
3941         In a member access of the form E.I, if E is a single identifier,
3942         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3943         field, property, localvariable, or parameter with the same type as
3944         the meaning of E as a type-name (§3.8), then both possible
3945         meanings of E are permitted.
3946
3947         We did not check that E as a simple-name had the same type as E as
3948         a type name.
3949
3950         This trivial check gives us 5-7% on bootstrap time.
3951
3952 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3953
3954         * expression.cs (Invocation.OverloadResolve): Avoid the
3955         use of hashtables and boxing here by allocating on demand.
3956
3957 2004-05-30  Martin Baulig  <martin@ximian.com>
3958
3959         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3960         we're doing a silent lookup.  Don't try to lookup nested types in
3961         TypeManager.object_type (thanks to Ben Maurer).
3962
3963 2004-05-30  Martin Baulig  <martin@ximian.com>
3964
3965         Committing a patch from Ben Maurer.
3966
3967         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3968
3969 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3970
3971         * convert.cs: add a trivial cache for overload operator resolution.
3972
3973 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
3974
3975         * attribute.cs
3976         (AttributeTester.GetObsoleteAttribute): Returns instance of
3977         ObsoleteAttribute when type is obsolete.
3978
3979         * class.cs
3980         (TypeContainer.VerifyObsoleteAttribute): Override.
3981         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3982         (MethodCode.VerifyObsoleteAttribute): Override.
3983         (MemberBase.VerifyObsoleteAttribute): Override.
3984
3985         * decl.cs
3986         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3987         and report proper error.
3988
3989         *delegate.cs
3990         (Delegate.VerifyObsoleteAttribute): Override.
3991
3992         * ecore.cs
3993         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3994         and report proper error.
3995         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3996
3997         * enum.cs
3998         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3999         and enum member.
4000
4001         * expression.cs
4002         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
4003         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
4004         Added test for ObsoleteAttribute.
4005
4006         * statement.cs
4007         (Catch): Derived from Statement.
4008
4009 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4010
4011         * decl.cs: If possible, use lookuptypedirect here. We can only do
4012         this if there is no `.' after the namespace. Avoids using
4013         LookupType, which does lots of slow processing.
4014         (FindNestedType) New method, does what it says :-).
4015         * namespace.cs: use LookupTypeDirect.
4016         * rootcontext.cs: use membercache, if possible.
4017         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
4018
4019 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4020
4021         * expression.cs:
4022         According to the spec, 
4023
4024         In a member access of the form E.I, if E is a single identifier,
4025         and if the meaning of E as a simple-name (§7.5.2) is a constant,
4026         field, property, localvariable, or parameter with the same type as
4027         the meaning of E as a type-name (§3.8), then both possible
4028         meanings of E are permitted.
4029
4030         We did not check that E as a simple-name had the same type as E as
4031         a type name.
4032
4033         This trivial check gives us 5-7% on bootstrap time.
4034
4035 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
4036
4037         Fixed bug #59071 & cs0160.cs
4038         * statement.cs (Try.Resolve): Check here whether order of catch
4039         clauses matches their dependencies.
4040
4041 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
4042
4043         Fixed bug #58624
4044         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
4045         unsafe type.
4046
4047 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4048
4049         * expression.cs (Invocation.OverloadResolve): Avoid the
4050         use of hashtables and boxing here by allocating on demand.
4051
4052 2004-05-30  Martin Baulig  <martin@ximian.com>
4053
4054         * rootcontext.cs (RootContext.LookupType): Don't cache things if
4055         we're doing a silent lookup.  Don't try to lookup nested types in
4056         TypeManager.object_type (thanks to Ben Maurer).
4057
4058 2004-05-30  Martin Baulig  <martin@ximian.com>
4059
4060         Committing a patch from Ben Maurer.
4061
4062         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
4063
4064 2004-05-29  Martin Baulig  <martin@ximian.com>
4065
4066         * class.cs (IMethodData.ShouldIgnore): New method.
4067
4068         * typemanager.cs (TypeManager.MethodFlags): Don't take a
4069         `Location' argument, we don't need it anywhere.  Use
4070         `IMethodData.ShouldIgnore ()' instead of
4071         `MethodData.GetMethodFlags ()'.
4072         (TypeManager.AddMethod): Removed.
4073         (TypeManager.AddMethod2): Renamed to AddMethod.
4074
4075 2004-05-29  Martin Baulig  <martin@ximian.com>
4076
4077         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4078
4079         * convert.cs (Convert.ImplicitReferenceConversion): If we're
4080         converting from a class type S to an interface type and we already
4081         have an object on the stack, don't box it again.  Fixes #52578.
4082
4083 2004-05-29  Martin Baulig  <martin@ximian.com>
4084
4085         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4086         Added support for `params' parameters.  Fixes #59267.
4087
4088 2004-05-29  Martin Baulig  <martin@ximian.com>
4089
4090         * literal.cs (NullPointer): Provide a private .ctor which sets
4091         `type' to TypeManager.object_type.  Fixes #59048.
4092
4093 2004-05-29  Martin Baulig  <martin@ximian.com>
4094
4095         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4096         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
4097
4098         * ecore.cs (EventExpr.instance_expr): Make the field private.
4099
4100 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
4101
4102         Fixed bug #50080 & cs0214-2.cs
4103         * expression.cs (Cast.DoResolve): Check unsafe context here.
4104         
4105         * statement.cs (Resolve.DoResolve): Likewise.
4106
4107 2004-05-26  Martin Baulig  <martin@ximian.com>
4108
4109         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4110
4111         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4112         (RootContext.LookupType): Pass down the `silent' flag.
4113
4114 2004-05-25  Martin Baulig  <martin@ximian.com>
4115
4116         * expression.cs
4117         (MethodGroupExpr.IdenticalTypeName): New public property.
4118         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4119         expression actually refers to a type.
4120
4121 2004-05-25  Martin Baulig  <martin@ximian.com>
4122
4123         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4124         for #56176 and made it actually work.
4125
4126 2004-05-25  Martin Baulig  <martin@ximian.com>
4127
4128         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4129         (FieldExpr, PropertyExpr): Override and implement
4130         CacheTemporaries.  Fixes #52279.
4131
4132 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
4133
4134         * location.cs: In the new compiler listing a file twice is a
4135         warning, not an error.
4136
4137 2004-05-24  Martin Baulig  <martin@ximian.com>
4138
4139         * enum.cs (Enum.DefineType): For the `BaseType' to be a
4140         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
4141
4142 2004-05-24  Martin Baulig  <martin@ximian.com>
4143
4144         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4145         walking the `using' list.  Fixes #53921.
4146
4147 2004-05-24  Martin Baulig  <martin@ximian.com>
4148
4149         * const.cs (Const.LookupConstantValue): Added support for
4150         EmptyCast's; fixes #55251.
4151
4152 2004-05-24  Martin Baulig  <martin@ximian.com>
4153
4154         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4155         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4156         which does the CS0135 check.  The reason is that we first need to
4157         check whether the variable actually exists.
4158
4159 2004-05-24  Martin Baulig  <martin@ximian.com>
4160
4161         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4162         than RootContext.LookupType() to find the explicit interface
4163         type.  Fixes #58584.
4164
4165 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4166
4167         * Makefile: Simplify.  Use executable.make.
4168         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4169
4170 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4171
4172         * decl.cs:
4173         * enum.cs:
4174         Use the invariant culture when doing String.Compare for CLS case
4175         sensitivity.
4176         
4177 2004-05-23  Martin Baulig  <martin@ximian.com>
4178
4179         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4180         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4181
4182         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4183
4184 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4185
4186         * class.cs (MemberBase.Define): Reuse MemberType member for 
4187         resolved type. Other methods can use it too.
4188
4189 2004-05-23  Martin Baulig  <martin@ximian.com>
4190
4191         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4192         the variable also exists in the current block (otherwise, we need
4193         to report a CS0103).  Fixes #58670.
4194
4195 2004-05-23  Martin Baulig  <martin@ximian.com>
4196
4197         * flowanalysis.cs (Reachability.Reachable): Compute this
4198         on-the-fly rather than storing it as a field.
4199
4200 2004-05-23  Martin Baulig  <martin@ximian.com>
4201
4202         * flowanalysis.cs (Reachability.And): Manually compute the
4203         resulting `barrier' from the reachability.      
4204        
4205 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4206
4207         Fix bug #57835
4208         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4209         instance of ObsoleteAttribute when symbol is obsolete.
4210
4211         * class.cs
4212         (IMethodData): Extended interface for ObsoleteAttribute support.
4213
4214 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4215
4216         * attribute.cs: Fix bug #55970
4217
4218 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4219
4220         Fix bug #52705
4221         * attribute.cs
4222         (GetObsoleteAttribute): New method. Creates the instance of
4223         ObsoleteAttribute.
4224         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4225         ObsoleteAttribute when member is obsolete.
4226         (AttributeTester.Report_ObsoleteMessage): Common method for
4227         Obsolete error/warning reporting.
4228
4229         * class.cs
4230         (TypeContainer.base_classs_type): New member for storing parent type.
4231
4232         * decl.cs
4233         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4234         for this MemberCore.
4235
4236 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4237
4238         * attribute.cs, const.cs: Fix bug #58590
4239
4240 2004-05-21  Martin Baulig  <martin@ximian.com>
4241
4242         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4243         out parameters if the end of the method is unreachable.  Fixes
4244         #58098. 
4245
4246 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4247
4248         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4249         Hari was right, why extra method.
4250
4251 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4252
4253         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4254
4255 2004-05-20  Martin Baulig  <martin@ximian.com>
4256
4257         * delegate.cs: Convert this file to Unix mode - like the original
4258         version in mcs is.
4259
4260 2004-05-20  Martin Baulig  <martin@ximian.com>
4261
4262         * attribute.cs: Convert this file to Unix mode - like the original
4263         version in mcs is.
4264
4265 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4266
4267        Fix bug #58688 (MCS does not report error when the same attribute
4268        is assigned twice)
4269
4270        * attribute.cs (Attribute.Emit): Distinction between null and default.
4271
4272 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4273
4274        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4275        of a top-level attribute without an attribute target.
4276        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4277        Make non-static.
4278        (Attribute.Conditional_GetConditionName), 
4279        (Attribute.Obsolete_GetObsoleteMessage): Update.
4280        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4281        part of ScanForIndexerName.
4282        (Attribute.CanIgnoreInvalidAttribute): New function.
4283        (Attribute.ScanForIndexerName): Move to ...
4284        (Attributes.ScanForIndexerName): ... here.
4285        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4286        (Attributes.Search): New internal variant that can choose not to
4287        complain if types aren't resolved.  The original signature now
4288        complains.
4289        (Attributes.GetClsCompliantAttribute): Use internal variant, with
4290        complaints suppressed.
4291        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4292        only if it not useful.
4293        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4294        top-level for attributes that are shared between the assembly
4295        and a top-level class.
4296        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4297        * class.cs: Update to reflect changes.
4298        (DefineIndexers): Fuse loops.
4299        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4300        a couple more variants of attribute names.
4301
4302 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4303
4304         Fix bug #52585 (Implemented explicit attribute declaration)
4305
4306         * attribute.cs:
4307         (Attributable.ValidAttributeTargets): New abstract method. It gets
4308         list of valid attribute targets for explicit target declaration.
4309         (Attribute.Target): It holds target itself.
4310         (AttributeSection): Removed.
4311         (Attribute.CheckTargets): New method. It checks whether attribute
4312         target is valid for the current element.
4313
4314         * class.cs:
4315         (EventProperty): New class. For events that are declared like
4316         property (with add and remove accessors).
4317         (EventField): New class. For events that are declared like field.
4318         class.cs
4319
4320         * cs-parser.jay: Implemented explicit attribute target declaration.
4321
4322         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4323         Override ValidAttributeTargets.
4324
4325         * parameter.cs:
4326         (ReturnParameter): Class for applying custom attributes on 
4327         the return type.
4328         (ParameterAtribute): New class. Class for applying custom
4329         attributes on the parameter type.
4330
4331 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4332
4333         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4334         definitions. 
4335
4336         (Method): Allow UNSAFE here.
4337
4338         * modifiers.cs: Support unsafe reporting.
4339
4340 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4341
4342         * decl.cs: Fix bug #58478.
4343
4344 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4345
4346         * statement.cs: When checking for unreachable code on an EmptyStatement,
4347         set the location. Fixes bug #58488.
4348
4349 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4350
4351         * driver.cs: Add -pkg handling.
4352
4353         From Gonzalo: UseShelLExecute=false
4354
4355 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4356
4357         * attribute.cs:
4358         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4359         for attribute.
4360         (Attribute.IsClsCompliaceRequired): Moved to base for better
4361         accesibility.
4362         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4363         when attribute is AttributeUsageAttribute.
4364         (Attribute.GetValidTargets): Simplified.
4365         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4366         attribute for this type.
4367         (Attribute.ApplyAttributes): Method renamed to Emit and make
4368         non-static.
4369         (GlobalAttributeSection): New class for special handling of global
4370         attributes (assembly, module).
4371         (AttributeSection.Emit): New method.
4372
4373         * class.cs: Implemented Attributable abstract methods.
4374         (MethodCore.LabelParameters): Moved to Parameter class.
4375         (Accessor): Is back simple class.
4376         (PropertyMethod): Implemented Attributable abstract class.
4377         (DelegateMethod): Implemented Attributable abstract class.
4378         (Event): New constructor for disctintion between normal Event
4379         and Event with accessors.
4380
4381         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4382
4383         * codegen.cs, const.cs, decl.cs, delegate.cs:
4384         (CommonAssemblyModulClass): Implemented Attributable abstract class
4385         and simplified.
4386
4387         * enum.cs: Implement IAttributeSupport interface.
4388         (EnumMember): New class for emum members. Implemented Attributable
4389         abstract class
4390
4391         * parameter.cs:
4392         (ParameterBase): Is abstract.
4393         (ReturnParameter): New class for easier [return:] attribute handling.
4394
4395         * typemanager.cs: Removed builder_to_attr.
4396
4397 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4398
4399         Fix bug #57151.
4400         * attribute.cs (Attribute.GetPositionalValue): New function.
4401         * class.cs (TypeContainer.VerifyMembers): New function.
4402         (TypeContainer.Emit): Use it.
4403         (ClassOrStruct): New base class for Class and Struct.
4404         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4405         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4406         class.
4407         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4408         then each non-static field should have a FieldOffset attribute.
4409         Otherwise, none of the fields should have a FieldOffset attribute.
4410         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4411         and FieldOffset attributes.
4412         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4413         (TypeManager.field_offset_attribute_type): New core types.
4414         (TypeManager.InitCoreTypes): Initialize them.
4415
4416 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4417
4418         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4419         Return correct type.
4420         From bug #58270.
4421
4422 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4423
4424         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4425         be implicitly converted to ulong.
4426         
4427         * expression.cs: The logic for allowing operator &, | and ^ worked
4428         was wrong, it worked before because we did not report an error in
4429         an else branch.  Fixes 57895.
4430
4431         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4432         allow volatile fields to be reference types.
4433
4434 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4435
4436         * driver.cs: Add support for /debug-
4437
4438 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4439
4440         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4441         Add a 'complain' parameter to silence errors.
4442         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4443         silently overlooked type-resolutions.
4444         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4445         to reflect changes.
4446         (Attributes.Search): New function.
4447         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4448         (Attributes.GetAttributeFullName): Remove hack.
4449         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4450         Update to reflect changes.
4451         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4452         Use Attributes.Search instead of nested loops.
4453
4454 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4455
4456         * decl.cs:
4457         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4458         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4459         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4460
4461         * report.cs: (Report.Warning): Renamed to Warning_T because of
4462         parameter collision.
4463
4464 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4465
4466         * expression.cs (MemberAccess.ResolveMemberAccess):
4467         Exit with non-zero status after Report.Error.
4468         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4469         Likewise.
4470         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4471
4472 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4473
4474         * support.cs: Don't hang when the file is empty.
4475
4476 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4477
4478         * support.cs: In SeekableStreamReader, compute the preamble size of the
4479           underlying stream. Position changes should take into account that initial
4480           count of bytes.
4481
4482 2004-05-03  Todd Berman  <tberman@sevenl.net>
4483
4484         * driver.cs: remove unused GetSysVersion function.
4485
4486 2004-05-03  Todd Berman  <tberman@sevenl.net>
4487
4488         * driver.cs: Remove the hack from saturday, as well as the hack
4489         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4490         link_paths to get that bit proper.
4491
4492 2004-05-01  Todd Berman  <tberman@sevenl.net>
4493
4494         * driver.cs: Try a LoadFrom before a Load, this checks the current
4495         path. This is currently a bug in mono that is be fixed, however, this
4496         provides a workaround for now. This will be removed when the bug
4497         is fixed.
4498
4499 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4500
4501         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4502         incomplete key pairs (#57941).
4503
4504 2004-05-01  Todd Berman  <tberman@sevenl.net>
4505
4506         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4507         from the GAC
4508
4509 2004-04-30  Jackson Harper  <jackson@ximian.com>
4510
4511         * codegen.cs: Open keys readonly.
4512         
4513 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4514
4515         * typemanager.cs: don't report cyclic struct layout when a struct
4516         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4517         which has 2 Pango.Rectangle fields.
4518
4519 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4520
4521         * expression.cs: Handle IntPtr comparisons with IL code
4522         rather than a method call.
4523
4524 2004-04-29  Martin Baulig  <martin@ximian.com>
4525
4526         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4527         the list of PropertyInfo's in class hierarchy and find the
4528         accessor.  Fixes #56013.
4529
4530 2004-04-29  Martin Baulig  <martin@ximian.com>
4531
4532         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4533
4534 2004-04-29  Martin Baulig  <martin@ximian.com>
4535
4536         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4537
4538         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4539
4540 2004-04-29  Martin Baulig  <martin@ximian.com>
4541
4542         * class.cs (ConstructorInitializer.Resolve): Check whether the
4543         parent .ctor is accessible.  Fixes #52146.
4544
4545 2004-04-29  Martin Baulig  <martin@ximian.com>
4546
4547         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4548
4549         * statement.cs (Using.EmitLocalVariableDecls): Use
4550         TypeManager.idisposable_type, not typeof (IDisposable).
4551         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4552
4553 2004-04-29  Martin Baulig  <martin@ximian.com>
4554
4555         * class.cs (Event.Define): Don't emit the field and don't set
4556         RTSpecialName and SpecialName for events on interfaces.  Fixes
4557         #57703. 
4558
4559 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4560
4561         Refactor Attribute.ApplyAttributes.
4562         * attribute.cs (Attributable): New base class for objects that can
4563         have Attributes applied on them.
4564         (Attribute): Make AttributeUsage fields public.
4565         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4566         (Attribute.IsInternalCall): New property.
4567         (Attribute.UsageAttr): Convert to a public read-only property.
4568         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4569         (Attribute.ResolveType, Attribute.Resolve)
4570         (Attribute.ScanForIndexerName): Update to reflect changes.
4571         (Attribute.CheckAttributeTarget): Re-format.
4572         (Attribute.ApplyAttributes): Refactor, to various
4573         Attributable.ApplyAttributeBuilder methods.
4574         * decl.cs (MemberCore): Make Attributable.
4575         * class.cs (Accessor): Make Attributable.
4576         (MethodData.ApplyAttributes): Use proper attribute types, not
4577         attribute names.
4578         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4579         (TypeContainer.ApplyAttributeBuilder)
4580         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4581         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4582         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4583         (Operator.ApplyAttributeBuilder): New factored-out methods.
4584         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4585         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4586         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4587         * parameter.cs (ParameterBase): New Attributable base class
4588         that can also represent Return types.
4589         (Parameter): Update to the changes.
4590
4591 2004-04-29  Jackson Harper  <jackson@ximian.com>
4592
4593         * driver.cs: Prefer the corlib system version when looking for
4594         assemblies in the GAC. This is still a hack, but its a better hack
4595         now.
4596         
4597 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4598
4599         * decl.cs, enum.cs: Improved error 3005 reporting.
4600   
4601         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4602         (related_symbols): New private member for list of symbols
4603         related to reported error/warning.
4604         
4605         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4606
4607 2004-04-29  Martin Baulig  <martin@ximian.com>
4608
4609         * ecore.cs (Expression.Constantify): If we're an enum and
4610         TypeManager.TypeToCoreType() doesn't give us another type, use
4611         t.UnderlyingSystemType.  Fixes #56178.  
4612
4613 2004-04-29  Martin Baulig  <martin@ximian.com>
4614
4615         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4616         interfaces and for each interface, only add members directly
4617         declared in that interface.  Fixes #53255.
4618
4619 2004-04-28  Martin Baulig  <martin@ximian.com>
4620
4621         * expression.cs (ConditionalLogicalOperator): Use a temporary
4622         variable for `left' to avoid that we evaluate it more than once;
4623         bug #52588.
4624
4625 2004-04-28  Martin Baulig  <martin@ximian.com>
4626
4627         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4628         `void[]' (CS1547).
4629
4630 2004-04-28  Martin Baulig  <martin@ximian.com>
4631
4632         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4633         void (CS1547).
4634
4635         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4636         whether the type is not void (CS1547).
4637
4638 2004-04-28  Martin Baulig  <martin@ximian.com>
4639
4640         * expression.cs (Unary.DoResolveLValue): Override this and report
4641         CS0131 for anything but Operator.Indirection.
4642
4643 2004-04-28  Martin Baulig  <martin@ximian.com>
4644
4645         Committing a patch from Ben Maurer; see bug #50820.
4646
4647         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4648         check for classes.
4649
4650         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4651         classes.        
4652
4653 2004-04-28  Martin Baulig  <martin@ximian.com>
4654
4655         Committing a patch from Ben Maurer; see bug #50820.
4656
4657         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4658         check for classes.
4659
4660         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4661         classes.        
4662
4663 2004-04-28  Martin Baulig  <martin@ximian.com>
4664
4665         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4666         (Block.AddLabel): Call DoLookupLabel() to only search in the
4667         current block.
4668
4669 2004-04-28  Martin Baulig  <martin@ximian.com>
4670
4671         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4672         comparing StringConstants and NullLiterals in Equality and Inequality.
4673
4674 2004-04-28  Jackson Harper  <jackson@ximian.com>
4675
4676         * driver.cs: Attempt to load referenced assemblies from the
4677         GAC. This is the quick and dirty version of this method that
4678         doesnt take into account versions and just takes the first
4679         canidate found. Will be good enough for now as we will not have more
4680         then one version installed into the GAC until I update this method.
4681
4682 2004-04-28  Martin Baulig  <martin@ximian.com>
4683
4684         * typemanager.cs (TypeManager.CheckStructCycles): New public
4685         static method to check for cycles in the struct layout.
4686
4687         * rootcontext.cs (RootContext.PopulateTypes): Call
4688         TypeManager.CheckStructCycles() for each TypeContainer.
4689         [Note: We only need to visit each type once.]
4690
4691 2004-04-28  Martin Baulig  <martin@ximian.com>
4692
4693         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4694
4695         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4696         success and added `out object value'.  Use a `bool resolved' field
4697         to check whether we've already been called rather than
4698         `ConstantValue != null' since this breaks for NullLiterals.
4699
4700 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4701
4702         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4703         setting of this flag, since the 'set' method may be non-public.
4704
4705 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4706
4707         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4708         check on current_vector.Block.
4709
4710 2004-04-27  Martin Baulig  <martin@ximian.com>
4711
4712         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4713         a field initializer.  Fixes #56459.
4714
4715 2004-04-27  Martin Baulig  <martin@ximian.com>
4716
4717         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4718         we're not attempting to use an indexer.  Fixes #52154.
4719
4720 2004-04-27  Martin Baulig  <martin@ximian.com>
4721
4722         * statement.cs (Return): Don't create a return label if we don't
4723         need it; reverts my change from January 20th.  Thanks to Ben
4724         Maurer for this.
4725
4726 2004-04-27  Martin Baulig  <martin@ximian.com>
4727
4728         According to the spec, `goto' can only leave a nested scope, but
4729         never enter it.
4730
4731         * statement.cs (Block.LookupLabel): Only lookup in the current
4732         block, don't recurse into parent or child blocks.
4733         (Block.AddLabel): Check in parent and child blocks, report
4734         CS0140/CS0158 if we find a duplicate.
4735         (Block): Removed this indexer for label lookups.
4736         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4737         this already does the error reporting for us.
4738
4739         * flowanalysis.cs
4740         (FlowBranching.UsageVector.Block): New public variable; may be null.
4741         (FlowBranching.CreateSibling): Added `Block' argument.
4742         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4743         label for the target of a `goto' and check whether we're not
4744         leaving a `finally'.
4745
4746 2004-04-27  Martin Baulig  <martin@ximian.com>
4747
4748         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4749         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4750         just for returns).
4751
4752 2004-04-27  Martin Baulig  <martin@ximian.com>
4753
4754         * statement.cs (Block.AddLabel): Also check for implicit blocks
4755         and added a CS0158 check.
4756
4757 2004-04-27  Martin Baulig  <martin@ximian.com>
4758
4759         * flowanalysis.cs (FlowBranchingLoop): New class.
4760         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4761         UsageVector's instead of an ArrayList.
4762         (FlowBranching.Label): Likewise.
4763         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4764         (FlowBranching.AddBreakVector): New method.
4765
4766 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4767
4768         * attribute.cs: Small regression fix: only convert the type if we
4769         the type is different, fixes System.Drawing build.
4770
4771 2004-04-27  Martin Baulig  <martin@ximian.com>
4772
4773         * attribute.cs (Attribute.Resolve): If we have a constant value
4774         for a named field or property, implicity convert it to the correct
4775         type.
4776
4777 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4778
4779         * statement.cs (Block.Block): Implicit blocks share
4780         'child_variable_names' fields with parent blocks.
4781         (Block.AddChildVariableNames): Remove.
4782         (Block.AddVariable): Mark variable as "used by a child block" in
4783         every surrounding block.
4784         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4785         been used in a child block, complain about violation of "Invariant
4786         meaning in blocks" rule.
4787         * cs-parser.jay (declare_local_variables): Don't use
4788         AddChildVariableNames.
4789         (foreach_statement): Don't create an implicit block: 'foreach'
4790         introduces a scope.
4791
4792 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4793
4794         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4795         converting from 0L to ulong.  Fixes 57522.
4796
4797 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4798
4799         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4800         derived class hides via 'new' keyword field from base class (test-242.cs).
4801         TODO: Handle this in the more general way.
4802         
4803         * class.cs (CheckBase): Ditto.
4804
4805 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4806
4807         * decl.cs (caching_flags): New member for storing cached values
4808         as bit flags.
4809         (MemberCore.Flags): New enum where bit flags for caching_flags
4810         are defined.
4811         (MemberCore.cls_compliance): Moved to caching_flags.
4812         (DeclSpace.Created): Moved to caching_flags.
4813
4814         * class.cs: Use caching_flags instead of DeclSpace.Created
4815         
4816 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4817
4818         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4819         if we are only a derived class, not a nested class.
4820
4821         * typemanager.cs: Same as above, but do this at the MemberLookup
4822         level (used by field and methods, properties are handled in
4823         PropertyExpr).   Allow for the qualified access if we are a nested
4824         method. 
4825
4826 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4827
4828         * class.cs: Refactoring.
4829         (IMethodData): New inteface; Holds links to parent members
4830         to avoid member duplication (reduced memory allocation).
4831         (Method): Implemented IMethodData interface.
4832         (PropertyBase): New inner classes for get/set methods.
4833         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4834         (Event): New inner classes for add/remove methods.
4835         (Event.DelegateMethod): Implemented IMethodData interface.
4836
4837         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4838         EmitContext (related to class.cs refactoring).
4839
4840 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4841
4842         * delegate.cs (Delegate.VerifyApplicability): If the number of
4843         arguments are the same as the number of parameters, first try to
4844         verify applicability ignoring  any 'params' modifier on the last
4845         parameter.
4846         Fixes #56442.
4847
4848 2004-04-08  Martin Baulig  <martin@ximian.com>
4849
4850         Merged latest changes into gmcs.  Please keep this comment in
4851         here, it makes it easier for me to see what changed in MCS since
4852         the last time I merged.
4853
4854 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4855
4856         * class.cs (TypeContainer.AddIndexer): Use
4857         'ExplicitInterfaceName' to determine if interface name was
4858         explicitly specified.  'InterfaceType' is not initialized at this time.
4859         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4860         Indexers array is already in the required order.  Initialize
4861         'IndexerName' only if there are normal indexers.
4862         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4863         (TypeContainer.Emit): Emit DefaultMember attribute only if
4864         IndexerName is initialized.
4865         Fixes #56300.
4866
4867 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4868
4869         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4870         Fixes #57007
4871
4872 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4873
4874         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4875         attributes.
4876         Fix for #56456.
4877
4878         * attribute.cs (Attribute.Resolve): Check for duplicate named
4879         attributes.
4880         Fix for #56463.
4881
4882 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4883
4884         * iterators.cs (MarkYield): track whether we are in an exception,
4885         and generate code accordingly.  Use a temporary value to store the
4886         result for our state.
4887
4888         I had ignored a bit the interaction of try/catch with iterators
4889         since their behavior was not entirely obvious, but now it is
4890         possible to verify that our behavior is the same as MS .NET 2.0
4891
4892         Fixes 54814
4893
4894 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4895
4896         * iterators.cs: Avoid creating temporaries if there is no work to
4897         do. 
4898
4899         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4900         Enumerations, use TypeManager.EnumToUnderlying and call
4901         recursively. 
4902
4903         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4904         bug #57013
4905
4906         (This.Emit): Use EmitContext.EmitThis to emit our
4907         instance variable.
4908
4909         (This.EmitAssign): Ditto.
4910
4911         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4912         codepaths, we will move all the functionality into
4913         Mono.CSharp.This 
4914
4915         (FieldExpr.EmitAssign): Ditto.
4916
4917         This fixes several hidden bugs that I uncovered while doing a code
4918         review of this today.
4919
4920         * codegen.cs (EmitThis): reworked so the semantics are more clear
4921         and also support value types "this" instances.
4922
4923         * iterators.cs: Changed so that for iterators in value types, we
4924         do not pass the value type as a parameter.  
4925
4926         Initialization of the enumerator helpers is now done in the caller
4927         instead of passing the parameters to the constructors and having
4928         the constructor set the fields.
4929
4930         The fields have now `assembly' visibility instead of private.
4931
4932 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4933
4934         * expression.cs (Argument.Resolve): Check if fields passed as ref
4935         or out are contained in a MarshalByRefObject.
4936
4937         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4938         another compiler type.
4939
4940 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4941
4942         * class.cs (Indexer.Define): use the new name checking method.
4943         Also, return false on an error.
4944         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4945         (is_identifier_[start/part]_character): make static.
4946
4947 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4948
4949         * expression.cs (Binary.ResolveOperator): Do no append strings
4950         twice: since we can be invoked more than once (array evaluation)
4951         on the same concatenation, take care of this here.  Based on a fix
4952         from Ben (bug #56454)
4953
4954 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4955
4956         * codegen.cs: Fix another case where CS1548 must be reported (when 
4957         delay-sign isn't specified and no private is available #56564). Fix
4958         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4959         error when MCS is used on the MS runtime and we need to delay-sign 
4960         (which seems unsupported by AssemblyBuilder - see #56621).
4961
4962 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4963
4964         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4965         (TypeManager.ComputeNamespaces): Faster implementation for
4966         Microsoft runtime.
4967
4968         * compiler.csproj: Updated AssemblyName to mcs.
4969
4970 2004-05-11  Jackson Harper  <jackson@ximian.com>
4971
4972         * Makefile: Preserve MONO_PATH
4973         
4974 2004-05-11  Jackson Harper  <jackson@ximian.com>
4975
4976         * Makefile: Use mono and mcs to build gmcs
4977         
4978 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
4979
4980         * codegen.cs: Add patch from Robert Shade
4981         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
4982         sync with mcs.
4983
4984 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
4985
4986         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4987         incomplete key pairs (#57941).
4988
4989 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4990
4991         * codegen.cs: Fix another case where CS1548 must be reported (when 
4992         delay-sign isn't specified and no private is available #56564). Fix
4993         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4994         error when MCS is used on the MS runtime and we need to delay-sign 
4995         (which seems unsupported by AssemblyBuilder - see #56621).
4996
4997 2004-04-29  Jackson Harper  <jackson@ximian.com>
4998
4999         * Makefile: Set MONO_PATH to use the bootstrap corlib
5000         * driver.cs: Check the GAC for referenced assemblies.
5001                 
5002 2004-04-29  Martin Baulig  <martin@ximian.com>
5003
5004         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
5005
5006 2004-04-07  Martin Baulig  <martin@ximian.com>
5007
5008         * expression.cs (Binary.ResolveOperator): Added special case for
5009         Equality/Inequality between a type parameter and a null literal.
5010
5011 2004-04-07  Martin Baulig  <martin@ximian.com>
5012
5013         * convert.cs: Check null literal -> type parameter conversions.
5014
5015 2004-04-07  Martin Baulig  <martin@ximian.com>
5016
5017         * generic.cs (ConstructedType.CheckConstraints): Enforce the
5018         `class' and `struct' constraints.
5019
5020 2004-04-07  Martin Baulig  <martin@ximian.com>
5021
5022         * generic.cs (SpecialConstraint): New public enum.
5023         (Constraints.Resolve): Added support for the `class' and `struct'
5024         constraints.
5025
5026         * cs-parser.jay (type_parameter_constraint): Added support for the
5027         `class' and `struct' constraints.
5028
5029 2004-04-07  Martin Baulig  <martin@ximian.com>
5030
5031         * support.cs (GenericConstraints): Replaced `Types' by
5032         `ClassConstraint' and `InterfaceConstraints'; added
5033         `HasClassConstraint'.   
5034
5035 2004-04-07  Martin Baulig  <martin@ximian.com>
5036
5037         * generic.cs
5038         (Constraints.InterfaceConstraints): New public property.
5039         (Constraints.Types): Make this property public
5040         (TypeParameter): Implement IMemberContainer.
5041         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
5042         instead of a TypeBuilder/MethodBuilder; pass the interface
5043         constraints to TypeManager.AddTypeParameter().
5044         (TypeParameter.DefineType): Just take an EmitContext and no
5045         TypeBuilder/MethodBuilder.  Use the new public API.
5046
5047         * typemanager.cs (TypeManager.AddTypeParameter): Added
5048         `TypeExpr[]' argument; add the interfaces to the
5049         `builder_to_ifaces' hash.
5050         (TypeManager.LookupMemberContainer): For
5051         GenericTypeParameterBuilders, get the TypeParameter from the
5052         `builder_to_type_param'.
5053         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
5054         the TypeParameter and call FindMembers on it.
5055
5056 2004-04-07  Martin Baulig  <martin@ximian.com>
5057
5058         * class.cs
5059         (MethodCore.GenericMethod): Moved this field here from Method.
5060         (MethodCore.IsDuplicateImplementation): Take the number of type
5061         parameters into account if we're a generic method.
5062
5063         * expression.cs (Invocation.InferTypeArguments): Don't return true
5064         if `arguments' is null; we still need to check whether we actually
5065         don't need to infer anything in this case.
5066         (MemberAccess): Merged the functionality from GenericMemberAccess
5067         into this class.
5068
5069         * generic.cs (GenericMemberAccess): Removed.
5070
5071 2004-04-05  Martin Baulig  <martin@ximian.com>
5072
5073         * decl.cs (MemberCore): For generic classes, interfaces and
5074         structs, `Name' now includes the number of type parameters
5075         ("Stack!1.Node!1").
5076         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
5077         encode the number of type arguments in the type name.
5078
5079         * expression.cs (Expression.MemberLookup): Removed the
5080         `num_type_args' argument; we now encode the number of type
5081         arguments in the type name.
5082
5083         * ecore.cs (SimpleName): Encode the number of type arguments in
5084         the type name itself.
5085
5086         * generic.cs (ConstructedType): Likewise.
5087
5088         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
5089         `MemberName'; we now include the number of type parameters in the
5090         type name.
5091
5092         * typemanager.cs (TypeManager.CheckGeneric): Removed.
5093         (TypeManager.MemberLookup): Removed the
5094         `num_type_args' argument; we now encode the number of type
5095         arguments in the type name.     
5096
5097 2004-04-03  Martin Baulig  <martin@ximian.com>
5098
5099         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
5100         (MemberCore.MemberName): Moved here from MemberBase.
5101         (DeclSpace.SetParameterInfo): Just take the constraints as an
5102         ArrayList; we already have the type parameters in our
5103         `MemberName'; also do the CS0080 reporting here.
5104
5105         * cs-parser.jay (struct_declaration): Use `member_name' instead of
5106         `IDENTIFIER opt_type_parameter_list'; when constructing our
5107         `MemberName', it'll already include our type parameters.
5108         (class_declaration, interface_declaration): Likewise.
5109         (delegate_declaration): Likewise.
5110         (MakeName): Take a MemberName and return a MemberName.
5111         The following two changes are required to avoid shift/reduce conflicts:
5112         (member_name): Don't include a TypeName anymore; ie. this is now
5113         just 'IDENTIFIER opt_type_parameter_list'.
5114         (property_declaration, event_declaration): Use a
5115         `namespace_or_type_name' instead of a `member_name'.            
5116
5117 2004-04-03  Martin Baulig  <martin@ximian.com>
5118
5119         * decl.cs (MemberName): Renamed to `TypeName' and created a new
5120         `MemberName' class.
5121         (TypeName): Formerly known as MemberName.
5122
5123         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
5124         instead of a `MemberName'.
5125
5126         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
5127         (member_name): New rule; create a MemberName.
5128
5129 2004-04-02  Martin Baulig  <martin@ximian.com>
5130
5131         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
5132         (CS0305 and CS0308).
5133
5134 2004-04-02  Martin Baulig  <martin@ximian.com>
5135
5136         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
5137         support for nested types.
5138
5139 2004-04-02  Martin Baulig  <martin@ximian.com>
5140
5141         * ecore.cs (IAlias): New public interface.
5142         (TypeExpr, TypeExpression): Implement IAlias.
5143         (TypeAliasExpression): New public class.
5144
5145         * namespace.cs (Namespace): Implement IAlias.
5146         (Namespace.Lookup): Return an IAlias instead on an object.
5147         (Namespace.DefineName): Take an IAlias instead of an object.
5148         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
5149         an object.
5150         (NamespaceEntry.UsingAlias): Take a Membername instead of an
5151         Expression.
5152         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
5153         object.
5154         (NamespaceEntry.Lookup): Likewise.
5155
5156         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
5157         instead of a Type.      
5158
5159         * decl.cs (DeclSpace): Implement IAlias.
5160         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
5161
5162         * generic.cs (ConstructedType): Improved error checking.
5163
5164 2004-04-02  Martin Baulig  <martin@ximian.com>
5165
5166         * convert.cs: Added type parameter conversions.
5167
5168         * ecore.cs
5169         (UnboxCast.Emit): Emit an `unbox.any' for type params.
5170         (ClassCast.Emit): If the source type is a type parameter, box it.
5171         If the target type is a type parameter, emit an `unbox.any'
5172         instead of a `classcast'.1      
5173
5174 2004-04-01  Martin Baulig  <martin@ximian.com>
5175
5176         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
5177
5178 2004-04-01  Martin Baulig  <martin@ximian.com>
5179
5180         * generic.cs (ConstructedType.CheckConstraints): Use
5181         Convert.ImplicitStandardConversionExists(); user-defined implicit
5182         conversions are not allowed according to the spec.
5183
5184 2004-03-30  Martin Baulig  <martin@ximian.com>
5185
5186         * expression.cs (New): Added support for type parameters.
5187
5188         * typemanager.cs
5189         (TypeManager.activator_type): New public static field.
5190         (TypeManager.activator_create_instance): Likewise.
5191
5192 2004-03-30  Martin Baulig  <martin@ximian.com>
5193
5194         * typemanager.cs (TypeManager.HasConstructorConstraint): New
5195         public method.
5196
5197 2004-03-30  Martin Baulig  <martin@ximian.com>
5198
5199         * generic.cs (ConstructedType.CheckConstraints): Actually follow
5200         the spec here: the argument type must be convertible to the
5201         constraints.
5202
5203 2004-03-30  Martin Baulig  <martin@ximian.com>
5204
5205         * generic.cs
5206         (TypeParameter.Define, TypeParameter.DefineMethod): Call
5207         TypeManager.AddTypeParameter().
5208         (ConstructedType.CheckConstraints): Re-enable this and actually
5209         check whether we have a constructor constraint.
5210
5211         * typemanager.cs
5212         (TypeManager.builder_to_type_param): New static field.
5213         (TypeManager.AddTypeParameter): New static method.
5214         (TypeManager.LookupTypeParameter): New public method.
5215
5216 2004-03-30  Martin Baulig  <martin@ximian.com>
5217
5218         * generic.cs (TypeParameter.DefineType): Return a boolean and use
5219         the new API to actually define the constructor constraint.
5220
5221         * typemanager.cs
5222         (TypeManager.new_constraint_attr_type): New static field.
5223         (TypeManager.InitCoreTypes): Initialize it.
5224
5225 2004-03-30  Martin Baulig  <martin@ximian.com>
5226
5227         * generic.cs (Constraints): Completed error checking, use correct
5228         error numbers.
5229
5230 2004-03-29  Martin Baulig  <martin@ximian.com>
5231
5232         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
5233
5234         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5235         public version which takes a `ParameterData pd' instead of an
5236         `ArrayList args'.
5237
5238 2004-03-29  Martin Baulig  <martin@ximian.com>
5239
5240         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
5241         not a MethodInfo.       
5242
5243 2004-03-29  Martin Baulig  <martin@ximian.com>
5244
5245         * expression.cs (Argument.ResolveMethodGroup): If we're a
5246         ConstructedType, call GetMemberAccess() on it.  
5247
5248 2004-03-29  Martin Baulig  <martin@ximian.com>
5249
5250         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
5251         (MethodCore.CheckGenericOverride): When overriding a generic
5252         method, check whether the constraints match.
5253
5254         * support.cs (GenericConstraints): New public interface.
5255         (ParameterData.GenericConstraints): New public method.
5256
5257         * parameter.cs (Parameter.Resolve): Check whether we're a generic
5258         method parameter and compute our constraints if appropriate.
5259         (Parameter.GenericConstraints): New public property.
5260
5261         * generic.cs (Constraints): Implement GenericConstraints.
5262
5263 2004-03-29  Martin Baulig  <martin@ximian.com>
5264
5265         * decl.cs (MemberCache.FindMemberToOverride): Use
5266         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
5267
5268 2004-03-29  Martin Baulig  <martin@ximian.com>
5269
5270         * generic.cs (GenericMethod.Define): Resolve our type parameters.
5271
5272 2004-03-29  Martin Baulig  <martin@ximian.com>
5273
5274         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
5275         not allowed on non-generic declarations").
5276
5277 2004-03-29  Martin Baulig  <martin@ximian.com>
5278
5279         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5280         public version of this method.
5281
5282         * class.cs (MethodCore.IsDuplicateImplementation): Use
5283         Invocation.InferTypeArguments() to check this.
5284
5285 2004-03-29  Martin Baulig  <martin@ximian.com>
5286
5287         * convert.cs: Use TypeManager.IsDelegateType() instead of
5288         comparing types correctly.
5289
5290 2004-03-29  Martin Baulig  <martin@ximian.com>
5291
5292         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
5293         types directly to make it work for generic instances.
5294
5295         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
5296
5297 2004-03-29  Martin Baulig  <martin@ximian.com>
5298
5299         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
5300         support for arrays.     
5301
5302 2004-03-24  Martin Baulig  <martin@ximian.com>
5303
5304         * decl.cs (DeclSpace.FindType): Also use
5305         TypeManager.CheckGeneric() for types from the using clauses.
5306
5307 2004-03-23  Martin Baulig  <martin@ximian.com>
5308
5309         * expression.cs (Invocation.OverloadResolve): Added `bool
5310         may_fail' argument and use it instead of the Location.IsNull() hack.
5311
5312 2004-03-23  Martin Baulig  <martin@ximian.com>
5313
5314         * expression.cs (Invocation.InferType): Use correct type inference
5315         rules here.     
5316
5317 2004-03-23  Martin Baulig  <martin@ximian.com>
5318
5319         * ecore.cs (MethodGroupExpr.Name): Use
5320         TypeManager.CSharpSignature() instead of just the name.
5321
5322         * expression.cs (Invocation.OverloadResolve): Provide better error
5323         reporting.
5324         (Invocation.DoResolve): OverloadResolve() never returns null
5325         without reporting an error, so removed the error -6 reporting here.
5326
5327 2004-03-23  Martin Baulig  <martin@ximian.com>
5328
5329         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
5330         generic methods.
5331
5332         * cs-parser.jay (delegate_declaration): Support generic delegates.
5333
5334         * delegate.cs: Support generic delegates.
5335
5336 2004-03-22  Martin Baulig  <martin@ximian.com>
5337
5338         * expression.cs (Invocation.InferParamsTypeArguments): New static
5339         method; does type inference for params arguments.
5340
5341 2004-03-21  Martin Baulig  <martin@ximian.com>
5342
5343         * typemanager.cs (TypeManager.IsGenericMethod): New public static
5344         method; checks whether a method is a generic method.    
5345
5346         * expression.cs (Invocation.InferTypeArguments): New static method;
5347         infer type arguments for generic method invocation.
5348
5349         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
5350         property; we set this to true if we're resolving a generic method
5351         invocation and the user specified type arguments, ie. we're not
5352         doing type inference.
5353
5354 2004-03-20  Martin Baulig  <martin@ximian.com>
5355
5356         * class.cs (MethodData.DeclaringType): New public property.
5357         (MethodData.Define): Set DeclaringType here.
5358         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
5359         instead of OperatorMethodBuilder.DeclaringType.
5360
5361 2004-03-20  Martin Baulig  <martin@ximian.com>
5362
5363         * cs-tokenizer.cs (xtoken): Return a special
5364         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
5365
5366         * cs-parser.jay (default_value_expression): Switch to the new
5367         syntax (14.5.13).
5368
5369 2004-03-19  Martin Baulig  <martin@ximian.com>
5370
5371         * decl.cs (MemberName): New class.  We use this to "construct"
5372         namespace_or_type_name's.
5373
5374         * generics.cs (TypeArguments.GetDeclarations): New public method;
5375         returns the type arguments as a string[] and reports a CS0081 if
5376         one of them is not an identifier.
5377
5378         * class.cs (MemberBase): The .ctor now takes the name as a
5379         MemberName instead of a string.
5380         (MemberBase.ExplicitInterfaceName): Changed type from string to
5381         Expression.
5382         (MemberBase.DoDefine): If we're an explicit implementation, the
5383         InterfaceType may be a generic instance.
5384
5385         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
5386         (namespace_name): Call MemberName.GetName () to transform the
5387         MemberName into a string and ensure we don't have any type
5388         arguments.
5389         (type_name): Call MemberName.GetTypeExpression() to transfrom the
5390         MemberName into an expression.
5391         (method_header): Use namespace_or_type_name instead of member_name.     
5392
5393 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5394
5395         * rootcontext.cs: Add new types to the boot resolution.
5396
5397         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5398         MulticastDelegate is not allowed.
5399
5400         * typemanager.cs: Add new types to lookup: System.TypedReference
5401         and ArgIterator.
5402
5403         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5404         check for TypedReference or ArgIterator, they are not allowed. 
5405
5406         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5407         makes us properly catch 1510 in some conditions (see bug 56016 for
5408         details). 
5409
5410 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5411
5412         * CryptoConvert.cs: update from corlib version
5413         with endian fixes.
5414
5415 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5416
5417         * class.cs (Indexer.Define): Check indexername declaration
5418
5419 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5420
5421         * attribute.cs (IsClsCompliant): Fixed problem with handling
5422         all three states (compliant, not-compliant, undetected).
5423
5424 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5425
5426         * attribute.cs (Attribute): Location is now public.
5427         (Resolve): Store resolved arguments (pos_values) in attribute class.
5428         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5429         (GetClsCompliantAttributeValue): New method that gets
5430         CLSCompliantAttribute value.
5431         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5432         if exists else null.
5433         (AttributeTester): New class for CLS-Compliant verification routines.
5434
5435         * class.cs (Emit): Add CLS-Compliant verification.
5436         (Method.GetSignatureForError): Implemented.
5437         (Constructor.GetSignatureForError): Implemented
5438         (Constructor.HasCompliantArgs): Returns if constructor has
5439         CLS-Compliant arguments.
5440         (Constructor.Emit): Override.
5441         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5442         is needed to test only parameters.
5443         (FieldBase.GetSignatureForError): Implemented.
5444         (TypeContainer): New member for storing base interfaces.
5445         (TypeContainer.FindMembers): Search in base interfaces too.
5446
5447         * codegen.cs (GetClsComplianceAttribute): New method that gets
5448         assembly or module CLSCompliantAttribute value.
5449         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5450         for assembly.
5451         (ModuleClass.Emit): Add error 3012 test.
5452
5453         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5454
5455         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5456         state for all decl types.
5457         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5458         if CLS-Compliant tests are required.
5459         (IsClsCompliaceRequired): New method. Analyze whether code
5460         must be CLS-Compliant.
5461         (IsExposedFromAssembly): New method. Returns true when MemberCore
5462         is exposed from assembly.
5463         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5464         value or gets cached value.
5465         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5466         is explicitly marked with CLSCompliantAttribute.
5467         (IsIdentifierClsCompliant): New abstract method. This method is
5468         used to testing error 3005.
5469         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5470         for identifier and parameters CLS-Compliant testing.
5471         (VerifyClsCompliance): New method. The main virtual method for
5472         CLS-Compliant verifications.
5473         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5474         null. I don't know why is null (too many public members !).
5475         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5476         and get value of first CLSCompliantAttribute that found.
5477
5478         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5479         (VerifyClsCompliance): Override and add extra tests.
5480
5481         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5482         clscheck- disable CLS-Compliant verification event if assembly is has
5483         CLSCompliantAttribute(true).
5484
5485         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5486         ApllyAttribute is now called in emit section as in the other cases.
5487         Possible future Emit integration.
5488         (IsIdentifierClsCompliant): New override.
5489         (VerifyClsCompliance): New override.
5490         (GetEnumeratorName): Returns full enum name.
5491
5492         * parameter.cs (GetSignatureForError): Implemented.
5493
5494         * report.cs (WarningData): New struct for Warning message information.
5495         (LocationOfPreviousError): New method.
5496         (Warning): New method. Reports warning based on the warning table.
5497         (Error_T): New method. Reports error based on the error table.
5498
5499         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5500         verifications are done here.
5501
5502         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5503
5504         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5505         CLSCompliantAttribute.
5506         (all_imported_types): New member holds all imported types from other
5507         assemblies.
5508         (LoadAllImportedTypes): New method fills static table with exported types
5509         from all referenced assemblies.
5510         (Modules): New property returns all assembly modules.
5511
5512 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5513
5514         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5515         throwing a parser error.
5516
5517         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5518         which removes the hardcoded get_/set_ prefixes for properties, as
5519         IL allows for the properties to be named something else.  
5520
5521         Bug #56013
5522
5523         * expression.cs: Do not override operand before we know if it is
5524         non-null.  Fix 56207
5525
5526 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5527
5528         * typemanager.cs: support for pinned variables.
5529
5530 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5531
5532         * decl.cs, typemanager.cs: Avoid using an arraylist
5533         as a buffer if there is only one result set.
5534
5535 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5536
5537         * expression.cs: Make sure you cant call a static method
5538         with an instance expression, bug #56174.
5539
5540 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5541
5542         * class.cs (IsDuplicateImplementation): Improve error reporting to
5543         flag 663 (method only differs in parameter modifier).
5544
5545         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5546         in preprocessor directives.
5547
5548         * location.cs (LookupFile): Allow for the empty path.
5549
5550         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5551         better approach for some of that patch, but its failing with the
5552         CharSet enumeration.  For now try/catch will do.
5553
5554         * typemanager.cs: Do not crash if a struct does not have fields.
5555         Fixes 56150.
5556
5557 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5558
5559         * expression.cs: cs0213, cant fix a fixed expression.
5560         fixes 50231.
5561
5562 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5563
5564         * cs-parser.jay: detect invalid embeded statements gracefully.
5565         bug #51113.
5566
5567 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5568
5569         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5570         As a regex:
5571         s/
5572         the invocation type may not be a subclass of the tye of the item/
5573         The type of the item must be a subclass of the invocation item.
5574         /g
5575
5576         Fixes bug #50820.
5577
5578 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5579
5580         * attribute.cs: Added methods to get a string and a bool from an
5581         attribute. Required to information from AssemblyKeyFileAttribute,
5582         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5583         * codegen.cs: Modified AssemblyName creation to include support for
5584         strongnames. Catch additional exceptions to report them as CS1548.
5585         * compiler.csproj: Updated include CryptoConvert.cs.
5586         * compiler.csproj.user: Removed file - user specific configuration.
5587         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5588         Mono.Security assembly. The original class is maintained and tested in
5589         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5590         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5591         like CSC 8.0 (C# v2) supports.
5592         * Makefile: Added CryptoConvert.cs to mcs sources.
5593         * rootcontext.cs: Added new options for strongnames.
5594
5595 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5596
5597         * driver.cs: For --expect-error, report error code `2'
5598         if the program compiled with no errors, error code `1' if
5599         it compiled with an error other than the one expected.
5600
5601 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5602
5603         * compiler.csproj: Updated for Visual Studio .NET 2003.
5604         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5605         * compiler.sln: Updated for Visual Studio .NET 2003.
5606
5607 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5608
5609         * expression.cs: Fix bug #47234. We basically need to apply the
5610         rule that we prefer the conversion of null to a reference type
5611         when faced with a conversion to 'object' (csc behaviour).
5612
5613 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5614
5615         * statement.cs: Shorter form for foreach, eliminates
5616         a local variable. r=Martin.
5617
5618 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5619
5620         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5621         checks if we can use brtrue/brfalse to test for 0.
5622         * expression.cs: use the above in the test for using brtrue/brfalse.
5623         cleanup code a bit.
5624
5625 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5626
5627         * expression.cs: Rewrite string concat stuff. Benefits:
5628
5629         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5630         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5631         rather than a concat chain.
5632
5633         * typemanager.cs: Add lookups for more concat overloads.
5634
5635 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5636
5637         * expression.cs: Emit shorter il code for array init.
5638
5639         newarr
5640         dup
5641         // set 1
5642
5643         // set 2
5644
5645         newarr
5646         stloc.x
5647
5648         ldloc.x
5649         // set 1
5650
5651         ldloc.x
5652         // set 2
5653
5654 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5655
5656         * statement.cs: Before, two switch blocks would be merged if the
5657         total size of the blocks (end_item - begin_item + 1) was less than
5658         two times the combined sizes of the blocks.
5659
5660         Now, it will only merge if after the merge at least half of the
5661         slots are filled.
5662
5663         fixes 55885.
5664
5665 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5666
5667         * class.cs : csc build fix for GetMethods(). See bug #52503.
5668
5669 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5670
5671         * expression.cs: Make sure fp comparisons work with NaN.
5672         This fixes bug #54303. Mig approved this patch a long
5673         time ago, but we were not able to test b/c the runtime
5674         had a related bug.
5675
5676 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5677
5678         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5679
5680 2004-03-19  Martin Baulig  <martin@ximian.com>
5681
5682         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5683         two overloads may unify for some type parameter substitutions and
5684         report a CS0408 if appropriate.
5685
5686 2004-03-19  Martin Baulig  <martin@ximian.com>
5687
5688         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5689         error here and not in our caller.
5690
5691 2004-03-19  Martin Baulig  <martin@ximian.com>
5692
5693         * interface.cs: Completely killed this file.
5694         (Interface): We're now a TypeContainer and live in class.cs.
5695
5696         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5697         argument; we're now also called for interfaces.
5698         (TypeContainer.DefineMembers): Allow this method being called
5699         multiple times.
5700         (TypeContainer.GetMethods): New public method; formerly known as
5701         Interface.GetMethod().  This is used by PendingImplementation.
5702         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5703         it's now private and non-static.
5704         (Interface): Moved this here; it's now implemented similar to
5705         Class and Struct.
5706         (Method, Property, Event, Indexer): Added `bool is_interface'
5707         argument to their .ctor's.
5708         (MemberBase.IsInterface): New public field.
5709
5710         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5711         instances instead of InterfaceMethod, InterfaceProperty, etc.
5712         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5713         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5714
5715 2004-03-19  Martin Baulig  <martin@ximian.com>
5716
5717         * class.cs (MethodCore.IsDuplicateImplementation): New private
5718         method which does the CS0111 checking.
5719         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5720         Use IsDuplicateImplementation().
5721
5722 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5723
5724         * decl.cs (FindMemberToOverride): New method to find the correct
5725         method or property to override in the base class.
5726         * class.cs
5727             - Make Method/Property use the above method to find the
5728               version in the base class.
5729             - Remove the InheritableMemberSignatureCompare as it is now
5730               dead code.
5731
5732         This patch makes large code bases much faster to compile, as it is
5733         O(n) rather than O(n^2) to do this validation.
5734
5735         Also, it fixes bug 52458 which is that nested classes are not
5736         taken into account when finding the base class member.
5737
5738         Reviewed/Approved by Martin.
5739
5740 2004-03-17  Martin Baulig  <martin@ximian.com>
5741
5742         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5743         of type arguments into account; use the `real_num_type_args'
5744         approach like in DoResolveAsTypeStep().
5745
5746         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5747         nested types.
5748
5749 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5750
5751         * interface.cs: In all interface classes removed redundant
5752         member initialization.
5753
5754 2004-03-16  Martin Baulig  <martin@ximian.com>
5755
5756         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5757
5758 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5759
5760         * decl.cs (DefineTypeAndParents): New helper method to define a
5761         type's containers before the type itself is defined;  This is a
5762         bug exposed by the recent changes to Windows.Forms when an
5763         implemented interface was defined inside a class that had not been
5764         built yet.   
5765
5766         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5767
5768         (Check): Loop correctly to report errors modifiers
5769         (UNSAFE was not in the loop, since it was the same as TOP).
5770
5771         * interface.cs: Every interface member now takes a ModFlags,
5772         instead of a "is_new" bool, which we set on the base MemberCore. 
5773
5774         Every place where we called "UnsafeOk" in the interface, now we
5775         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5776         the unsafe settings from the member declaration instead of the
5777         container interface. 
5778
5779         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5780
5781         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5782         `set_indexer_name' to the pending bits (one per type).
5783
5784         We fixed a bug today that was picking the wrong method to
5785         override, since for properties the existing InterfaceMethod code
5786         basically ignored the method name.  Now we make sure that the
5787         method name is one of the valid indexer names.
5788
5789 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5790  
5791         * support.cs (SeekableStreamReader): Keep track of stream byte
5792         positions and don't mix them with character offsets to the buffer.
5793
5794         Patch from Gustavo Giráldez
5795
5796 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5797
5798         * interface.cs (InterfaceSetGetBase): Removed double member
5799         initialization, base class does it as well.
5800
5801 2004-03-13  Martin Baulig  <martin@ximian.com>
5802
5803         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5804         when compiling corlib.
5805
5806 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5807
5808         * convert.cs (ExplicitConversion): We were reporting an error on
5809         certain conversions (object_type source to a value type, when the
5810         expression was `null') before we had a chance to pass it through
5811         the user defined conversions.
5812
5813         * driver.cs: Replace / and \ in resource specifications to dots.
5814         Fixes 50752
5815
5816         * class.cs: Add check for duplicate operators.  Fixes 52477
5817
5818 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5819
5820         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5821         that are in the middle of the statements, not only at the end.
5822         Fixes #54987
5823
5824         * class.cs (TypeContainer.AddField): No longer set the
5825         `HaveStaticConstructor' flag, now we call it
5826         `UserDefineStaticConstructor' to diferentiate the slightly
5827         semantic difference.
5828
5829         The situation is that we were not adding BeforeFieldInit (from
5830         Modifiers.TypeAttr) to classes that could have it.
5831         BeforeFieldInit should be set to classes that have no static
5832         constructor. 
5833
5834         See:
5835
5836         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5837
5838         And most importantly Zoltan's comment:
5839
5840         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5841
5842         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5843          before its static fields are used', i.e. initialization does not need
5844          to be triggered by the first access to the type. Setting this flag
5845          helps the JIT to compile better code, since it can run the static
5846          constructor at JIT time, and does not need to generate code to call it
5847          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5848          this flag for lots of classes like String. 
5849          
5850          csc sets this flag if the type does not have an explicit static 
5851          constructor. The reasoning seems to be that if there are only static
5852          initalizers for a type, and no static constructor, then the programmer
5853          does not care when this initialization happens, so beforefieldinit
5854          can be used.
5855          
5856          This bug prevents the AOT compiler from being usable, since it 
5857          generates so many calls to mono_runtime_class_init that the AOT code
5858          is much slower than the JITted code. The JITted code is faster, 
5859          because it does not generate these calls if the vtable is type is
5860          already initialized, which is true in the majority of cases. But the
5861          AOT compiler can't do this."
5862
5863 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5864
5865         * class.cs (MethodData.Emit): Refactor the code so symbolic
5866         information is generated for destructors;  For some reasons we
5867         were taking a code path that did not generate symbolic information
5868         before. 
5869
5870 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5871
5872         * class.cs: Create a Constructor.CheckBase method that
5873         takes care of all validation type code. The method
5874         contains some code that was moved from Define.
5875
5876         It also includes new code that checks for duplicate ctors.
5877         This fixes bug #55148.
5878
5879 2004-03-09  Joshua Tauberer <tauberer@for.net>
5880
5881         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5882         a { ... }-style array creation invokes EmitStaticInitializers
5883         which is not good for reference-type arrays.  String, decimal
5884         and now null constants (NullCast) are not counted toward
5885         static initializers.
5886
5887 2004-03-05  Martin Baulig  <martin@ximian.com>
5888
5889         * location.cs (SourceFile.HasLineDirective): New public field;
5890         specifies whether the file contains or is referenced by a "#line"
5891         directive.
5892         (Location.DefineSymbolDocuments): Ignore source files which
5893         either contain or are referenced by a "#line" directive.        
5894
5895 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5896
5897         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5898         direct access to our parent, so check the method inline there.
5899
5900 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5901
5902         * expression.cs (Invocation.EmitCall): Miguel's last commit
5903         caused a regression. If you had:
5904
5905             T t = null;
5906             t.Foo ();
5907
5908         In Foo the implict this would be null.
5909
5910 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5911
5912         * expression.cs (Invocation.EmitCall): If the method is not
5913         virtual, do not emit a CallVirt to it, use Call.
5914
5915         * typemanager.cs (GetFullNameSignature): Improve the method to
5916         cope with ".ctor" and replace it with the type name.
5917
5918         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5919         as an argument the ConstructorBuilder where it is being defined,
5920         to catch the recursive constructor invocations.
5921
5922 2004-03-16  Martin Baulig  <martin@ximian.com>
5923
5924         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5925         ConstructedType, call ResolveType() on it to get the type rather
5926         than just using `expr.Type'.
5927
5928 2004-03-16  Martin Baulig  <martin@ximian.com>
5929
5930         * generics.cs (ConstructedType.GetMemberAccess): Take the
5931         EmitContext instead on the TypeExpr and use
5932         ec.TypeContainer.CurrentType/ec.ContainerType.
5933
5934 2004-03-16  Martin Baulig  <martin@ximian.com>
5935
5936         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5937         parameters before aliases.
5938
5939 2004-03-16  Martin Baulig  <martin@ximian.com>
5940
5941         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5942         New oublic function; checks whether two generic instances may become
5943         equal under some instantiations (26.3.1).
5944
5945         * class.cs (TypeContainer.Define): Call
5946         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5947         error.
5948
5949 2004-03-16  Martin Baulig  <martin@ximian.com>
5950
5951         * class.cs (TypeContainer.GetClassBases): Moved
5952         Error_TypeParameterAsBase() here and also check whether the base
5953         class is not an attribute.
5954
5955 2004-03-16  Martin Baulig  <martin@ximian.com>
5956
5957         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5958
5959 2004-03-16  Martin Baulig  <martin@ximian.com>
5960
5961         * class.cs (Error_TypeParameterAsBase): Use correct error number
5962         here (CS0689).  
5963
5964 2004-03-16  Martin Baulig  <martin@ximian.com>
5965
5966         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5967         for generics.
5968
5969         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5970         error reporting.
5971
5972 2004-03-15  Martin Baulig  <martin@ximian.com>
5973
5974         * typemanager.cs (TypeManager.GetFullName): New public method.
5975         (TypeManager.MemberLookup): Added `int_num_type_arguments'
5976         argument; only return members with the correct number of type
5977         arguments.
5978         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
5979         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
5980         whether the number of type arguments matches.
5981
5982         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
5983         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
5984
5985         * expression.cs (MemberAccess): Added public `NumTypeArguments'
5986         field; it's set by the protected .ctor when we're actually a
5987         GenericMemberAccess.
5988         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
5989         arguments and pass it to MemberLookupFinal ().
5990
5991         * ecore.cs (Expression.MemberLookup): Added `int
5992         num_type_arguments' argument; only return members with the correct
5993         number of type arguments.
5994         (Expression.MemberLookupFailed): Check whether the MemberLookup
5995         failed because we did not have the correct number of type
5996         arguments; report CS0305 in this case.
5997
5998         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
5999         `e.ResolveAsTypeTerminal()' already did so.
6000
6001 2004-03-15  Martin Baulig  <martin@ximian.com>
6002
6003         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
6004         we're a ConstructedType; in this case, the caller must report an
6005         error (for instance CS0131).
6006
6007         * generic.cs (TypeArguments): Added Location argument to the .ctor.
6008         (TypeArguments.Resolve): Actually report errors here.
6009
6010 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
6011
6012         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
6013         `set_indexer_name' to the pending bits (one per type).
6014
6015         We fixed a bug today that was picking the wrong method to
6016         override, since for properties the existing InterfaceMethod code
6017         basically ignored the method name.  Now we make sure that the
6018         method name is one of the valid indexer names.
6019
6020 2004-03-15  Martin Baulig  <martin@ximian.com>
6021
6022         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
6023         for generic instances.
6024
6025 2004-03-13  Martin Baulig  <martin@ximian.com>
6026
6027         * class.cs (TypeContainer.DefineType): Call
6028         TypeManager.AddUserType() immediately after creating the
6029         TypeBuilder; pass all type parameters when creating the
6030         CurrentType.
6031
6032         * decl.cs (DeclSpace.FindNestedType): New public method.
6033         (DeclSpace.FindType): Added `int num_type_args' argument; only
6034         return types with the correct number of type parameters.
6035         (DeclSpace.CountTypeParams): New public property.
6036
6037         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
6038         the number of type parameters; defaults to zero.
6039
6040         * generic.cs (TypeArguments.Count): New public property.
6041         (ConstructedType.DoResolveAsTypeStep): First call
6042         ds.FindNestedType() to find out whether we're nested in the
6043         current generic type; in this case, we inherit all type parameters
6044         from the current class.
6045
6046         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
6047         num_type_args' argument.
6048         (RootContext.LookupType): Added overloaded version which takes the
6049         number of type arguments; only return types with the correct
6050         number of type arguments.
6051
6052         * typemanager.cs (TypeManager.CheckGeneric): New public function;
6053         checks whether `Type t' has `int num_type_args'.
6054
6055 2004-03-13  Martin Baulig  <martin@ximian.com>
6056
6057         * generic.cs (GenericMethod.DefineType): New method; calls
6058         DefineType() on all the type parameters.
6059
6060         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
6061         (MethodData.Define): If we're a generic method, call
6062         GenericMethod.DefineType() to define the type parameters.       
6063
6064 2004-03-10  Martin Baulig  <martin@ximian.com>
6065
6066         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
6067         instead of IsAssignableFrom.    
6068
6069 2004-03-10  Martin Baulig  <martin@ximian.com>
6070
6071         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
6072
6073         * support.cs (ParameterData.HasArrayParameter): New property.
6074         (ReflectionParameters.ctor): Take a MethodBase instead of a
6075         ParameterInfo[].  If we have any type parameters, get the generic
6076         method definition and ask it whether we have variable arguments.
6077
6078 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
6079
6080         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
6081         routines to check if a type is an enumerable/enumerator allow
6082         classes that implement the IEnumerable or IEnumerator interfaces.
6083
6084         * class.cs (Property, Operator): Implement IIteratorContainer, and
6085         implement SetYields.
6086
6087         (Property.Define): Do the block swapping for get_methods in the
6088         context of iterators.   We need to check if Properties also
6089         include indexers or not.
6090
6091         (Operator): Assign the Block before invoking the
6092         OperatorMethod.Define, so we can trigger the Iterator code
6093         replacement. 
6094
6095         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
6096         Property and Operator classes are not created when we parse the
6097         declarator but until we have the block completed, so we use a
6098         singleton SimpleIteratorContainer.Simple to flag whether the
6099         SetYields has been invoked.
6100
6101         We propagate this setting then to the Property or the Operator to
6102         allow the `yield' to function.
6103
6104 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
6105
6106         * codegen.cs: Implemented attribute support for modules.
6107         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
6108         Assembly/Module functionality.
6109
6110         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
6111         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
6112         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
6113
6114 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
6115
6116         * interface.cs (FindMembers): The operation is performed on all base
6117         interfaces and not only on the first. It is required for future CLS Compliance patch.
6118
6119 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6120
6121         * statement.cs, codegen.cs:
6122         This patch deals with patterns such as:
6123
6124         public class List : IEnumerable {
6125
6126                 public MyEnumerator GetEnumerator () {
6127                         return new MyEnumerator(this);
6128                 }
6129
6130                 IEnumerator IEnumerable.GetEnumerator () {
6131                         ...
6132                 }
6133                 
6134                 public struct MyEnumerator : IEnumerator {
6135                         ...
6136                 }
6137         }
6138
6139         Before, there were a few things we did wrong:
6140         1) we would emit callvirt on a struct, which is illegal
6141         2) we emited ldarg when we needed to emit ldarga
6142         3) we would mistakenly call the interface methods on an enumerator
6143         type that derived from IEnumerator and was in another assembly. For example:
6144
6145         public class MyEnumerator : IEnumerator
6146
6147         Would have the interface methods called, even if there were public impls of the
6148         method. In a struct, this lead to invalid IL code.
6149
6150 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
6151
6152         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
6153           renamed to Emit.
6154
6155         * delegate.cs (Define): Fixed crash when delegate type is undefined.
6156
6157 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
6158
6159         * cs-parser.jay: Fix small regression: we were not testing V2
6160         compiler features correctly.
6161
6162         * interface.cs: If the emit context is null, then create one
6163
6164 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6165
6166         * decl.cs (GetSignatureForError): New virtual method to get full name
6167           for error messages.
6168
6169         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6170           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6171
6172         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6173           Duplicated members and code in these classes has been removed.
6174           Better encapsulation in these classes.
6175
6176 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
6177
6178         * assign.cs (Assign.DoResolve): When dealing with compound
6179         assignments, there is a new rule in ECMA C# 2.4 (might have been
6180         there before, but it is documented here) that states that in:
6181
6182         a op= b;
6183
6184         If b is of type int, and the `op' is a shift-operator, then the
6185         above is evaluated as:
6186
6187         a = (int) a op b 
6188
6189         * expression.cs (Binary.ResolveOperator): Instead of testing for
6190         int/uint/long/ulong, try to implicitly convert to any of those
6191         types and use that in pointer arithmetic.
6192
6193         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6194         method to print information for from the type, not from the
6195         null-method we were given.
6196
6197 2004-02-01  Duncan Mak  <duncan@ximian.com>
6198
6199         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6200         parsing for cmd, fixes bug #53694.
6201
6202 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6203
6204         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6205         in the member name duplication tests. Property and operator name duplication
6206         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6207
6208 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6209
6210         * interface.cs (PopulateMethod): Fixed crash when interface method
6211         returns not existing type (error test cs0246-3.cs).
6212
6213 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6214
6215         * cs-parser.jay (interface_accessors): Re-write actions to also
6216         store attributes attached to get and set methods. Fix spelling
6217         while at it.
6218
6219         (inteface_property_declaration): Modify accordingly.
6220
6221         (InterfaceAccessorInfo): New helper class to store information to pass
6222         around between rules that use interface_accessors.
6223
6224         * interface.cs (Emit): Apply attributes on the get and set
6225         accessors of properties and indexers too.
6226
6227         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6228         right MethodBuilder when applying attributes to the get and set accessors.
6229
6230 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6231
6232         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6233
6234 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6235
6236         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6237
6238 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6239
6240         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6241         changes that treat `yield' specially when present before `break'
6242         or `return' tokens.
6243
6244         * cs-tokenizer.cs: yield is no longer a keyword.
6245
6246 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6247
6248         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6249         setting for default constructors.
6250         For default constructors are almost every time set wrong Modifier. The
6251         generated IL code has been alright. But inside mcs this values was
6252         wrong and this was reason why several of my CLS Compliance tests
6253         failed.
6254
6255 2004-02-27  Martin Baulig  <martin@ximian.com>
6256
6257         * generics.cs (ConstructedType.ResolveType): Make the nested type
6258         stuff actually work.
6259
6260 2004-02-25  Martin Baulig  <martin@ximian.com>
6261
6262         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
6263         property; returns the type parameters just from the current type,
6264         ie. with the ones from outer classes.
6265         (DeclSpace.LookupGeneric): First search in the current class, then
6266         in outer classes.
6267         (DeclSpace.initialize_type_params): When hiding a type parameter
6268         from an outer class, put it into the `type_param_list' anyways.
6269
6270         * expression.cs (MemberAccess.expr): Made this field protected.
6271
6272         * class.cs (TypeContainer.Define): The `CurrentType' just contains
6273         the type parameters from the current class.
6274
6275         * generic.cs (ConstructedType.ResolveType): Support nested generic
6276         types by taking the type parameters which we inherit from outer
6277         classes into account.
6278         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
6279         support for nested generic types.
6280
6281 2004-02-23  Martin Baulig  <martin@ximian.com>
6282
6283         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
6284         field and check whether we're nested inside a generic type.
6285         (DeclSpace.ResolveType): If we're resolving to a generic type
6286         definition, create a ConstructedType and return its resolved type.
6287         (DeclSpace.initialize_type_params): New private method;
6288         initializes the `type_param_list' field from the type parameters
6289         from this and all enclosing classes.
6290         (DeclSpace.TypeParameters): Call initialize_type_params() unless
6291         we're already initialized.
6292
6293 2004-02-23  Martin Baulig  <martin@ximian.com>
6294
6295         * class.cs (Method.Define): Create the generic method before
6296         calling DoDefine().
6297         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
6298         the TypeContainer one); we use this for generic methods.
6299
6300         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
6301         parent's TypeBuilder.
6302
6303 2004-02-18  Martin Baulig  <martin@ximian.com>
6304
6305         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
6306         to check for equality.
6307
6308 2004-02-05  Martin Baulig  <martin@ximian.com>
6309
6310         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
6311         `ec.TypeContainer.CurrentType', use it instead of
6312         `ec.ContainerType' to check whether we're in the type's ctor.
6313
6314 2004-01-29  Martin Baulig  <martin@ximian.com>
6315
6316         * expression.cs (Invocation.DoResolve): If we're a
6317         `ConstructedType', then we're actually a generic method, so
6318         rewrite the expr as a GenericMemberAccess.
6319
6320         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
6321         here; manually parse it into a string.
6322
6323 2004-01-28  Martin Baulig  <martin@ximian.com>
6324
6325         * typemanager.cs (TypeManager.IsEqual): New static method.
6326         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
6327         check for equality instead of using `=='.
6328
6329 2004-01-26  Martin Baulig  <martin@ximian.com>
6330
6331         * decl.cs (DeclSpace.CurrentType): New public field.
6332
6333         * expression.cs (This.ResolveBase): If we have an
6334         `ec.TypeContainer.CurrentType', use it instead of
6335         `ec.ContainerType'.
6336
6337         * class.cs (TypeContainer.DefineType): If we're a generic type,
6338         create the `CurrentType' (unresolved).
6339         (TypeContainer.GenericType): New private field.
6340         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
6341         it and store it in `GenericType' before creating the MemberCache.
6342         (TypeContainer.GetMembers): If we have a `GenericType', call
6343         TypeManager.FindMembers() on it.
6344
6345         * interface.cs (Interface.GenericType): New private field.
6346         (Interface.DefineType): If we're a generic type, create the
6347         `CurrentType' (unresolved).
6348         (Interface.DefineMembers): If we have a `CurrentType', resolve it
6349         and store it in `GenericType' before creating the MemberCache.
6350         (Interface.GetMembers): If we have a `GenericType', call
6351         TypeManager.FindMembers() on it.
6352
6353 2004-01-22  Martin Baulig  <martin@ximian.com>
6354
6355         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6356         not a QualifiedIdentifier.  This is what `type_name_expression'
6357         was previously doing.
6358         (type_name_expression): Removed; the code is now in
6359         `namespace_or_type_name'.
6360         (qualified_identifier): Removed, use `namespace_or_type_name'
6361         instead.
6362         (QualifiedIdentifier): Removed this class.      
6363
6364 2004-01-22  Martin Baulig  <martin@ximian.com>
6365
6366         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6367         not a string as alias name.
6368
6369 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6370
6371         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6372         #52730 bug, and instead compute correctly the need to use a
6373         temporary variable when requesting an address based on the
6374         static/instace modified of the field and the constructor.
6375  
6376 2004-01-21  Martin Baulig  <martin@ximian.com>
6377
6378         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6379         class and namespace before looking up aliases.  Fixes #52517.
6380
6381 2004-01-21  Martin Baulig  <martin@ximian.com>
6382
6383         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6384         assinged in a 'try'; fixes exception4.cs.
6385
6386 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6387         * class.cs : Implemented parameter-less constructor for TypeContainer
6388
6389         * decl.cs: Attributes are now stored here. New property OptAttributes
6390
6391         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6392
6393         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6394
6395 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6396
6397         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6398           (CSharpSignature): New method for indexer and property signature.
6399
6400 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6401
6402         * pending.cs (IsVirtualFilter): Faster implementation.
6403
6404 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6405
6406         * typemanager.cs: Avoid inclusion of same assembly more than once.
6407
6408 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6409
6410         * cs-parser.jay: Fixed problem where the last assembly attribute
6411           has been applied also to following declaration (class, struct, etc.)
6412           
6413 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6414
6415         * class.cs: Added error CS0538, CS0539 reporting.
6416         Fixed crash on Microsoft runtime when field type is void.
6417
6418         * cs-parser.jay: Added error CS0537 reporting.
6419
6420         * pending.cs: Added error CS0535 reporting.
6421         Improved error report for errors CS0536, CS0534.
6422
6423 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6424
6425         Merge a few bits from the Anonymous Method MCS tree.
6426
6427         * statement.cs (ToplevelBlock): New class for toplevel methods,
6428         will hold anonymous methods, lifted variables.
6429
6430         * cs-parser.jay: Create toplevel blocks for delegates and for
6431         regular blocks of code. 
6432
6433 2004-01-20  Martin Baulig  <martin@ximian.com>
6434
6435         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6436         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6437         and `NeedExplicitReturn'; added `IsLastStatement'.
6438         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6439         have a `ReturnLabel' or we're not unreachable.
6440
6441         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6442         child's reachability; don't just override ours with it.  Fixes
6443         #58058 (lluis's example).
6444         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6445         InFinally(), InLoop(), InSwitch() and
6446         BreakCrossesTryCatchBoundary() methods.
6447
6448         * statement.cs (Return): Do all error checking in Resolve().
6449         Unless we are the last statement in a top-level block, always
6450         create a return label and jump to it.
6451         (Break, Continue): Do all error checking in Resolve(); also make
6452         sure we aren't leaving a `finally'.
6453         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6454         statement in a top-level block.
6455         (Block.Flags): Added `IsDestructor'.
6456         (Block.IsDestructor): New public property.
6457
6458 2004-01-20  Martin Baulig  <martin@ximian.com>
6459
6460         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6461
6462 2004-01-20  Martin Baulig  <martin@ximian.com>
6463
6464         * statement.cs (Statement.ResolveUnreachable): New public method.
6465         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6466         (Block.Resolve): Resolve unreachable statements.
6467
6468 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6469
6470         * expression.cs: We need to fix the case where we do
6471         not have a temp variable here.
6472
6473         * assign.cs: Only expression compound assignments need
6474         temporary variables.
6475
6476 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6477
6478         * flowanalysis.cs: Reduce memory allocation in a few ways:
6479           - A block with no variables should not allocate a bit
6480             vector for itself.
6481           - A method with no out parameters does not need any tracking
6482             for assignment of the parameters, so we need not allocate
6483             any data for it.
6484           - The arrays:
6485                 public readonly Type[] VariableTypes;
6486                 public readonly string[] VariableNames;
6487             Are redundant. The data is already stored in the variable
6488             map, so we need not allocate another array for it.
6489           - We need to add alot of checks for if (params | locals) == null
6490             due to the first two changes.
6491
6492 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6493
6494         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6495         implement IMemoryLocation, we store a copy on a local variable and
6496         take the address of it.  Patch from Benjamin Jemlich
6497
6498         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6499         to use a special "type_name_expression" rule which reduces the
6500         number of "QualifiedIdentifier" classes created, and instead
6501         directly creates MemberAccess expressions.
6502
6503 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6504
6505         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6506         that fixes #52853.  Null literal assignment to ValueType
6507
6508         * class.cs (MethodData.Emit): Instead of checking the name of the
6509         method to determine if its a destructor, create a new derived
6510         class from Method called Destructor, and test for that.  
6511
6512         * cs-parser.jay: Create a Destructor object instead of a Method.  
6513
6514         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6515
6516         Fixes: 52933
6517
6518 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6519
6520         * expression.cs (Binary.ResolveOperator): Perform an implicit
6521         conversion from MethodGroups to their delegate types on the
6522         Addition operation.
6523
6524         * delegate.cs: Introduce a new class DelegateCreation that is the
6525         base class for `NewDelegate' and `ImplicitDelegateCreation',
6526         factor some code in here.
6527
6528         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6529         conversion from MethodGroups to compatible delegate types. 
6530
6531         * ecore.cs (Expression.Resolve): Do not flag error 654
6532         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6533         we allow conversions from MethodGroups to delegate types now.
6534
6535         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6536         assignments in v2 either.
6537
6538 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6539
6540         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6541         static read-only fields in ctors.
6542
6543         Applied patch from Benjamin Jemlich 
6544
6545         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6546
6547 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6548
6549         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6550         here to return true, as they can be used like this:
6551
6552                 (XXX) int.MEMBER ()
6553
6554         Fixed 49836 and all the other dups
6555
6556 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6557
6558         * driver.cs: Implement /win32res and /win32icon.
6559
6560 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6561
6562         * cs-parser.jay: Add a rule to improve error handling for the
6563         common mistake of placing modifiers after the type.
6564
6565 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6566
6567         * cs-parser.jay (interface_event_declaration): Catch
6568         initialization of events on interfaces, and report cs0068
6569
6570         * cs-parser.jay (interface_event_declaration): Catch
6571         initialization of events. 
6572
6573         * ecore.cs: Better report missing constructors.
6574
6575         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6576         the error reporting done in the wrong place.  Fix.
6577
6578         * expression.cs (Binary.ResolveOperator): Catch the 
6579         operator + (E x, E y) error earlier, and later allow for implicit
6580         conversions in operator +/- (E e, U x) from U to the underlying
6581         type of E.
6582
6583         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6584         52596, if the container class is abstract, the default constructor
6585         is protected otherwise its public (before, we were always public).
6586
6587         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6588         fixed statement.
6589
6590         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6591         Jemlich that fixes bug #52597, MCS was generating invalid code for
6592         idisposable structs.   Thanks to Ben for following up with this
6593         bug as well.
6594
6595 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6596
6597         * driver.cs: Allow assemblies without code to be generated, fixes
6598         52230.
6599
6600 2004-01-07  Nick Drochak <ndrochak@gol.com>
6601
6602         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6603
6604 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6605
6606         * cs-parser.jay: Add rules to improve error reporting if fields or
6607         methods are declared at the namespace level (error 116)
6608
6609         * Add rules to catch event add/remove
6610
6611 2004-01-04  David Sheldon <dave-mono@earth.li>
6612
6613   * expression.cs: Added matching ")" to error message for 
6614   CS0077
6615
6616 2004-01-03 Todd Berman <tberman@gentoo.org>
6617
6618         * ecore.cs, attribute.cs:
6619         Applying fix from #52429.
6620
6621 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6622
6623         * ecore.cs, expression.cs, statement.cs:
6624         Total rewrite of how we handle branching. We
6625         now handle complex boolean expressions with fewer
6626         jumps. As well if (x == 0) no longer emits a ceq.
6627
6628         if (x is Foo) is much faster now, because we generate
6629         better code.
6630
6631         Overall, we get a pretty big improvement on our benchmark
6632         tests. The code we generate is smaller and more readable.
6633
6634         I did a full two-stage bootstrap. The patch was reviewed
6635         by Martin and Miguel.
6636
6637 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6638
6639         * cs-parser.jay: Make primary_expression not take a QI.
6640         we dont need this because the member_access rule covers
6641         us here. So we replace the rule with just IDENTIFIER.
6642
6643         This has two good effects. First, we remove a s/r conflict.
6644         Second, we allocate many fewer QualifiedIdentifier objects.
6645
6646 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6647
6648         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6649         set the correct information via SRE. This prevents
6650         hanging on the MS runtime. Fixes #29374.
6651
6652 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6653
6654         * convert.cs: correctly handle conversions to value types
6655         from Enum and ValueType as unboxing conversions.
6656
6657         Fixes bug #52569. Patch by Benjamin Jemlich.
6658
6659 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6660
6661         * expression.cs (BetterConversion): Prefer int -> uint
6662         over int -> ulong (csc's behaviour). This fixed bug #52046.
6663
6664 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6665
6666         * decl.cs (MemberCache.FindMembers): now returns a
6667         MemberInfo [].
6668
6669         * typemanager.cs: In general, go with with ^^.
6670         (CopyNewMethods): take an IList.
6671         (RealMemberLookup): Only allocate an arraylist
6672         if we copy from two sets of methods.
6673
6674         This change basically does two things:
6675         1) Fewer array lists allocated due to CopyNewMethods.
6676         2) the explicit cast in MemberList costed ALOT.
6677
6678 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6679
6680         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6681         a hashtable to avoid needless string allocations when an identifier is
6682         used more than once (the common case).
6683
6684 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6685
6686         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6687         is broken, it will not return anything. So, we
6688         have to use the information we have in mcs to
6689         do the task.
6690
6691         * typemanager.cs: Add a cache for GetInterfaces,
6692         since this will now be used more often (due to ^^)
6693
6694         (GetExplicitInterfaces) New method that gets the
6695         declared, not effective, interfaces on a type
6696         builder (eg, if you have interface IFoo, interface
6697         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6698         { IBar }.
6699
6700         This patch makes MCS able to bootstrap itself on
6701         Windows again.
6702
6703 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6704
6705         * expression.cs: Remove the Nop's that Miguel put
6706         in by mistake.
6707
6708 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6709
6710         * report.cs, codegen.cs: Give the real stack trace to
6711         the error when an exception is thrown.
6712
6713 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6714
6715         * decl.cs: only allocate hashtables for ifaces if 
6716         it is an iface!
6717
6718 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6719
6720         * expression.cs: fix the error from cs0121-2.cs
6721         (a parent interface has two child interfaces that
6722         have a function with the same name and 0 params
6723         and the function is called through the parent).
6724
6725 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6726
6727         * class.cs, rootcontext.cs, typmanager.cs: do not
6728         leak pointers.
6729
6730 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6731
6732         * codegen.cs: remove stack for the ec flow branching.
6733         It is already a linked list, so no need.
6734
6735 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6736
6737         * Makefile: Allow custom profiler here.
6738
6739 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6740
6741         * typemanager.cs (LookupType):
6742           - Use a static char [], because split takes
6743             a param array for args, so it was allocating
6744             every time.
6745           - Do not store true in a hashtable, it boxes.
6746
6747 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6748
6749         * flowanalysis.cs: bytify common enums.
6750
6751 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6752
6753         * modifiers.cs: Add a new set of flags for the
6754         flags allowed on explicit interface impls.
6755         * cs-parser.jay: catch the use of modifiers in
6756         interfaces correctly.
6757         * class.cs: catch private void IFoo.Blah ().
6758
6759         All related to bug #50572.
6760
6761 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6762
6763         * decl.cs: Rewrite the consistant accessability checking.
6764         Accessability is not linear, it must be implemented in
6765         a tableish way. Fixes #49704.
6766
6767 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6768
6769         * expression.cs: Handle negation in a checked context.
6770         We must use subtraction from zero. Fixes #38674.
6771
6772 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6773
6774         * class.cs: Ignore static void main in DLLs.
6775         * rootcontext.cs: Handle the target type here,
6776         since we are have to access it from class.cs
6777         * driver.cs: account for the above.
6778
6779 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6780
6781         * report.cs: Give line numbers and files if available.
6782
6783 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6784
6785         * driver.cs: Implement /addmodule.
6786
6787         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6788         ModuleBuilders.
6789
6790 2003-12-20  Martin Baulig  <martin@ximian.com>
6791
6792         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6793         (FieldBase.IsAssigned): Removed this field.
6794         (FieldBase.SetAssigned): New public method.
6795         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6796
6797 2003-12-20  Martin Baulig  <martin@ximian.com>
6798
6799         * expression.cs (LocalVariableReference.DoResolve): Don't set
6800         `vi.Used' if we're called from DoResolveLValue().
6801
6802         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6803         returns the usage vector it just merged into the current one -
6804         pass this one to UsageWarning().
6805         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6806         of the `EmitContext', don't call this recursively on our children.
6807
6808 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6809
6810         * driver.cs: Implement /target:module.
6811
6812 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6813
6814         * support.cs (CharArrayHashtable): New helper class.
6815
6816         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6817         char arrays, not strings, so we can avoid creating a string in
6818         consume_identifier if the identifier is a keyword.
6819
6820 2003-12-16  Martin Baulig  <martin@ximian.com>
6821
6822         * statement.cs (LocalInfo.Assigned): Removed this property.
6823         (LocalInfo.Flags): Removed `Assigned'.
6824         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6825         and uses flow analysis.
6826         (Block.UsageWarning): Made this method private.
6827         (Block.Resolve): Call UsageWarning() if appropriate.
6828
6829         * expression.cs (LocalVariableReference.DoResolve): Always set
6830         LocalInfo.Used here.
6831
6832 2003-12-13  Martin Baulig  <martin@ximian.com>
6833
6834         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6835         any value here; we're now using flow analysis to figure out
6836         whether a statement/block returns a value.
6837
6838 2003-12-13  Martin Baulig  <martin@ximian.com>
6839
6840         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6841         working again.
6842         (FlowBranching.MergeFinally): Don't call
6843         `branching.CheckOutParameters()' here, this is called in
6844         MergeTopBlock().
6845         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6846         when adding the `finally' vector.       
6847
6848 2003-12-13  Martin Baulig  <martin@ximian.com>
6849
6850         * flowanalysis.cs
6851         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6852         actually work and also fix #48962.
6853
6854 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6855
6856         * decl.cs: Do not check System.Object for nested types,
6857         since we know it does not have any. Big bang for buck:
6858
6859         BEFORE:
6860            Run 1:   8.35 seconds
6861            Run 2:   8.32 seconds
6862            corlib:  17.99 seconds
6863         AFTER:
6864            Run 1:   8.17 seconds
6865            Run 2:   8.17 seconds
6866            corlib:  17.39 seconds
6867
6868 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6869
6870         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6871         time we are returning 0 members, so we save alot here.
6872
6873 2003-12-11  Martin Baulig  <martin@ximian.com>
6874
6875         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6876         `MergeChild()', also just take the `FlowBranching' as argument;
6877         call Merge() on it and return the result.
6878         (FlowBranching.Merge): We don't need to do anything if we just
6879         have one sibling.
6880
6881 2003-12-11  Martin Baulig  <martin@ximian.com>
6882
6883         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6884         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6885         Maurer for this idea.
6886
6887 2003-12-11  Martin Baulig  <martin@ximian.com>
6888
6889         * flowanalysis.cs (MergeResult): This class is now gone; we now
6890         use the `UsageVector' for this.  The reason for this is that if a
6891         branching just has one sibling, we don't need to "merge" them at
6892         all - that's the next step to do.
6893         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6894         `MergeResult'.
6895
6896 2003-12-11  Martin Baulig  <martin@ximian.com>
6897
6898         Reworked flow analyis and made it more precise and bug-free.  The
6899         most important change is that we're now using a special `Reachability'
6900         class instead of having "magic" meanings of `FlowReturns'.  I'll
6901         do some more cleanups and optimizations and also add some more
6902         documentation this week.
6903
6904         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6905         largely reworked this class.
6906         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6907         the new `Reachability' class instead of having "magic" values here.
6908         (FlowBranching): We're now using an instance of `Reachability'
6909         instead of having separate `Returns', `Breaks' etc. fields.
6910
6911         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6912         based on flow analysis; ignore the return value of block.Emit ().
6913
6914 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6915
6916         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6917         if they are private.
6918
6919 2003-12-09  Martin Baulig  <martin@ximian.com>
6920
6921         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6922         call them directly on the UsageVector.
6923
6924 2003-12-09  Martin Baulig  <martin@ximian.com>
6925
6926         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6927         Changed return type from `FlowReturns' to `Reachability'.
6928
6929 2003-12-09  Martin Baulig  <martin@ximian.com>
6930
6931         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6932         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6933         `Reachable' fields with a single `Reachability' one.
6934
6935 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6936
6937         * class.cs (FindMembers): Remove foreach's.
6938
6939         Bootstrap times:
6940
6941         BEFORE
6942                 Run 1:   8.74 seconds
6943                 Run 2:   8.71 seconds
6944
6945         AFTER
6946                 Run 1:   8.64 seconds
6947                 Run 2:   8.58 seconds
6948
6949
6950 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6951
6952         * cs-parser.jay:
6953         * gen-treedump.cs:
6954         * statement.cs:
6955         This patch does a few things:
6956                 1. EmptyStatement is now a singleton, so it is never reallocated.
6957                 2. All blah is EmptyStatement constructs have been changed to
6958                    blah == EmptyStatement.Value, which is much faster and valid
6959                    now that EmptyStatement is a singleton.
6960                 3. When resolving a block, rather than allocating a new array for
6961                    the non-empty statements, empty statements are replaced with
6962                    EmptyStatement.Value
6963                 4. Some recursive functions have been made non-recursive.
6964         Mainly the performance impact is from (3), however (1) and (2) are needed for
6965         this to work. (4) does not make a big difference in normal situations, however
6966         it makes the profile look saner.
6967
6968         Bootstrap times:
6969
6970         BEFORE
6971         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6972         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6973         Total memory allocated: 56397 KB
6974
6975         AFTER
6976         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6977         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6978         Total memory allocated: 55666 KB
6979
6980 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6981
6982         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6983         than the hashtable in a hashtable version
6984
6985         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6986         we always end up concating a string. This results in a huge perf
6987         loss, because many strings have to be tracked by the GC. In this
6988         patch, we first use a hashtable that works with two keys, so that
6989         the strings do not need to be concat'ed.
6990
6991         Bootstrap times:
6992         BEFORE
6993                 Run 1:   8.74 seconds
6994                 Run 2:   8.71 seconds
6995
6996         AFTER
6997                 Run 1:   8.65 seconds
6998                 Run 2:   8.56 seconds
6999
7000 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7001
7002         * Makefile: Add a new target `do-time' that does a quick and simple
7003         profile, leaving easy to parse output.
7004
7005 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
7006
7007         * codegen.cs (Init): Create the dynamic assembly with 
7008         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
7009
7010 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7011
7012         * support.cs: Make the PtrHashtable use only one
7013         instance of its comparer.
7014
7015 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
7016
7017         * typemanager.cs: Fix lookup of GetNamespaces.
7018
7019 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
7020
7021         * expression.cs: Removed redundant line.
7022
7023         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
7024         ArrayLists, use for loops with bounds.  
7025
7026         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
7027         arraylist.
7028
7029         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
7030         arraylists, use for loop with bounds.
7031
7032         The above three changes give us a 0.071 second performance
7033         improvement out of 3.294 seconds down to 3.223.  On my machine
7034         the above changes reduced the memory usage by 1,387 KB during
7035         compiler bootstrap.
7036
7037         * cs-parser.jay (QualifiedIdentifier): New class used to represent
7038         QualifiedIdentifiers.  Before we created a new string through
7039         concatenation, and mostly later on, the result would be
7040         manipulated by DecomposeQI through string manipulation.
7041
7042         This reduced the compiler memory usage for bootstrapping from
7043         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
7044         compile times in 0.05 seconds.
7045
7046 2003-11-28  Dick Porter  <dick@ximian.com>
7047
7048         * support.cs: Do string compares with the Invariant culture.
7049
7050         * rootcontext.cs: 
7051         * gen-treedump.cs: 
7052         * expression.cs: 
7053         * driver.cs: 
7054         * decl.cs: 
7055         * codegen.cs: 
7056         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
7057         the comparison is done with the Invariant culture.
7058
7059 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
7060
7061         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7062         GetEnumerator method.
7063
7064         (ProbeCollectionType): Iterate starting at the most specific type
7065         upwards looking for a GetEnumerator
7066
7067         * expression.cs: Shift count can be up to 31 for int/uint and 63
7068         for long/ulong.
7069
7070 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
7071
7072         * statement.cs (Block.LookupLabel): Also look for the label on the
7073         children blocks.  Use a hash table to keep track of visited
7074         nodes. 
7075
7076         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7077         we actually did transform the other operand, otherwise fall back
7078         to the common codepath that casts to long.
7079
7080         * cs-tokenizer.cs: Use the same code pattern as the int case.
7081         Maybe I should do the parsing myself, and avoid depending on the
7082         Parse routines to get this done.
7083
7084 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
7085
7086         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7087         which fixes bug 51347.  This time test it.
7088
7089         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7090         attributes for example can not tell the difference between these.
7091         The difference was only a syntax feature of the language. 
7092
7093         * attribute.cs: Apply attributes to delegates.
7094
7095         * delegate.cs: Call the apply attributes method.
7096
7097 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
7098
7099         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7100         comparing 0 vs Byte.MinValue, not the value
7101
7102         (ImplicitConversionRequired): When reporting a conversion error,
7103         use error 31 to print out the constant error instead of the
7104         simpler 29.
7105
7106         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7107         which fixes bug 51347.
7108
7109 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
7110
7111         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
7112         which fixes the -warnaserror command line option.
7113
7114 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
7115
7116         * cfold.cs (DoNumericPromotions): During constant folding of
7117         additions on UIntConstant, special case intconstants with
7118         IntConstants like we do on the expression binary operator. 
7119
7120 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
7121
7122         * convert.cs (ImplicitReferenceConversion): We were missing a case
7123         (System.Enum are not value types or class types, so we need to
7124         classify them separatedly).
7125
7126         * driver.cs: We do not support error 2007.
7127
7128 2003-11-12 Jackson Harper <jackson@ximian.com>
7129
7130         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
7131         system directory. Also use the full file name so users can
7132         libraries names mscorlib-o-tron.dll in a non system dir.
7133         
7134 2004-01-04  David Sheldon <dave-mono@earth.li>
7135
7136         * expression.cs: Added matching ")" to error message for CS0077.
7137
7138 2003-12-19  Martin Baulig  <martin@ximian.com>
7139
7140         * typemanager.cs (TypeManager.IsEqualGenericType): New public
7141         static method; see documentation in the method.
7142         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
7143
7144         * convert.cs (Convert.ImplicitReferenceConversion,
7145         Convert.ImplicitReferenceConversionExists): Add support for
7146         generic type declarations; see gen-36.cs.
7147
7148 2003-12-19  Martin Baulig  <martin@ximian.com>
7149
7150         * pending.cs (Pending.InterfaceMethod): Use
7151         `Type.IsAssignableFrom()' instead of `=='.
7152
7153 2003-12-18  Martin Baulig  <martin@ximian.com>
7154
7155         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
7156         byref types first.
7157
7158         * convert.cs (Convert.ImplicitStandardConversionExists): Use
7159         `expr_type.Equals (target_type)' instead of `=='.
7160
7161 2003-12-08  Martin Baulig  <martin@ximian.com>
7162
7163         * generics.cs (Constraints.Types): Removed.
7164         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
7165         to Type's.
7166         (Constraints.ResolveTypes): New public method; resolves the
7167         TypeExpr's to Type's.
7168         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
7169         longer takes the constraints.
7170         (TypeParameter.DefineMethod): Likewise.
7171         (TypeParameter.DefineType): New public method.  Calls
7172         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
7173         the constraints.
7174
7175 2003-12-08  Martin Baulig  <martin@ximian.com>
7176
7177         * convert.cs (Convert.ImplicitConversionStandard): Use
7178         `expr_type.Equals (target_type)' instead of `=='.
7179
7180 2003-12-08  Martin Baulig  <martin@ximian.com>
7181
7182         * typemanager.cs (TypeManager.GetReferenceType): Call
7183         `Type.MakeByRefType ()'.
7184
7185 2003-12-08  Martin Baulig  <martin@ximian.com>
7186
7187         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
7188         just has some special meaning in some situations.  For instance,
7189         it is allowed to use `where' as the name of a variable etc.
7190
7191 2003-12-04  Martin Baulig  <martin@ximian.com>
7192
7193         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7194         `Type.MakeArrayType()' for array types.
7195
7196 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
7197
7198         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
7199         debugging message.
7200
7201         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
7202         corlib to compile.
7203
7204 2003-11-16  Martin Baulig  <martin@ximian.com>
7205
7206         * codegen.cs (EmitContext.IsGeneric): Removed.
7207
7208         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
7209         ResolveGeneric() on the DeclSpace.
7210
7211 2003-11-16  Martin Baulig  <martin@ximian.com>
7212
7213         * generic.cs (TypeArguments.Resolve):
7214         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
7215         `ResolveType()' on it to get the Type.
7216
7217 2003-11-15  Martin Baulig  <martin@ximian.com>
7218
7219         * generic.cs (ConstructedType.GetInterfaces): Override this.
7220
7221 2003-11-14  Martin Baulig  <martin@ximian.com>
7222
7223         * interface.cs (Interface.DefineType): Define all type parameters
7224         before adding the interfaces we inherit.
7225
7226 2003-11-11  Martin Baulig  <martin@ximian.com>
7227
7228         * generic.cs (ConstructedType.ResolveType): Always call
7229         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
7230
7231 2003-11-10  Martin Baulig  <martin@ximian.com>
7232
7233         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7234         (TypeManager.InitCoreTypes): Initialize them here, but instead of
7235         calling `ResolveType()' on them, directly assign their `Type'.
7236
7237 2003-11-08  Martin Baulig  <martin@ximian.com>
7238
7239         * generic.cs (ConstructedType): Override `IsClass' etc.
7240
7241 2003-11-08  Martin Baulig  <martin@ximian.com>
7242
7243         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7244         return value and the `out parent' parameter.
7245         (TypeContainer.DefineType): Moved the CS0644 check into
7246         GetClassBases().  Don't pass the interface types to the
7247         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7248         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7249
7250         * ecore.cs (TypeExpr.IsAttribute): New property.
7251         (TypeExpr.GetInterfaces): New method.
7252
7253         * interface.cs (Interface.GetInterfaceTypeByName): Return a
7254         TypeExpr instead of a Type.
7255         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7256         (Interface.DefineType): Don't pass the interface types to the
7257         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7258         them later and then call `TypeBulider.AddInterfaceImplementation()'.
7259
7260         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7261         instead of a `Type[]'.
7262         (TypeManager.RegisterBuilder): Likewise.
7263         (TypeManager.AddUserInterface): Likewise.
7264         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7265         `Type[]' and also return a `TypeExpr[]'.
7266         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7267
7268 2003-11-08  Martin Baulig  <martin@ximian.com>
7269
7270         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7271         Expression.     
7272
7273 2003-11-08  Martin Baulig  <martin@ximian.com>
7274
7275         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7276         TypeManager.ResolveExpressionTypes().
7277
7278         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7279         instead of an Expression.
7280         (TypeExpr): This is now an abstract base class for `TypeExpression'.
7281         (TypeExpression): New public class; formerly known as `TypeExpr'.
7282
7283         * expression.cs (ComposedCast): Derive from TypeExpr.
7284
7285         * typemanager.cs (TypeManager.system_*_expr): These are now
7286         TypExpr's instead of Expression's.
7287         (TypeManager.ResolveExpressionTypes): New public static function;
7288         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7289         of them.        
7290
7291 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
7292
7293         * expression.cs (New.DoResolve): Do not dereference value that
7294         might be a null return.
7295
7296         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7297         sure that the constant value has the right type.  Fixes an
7298         unreported bug, similar to 50425.
7299
7300         * const.cs (Const.LookupConstantValue): Call
7301         ImplicitStandardConversionExists before doing a conversion to
7302         avoid havng the TypeManager.ChangeType do conversions.
7303
7304         Reduced the number of casts used
7305
7306         (Const.ChangeType): New routine to enable reuse of the constant
7307         type changing code from statement.
7308
7309         * typemanager.cs (ChangeType): Move common initialization to
7310         static global variables.
7311
7312         Fixes #50425.
7313
7314         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7315         every value type to go through, even if it was void.  Fix that. 
7316
7317         * cs-tokenizer.cs: Use is_identifier_start_character on the start
7318         character of the define, and the is_identifier_part_character for
7319         the rest of the string.
7320
7321 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
7322
7323         * expression.cs (UnaryMutator.EmitCode): When I updated
7324         LocalVariableReference.DoResolve, I overdid it, and dropped an
7325         optimization done on local variable references.
7326
7327 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
7328
7329         * ecore.cs: Convert the return from Ldlen into an int.
7330
7331 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
7332
7333         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7334         the accessibility, this is a special case for toplevel non-public
7335         classes (internal for instance).
7336
7337 2003-10-20  Nick Drochak <ndrochak@gol.com>
7338
7339         * ecore.cs: Fix typo and build.  Needed another right paren.
7340
7341 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
7342
7343         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
7344         `internal' case regular and protected, but not allowing protected
7345         to be evaluated later.  Bug 49840
7346
7347 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
7348
7349         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7350         to kb.Nlast, and not the kb.nFirst to isolate the switch
7351         statement.
7352
7353         Extract the underlying type, so enumerations of long/ulong are
7354         treated like long/ulong.
7355
7356 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
7357
7358         * expression.cs (New): Overload the meaning of RequestedType to
7359         track the possible creation of the NewDelegate type, since
7360         DoResolve is invoked more than once for new constructors on field
7361         initialization.
7362
7363         See bugs: #48800 and #37014
7364
7365         * cs-parser.jay (declare_local_constants): Take an arraylist
7366         instead of a single constant.
7367
7368         (local_constant_declaration): It should take a
7369         constant_declarators, not a constant_declarator.  Fixes 49487
7370
7371         * convert.cs: Fix error report.
7372
7373 2003-10-13 Jackson Harper <jackson@ximian.com>
7374
7375         * typemanager.cs (TypeToCoreType): Add float and double this fixes
7376         bug #49611
7377         
7378 2003-11-03  Martin Baulig  <martin@ximian.com>
7379
7380         * expression.cs (ArrayAccess.GetStoreOpcode): Added
7381         `out bool has_type_arg'; if set, we need to pass the type to
7382         ig.Emit().
7383         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
7384         Stelem_Any/Ldelem_Any for generic parameters.   
7385
7386 2003-11-02  Martin Baulig  <martin@ximian.com>
7387
7388         * expression.cs (Invocation.EmitCall): Use
7389         `TypeManager.IsValueType()' to check whether it's a value type.
7390         Don't set `struct_call' when calling a method on a type parameter.
7391
7392 2003-11-02  Martin Baulig  <martin@ximian.com>
7393
7394         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
7395         and removed the TypeBuilder argument.
7396
7397         * typemanager.cs (TypeManager.IsValueType): Return
7398         `t.IsGenericParameter || t.IsValueType'.
7399
7400 2003-10-25  Martin Baulig  <martin@ximian.com>
7401
7402         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
7403         call ConstructedType.Resolve() on it.
7404
7405         * generic.cs (ConstructedType.Resolve): Set `type' on success.
7406
7407 2003-10-25  Martin Baulig  <martin@ximian.com>
7408
7409         * class.cs (TypeContainer.GetClassBases): Changed
7410         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
7411         CS8214 reporting here.
7412         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
7413         instead of a `Type' for our parent.  In case of a recursive
7414         declaration (see tests/gen-23.cs for an example), our parent is a
7415         ConstructedType and it doesn't have its type set.  So, first
7416         create our own TypeBuilder, then call constructed.Resolve() to get
7417         the parent's type and finally TypeBuilder.SetParent() it.
7418
7419         * ecore.cs (TypeExpr.Name): New public virtual property.
7420
7421         * generic.cs
7422         (ConstructedType): We're now a TypeExpr and not just an Expression.
7423         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
7424         arguments here; this is done later.
7425         (ConstructedType.Resolve): New public method to resolve the type
7426         arguments and bind them.
7427
7428 2003-10-21  Martin Baulig  <martin@ximian.com>
7429
7430         * convert.cs: Use `TypeManager.IsValueType' instead of
7431         'type.IsValueType' everywhere.
7432
7433         * typemanager.cs (TypeManager.IsValueType): Return true for type
7434         parameters.  The reason for this is that we need to box a type
7435         parameter when converting it to a reference type.
7436
7437         * cs-parser.jay: Added support for default value expressions.
7438
7439         * generics.cs (DefaultValueExpression): New public class.       
7440
7441 2003-10-17  Martin Baulig  <martin@ximian.com>
7442
7443         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
7444         TypeContainer so we can also use this for Interfaces.
7445         (TypeParameter.Resolve): Likewise.
7446
7447         * interface.cs (Interface.DefineType): Added support for generic
7448         interfaces.
7449
7450         * cs-parser.jay: Added support for generic structs and interfaces.
7451
7452 2003-10-17  Martin Baulig  <martin@ximian.com>
7453
7454         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
7455         call generic methods :-)
7456
7457 2003-10-16  Martin Baulig  <martin@ximian.com>
7458
7459         * cs-parser.jay (namespace_or_type_name): Only create a
7460         GenericMemberAccess if we actually have type arguments.
7461
7462 2003-10-13  Martin Baulig  <martin@ximian.com>
7463
7464         * class.cs (Method.Define): If we're a generic method, call
7465         TypeBuilder.DefineGenericMethod () before resolving
7466         the parameters.
7467         (MethodData): Added .ctor which takes an additional MethodBuilder
7468         argument; this is used for generic methods.
7469         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
7470         we already have a MethodBuilder.
7471
7472 2003-10-10  Martin Baulig  <martin@ximian.com>
7473
7474         * class.cs (Method): Added .ctor which takes a `GenericMethod'
7475         instead of a `DeclSpace'.  This is used for generic methods.
7476
7477         * cs-parser.jay (method_header): Added support for generic
7478         methods; create a `GenericMethod' instance and pass it to the
7479         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
7480         parameters and locals.
7481
7482         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
7483         since we already have the location.  Check whether we're a generic
7484         type declaration or a generic method and create the correct type
7485         parameter.
7486
7487         * generic.cs (TypeParameter.DefineMethod): New public method.
7488         (GenericMethod): New public class; derives from DeclSpace and is
7489         used for generic methods.       
7490
7491 2003-10-09  Martin Baulig  <martin@ximian.com>
7492
7493         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7494         to the .ctor.
7495         (MethodCore.DoDefineParameters): Removed the TypeContainer
7496         argument; use the DeclSpace which was passed to the .ctor instead.
7497         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7498         TypeContainer; we only need a DeclSpace here.
7499
7500 2003-10-09  Martin Baulig  <martin@ximian.com>
7501
7502         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7503         to the .ctor.
7504         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7505         EmitContext's .ctor.    
7506
7507 2003-10-09  Martin Baulig  <martin@ximian.com>
7508
7509         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7510         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7511         AsAccessible(), moved them as well.
7512
7513         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7514
7515 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7516
7517         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7518         generation for >=, as spotted by Paolo, bug 48679.  
7519         Patch from David Waite.
7520
7521         * cs-tokenizer.cs: Add handling for #pragma.
7522
7523         * cs-parser.jay: Allow for both yield and yield return in the
7524         syntax.  The anti-cobolization of C# fight will go on!
7525
7526         * class.cs (TypeBuilder.DefineType): Catch error condition here
7527         (Parent.DefineType erroring out and returning null).
7528
7529         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7530         coping with enumerations variables, we were mistakenly processing
7531         them as a regular value type instead of built-in types.  Fixes the
7532         bug #48063
7533
7534         * typemanager.cs (IsBuiltinOrEnum): New method.
7535
7536 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7537
7538         * cs-parser.jay: Upgrade: yield now needs the return clause.
7539
7540 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7541
7542         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7543
7544 2003-09-29  Martin Baulig  <martin@ximian.com>
7545
7546         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
7547         inflated generic methods.
7548
7549         * generics.cs (ConstructedType): Distinguish between open and
7550         closed constructed types; correctly resolve the arguments.
7551
7552 2003-09-22  Martin Baulig  <martin@ximian.com>
7553
7554         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
7555         all type arguments meet their constraints.
7556
7557 2003-09-19  Martin Baulig  <martin@ximian.com>
7558
7559         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7560         `MemberCache parent' argument.  Normally, an interface doesn't
7561         have a parent type except System.Object, but we use this in gmcs
7562         for generic type parameters.
7563
7564 2003-09-18  Martin Baulig  <martin@ximian.com>
7565
7566         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7567         on `type.IsInterface'; don't check whether the type has a parent
7568         to determine whether it's an interface.
7569
7570 2003-09-17  Martin Baulig  <martin@ximian.com>
7571
7572         * generic.cs (ConstructedType.ToString): Always use `name' as the
7573         type name.
7574
7575 2003-09-15  Martin Baulig  <martin@ximian.com>
7576
7577         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7578
7579         * generic.cs (Constraints.Resolve): New public method; this is
7580         called to resolve the constraint types and to check whether all
7581         the constraints are correct.
7582         (Constraints.Types): New public property.
7583         (TypeParameter.Resolve): New public method; resolves all the
7584         type's constraints.
7585
7586         * class.cs (TypeContainer.DefineType): Call
7587         TypeParameter.Resolve() before actually defining the type.
7588
7589 2003-09-15  Martin Baulig  <martin@ximian.com>
7590
7591         * class.cs (TypeContainer.DefineType): Added an error flag to
7592         avoid reporting duplicate CS0146's ("class definition is
7593         circular.").
7594
7595         * driver.cs (Driver.MainDriver): Abort if
7596         RootContext.ResolveTree() reported any errors.
7597
7598 2003-09-07  Martin Baulig  <martin@ximian.com>
7599
7600         * report.cs (Error, Warning): Added overloaded versions which take
7601         a `params object[] args' and call String.Format().
7602
7603 2003-09-07  Martin Baulig  <martin@ximian.com>
7604
7605         * decl.cs (DeclSpace..ctor): Don't call
7606         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7607         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7608         (DeclSpace.RecordDecl): New method.
7609
7610         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7611
7612 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7613
7614         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7615         value attributes to be applied to ParameterBuilders.
7616
7617         * class.cs (MethodCore.LabelParameters): Make static and more
7618         generic so that it can be used from other places - like interface
7619         methods, for instance.
7620
7621         * interface.cs (Interface.Emit): Call LabelParameters before
7622         emitting attributes on the InterfaceMethod.
7623
7624 2003-09-07  Martin Baulig  <martin@ximian.com>
7625
7626         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7627         if the number of type parameters doesn't match.
7628
7629 2003-09-04  Martin Baulig  <martin@ximian.com>
7630
7631         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7632         for arrays of generic type params (ie. `!0[]').
7633
7634 2003-09-04  Martin Baulig  <martin@ximian.com>
7635
7636         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7637         for the moment.
7638
7639 2003-09-04  Martin Baulig  <martin@ximian.com>
7640
7641         * decl.cs (DeclSpace.LookupGeneric): New method.
7642         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7643         moment.
7644
7645         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7646         argument, not just a string.
7647         (TypeParameter.Define): New public method; this is called to
7648         actually define the generic parameter; after this, you can use the
7649         new `Type' property to get the type.
7650
7651 2003-09-04  Martin Baulig  <martin@ximian.com>
7652
7653         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7654         is now an ArrayList; initialize the result of the `TypeParameters'
7655         property here.
7656         (DeclSpace.GetGenericData): Removed.
7657         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7658         implement this in a different way.
7659         (DeclSpace.GetTypeParameters): Removed; there's now a
7660         `TypeParameters' property.
7661         (DeclSpace.TypeParameters): New public property.
7662
7663         * generic.cs (Constraints): Make this class public.
7664         (TypeParameter): New public class.
7665
7666 2003-09-04  Martin Baulig  <martin@ximian.com>
7667
7668         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7669         generic parameters.
7670
7671         * class.cs (TypeContainer.DefineType): Call
7672         TypeBuilder.DefineGenericParameter () on all generic parameters if
7673         this is a generic type.
7674
7675 2003-08-28  Martin Baulig  <martin@ximian.com>
7676
7677         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7678         sample-stack.il".
7679
7680         * sample-hello.cs: Compile this with gmcs: "gmcs
7681         /r:sample-stack.dll sample-hello.cs".
7682
7683 2003-08-28  Martin Baulig  <martin@ximian.com>
7684
7685         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7686         the parameters to the generic type.
7687
7688 2003-08-28  Martin Baulig  <martin@ximian.com>
7689
7690         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7691
7692 2003-08-28  Martin Baulig  <martin@ximian.com>
7693
7694         * cs-parser.jay (opt_type_argument_list): Use
7695         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7696         (primary_expression): Replace `qualified_identifier' with `type_name'.
7697         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7698
7699         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7700         parser to check whether it is syntactically a type parameter list;
7701         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7702         this case.
7703
7704 2003-08-26  Martin Baulig  <martin@ximian.com>
7705
7706         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7707         resolving aliases; fixes #47927.
7708
7709 2003-08-26  Martin Baulig  <martin@ximian.com>
7710
7711         * statement.cs (Using.DoResolve): This is internally emitting a
7712         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7713         do not always return.  Fixes #47681.
7714
7715 2003-08-26  Martin Baulig  <martin@ximian.com>
7716
7717         * decl.cs (MemberCore): Moved WarningNotHiding(),
7718         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7719         into MemberBase.
7720         (AdditionResult): Make this nested in DeclSpace.
7721         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7722         argument; call NamespaceEntry.Define() unless we're nested in a
7723         class or struct.
7724
7725         * namespace.cs (Namespace.DefineName): New public function.  This
7726         is called from DeclSpace's .ctor to add 
7727         (Namespace.Lookup): Include DeclSpaces in the lookup.
7728
7729         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7730
7731         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7732
7733 2003-08-25  Martin Baulig  <martin@ximian.com>
7734
7735         * convert.cs (Convert.ExplicitReferenceConversion): When
7736         converting from an interface type to a class, unbox if the target
7737         type is a struct type.  Fixes #47822.
7738
7739 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7740
7741         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7742         #47854.
7743
7744 2003-08-22  Martin Baulig  <martin@ximian.com>
7745
7746         * class.cs (TypeManager.DefineType): When defining a nested type,
7747         call DefineType() on our parent; fixes #47801.
7748
7749 2003-08-22  Martin Baulig  <martin@ximian.com>
7750
7751         * class.cs (MethodData.Define): While checking if a method is an
7752         interface implementation, improve the test a bit more to fix #47654.
7753
7754 2003-08-22  Martin Baulig  <martin@ximian.com>
7755
7756         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7757         correctly; fixes #47722.
7758
7759 2003-08-22  Martin Baulig  <martin@ximian.com>
7760
7761         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7762         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7763
7764         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7765
7766 2003-08-22  Martin Baulig  <martin@ximian.com>
7767
7768         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7769         can only be assigned in static constructors.  Fixes #47161.
7770
7771 2003-08-22  Martin Baulig  <martin@ximian.com>
7772
7773         Rewrote and improved the flow analysis code.
7774
7775         * flowbranching.cs (FlowBranching): Make this class abstract.
7776         (FlowBranching.CreateBranching): New static function to create a
7777         new flow branching.
7778         (FlowBranchingBlock, FlowBranchingException): New classes.
7779         (FlowBranching.UsageVector.Type): New public readonly field.
7780         (FlowBranching.UsageVector.Breaks): Removed the setter.
7781         (FlowBranching.UsageVector.Returns): Removed the setter.
7782         (FlowBranching.UsageVector): Added Break(), Return(),
7783         NeverReachable() and Throw() methods to modify the reachability.
7784         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7785         done by FlowBranching.Merge().
7786         (FlowBranching.UsageVector.MergeChild): New method; merges the
7787         merge result into the current vector.
7788         (FlowBranching.Merge): New abstract method to merge a branching.
7789
7790 2003-08-12  Martin Baulig  <martin@ximian.com>
7791
7792         * expression.cs (Indirection.CacheTemporaries): Create the
7793         LocalTemporary with the pointer type, not its element type.
7794
7795 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7796
7797         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7798         token was a keyword or not.
7799
7800         Add `error' options where an IDENTIFIER was expected;  Provide
7801         CheckToken and CheckIdentifierToken convenience error reporting
7802         functions. 
7803
7804         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7805
7806         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7807         NameSpaceEntry NameSpaceEntry.
7808
7809         (LookupInterfaceOrClass): Avoid creating a full qualified name
7810         from namespace and name: avoid doing lookups when we know the
7811         namespace is non-existant.   Use new Tree.LookupByNamespace which
7812         looks up DeclSpaces based on their namespace, name pair.
7813
7814         * driver.cs: Provide a new `parser verbose' to display the
7815         exception thrown during parsing.  This is turned off by default
7816         now, so the output of a failure from mcs is more graceful.
7817
7818         * namespace.cs: Track all the namespaces defined in a hashtable
7819         for quick lookup.
7820
7821         (IsNamespace): New method
7822
7823 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7824
7825         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7826         we know that we need to concatenate (full typename can never be
7827         null). 
7828
7829         * class.cs: ditto.
7830
7831         * statement.cs: Use a bitfield;  Do not initialize to null things
7832         which are done by the constructor by default.
7833
7834         * cs-parser.jay: bug fix, parameter was 4, not 3.
7835
7836         * expression.cs: Just use the property;
7837
7838         * statement.cs: No need for GetVariableInfo method.
7839
7840 2003-08-08  Martin Baulig  <martin@ximian.com>
7841
7842         * flowanalysis.cs (FlowReturns): This is now nested in the
7843         `FlowBranching' class.
7844         (MyBitVector): Moved this here from statement.cs.
7845         (FlowBranching.SiblingType): New enum type.
7846         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7847
7848 2003-08-07  Martin Baulig  <martin@ximian.com>
7849
7850         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7851         `FlowBranching' class and called `BranchingType'.
7852
7853 2003-08-07  Martin Baulig  <martin@ximian.com>
7854
7855         * flowanalysis.cs: Moved all the control flow analysis code into
7856         its own file.
7857
7858 2003-08-07  Martin Baulig  <martin@ximian.com>
7859
7860         * assign.cs (Assign.DoResolve): `target' must either be an
7861         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7862         #37319.
7863
7864 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7865
7866         * expression.cs (BinaryMethod): This kind of expression is created by the
7867         Binary class if it determines that the operator has to be handled
7868         by a method.
7869
7870         (BinaryDelegate): This kind of expression is created if we are
7871         dealing with a + or - operator on delegates.
7872
7873         (Binary): remove method, argumetns, and DelegateOperator: when
7874         dealing with methods, 
7875
7876         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7877
7878         * statement.cs (Block): use bitfields for the three extra booleans
7879         we had in use.   Remove unused topblock parameter.
7880
7881         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7882
7883         * assign.cs: Drop extra unneeded tests.
7884
7885 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7886
7887         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7888
7889         * statement.cs (Foreach): Use VariableStorage instead of
7890         LocalBuilders.   
7891
7892         * codegen.cs (VariableStorage): New class used by clients that
7893         require a variable stored: locals or fields for variables that
7894         need to live across yield.
7895
7896         Maybe provide a convenience api for EmitThis+EmitLoad?
7897
7898         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7899         these bad boys.
7900
7901 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7902
7903         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7904         RemapParameterLValue): New methods that are used to turn a
7905         precomputed FieldInfo into an expression like this:
7906
7907                 instance.FieldInfo
7908
7909         The idea is to use this instead of making LocalVariableReference
7910         have more than one meaning.
7911
7912         * cs-parser.jay: Add error production to BASE.
7913
7914         * ecore.cs: Deal with TypeManager.GetField returning null, which
7915         is now a valid return value.
7916
7917         (FieldExprNoAddress): New expression for Fields whose address can
7918         not be taken.
7919
7920         * expression.cs (LocalVariableReference): During the resolve
7921         phases, create new expressions if we are in a remapping context.
7922         Remove code that dealt with remapping here.
7923
7924         (ParameterReference): same.
7925
7926         (ProxyInstance): New expression, like the `This' expression, but
7927         it is born fully resolved.  We know what we are doing, so remove
7928         the errors that are targeted to user-provided uses of `this'.
7929
7930         * statement.cs (Foreach): our variable is now stored as an
7931         Expression;  During resolution, follow the protocol, dont just
7932         assume it will return this.
7933
7934 2003-08-06  Martin Baulig  <martin@ximian.com>
7935
7936         * support.cs (SeekableStreamReader.cs): New public class.
7937
7938         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7939         SeekableStreamReader instead of the normal StreamReader.
7940
7941 2003-08-04  Martin Baulig  <martin@ximian.com>
7942
7943         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7944         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7945         deambiguate casts and delegate invocations.
7946         (parenthesized_expression): Use the new tokens to ensure this is
7947         not a cast of method invocation.
7948
7949         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7950         when reading a `)' and Deambiguate_CloseParens () was previously
7951         called.
7952
7953         * expression.cs (ParenthesizedExpression): New class.  This is
7954         just used for the CS0075 test.
7955         (Binary.DoResolve): Check for CS0075.   
7956
7957 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7958
7959         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7960         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7961         reference comparison.
7962
7963         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7964         examine the ReturnType for equality - this is necessary in the
7965         cases of implicit and explicit operators whose signature also
7966         includes the return type.
7967
7968 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7969
7970         * namespace.cs: Cache the result of the namespace computation,
7971         instead of computing it every time.
7972
7973 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7974
7975         * decl.cs: Use a global arraylist that we reuse over invocations
7976         to avoid excesive memory consumption.  Reduces memory usage on an
7977         mcs compile by one meg (45 average).
7978
7979         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7980         private, work around that.
7981
7982 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7983
7984         * literal.cs (IntLiteral): Define Zero and One static literals. 
7985
7986         * cs-parser.jay (integer_literal): use static literals to reduce
7987         memory usage for the most used literals (0, 1 and -1).  211kb
7988         reduced in memory usage.
7989
7990         Replace all calls to `new ArrayList' with `new
7991         ArrayList(4)' which is a good average number for most allocations,
7992         and also requires only 16 bytes of memory for its buffer by
7993         default. 
7994
7995         This reduced MCS memory usage in seven megabytes for the RSS after
7996         bootstrapping.
7997
7998 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7999
8000         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8001         handle params methods the correct way by forming only one
8002         applicable set with params and normal methods in them. Earlier we
8003         were looking at params methods only if we found no normal methods
8004         which was not the correct thing to do.
8005
8006         (Invocation.BetterFunction): Take separate arguments indicating
8007         when candidate and the best method are params methods in their
8008         expanded form.
8009
8010         This fixes bugs #43367 and #46199.
8011
8012         * attribute.cs: Documentation updates.
8013
8014         (CheckAttribute): Rename to CheckAttributeTarget.
8015         (GetValidPlaces): Rename to GetValidTargets.
8016
8017         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8018         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8019
8020         Fixes bug #44468.
8021
8022 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
8023
8024         * codegen.cs: Compute IsGeneric correctly.
8025
8026         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
8027         resolution. 
8028
8029         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
8030         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
8031         regressions, and I was chasing more bugs than I required.
8032
8033         * interface.cs: Use expressions for base type names (like classes
8034         and structs have been doing for a while now), and resolve that.
8035         This patch should probably go into head as well.
8036
8037         This makes it one less user of FindType.
8038
8039 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8040
8041         This compiler can not self host currently.  Need to fix that.
8042         
8043         * Makefile: compile to `gmcs.exe'
8044
8045         * driver.cs: Turn on v2 by default on gmcs.
8046
8047         * generic.cs (ConstructedType): Does no longer take a container
8048         type argument;  That will be taken care of later.
8049
8050         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
8051         Use SimpleName to resolve for now, so we can continue the work on
8052         the parser, until we get Type.GetType that understands generics.
8053
8054         (ConstructedType.ToString): Implement
8055
8056         (TypeArguments.Resolve): Resolve the child expressions as types. 
8057         
8058         * cs-parser.jay: Rename interface_constraints to
8059         type_parameter_constraints
8060
8061         (namespace_or_type_name): Only use constructed types for the basic
8062         construction, we will deal with identifier<...> later.
8063
8064         (type/type_name): No longer call DecomposeQI, as
8065         namespace_or_type_name is always decoded now.
8066         
8067 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8068
8069         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8070         closely: we eliminate methods in base types when we have an
8071         applicable method in a top-level type.
8072
8073         Please see section 14.5.5.1 for an exact description of what goes
8074         on. 
8075
8076         This fixes bug #45127 and a host of other related to corlib compilation.
8077
8078         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8079         array is the method corresponding to the top-level type (this is
8080         because of the changes made to icall.c) so we change this
8081         accordingly.
8082
8083         (MethodGroupExpr.Name): This too.
8084
8085         * typemanager.cs (GetElementType): New method which does the right
8086         thing when compiling corlib. 
8087
8088         * everywhere: Make use of the above in the relevant places.
8089
8090 2003-07-22  Martin Baulig  <martin@ximian.com>
8091
8092         * cs-parser.jay (invocation_expression): Moved
8093         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8094         `cast_expression', but create a InvocationOrCast which later
8095         resolves to either an Invocation or a Cast.
8096
8097         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8098         method; call this before EmitStatement() to make sure that this
8099         expression can be used as a statement.
8100
8101         * expression.cs (InvocationOrCast): New class; resolves to either
8102         an Invocation or a Cast.
8103
8104         * statement.cs (StatementExpression): Call ResolveStatement() on
8105         the ExpressionStatement before emitting it.
8106
8107 2003-07-21  Martin Baulig  <martin@ximian.com>
8108
8109         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8110         `ref' and `out' attributes match; fixes #46220.
8111         (MemberAccess.ResolveMemberAccess): You can't reference a type
8112         through an expression; fixes #33180.
8113         (Indexers.GetIndexersForType): Don't return the indexers from
8114         interfaces the class implements; fixes #46502.
8115
8116 2003-07-21  Martin Baulig  <martin@ximian.com>
8117
8118         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8119         CS0661 checks; fixes bug #30442.
8120
8121 2003-07-21  Martin Baulig  <martin@ximian.com>
8122
8123         * decl.cs (AdditionResult): Added `Error'.
8124
8125         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8126
8127         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
8128         cs0031.cs actually work.
8129
8130  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8131  
8132         * cs-parser.jay (namespace_name): do not use
8133         namespace_or_type_name, use qualified_identifier, because
8134         namespace_or_type_name will soon return a composed expression
8135         instead of a string.
8136  
8137         (namespace_or_type_name): Instead of returning a string, now this
8138         production returns an expression.
8139  
8140         * codegen.cs (EmitContext): Setup IsGeneric property based on
8141         whether our DeclSpace is generic, our the method is generic.
8142  
8143         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
8144         the method is generic.
8145  
8146         * cs-parser.jay (type_arguments, opt_type_argument_list,
8147         type_parameters, type_parameter_list, opt_type_parameter_list,
8148         type_parameter,, opt_type_parameter_constraints_clauses,
8149         type_parameter_constraints_clauses,
8150         type_parameter_constraint_clause, type_parameter_constraint,
8151         interface_constraints): Add new production
8152  
8153         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
8154         DeclSpace is generic or not.
8155  
8156         (DeclSpace.SetParameterInfo): New routine, used to set the
8157         parameter info for a type.
8158  
8159         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
8160         returns a GenericTypeExpr
8161  
8162         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
8163         generic, lookup the generic argument.
8164  
8165         * attribute.cs: Do not allow TypeParameterExpressions in
8166         Attributes.
8167  
8168         * class.cs: Do not allow the Main method to be defined in a
8169         Generic container.
8170  
8171         * expression.cs (SizeOf): Do not allow generic types to be used as
8172         arguments to sizeof.
8173  
8174         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
8175         it: whether a type is generic or not.  Only works for types we are
8176         currently building for now.
8177         
8178 2003-07-20  Martin Baulig  <martin@ximian.com>
8179
8180         * namespace.cs: Fixed that bug which caused a crash when compiling
8181         the debugger's GUI.
8182
8183 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8184
8185         * typemanager.cs (LookupTypeReflection): Never expose types which
8186         are NotPublic, NestedPrivate, NestedAssembly, or
8187         NestedFamANDAssem.  We used to return these, and later do a check
8188         that would report a meaningful error, but the problem is that we
8189         would not get the real match, if there was a name override.
8190
8191 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8192
8193         * namespace.cs (Namespace, Name): Do not compute the namespace
8194         name dynamically, compute it in the constructor.  This reduced
8195         memory usage by 1697 KB.
8196
8197         * driver.cs: Use --pause to pause at the end.
8198
8199 2003-07-17  Peter Williams  <peter@newton.cx>
8200
8201         * Makefile: Change the name of the test target so that it doesn't
8202         conflict with the recursive test target.
8203
8204 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8205
8206         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8207         AddressOf): Do not use EmitThis, that was wrong, use the actual
8208         this pointer.
8209
8210 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8211
8212         * class.cs (MethodData.Define): While checking if a method is an
8213         interface implementation, improve the test: If we are not public
8214         (use new test here: use the computed MethodAttributes directly,
8215         instead of the parsed modifier flags) check if the `implementing'
8216         method comes from an interface or not.
8217
8218         * pending.cs (VerifyPendingMethods): Slightly better error
8219         message.
8220
8221         * makefile: add test target that does the mcs bootstrap.
8222
8223 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8224
8225         * interface.cs (Define): Do nothing here since there are no
8226         members to populate etc. Move the attribute emission out of here
8227         since this was just totally the wrong place to put it. Attribute
8228         application happens during the 'Emit' phase, not in the 'Define'
8229         phase.
8230
8231         (Emit): Add this method and move the attribute emission here
8232
8233         * rootcontext.cs (EmitCode): Call the Emit method on interface
8234         types too.
8235
8236 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8237
8238         * expression.cs (OverloadResolve): Report error only if Location
8239         is not 'Null' which means that there was a probe going on.
8240
8241 2003-07-14  Martin Baulig  <martin@ximian.com>
8242
8243         * expression.cs (ConditionalLogicalOperator): New public class to
8244         implement user defined conditional logical operators.
8245         This is section 14.11.2 in the spec and bug #40505.
8246
8247 2003-07-14  Martin Baulig  <martin@ximian.com>
8248
8249         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8250
8251 2003-07-14  Martin Baulig  <martin@ximian.com>
8252
8253         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8254
8255         * ecore.cs (IVariable.VerifyFixed): New interface method.
8256
8257         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8258         operator, check whether the variable is actually fixed.  Fixes bug
8259         #36055.  Set a variable definitely assigned when taking its
8260         address as required by the spec.
8261
8262         * statement.cs (LocalInfo.IsFixed): New field.
8263         (LocalInfo.MakePinned): Set `IsFixed' to true.
8264
8265 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8266
8267         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8268         for .ctors, ensure that we only ask for members declared in the
8269         attribute type (BindingFlags.DeclaredOnly).
8270
8271         Fixes bug #43632.
8272
8273         * expression.cs (Error_WrongNumArguments): Report error 1501
8274         correctly the way CSC does.
8275
8276 2003-07-13  Martin Baulig  <martin@ximian.com>
8277
8278         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8279         lookup on the fully qualified name, to make things like "X.X" work
8280         where "X.X" is a fully qualified type name, but we also have a
8281         namespace "X" in the using list.  Fixes #41975.
8282
8283 2003-07-13  Martin Baulig  <martin@ximian.com>
8284
8285         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8286         function. If we're a CompoundAssign, we need to create an embedded
8287         CompoundAssign, not an embedded Assign.
8288         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8289         Fixes #45854.
8290
8291 2003-07-13  Martin Baulig  <martin@ximian.com>
8292
8293         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8294         work to fix bug #46088.
8295
8296 2003-07-13  Ravi Pratap <ravi@ximian.com>
8297
8298         * class.cs (Operator.Emit): Do not emit attributes here - it is
8299         taken care of by the Method class that we delegate too. This takes
8300         care of bug #45876.
8301
8302 2003-07-10  Martin Baulig  <martin@ximian.com>
8303
8304         * expression.cs (TypeOfVoid): New class.
8305         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8306
8307 2003-07-10  Martin Baulig  <martin@ximian.com>
8308
8309         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8310         bug #35957.
8311
8312 2003-07-10  Martin Baulig  <martin@ximian.com>
8313
8314         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8315         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8316
8317         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8318
8319         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8320
8321 2003-07-10  Martin Baulig  <martin@ximian.com>
8322
8323         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8324         of decimal.  Fixes #42850.
8325
8326         NOTE: I also fixed the created byte blob, but this doesn't work on
8327         the MS runtime and csc never produces any byte blobs for decimal
8328         arrays.
8329
8330 2003-07-10  Martin Baulig  <martin@ximian.com>
8331
8332         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8333         structs; fixes #32068.
8334         (Block.AddChildVariableNames): Fixed #44302.
8335
8336 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8337
8338         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8339
8340 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8341
8342         * attribute.cs: And this test is onger needed.
8343
8344 2003-07-08  Martin Baulig  <martin@ximian.com>
8345
8346         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8347         inaccessible types.  Fixes #36313.
8348
8349         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8350
8351         * namespace.cs (NamespaceEntry): Create implicit entries for all
8352         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8353         implicit entries for N1.N2 and N1.
8354
8355 2003-07-08  Martin Baulig  <martin@ximian.com>
8356
8357         Rewrote the handling of namespaces to fix a lot of the issues
8358         wrt. `using' aliases etc.
8359
8360         * namespace.cs (Namespace): Splitted this class into a
8361         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8362
8363         * typemanager.cs (TypeManager.IsNamespace): Removed.
8364         (TypeManager.ComputeNamespaces): Only compute namespaces from
8365         loaded assemblies here, not the namespaces from the assembly we're
8366         currently compiling.
8367
8368 2003-07-08  Martin Baulig  <martin@ximian.com>
8369
8370         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8371
8372 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8373
8374         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8375         already fixed it.  
8376
8377         I thought about the memory savings here, but LookupTypeReflection
8378         is used under already very constrained scenarios.  Compiling
8379         corlib or mcs only exposes one hit, so it would not really reduce
8380         any memory consumption.
8381
8382 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8383
8384         * typemanager.cs: fixes bug #45889 by only adding public types from
8385         other assemblies to the list of known types.
8386
8387 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8388
8389         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8390         on the type we resolved.
8391
8392 2003-07-05  Martin Baulig  <martin@ximian.com>
8393
8394         * pending.cs (PendingImplementation.ParentImplements): Don't
8395         create the proxy if the parent is abstract.
8396
8397         * class.cs (TypeContainer.DefineIndexers): Process explicit
8398         interface implementations first.  Fixes #37714.
8399
8400 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8401
8402         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8403         defined recursively;  but since we modify the input parameters
8404         (left is set to `this' temporarily), we reset this value if the
8405         left_is_explicit is false, which gives the original semantics to
8406         the code.  
8407
8408         * literal.cs (NullPointer): new class used to represent a null
8409         literal in a pointer context.
8410
8411         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8412         type is a pointer, use a NullPointer object instead of a
8413         NullLiteral.   Closes 43687
8414
8415         (ExplicitConversion): Convert pointer values using
8416         the conv opcode to the proper type.
8417
8418         * ecore.cs (New): change ValueTypeVariable property into a method,
8419         that returns whether the valuetype is suitable for being used.
8420
8421         * expression.cs (Binary.DoNumericPromotions): Only return if we
8422         the int constant was a valid uint, and we can return both left and
8423         right as uints.  If not, we continue processing, to trigger the
8424         type conversion.  This fixes 39018.
8425
8426         * statement.cs (Block.EmitMeta): During constant resolution, set
8427         the CurrentBlock property on the emitcontext, so that we resolve
8428         constants propertly.
8429
8430 2003-07-02  Martin Baulig  <martin@ximian.com>
8431
8432         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8433         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8434
8435         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8436         than emitting it here.
8437
8438         * statement.cs: Fixed some more flow analysis bugs.
8439
8440 2003-07-02  Martin Baulig  <martin@ximian.com>
8441
8442         * class.cs (MethodData.Define): When implementing interface
8443         methods, set Final unless we're Virtual.
8444
8445         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8446         check work for interface methods.
8447
8448 2003-07-01  Martin Baulig  <martin@ximian.com>
8449
8450         * ecore.cs (EmitContext.This): Replaced this property with a
8451         GetThis() method which takes a Location argument.  This ensures
8452         that we get the correct error location for a CS0188.
8453
8454 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8455
8456         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8457         ImplicitStandardConversion.
8458
8459         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8460
8461 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8462
8463         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8464         optimization.
8465
8466 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8467
8468         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8469         constructors.
8470
8471         (MethodData.Define): Turn off initlocals for unsafe methods.
8472
8473 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8474
8475         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8476         complete;  Fixes #37521.
8477
8478         * delegate.cs: Use Modifiers.TypeAttr to compute the
8479         TypeAttributes, instead of rolling our own.  This makes the flags
8480         correct for the delegates.
8481
8482 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8483
8484         * class.cs (Constructor.Define): Set the private flag for static
8485         constructors as well.
8486
8487         * cs-parser.jay (statement_expression): Set the return value to
8488         null, to avoid a crash when we catch an error.
8489
8490 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8491
8492         * cs-parser.jay: Applied patch from Jackson that adds support for
8493         extern and unsafe modifiers to destructor declarations.
8494
8495         * expression.cs: Report error 21 if the user is trying to index a
8496         System.Array.
8497
8498         * driver.cs: Add an error message, suggested by the bug report.
8499
8500         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8501         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8502
8503 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8504
8505         * namespace.cs: Add some information to reduce FAQs.
8506
8507 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8508
8509         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8510         underlying enumeration types.  Fixes #43915.
8511
8512         * expression.cs: Treat ushort/short as legal values to be used in
8513         bitwise operations.
8514
8515 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8516
8517         * delegate.cs: transfer custom attributes for paramenters from
8518         the delegate declaration to Invoke and BeginInvoke.
8519
8520 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8521
8522         * attribute.cs: handle custom marshalers and emit marshal info
8523         for fields, too.
8524
8525 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8526
8527         * makefile.gnu: Added anonymous.cs to the compiler sources.
8528
8529 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8530
8531         * iterators.cs: Change the name of the proxy class to include two
8532         underscores.
8533
8534         * cs-parser.jay: Update grammar to include anonymous methods.
8535
8536         * anonymous.cs: new file.
8537
8538 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8539
8540         * class.cs (Field.Define): Add missing test for pointers and
8541         safety. 
8542
8543 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8544
8545         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8546         we use the stobj opcode.
8547
8548         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8549         since it wasn't the correct fix. 
8550
8551         It still is puzzling that we are required to use stobj for IntPtr
8552         which seems to be a ValueType.
8553
8554 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8555
8556         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8557         during regular simple name resolution.   Now, the trick is that
8558         instead of returning for processing the simplename, we do a
8559         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8560         contextual lookup type).   If a match is found, return that, if
8561         not, return for further composition.
8562
8563         This fixes long-standing 30485.
8564
8565         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8566         using the address to initialize an object, do an Stobj instead of
8567         using the regular Stelem.
8568
8569         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8570         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8571         Because if we are a BaseIndexerAccess that value will be true.
8572         Fixes 43643.
8573
8574         * statement.cs (GotoCase.Resolve): Return after reporting an
8575         error, do not attempt to continue. 
8576
8577         * expression.cs (PointerArithmetic.Emit): If our operand is a
8578         long, convert our constants to match the operand before
8579         multiplying.  Convert to I type before adding.   Fixes 43670.
8580
8581 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8582
8583         * enum.cs (ImplicitConversionExists) : Rename to
8584         ImplicitEnumConversionExists to remove ambiguity. 
8585
8586         * ecore.cs (NullCast): New type of cast expression class which
8587         basically is very similar to EmptyCast with the difference being
8588         it still is a constant since it is used only to cast a null to
8589         something else
8590         (eg. (string) null)
8591
8592         * convert.cs (ImplicitReferenceConversion): When casting a null
8593         literal, we return a NullCast.
8594
8595         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8596         should be around anymore.
8597
8598         The renaming (reported was slightly wrong). Corrections:
8599
8600         ConvertImplicitStandard -> ImplicitConversionStandard
8601         ConvertExplicitStandard -> ExplicitConversionStandard
8602
8603         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8604         before passing them in !
8605
8606         * convert.cs (ImplicitConversionStandard): When comparing for
8607         equal expr and target types, ensure that expr is not a
8608         NullLiteral.
8609
8610         In general, we must not be checking (expr_type ==
8611         target_type) in the top level conversion methods
8612         (ImplicitConversion, ExplicitConversion etc). This checking is
8613         done in the methods that they delegate to.
8614
8615 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8616
8617         * convert.cs: Move Error_CannotConvertType,
8618         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8619         ImplicitNumericConversion, ImplicitConversionExists,
8620         ImplicitUserConversionExists, StandardConversionExists,
8621         FindMostEncompassedType, FindMostSpecificSource,
8622         FindMostSpecificTarget, ImplicitUserConversion,
8623         ExplicitUserConversion, GetConversionOperators,
8624         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8625         TryImplicitIntConversion, Error_CannotConvertImplicit,
8626         ConvertImplicitRequired, ConvertNumericExplicit,
8627         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8628         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8629         its own file.
8630
8631         Perform the following renames:
8632
8633         StandardConversionExists -> ImplicitStandardConversionExists
8634         ConvertImplicit -> ImplicitConversion
8635         ConvertImplicitStandard -> ImplicitStandardConversion
8636         TryImplicitIntConversion -> ImplicitIntConversion
8637         ConvertImplicitRequired -> ImplicitConversionRequired
8638         ConvertNumericExplicit -> ExplicitNumericConversion
8639         ConvertReferenceExplicit -> ExplicitReferenceConversion
8640         ConvertExplicit -> ExplicitConversion
8641         ConvertExplicitStandard -> ExplicitStandardConversion
8642
8643 2003-05-19  Martin Baulig  <martin@ximian.com>
8644
8645         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8646         (TypeInfo): Added support for structs having structs as fields.
8647
8648         * ecore.cs (FieldExpr): Implement IVariable.
8649         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8650         VariableInfo for the field.
8651
8652 2003-05-18  Martin Baulig  <martin@ximian.com>
8653
8654         * expression.cs (This.DoResolve): Report a CS0027 if we're
8655         emitting a field initializer.
8656
8657 2003-05-18  Martin Baulig  <martin@ximian.com>
8658
8659         * expression.cs (This.ResolveBase): New public function.
8660         (This.DoResolve): Check for CS0188.
8661
8662         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8663         This.Resolve().
8664
8665         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8666         `instance_expression' to null if we don't have any non-static
8667         methods.
8668
8669 2003-05-18  Martin Baulig  <martin@ximian.com>
8670
8671         Reworked the way how local variables and parameters are handled by
8672         the flow analysis code.
8673
8674         * statement.cs (TypeInfo, VariableMap): New public classes.
8675         (VariableInfo): New public class.  This is now responsible for
8676         checking whether a variable has been assigned.  It is used for
8677         parameters and local variables.
8678         (Block.EmitMeta): Take the InternalParameters as argument; compute
8679         the layout of the flow vectors here.
8680         (Block.LocalMap, Block.ParameterMap): New public properties.
8681         (FlowBranching): The .ctor doesn't get the InternalParameters
8682         anymore since Block.EmitMeta() now computes the layout of the flow
8683         vector.
8684         (MyStructInfo): This class is now known as `StructInfo' and nested
8685         in `TypeInfo'; we don't access this directly anymore.
8686
8687         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8688         property and removed IsAssigned(), IsFieldAssigned(),
8689         SetAssigned() and SetFieldAssigned(); we now call them on the
8690         VariableInfo so we don't need to duplicate this code everywhere.
8691
8692         * expression.cs (ParameterReference): Added `Block block' argument
8693         to the .ctor.
8694         (LocalVariableReference, ParameterReference, This): The new
8695         VariableInfo class is now responsible for all the definite
8696         assignment stuff.
8697
8698         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8699         IsParameterAssigned, SetParameterAssigned): Removed.
8700
8701 2003-05-18  Martin Baulig  <martin@ximian.com>
8702
8703         * typemanager.cs (InitCoreTypes): Try calling
8704         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8705         the 3-args-version.  Corlib now also needs our `void_type'.
8706         (GetMethod): Added overloaded version which takes an optional
8707         `bool report_errors' to allow lookups of optional methods.
8708
8709 2003-05-12  Martin Baulig  <martin@ximian.com>
8710
8711         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8712         only used for locals and not for parameters.
8713
8714 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8715
8716         * support.cs (InternalParameters.ParameterType): Return the
8717         ExternalType of the parameter.
8718
8719         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8720         they were unused.
8721
8722 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8723
8724         * class.cs (MethodData.Define): Do not set the `newslot' on
8725         interface members, if they are also flagged as "override".
8726
8727         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8728         better code for ++i and i++.  This only works for static fields
8729         and local variables.
8730
8731         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8732         want to pull the DeclSpace out of the builder_to_declspace instead
8733         of the TypeBuilder (like in TypeContainer.FindMembers).
8734
8735         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8736         instead of LookupTypeContainer.  Fixes the crash on .NET for
8737         looking up interface members.
8738
8739         * const.cs: Create our own emit context during the Definition
8740         stage, so that constants are evaluated in the proper context, when
8741         a recursive definition happens.
8742
8743 2003-05-11  Martin Baulig  <martin@ximian.com>
8744
8745         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8746         new block for a switch section.
8747         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8748         the adding/lookup in the switch block.  Fixes #39828.
8749
8750 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8751
8752         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8753         functionality: I needed to convert the data after I had performed
8754         the add/sub operation into the operands type size.
8755
8756         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8757         pass the type for the box operation, otherwise the resulting
8758         object would have been of type object.
8759
8760         (BoxedCast): Add constructor to specify the type to box as.
8761
8762 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8763
8764         * iterators.cs: I was reusing the `count' variable inadvertently,
8765         take steps to not allow this to happen.
8766
8767 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8768
8769         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8770         by creating an array at the point where the params starts and
8771         putting all those arguments there, then adjusting the size of the
8772         array.
8773
8774 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8775
8776         * expression.cs (New.AddressOf): Implement interface
8777         IMemoryLocation.  This is used when the `new' operator is used in
8778         the context of an invocation to a method on a value type.
8779
8780         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8781         example. 
8782
8783         * namespace.cs: Also check the using aliases here.
8784
8785         * driver.cs: Move the test for using validity after the types have
8786         been entered, so we do a single pass that also includes the using
8787         aliases. 
8788
8789         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8790         in the regular case.   CreateSiblingForFinally is doing extra
8791         error checking.
8792
8793         * attribute.cs (GetAttributeArgumentExpression): Store the result
8794         on an out value, and use the return value to indicate failure
8795         instead of using null (which is a valid return for Constant.GetValue).
8796
8797         * statement.cs: Perform the analysis flow for the increment
8798         portion after the statement, because this will be the real flow of
8799         execution.  Fixes #42385
8800
8801         * codegen.cs (EmitContext.EmitArgument,
8802         EmitContext.EmitStoreArgument): New helper functions when the
8803         RemapToProxy flag is set.
8804
8805         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8806         function.
8807
8808         Add support for remapping parameters. 
8809
8810         * iterators.cs: Propagate parameter values;  Store parameter
8811         values in the proxy classes.
8812
8813 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8814
8815         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8816         need a proxy reference;  I do not know what I was thinking
8817
8818         * cs-parser.jay (constructor_initializer): catch another error,
8819         and display nice message.
8820
8821         (field_declaration): catch void field declaration
8822         to flag a better error. 
8823
8824         * class.cs (MemberBase.CheckBase): Report an error instead of a
8825         warning if a new protected member is declared in a struct. 
8826         (Field.Define): catch the error of readonly/volatile.
8827
8828         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8829
8830         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8831         volatile variable is taken
8832
8833 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8834
8835         * statement.cs (Fixed.Resolve): Report an error if we are not in
8836         an unsafe context.
8837
8838 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8839
8840         * typemanager.cs: reuse the code that handles type clashes for
8841         delegates and enumerations.
8842
8843         * class.cs (Report28): Always report.
8844
8845         * expression.cs (EncodeAsAttribute): Allow nulls here.
8846
8847 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8848
8849         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8850         the functionality for testing whether an expression is valid for
8851         an attribute here.  Also handle the case of arrays of elements
8852         being stored. 
8853
8854         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8855         encoding a linear array into an array of objects that are suitable
8856         to be passed to an CustomAttributeBuilder.
8857
8858         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8859
8860         * ecore.cs: (FieldExpr): Handle field remapping here.
8861
8862         * iteratators.cs: Pass the instance variable (if the method is an
8863         instance method) to the constructors, so we can access the field
8864         variables on the class.
8865
8866         TODO: Test this with structs.  I think the THIS variable on
8867         structs might have to be a pointer, and not a refenrece
8868
8869 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8870
8871         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8872         local variables to fields in a proxy class.
8873
8874         * iterators.cs (PopulateProxy): Rename our internal fields to
8875         <XXX>.  
8876         Create a <THIS> field if we are an instance method, so we can
8877         reference our parent container variables.
8878         (MapVariable): Called back from the EmitContext code to enter a
8879         new variable to field mapping into the proxy class (we just create
8880         a FieldBuilder).
8881
8882         * expression.cs
8883         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8884         for using the remapped locals to fields.
8885
8886         I placed the code here, because that gives the same semantics to
8887         local variables, and only changes the Emit code.
8888
8889         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8890         statements inside iterators.
8891         (VariableInfo): Add a FieldBuilder for the cases when we are
8892         remapping local variables to fields in a proxy class
8893
8894         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8895         current_block != null.
8896
8897         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8898         not cope with strings, as it has been moved to the
8899         TableSwitchEmit.  Fixed bug in switch generation.
8900
8901         * expression.cs (New.DoResolve): Provide more context for the user
8902         when reporting an error.
8903
8904         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8905         pointers. 
8906
8907         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8908         check the permissions for it.  Note than in a type-resolution
8909         context the check was already present in DeclSpace.ResolveType,
8910         but was missing from the MemberAccess.
8911
8912         (ArrayCreation.CheckIndices): warn if the user has
8913         more nested levels of expressions, but there are no more
8914         dimensions specified.  Avoids crash on bug 41906.
8915
8916 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8917
8918         * statement.cs (Block): replace Implicit bool, for a generic
8919         flags.   
8920         New flag: `Unchecked'.  This is used during the EmitMeta phase
8921         (which is out-of-line with the regular Resolve/Emit process for a
8922         statement, as this is done ahead of time, but still gets a chance
8923         to call constant resolve).
8924
8925         (Block.Flags): new enum for adding a new flag.
8926
8927         (Block.EmitMeta): track the state of unchecked.
8928
8929         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8930         to enable constant resolution to work there as well.
8931
8932 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8933
8934         * typemanager.cs (ienumerable_type): Also look up
8935         System.Collections.IEnumerable. 
8936
8937 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8938
8939         TODO: Test more than one conditional per method.
8940
8941         * class.cs (Indexer.Define): Report the location where the user is
8942         referencing the unsupported feature.
8943
8944         (MethodData): Overload the use of `conditionals' to
8945         minimize the creation of needless ArrayLists.   This saves roughly
8946         212kb on my machine.
8947
8948         (Method): Implement the new IIteratorContainer interface.
8949         (Method.SetYields): Implement the method by setting the ModFlags
8950         to contain METHOD_YIELDS.
8951
8952         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8953         which just got set to null.
8954
8955         * iterators.cs: New file.
8956
8957         (Yield, YieldBreak): New statements.
8958
8959         * statement.cs (Return.Resolve): Flag an error if we are used in
8960         an iterator method.
8961
8962         * codegen.cs (InIterator): New flag set if the code is being
8963         compiled in an iterator method.
8964
8965         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8966         internal modifier, and we just use it to avoid adding extra
8967         fields, as this is seldom used.  
8968
8969         * cs-parser.jay: Add yield_statement (yield and yield break).
8970
8971         * driver.cs: New flag -v2 to turn on version 2 features. 
8972
8973         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8974         hashtable when v2 is enabled.
8975
8976 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8977
8978         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8979         there is already a namespace defined with this name.
8980
8981         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8982         people upgraded their corlibs.
8983
8984         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8985         always use fully qualified types, no need to use the compiler
8986         front end.
8987
8988         (TypeManager.IsNamespace): Use binarysearch.
8989
8990         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8991         AddDelegate): I did not quite use the new IsValid API properly: I
8992         have to pass the short-name and the fullname.  I was passing only
8993         the basename instead of the fullname sometimes. 
8994
8995         (TypeContainer.DefineType): call NamespaceClash.
8996
8997         * interface.cs (Interface.DefineType): use NamespaceClash before
8998         defining the type.
8999
9000         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9001         defining the type.
9002
9003         * enum.cs: (Enum.DefineType): use NamespaceClash before
9004         defining the type.
9005
9006         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9007         speed increase.  First, use the negative_hits cache when we get a
9008         negative.  Second, add the type with its full original name
9009         instead of the new . and + encoded name (reflection uses + to
9010         separate type from a nested type).  Use LookupTypeReflection
9011         directly which bypasses the type->name hashtable (that we already
9012         know does not contain the type.
9013
9014         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9015         location/container type. 
9016
9017         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9018
9019 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9020
9021         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9022
9023         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9024         method is being referenced in the method group from a static
9025         context, and report error 120 if so.
9026
9027         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9028         Error118. 
9029
9030         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9031         is created, we create the A namespace).
9032
9033         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9034         Fixes #41591
9035
9036 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9037
9038         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9039         invocation to ModuleBuilder.GetType with the same values will
9040         return a new type instance, so we need to cache its return
9041         values. 
9042
9043         * expression.cs (Binary.ResolveOperator): Only allow the compare
9044         operators on enums if they are of the same type.
9045
9046         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9047         types of ValueType on their own case.  Before we were giving them
9048         the same treatment as objects.
9049
9050         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9051         fullname.  Short name is used to compare against container name.
9052         Fullname is used to check against defined namespace names.
9053
9054         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9055         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9056
9057         (Method.CheckBase): Call parent.
9058         (MemberBase.CheckBase): Check for protected members on sealed
9059         classes.
9060         (PropertyBase.CheckBase): Call parent.
9061         (Field.Define): Call parent.
9062
9063         * report.cs: Negative error codes are now mapped to 8000 - code,
9064         so that the display is render more nicely.
9065
9066         * typemanager.cs: Do not use try/catch, instead report a regular
9067         error. 
9068
9069         (GetPointerType, GetReferenceType): These methods provide
9070         mechanisms to obtain the T* and T& from a T.  We had the code
9071         previously scattered around the code base, and it also used
9072         TypeManager.LookupType that would go through plenty of caches.
9073         This one goes directly to the type source.
9074
9075         In some places we did the Type.GetType followed by
9076         ModuleBuilder.GetType, but not in others, so this unifies the
9077         processing as well.
9078
9079         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9080         statements now that we have namespace information.
9081
9082         * typemanager.cs (IsNamespace): New method, returns whether the
9083         string presented is a namespace or not.
9084
9085         (ComputeNamespaces): New public entry point, computes the list of
9086         available namespaces, using the GetNamespaces API call in Mono, or
9087         the slower version in MS.NET.   
9088
9089         Now before we start the semantic analysis phase, we have a
9090         complete list of namespaces including everything that the user has
9091         provided.
9092
9093         Deleted old code to cache namespaces in .nsc files.
9094
9095 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9096
9097         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9098         class/struct location definition Location for the implicit
9099         constructor location.
9100
9101         (Operator.Define): Use the location of the operator for the
9102         implicit Method definition.
9103
9104         (Constructor.Emit): use the constructor location for the implicit
9105         base initializer constructor.
9106
9107         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9108         and the Expression class now contains two new methods:
9109
9110         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9111         isolate type lookup from the rest of the resolution process.
9112
9113         Since we use Expressions to hold type definitions due to the way
9114         we parse the input we have historically overloaded Resolve to
9115         perform the Type lookups if a special flag is passed.  Now this is
9116         eliminated and two methods take their place. 
9117
9118         The differences in the two methods between xStep and xTerminal is
9119         that xStep is involved in our current lookup system that uses
9120         SimpleNames to compose a name, while xTerminal is used just to
9121         catch the case where the simplename lookup failed.
9122
9123 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9124
9125         * expression.cs (ResolveMemberAccess): Remove redundant code.
9126         TypeExpr expressions are always born fully resolved.
9127
9128         * interface.cs (PopulateMethod): Do not lookup the types twice.
9129         We were doing it once during SemanticAnalysis and once during
9130         PopulateMethod.
9131
9132         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9133         in local variable type definitions, were being returned as a
9134         SimpleName (we decomposed everything into a string), that is
9135         because primary_expression was being used instead of a type in the
9136         grammar (reduce/reduce conflicts).
9137
9138         The part that was wrong is that we converted the expression into a
9139         string (an oversimplification in one hand, compounded with primary
9140         expressions doing string concatenation).
9141
9142         So things like:
9143
9144         A.B.C [] x;
9145
9146         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9147         using clauses from working on this particular context.  And a type
9148         was being matched directly against "A.B.C[]".
9149
9150         We now use the correct approach, and allow for ComposedCast to be
9151         part of the unary expression.  So the "A.B.C []" become a composed
9152         cast of "A.B.C" (as a nested group of MemberAccess with a
9153         SimpleName at the end) plus the rank composition "[]". 
9154
9155         Also fixes 35567
9156
9157 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9158
9159         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9160         for the access level checking.
9161
9162         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9163         `TypeContainer container', because I kept getting confused when I
9164         was debugging this code.
9165
9166         * expression.cs (Indexers): Instead of tracking getters/setters,
9167         we now track them in parallel.  We create one arraylist less, but
9168         most importantly it is possible now for the LValue code to find a
9169         matching get for a set.
9170
9171         (IndexerAccess.DoResolveLValue): Update the code.
9172         GetIndexersForType has been modified already to extract all the
9173         indexers from a type.  The code assumed it did not.
9174
9175         Also make the code set the correct return type for the indexer.
9176         This was fixed a long time ago for properties, but was missing for
9177         indexers.  It used to be void_type.
9178
9179         (Binary.Emit): Test first for doubles instead of
9180         floats, as they are more common.
9181
9182         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9183         when dealing with floats and the <=, >= operators.  This fixes bug
9184         #39314 
9185
9186         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9187         to load the array value by emitting a load on the foreach variable
9188         type.  This was incorrect.  
9189
9190         We now emit the code to load an element using the the array
9191         variable type, and then we emit the conversion operator.
9192
9193         Fixed #40176
9194
9195 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9196
9197         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9198
9199 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9200
9201         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9202         test for protection before we test for signatures. 
9203
9204         (MethodSignature.ToString): implement.
9205
9206         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9207         to the case where we reduced into a LongConstant.
9208
9209         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9210         depend on whether the information is acurrate, because the
9211         Microsoft runtime will always claim that the array type is public,
9212         regardless of the real state.
9213
9214         If the type is a pointer, another problem happens: the type is
9215         reported as non-public in Microsoft.  
9216
9217         In both cases we have to call CheckAccessLevel recursively with
9218         the underlying type as the argument to be tested.
9219
9220 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9221
9222         * assign.cs (Assign.Emit): If we are dealing with a compound
9223         assignment expression, we should use the code path that stores the
9224         intermediate result in a temporary value.  This fixes #40903.
9225
9226         *expression.cs (Indirection.ToString): Provide ToString method for
9227         debugging. 
9228
9229 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9230
9231         * class.cs: Null out fields holding references to Block objects so
9232         they can be garbage collected.
9233
9234         * expression.cs (OverloadResolve): Remove unused local.
9235
9236 2003-04-07  Martin Baulig  <martin@ximian.com>
9237
9238         * codegen.cs (EmitContext.CurrentFile): New public field.
9239         (EmitContext.Mark): Use the CurrentFile to check whether the
9240         location is in the correct file.
9241         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9242
9243 2003-04-07  Martin Baulig  <martin@ximian.com>
9244
9245         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9246
9247         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9248         location.  [FIXME: The location argument which gets passed to this
9249         method is sometimes wrong!]
9250
9251 2003-04-07  Nick Drochak <ndrochak@gol.com>
9252
9253         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9254
9255 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9256
9257         * expression.cs (Indirection.EmitAssign): We were using the
9258         temporary, but returning immediately instead of continuing the
9259         EmitAssing flow.
9260
9261 2003-04-06  Martin Baulig  <martin@ximian.com>
9262
9263         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9264         if it's a nested child, but also deriving from the outer class.
9265         See test 190.cs.
9266
9267         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9268         nested child, but also deriving from the outer class.  See
9269         test-190.cs.
9270         (FilterWithClosure): We may access private members of the outer
9271         class if we're a nested child and deriving from the outer class.
9272         (RealMemberLookup): Only set `closure_private_ok' if the
9273         `original_bf' contained BindingFlags.NonPublic.
9274
9275 2003-04-05  Martin Baulig  <martin@ximian.com>
9276
9277         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
9278         probe if its a type parameter, and if so, flag an error.
9279
9280         * decl.cs: Move here the SetParameterInfo code from class.cs.
9281         Handle IsGeneric here.
9282
9283         Handle a variety of errors in the parameter info definition.
9284
9285         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
9286         type parameters here.
9287
9288         * cs-parser.jay (class_declaration): report errors for parameters
9289         here as well.
9290
9291 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
9292
9293         * generic.cs: New file, contains support code for generics.
9294
9295         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
9296         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
9297
9298         Update parser for the above removals.
9299
9300         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
9301         now taken care of in the parser.
9302
9303 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9304
9305         * class.cs (Event.Define): Do not allow abstract events to have
9306         initializers. 
9307
9308 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9309
9310         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9311         block in event declarations.
9312
9313         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9314         value type, get its address.
9315
9316         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9317         leaving a class on the stack instead of a boolean value (int
9318         0/1).  Change the code so we compare against null, and then the
9319         result against zero.
9320
9321         * class.cs (TypeContainer.GetClassBases): We were checking for the
9322         parent class being sealed too late.
9323
9324         * expression.cs (Binary.Emit): For <= and >= when dealing with
9325         floating point values, use cgt.un and clt.un instead of cgt and
9326         clt alone.
9327
9328 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9329
9330         * statement.cs: Apply the same optimization as MS: skip the 
9331         GetEnumerator returning an IEnumerator, and use the one returning a 
9332         CharEnumerator instead. This allows us to avoid the try-finally block 
9333         and the boxing.
9334
9335 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9336
9337         * cs-parser.jay: Attributes cannot be applied to
9338                          namespaces. Fixes #40473
9339
9340 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9341
9342         * class.cs:
9343         (Add*): check if the name is valid using the full name for constants,
9344         fields, properties and events.
9345
9346 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9347
9348         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9349         char constants to be part of the enumeration.
9350
9351         * expression.cs (Conditional.DoResolve): Add support for operator
9352         true. Implements the missing functionality from 14.12
9353
9354         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9355         operator true/false as required by the spec.
9356
9357         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9358         implicit conversion to boolean.
9359
9360         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9361         also one where the type implements `operator true'. 
9362
9363         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9364         get an expression that will invoke operator true based on an
9365         expression.  
9366
9367         (GetConversionOperators): Removed the hack that called op_True
9368         here.  
9369
9370         (Expression.ResolveBoolean): Move this from Statement.
9371
9372 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9373
9374         * ecore.cs (FieldExpr): do not allow initialization of initonly
9375         fields on derived classes
9376
9377 2003-03-13  Martin Baulig  <martin@ximian.com>
9378
9379         * statement.cs (Block.Emit): Call ig.BeginScope() and
9380         ig.EndScope() when compiling with debugging info; call
9381         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9382
9383 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9384
9385         * expression.cs (Indexers): Do not construct immediately, allow
9386         for new members to be appended as we go.  Fixes 38143
9387
9388 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9389
9390         * expression.cs: save/restore context when resolving an unchecked
9391         expression.
9392
9393 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9394
9395         * cfold.cs: Catch division by zero in modulus operator during
9396         constant folding.
9397
9398 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9399
9400         * interface.cs (Interface.DefineMembers): Avoid defining members
9401         twice. 
9402
9403 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9404
9405         * driver.cs: handle the +/- options for -noconfig
9406
9407         * statement.cs (Unckeched.Resolve): Also track the state of
9408         unchecked in the Resolve phase.
9409
9410 2003-02-27  Martin Baulig  <martin@ximian.com>
9411
9412         * ecore.cs (Expression.MemberLookup): Don't create a
9413         MethodGroupExpr for something which is not a method.  Fixes #38291.
9414
9415 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9416
9417         * class.cs (MemberBase.CheckParameters): Also check that the type
9418         is unmanaged if it is a pointer.
9419
9420         * expression.cs (SizeOf.Resolve): Add location information.
9421
9422         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9423         a managed type is declared.
9424
9425         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9426         parameter modifiers as well.  Fixes bug 38606
9427
9428         * class.cs: Very sad.  Am backing out the speed up changes
9429         introduced by the ArrayList -> Array in the TypeContainer, as they
9430         were not actually that much faster, and introduced a bug (no error
9431         reports on duplicated methods).
9432
9433         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9434         source first, this will guarantee that we have a valid expression
9435         before calling in lower levels functions that will require a
9436         resolved object.  Then use this original_source in the
9437         target.ResolveLValue instead of the original source that was
9438         passed to us.
9439
9440         Another change.  Use target.Resolve instead of LValueResolve.
9441         Although we are resolving for LValues, we will let the Assign code
9442         take care of that (it will be called again from Resolve).  This
9443         basically allows code like this:
9444
9445         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9446         class Y { void A (X x) { x [0] += o; }
9447
9448         The problem was that the indexer was trying to resolve for
9449         set_Item (idx, object o) and never finding one.  The real set_Item
9450         was set_Item (idx, X).  By delaying the process we get the right
9451         semantics. 
9452
9453         Fixes bug 36505
9454
9455 2003-02-23  Martin Baulig  <martin@ximian.com>
9456
9457         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9458         while calling DoEmit ().
9459
9460         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9461         source files; if you use the #line directive inside a method, the
9462         compiler stops emitting line numbers for the debugger until it
9463         reaches the end of the method or another #line directive which
9464         restores the original file.
9465
9466 2003-02-23  Martin Baulig  <martin@ximian.com>
9467
9468         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9469
9470 2003-02-23  Martin Baulig  <martin@ximian.com>
9471
9472         * statement.cs (Block.AddChildVariableNames): We need to call this
9473         recursively, not just for our immediate children.
9474
9475 2003-02-23  Martin Baulig  <martin@ximian.com>
9476
9477         * class.cs (Event.Define): Always make the field private, like csc does.
9478
9479         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9480         actually work, fixes bug #37521.
9481
9482 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9483
9484         * delegate.cs: When creating the various temporary "Parameters"
9485         classes, make sure that we call the ComputeAndDefineParameterTypes
9486         on those new parameters (just like we do with the formal ones), to
9487         allow them to be resolved in the context of the DeclSpace.
9488
9489         This fixes the bug that Dick observed in Bugzilla #38530.
9490
9491 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9492
9493         * expression.cs (ResolveMemberAccess): When resolving a constant,
9494         do not attempt to pull a constant if the value was not able to
9495         generate a valid constant.
9496
9497         * const.cs (LookupConstantValue): Do not report more errors than required.
9498
9499 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9500
9501         * expression.cs: fixes bug #38328.
9502
9503 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9504
9505         * class.cs: Changed all the various members that can be part of a
9506         class from being an ArrayList to be an Array of the right type.
9507         During the DefineType type_list, interface_list, delegate_list and
9508         enum_list are turned into types, interfaces, delegates and enums
9509         arrays.  
9510
9511         And during the member population, indexer_list, event_list,
9512         constant_list, field_list, instance_constructor_list, method_list,
9513         operator_list and property_list are turned into their real arrays.
9514
9515         Although we could probably perform this operation earlier, for
9516         good error reporting we need to keep the lists and remove the
9517         lists for longer than required.
9518
9519         This optimization was triggered by Paolo profiling the compiler
9520         speed on the output of `gen-sample-program.pl' perl script. 
9521
9522         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9523         not crash in methods like MemberLookupFailed that use this field.  
9524
9525         This problem arises when the compiler fails to resolve a type
9526         during interface type definition for example.
9527
9528 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9529
9530         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9531         inherit from System.Object, so we have to stop at null, not only
9532         when reaching System.Object.
9533
9534 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9535
9536         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9537         DeclaredOnly because the parent indexer might have had a different
9538         name, but did not loop until the top of the hierarchy was reached.
9539
9540         The problem this one fixes is 35492: when a class implemented an
9541         indexer from an interface, we were getting the interface method
9542         (which was abstract) and we were flagging an error (can not invoke
9543         abstract method).
9544
9545         This also keeps bug 33089 functioning, and test-148 functioning.
9546
9547         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9548         out if a method is special is to see if it is declared in a
9549         property or event, or whether it is one of the predefined operator
9550         names.   This should fix correctly #36804.
9551
9552 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9553
9554         The goal here is to remove the dependency on EmptyCast.Peel ().
9555         Killing it completely.
9556
9557         The problem is that currently in a number of places where
9558         constants are expected, we have to "probe" for an EmptyCast, and
9559         Peel, which is not the correct thing to do, as this will be
9560         repetitive and will likely lead to errors. 
9561
9562         The idea is to remove any EmptyCasts that are used in casts that
9563         can be reduced to constants, so we only have to cope with
9564         constants. 
9565
9566         This bug hunt was triggered by Bug 37363 and the desire to remove
9567         the duplicate pattern where we were "peeling" emptycasts to check
9568         whether they were constants.  Now constants will always be
9569         constants.
9570
9571         * ecore.cs: Use an enumconstant here instead of wrapping with
9572         EmptyCast.  
9573
9574         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9575         throwing me off.  By handling this we can get rid of a few hacks.
9576
9577         * statement.cs (Switch): Removed Peel() code.
9578
9579 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9580
9581         * class.cs: Location information for error 508
9582
9583         * expression.cs (New.DoResolve): Add a guard against double
9584         resolution of an expression.  
9585
9586         The New DoResolve might be called twice when initializing field
9587         expressions (see EmitFieldInitializers, the call to
9588         GetInitializerExpression will perform a resolve on the expression,
9589         and later the assign will trigger another resolution
9590
9591         This leads to bugs (#37014)
9592
9593         * delegate.cs: The signature for EndInvoke should contain any ref
9594         or out parameters as well.  We were not doing this in the past. 
9595
9596         * class.cs (Field.Define): Do not overwrite the type definition
9597         inside the `volatile' group.  Turns out that volatile enumerations
9598         were changing the type here to perform a validity test, which
9599         broke conversions. 
9600
9601 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9602
9603         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9604         and structs, we do not want to load the instance variable
9605
9606         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9607         enum_type has to be handled like an object reference (implicit
9608         conversions exists from this to object), but the regular IsClass
9609         and IsValueType tests will never return true for this one.
9610
9611         Also we use TypeManager.IsValueType instead of type.IsValueType,
9612         just for consistency with the rest of the code (this is only
9613         needed if we ever use the construct exposed by test-180.cs inside
9614         corlib, which we dont today).
9615
9616 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9617
9618         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9619         just InternalCall.
9620
9621 2003-02-09  Martin Baulig  <martin@ximian.com>
9622
9623         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9624         (Namespace.DefineNamespaces): New static public method; this is
9625         called when we're compiling with debugging to add all namespaces
9626         to the symbol file.
9627
9628         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9629         pass it to the Namespace's .ctor.
9630
9631         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9632         and MethodBase arguments; pass the namespace ID to the symwriter;
9633         pass the MethodBase instead of the token to the symwriter.
9634         (SymbolWriter.DefineNamespace): New method to add a namespace to
9635         the symbol file.
9636
9637 2003-02-09  Martin Baulig  <martin@ximian.com>
9638
9639         * symbolwriter.cs: New file.  This is a wrapper around
9640         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9641         methods here in near future.
9642
9643 2003-02-09  Martin Baulig  <martin@ximian.com>
9644
9645         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9646         ILGenerator.MarkSequencePoint() which are actually used by the
9647         symbol writer.
9648
9649 2003-02-09  Martin Baulig  <martin@ximian.com>
9650
9651         * location.cs (SourceFile): New public sealed class.  This
9652         contains the name and an index which is used in the location's token.
9653         (Location): Reserve an appropriate number of bits in the token for
9654         the source file instead of walking over that list, this gives us a
9655         really huge performance improvement when compiling with debugging.
9656
9657         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9658         `SourceFile' argument instead of a string.
9659         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9660         but don't parse/tokenize here, we need to generate the list of all
9661         source files before we do that.
9662         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9663         the files.
9664
9665         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9666         instead of a string.
9667
9668         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9669         of a string.
9670
9671 2003-02-09  Martin Baulig  <martin@ximian.com>
9672
9673         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9674         filename on `#line default'.
9675
9676 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9677
9678         * statement.cs: don't clear the pinned var when the fixed statement
9679         returns from the method (fixes bug#37752).
9680
9681 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9682
9683         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9684         to IsValueType.
9685
9686 2003-02-07  Martin Baulig  <martin@ximian.com>
9687
9688         * driver.cs: Removed the `--debug-args' command line argument.
9689
9690         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9691         automatically by the AsssemblyBuilder.
9692         (CodeGen.InitializeSymbolWriter): We don't need to call any
9693         initialization function on the symbol writer anymore.  This method
9694         doesn't take any arguments.
9695
9696 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9697
9698         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9699         from referenced assemblies as well.
9700
9701 2003-02-02  Martin Baulig  <martin@ximian.com>
9702
9703         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9704
9705 2003-02-02  Martin Baulig  <martin@ximian.com>
9706
9707         * class.cs (Constructor.Emit): Open the symbol writer before
9708         emitting the constructor initializer.
9709         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9710         single-stepping through constructor initializers.
9711
9712 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9713
9714         * class.cs: Handle error 549: do not allow virtual methods in
9715         sealed classes. 
9716
9717 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9718
9719         * decl.cs: Check access levels when resolving types
9720
9721 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9722
9723         * statement.cs: Add parameters and locals set in catch blocks that might 
9724         return to set vector
9725
9726 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9727
9728         * class.cs (Operator): Set the SpecialName flags for operators.
9729
9730         * expression.cs (Invocation.DoResolve): Only block calls to
9731         accessors and operators on SpecialName methods.
9732
9733         (Cast.TryReduce): Handle conversions from char constants.
9734
9735
9736 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9737
9738         * statement.cs: small memory and time optimization in FlowBranching.
9739
9740 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9741
9742         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9743         problem that the last fix but in the other sid (Set).
9744
9745         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9746         access when there is no indexer in the hierarchy.
9747
9748 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9749
9750         * class.cs: Combine some if statements.
9751
9752 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9753
9754         * driver.cs: fixed bug #37187.
9755
9756 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9757
9758         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9759         any indexer, it's needed to build a list with all the indexers in the
9760         hierarchy (AllGetters), else we have problems. Fixes #35653.
9761
9762 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9763
9764         * class.cs (MethodData.Define): It is wrong for an interface
9765         implementation to be static in both cases: explicit and implicit.
9766         We were only handling this in one case.
9767
9768         Improve the if situation there to not have negations.
9769
9770         * class.cs (Field.Define): Turns out that we do not need to check
9771         the unsafe bit on field definition, only on usage.  Remove the test.
9772
9773 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9774
9775         * driver.cs: use assembly.Location instead of Codebase (the latest
9776         patch made mcs fail when using MS assemblies).
9777
9778 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9779
9780         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9781         get the path to *corlib.dll.
9782
9783 2003-01-21  Nick Drochak <ndrochak@gol.com>
9784
9785         * cs-tokenizer.cs:
9786         * pending.cs:
9787         * typemanager.cs: Remove compiler warnings
9788
9789 2003-01-20  Duncan Mak  <duncan@ximian.com>
9790
9791         * AssemblyInfo.cs: Bump the version number to 0.19.
9792
9793 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9794
9795         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9796
9797 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9798
9799         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9800
9801 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9802
9803         * cs-parser.jay: Small fix: we were not comparing the constructor
9804         name correctly.   Thanks to Zoltan for the initial pointer.
9805
9806 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9807
9808         * cs-tokenizer.cs: Set file name when specified with #line
9809
9810 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9811
9812         * cs-parser.jay: Only perform the constructor checks here if we
9813         are named like the class;  This will help provider a better
9814         error.  The constructor path is taken when a type definition is
9815         not found, but most likely the user forgot to add the type, so
9816         report that rather than the constructor error.
9817
9818 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9819
9820         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9821         allocations.
9822
9823 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9824
9825         * cs-parser.jay: Add cleanup call.
9826
9827 2003-01-13  Duncan Mak  <duncan@ximian.com>
9828
9829         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9830         consistent with other methods.
9831
9832 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9833
9834         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9835
9836 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9837
9838         * attribute.cs: only set GuidAttr to true when we have a
9839         GuidAttribute.
9840
9841 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9842
9843         * ecore.cs:
9844         * expression.cs:
9845         * typemanager.cs: fixes to allow mcs compile corlib with the new
9846         Type.IsSubclassOf fix.
9847
9848 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9849
9850         * expression.cs (LocalVariableReference.DoResolve): Classify a
9851         constant as a value, not as a variable.   Also, set the type for
9852         the variable.
9853
9854         * cs-parser.jay (fixed_statement): take a type instead of a
9855         pointer_type, so we can produce a better error message later.
9856
9857         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9858         as an error.  
9859
9860         (For.DoEmit): Make inifinite loops have a
9861         non-conditional branch back.
9862
9863         (Fixed.DoEmit): First populate the pinned variables, then emit the
9864         statement, then clear the variables.  Before I was emitting the
9865         code once for each fixed piece.
9866
9867
9868 2003-01-08  Martin Baulig  <martin@ximian.com>
9869
9870         * statement.cs (FlowBranching.MergeChild): A break in a
9871         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9872
9873 2003-01-08  Martin Baulig  <martin@ximian.com>
9874
9875         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9876         lives in the same number space than `param_map'.  Fixes #36154.
9877
9878 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9879
9880         * cs-parser.jay (constructor_declaration): Set the
9881         Constructor.ModFlags before probing for it.  This makes the
9882         compiler report 514, 515 and 132 (the code was there, but got
9883         broken). 
9884
9885         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9886         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9887         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9888
9889 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9890
9891         * enum.cs: create the enum static fields using the enum type.
9892
9893 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9894
9895         * class.cs: don't try to create the ParamBuilder for the return
9896         type if it's not needed (and handle it breaking for the ms runtime
9897         anyway).
9898
9899 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9900
9901         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9902
9903 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9904
9905         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9906         the command.   This showed up while compiling the JANET source
9907         code, which used \r as its only newline separator.
9908
9909 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9910
9911         * class.cs (Method.Define): If we are an operator (because it
9912         reuses our code), then set the SpecialName and HideBySig.  #36128
9913
9914 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9915
9916         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9917         exception, report error 120 `object reference required'.
9918
9919         * driver.cs: Add --pause option, used during to measure the size
9920         of the process as it goes with --timestamp.
9921
9922         * expression.cs (Invocation.DoResolve): Do not allow methods with
9923         SpecialName to be invoked.
9924
9925 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9926
9927         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9928         number before adding it.
9929
9930 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9931
9932         * ecore.cs (StandardImplicitConversion): When in an unsafe
9933         context, we allow conversion between void * to any other pointer
9934         type. This fixes bug #35973.
9935
9936 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9937
9938         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9939         is not thrown when extensionless outputs are used 
9940
9941 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9942
9943         * rootcontext.cs: fixed compilation of corlib.
9944
9945 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9946
9947         * attribute.cs (Attributes.Contains): Add new method.
9948
9949         * class.cs (MethodCore.LabelParameters): if the parameter is an
9950         `out' parameter, check that no attribute `[In]' has been passed.
9951
9952         * enum.cs: Handle the `value__' name in an enumeration.
9953
9954 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9955
9956         * decl.cs: Added special case to allow overrides on "protected
9957         internal" methods
9958
9959 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9960
9961         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9962         since it makes much more sense.
9963
9964         (Attributes.ctor): Don't require a Location parameter.
9965
9966         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9967
9968         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9969         since we already have that information per attribute.
9970
9971         * everywhere : make appropriate changes.
9972
9973         * class.cs (LabelParameters): Write the code which actually
9974         applies attributes to the return type. We can't do this on the MS
9975         .NET runtime so we flag a warning in the case an exception is
9976         thrown.
9977
9978 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9979
9980         * const.cs: Handle implicit null conversions here too.
9981
9982 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9983
9984         * class.cs (MethodCore.LabelParameters): Remove the extra
9985         Type [] parameter since it is completely unnecessary. Instead
9986         pass in the method's attributes so that we can extract
9987         the "return" attribute.
9988
9989 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9990
9991         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9992         of ignoring it and letting the compile continue.
9993
9994         * typemanager.cs (ChangeType): use an extra argument to return an
9995         error condition instead of throwing an exception.
9996
9997 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9998
9999         * expression.cs (Unary.TryReduce): mimic the code for the regular
10000         code path.  Perform an implicit cast in the cases where we can
10001         implicitly convert to one of the integral types, and then reduce
10002         based on that constant.   This fixes bug #35483.
10003
10004 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10005
10006         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10007
10008 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10009
10010         * namespace.cs: fixed bug #35489.
10011
10012 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10013
10014         * class.cs: Remove some dead code.
10015
10016         * cs-parser.jay: Estimate the number of methods needed
10017         (RootContext.MethodCount);
10018
10019         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10020         numbers instead of StringBuilders.
10021
10022         * support.cs (PtrHashtable): Add constructor with initial size;
10023         We can now reduce reallocations of the method table.
10024
10025 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10026
10027         * attribute.cs (ApplyAttributes): Keep track of the emitted
10028         attributes on a per-target basis. This fixes bug #35413.
10029
10030 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10031
10032         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10033         default to the Windows 1252 encoding.
10034
10035         (UnixParseOption): Support version, thanks to Alp for the missing
10036         pointer. 
10037
10038         * AssemblyInfo.cs: Add nice assembly information.
10039
10040         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10041         (bug 35169).
10042
10043         * cs-parser.jay: Allow a trailing comma before the close bracked
10044         in the attribute_section production.
10045
10046         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10047         address of the instance was being taken, I will take this out,
10048         because we take the address of the object immediately here.
10049
10050 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10051
10052         * typemanager.cs (AreMultipleAllowed): Take care of the most
10053         obvious case where attribute type is not in the current assembly -
10054         stupid me ;-)
10055
10056 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10057
10058         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10059         definitions, instead of doing that afterwards.  
10060
10061         Also we use a nice little hack, depending on the constructor, we
10062         know if we are a "composed" name or a simple name.  Hence, we
10063         avoid the IndexOf test, and we avoid 
10064
10065         * codegen.cs: Add code to assist in a bug reporter to track down
10066         the source of a compiler crash. 
10067
10068 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10069
10070         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10071         types have been emitted for a given element and flag an error
10072         if something which does not have AllowMultiple set is used more
10073         than once.
10074
10075         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10076         attribute types and their corresponding AllowMultiple properties
10077
10078         (AreMultipleAllowed): Check the property for a given type.
10079
10080         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10081         property in the case we have a TypeContainer.
10082
10083         (Attributes.AddAttribute): Detect duplicates and just skip on
10084         adding them. This trivial fix catches a pretty gross error in our
10085         attribute emission - global attributes were being emitted twice!
10086
10087         Bugzilla bug #33187 is now fixed.
10088
10089 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10090
10091         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10092         instead of pp_and).
10093
10094         * expression.cs (Binary.ResolveOperator): I can only use the
10095         Concat (string, string, string) and Concat (string, string,
10096         string, string) if the child is actually a concatenation of
10097         strings. 
10098
10099 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10100
10101         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10102         context where we need a 2-character lookahead.
10103
10104         * pending.cs (PendingImplementation): Rework so we can keep track
10105         of interface types all the time, and flag those which were
10106         implemented by parents as optional.
10107
10108 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10109
10110         * expression.cs (Binary.ResolveOperator): Use
10111         String.Concat(string,string,string) or
10112         String.Concat(string,string,string,string) when possible. 
10113
10114         * typemanager: More helper methods.
10115
10116
10117 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10118
10119         * pending.cs: remove the bogus return from GetMissingInterfaces()
10120         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10121
10122 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10123
10124         * namespace.cs: avoid duplicated 'using xxx' being added to
10125         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10126         when we get more than one 'using' statement for the same namespace.
10127         Report a CS0105 warning for it.
10128
10129 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10130
10131         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10132         of calling getChar/putback, uses internal knowledge of it.    
10133
10134         (xtoken): Reorder tokenizer so most common patterns are checked
10135         first.  This reduces the compilation time in another 5% (from 8.11s
10136         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10137
10138         The parsing time is 22% of the compilation in mcs, and from that
10139         64% is spent on the tokenization process.  
10140
10141         I tried using a binary search for keywords, but this is slower
10142         than the hashtable.  Another option would be to do a couple of
10143         things:
10144
10145                 * Not use a StringBuilder, instead use an array of chars,
10146                   with a set value.  Notice that this way we could catch
10147                   the 645 error without having to do it *afterwards*.
10148
10149                 * We could write a hand-parser to avoid the hashtable
10150                   compares altogether.
10151
10152         The identifier consumption process takes 37% of the tokenization
10153         time.  Another 15% is spent on is_number.  56% of the time spent
10154         on is_number is spent on Int64.Parse:
10155
10156                 * We could probably choose based on the string length to
10157                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10158                   computations. 
10159
10160         Another 3% is spend on wrapping `xtoken' in the `token' function.
10161
10162         Handle 0xa0 as whitespace (#34752)
10163
10164 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10165
10166         * typemanager.cs (IsCLRType): New routine to tell whether a type
10167         is one of the builtin types.  
10168
10169         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10170         typecode in more places instead of doing pointer comparissions.
10171         We could leverage some knowledge about the way the typecodes are
10172         laid out.
10173
10174         New code to cache namespaces in assemblies, it is currently not
10175         invoked, to be used soon.
10176
10177         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10178
10179         * expression.cs (Binary.ResolveOperator): specially handle
10180         strings, and do not perform user-defined operator overloading for
10181         built-in types.
10182
10183 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10184
10185         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10186         internalcall as it is a pretty simple operation;  Avoid whenever
10187         possible to call Char.IsLetter.
10188
10189         (consume_identifier): Cut by half the number of
10190         hashtable calls by merging the is_keyword and GetKeyword behavior.
10191
10192         Do not short-circuit, because if we do, we
10193         report errors (ie, #if false && true would produce an invalid
10194         directive error);
10195
10196
10197 2002-11-24  Martin Baulig  <martin@ximian.com>
10198
10199         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10200         check constant ranges and report a CS0221.  Fixes #33186.
10201
10202 2002-11-24  Martin Baulig  <martin@ximian.com>
10203
10204         * cs-parser.jay: Make this work for uninitialized variable
10205         declarations in the `for' initializer.  Fixes #32416.
10206
10207 2002-11-24  Martin Baulig  <martin@ximian.com>
10208
10209         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10210         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10211
10212 2002-11-24  Martin Baulig  <martin@ximian.com>
10213
10214         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10215         argument; if true, we also check for user-defined conversions.
10216         This is only needed if both arguments are of a user-defined type.
10217         Fixes #30443, added test-175.cs.
10218         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10219
10220         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10221
10222 2002-11-24  Martin Baulig  <martin@ximian.com>
10223
10224         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10225         function to get the store opcode.
10226         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10227         only emit the Ldelema if the store opcode is Stobj.  You must run
10228         both test-34 and test-167 to test this.  Fixes #34529.
10229
10230 2002-11-23  Martin Baulig  <martin@ximian.com>
10231
10232         * ecore.cs (Expression.MemberLookup): Added additional
10233         `qualifier_type' argument which is used when we're being called
10234         from MemberAccess.DoResolve() and null if we're called from a
10235         SimpleName lookup.
10236         (Expression.MemberLookupFailed): New method to report errors; this
10237         does the CS1540 check and reports the correct error message.
10238
10239         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10240         argument for the CS1540 check and redone the way how we're dealing
10241         with private members.  See the comment in the source code for details.
10242         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10243         `closure_start_type' to `closure_qualifier_type' and check whether
10244         it's not null.  It was not this filter being broken, it was just
10245         being called with the wrong arguments.
10246
10247         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10248         and pass it the correct `qualifier_type'; this also does the error
10249         handling for us.
10250
10251 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10252
10253         * expression.cs (Invocation.EmitParams): If the we are dealing
10254         with a non-built-in value type, load its address as well.
10255
10256         (ArrayCreation): Use a a pretty constant instead
10257         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10258         static initializers.  
10259
10260         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10261         because they are not really value types, just glorified integers. 
10262
10263         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10264
10265         * ecore.cs: Remove redundant code for enumerations, make them use
10266         the same code path as everything else, fixes the casting issue
10267         with enumerations in Windows.Forms.
10268
10269         * attribute.cs: Do only cast to string if it is a string, the
10270         validation happens later.
10271
10272         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10273         people upgrade their corlibs.
10274
10275         * ecore.cs: Oops, enumerations were not following the entire code path
10276
10277 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10278
10279         * typemanager.cs (FilterWithClosure): Commented out the test for
10280         1540 in typemanager.cs, as it has problems when accessing
10281         protected methods from a parent class (see test-174.cs). 
10282
10283         * attribute.cs (Attribute.ValidateGuid): new method.
10284         (Attribute.Resolve): Use above.
10285
10286 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10287
10288         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10289
10290         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10291         handling for enumerations, as we only needed the TypeContainer
10292         functionality to begin with (this is required for the fix below to
10293         work for enums that reference constants in a container class for
10294         example). 
10295
10296         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10297
10298         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10299         a valid TypeBuilder to perform lookups on.o
10300
10301         * class.cs (InheritableMemberSignatureCompare): Use true in the
10302         call to GetGetMethod and GetSetMethod, because we are comparing
10303         the signature, and we need to get the methods *even* if they are
10304         private. 
10305
10306         (PropertyBase.CheckBase): ditto.
10307
10308         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10309         GotoCase.Resolve): Use Peel on EmpytCasts.
10310
10311         * ecore.cs (EmptyCast): drop child, add Peel method.
10312
10313 2002-11-17  Martin Baulig  <martin@ximian.com>
10314
10315         * ecore.cs (EmptyCast.Child): New public property.
10316
10317         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10318         label resolved to an EmptyCast.  Fixes #34162.
10319         (GotoCase.Resolve): Likewise.
10320         (Block.EmitMeta): Likewise.
10321
10322 2002-11-17  Martin Baulig  <martin@ximian.com>
10323
10324         * expression.cs (Invocation.BetterConversion): Prefer int over
10325         uint; short over ushort; long over ulong for integer literals.
10326         Use ImplicitConversionExists instead of StandardConversionExists
10327         since we also need to check for user-defined implicit conversions.
10328         Fixes #34165.  Added test-173.cs.
10329
10330 2002-11-16  Martin Baulig  <martin@ximian.com>
10331
10332         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10333         with the `true' and `false' literals.  Fixes #33151.
10334
10335 2002-11-16  Martin Baulig  <martin@ximian.com>
10336
10337         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10338         October 22nd; don't do the cs1540 check for static members.
10339
10340         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10341         now using our own filter here and doing the cs1540 check again.
10342
10343 2002-11-16  Martin Baulig  <martin@ximian.com>
10344
10345         * support.cs (InternalParameters): Don't crash if we don't have
10346         any fixed parameters.  Fixes #33532.
10347
10348 2002-11-16  Martin Baulig  <martin@ximian.com>
10349
10350         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10351         when looking up static methods to make this work on Windows.
10352         Fixes #33773.
10353
10354 2002-11-16  Martin Baulig  <martin@ximian.com>
10355
10356         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10357         a setter rather than using PropertyInfo.CanWrite.
10358
10359 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10360
10361         * class.cs: Allow acces to block member by subclasses. Fixes build
10362         breaker.
10363
10364 2002-11-14  Martin Baulig  <martin@ximian.com>
10365
10366         * class.cs (Constructor.Emit): Added the extern/block check.
10367         Fixes bug #33678.
10368
10369 2002-11-14  Martin Baulig  <martin@ximian.com>
10370
10371         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10372         iteration while looking for indexers, this is needed because the
10373         indexer may have a different name in our base classes.  Fixed the
10374         error reporting (no indexers at all, not get accessor, no
10375         overloaded match).  Fixes bug #33089.
10376         (IndexerAccess.DoResolveLValue): Likewise.
10377
10378 2002-11-14  Martin Baulig  <martin@ximian.com>
10379
10380         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10381         indexers.  Fixes the first part of bug #33089.
10382         (MethodSignature.InheritableMemberSignatureCompare): Added support
10383         for properties.
10384
10385 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10386
10387         * attribute.cs (Attribute.Resolve): Catch the
10388         NullReferenceException and report it since it isn't supposed to
10389         happen. 
10390
10391 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10392
10393         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10394         LogicalOr and LogicalAnd that can benefit from recursively
10395         handling EmitBranchable.  The code now should be nice for Paolo.
10396
10397 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10398
10399         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10400         the Type lookups, as we perform quite a number of lookups on
10401         non-Types.  This can be removed once we can deterministically tell
10402         whether we have a type or a namespace in advance.
10403
10404         But this might require special hacks from our corlib.
10405
10406         * TODO: updated.
10407
10408         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10409         and double which avoids a conversion from an integer to a double.
10410
10411         * expression.cs: tiny optimization, avoid calling IsConstant,
10412         because it effectively performs the lookup twice.
10413
10414 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10415
10416         But a bogus return here to keep the semantics of the old code
10417         until the Mono runtime is fixed.
10418
10419         * pending.cs (GetMissingInterfaces): New method used to remove all
10420         the interfaces that are already implemented by our parent
10421         classes from the list of pending methods. 
10422
10423         * interface.cs: Add checks for calls after ResolveTypeExpr.
10424
10425 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10426
10427         * class.cs (Class.Emit): Report warning 67: event not used if the
10428         warning level is beyond 3.
10429
10430         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10431         being a NullLiteral.
10432
10433         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10434         specifiers. 
10435
10436         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10437         path that might fail if a type can not be resolved.
10438
10439         * expression.cs (Binary.Emit): Emit unsigned versions of the
10440         operators. 
10441
10442         * driver.cs: use error 5.
10443
10444 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10445
10446         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10447
10448 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10449
10450         * cs-parser.jay (switch_section): A beautiful patch from Martin
10451         Baulig that fixed 33094.
10452
10453 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10454
10455         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10456         Check whether the base is abstract and report an error if so.
10457
10458         * expression.cs (IndexerAccess.DoResolveLValue,
10459         IndexerAccess.DoResolve): ditto. 
10460
10461         (Invocation.DoResolve): ditto.
10462
10463         (Invocation.FullMethodDesc): Improve the report string.
10464
10465         * statement.cs (Block): Eliminate IsVariableDefined as it is
10466         basically just a wrapper for GetVariableInfo.
10467
10468         * ecore.cs (SimpleName): Use new 
10469
10470         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10471         type, as we return the actual parameter ref/unref state on a
10472         different call.
10473
10474 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10475
10476         * support.cs: Return proper flags REF/OUT fixing the previous
10477         commit.  
10478
10479         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10480         not used to mean `ref' but `ref or out' in ParameterReference
10481
10482         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10483         full type signature instead of calling TypeManger.CSharpName
10484         ourselves. 
10485
10486         * support.cs (InternalParameters.ParameterDesc): Do not compare
10487         directly to the modflags, because REF/OUT will actually be bitsets
10488         if set. 
10489
10490         * delegate.cs (VerifyMethod): Check also the modifiers.
10491
10492         * cs-tokenizer.cs: Fix bug where floating point values with an
10493         exponent where a sign was missing was ignored.
10494
10495         * driver.cs: Allow multiple assemblies to be specified in a single
10496         /r: argument
10497
10498 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10499
10500         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10501         because identifiers after a parenthesis would end up in this kind
10502         of production, and we needed to desamiguate it for having casts
10503         like:
10504
10505                 (UserDefinedType *) xxx
10506
10507 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10508
10509         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10510         we should set on the Bindingflags.NonPublic, but not turn on
10511         private_ok.  private_ok controls whether a Private member is
10512         returned (this is chekced on the filter routine), while the
10513         BindingFlags.NonPublic just controls whether private/protected
10514         will be allowed.   This fixes the problem part of the problem of
10515         private properties being allowed to be used in derived classes.
10516
10517         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10518         so we can call the children DoResolveLValue method (this will
10519         properly signal errors on lvalue assignments to base properties)
10520
10521         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10522         getter are null, and we have a property info, we know that this
10523         happened because the lookup failed, so we report an error 122 for
10524         protection level violation.
10525
10526         We also silently return if setter and getter are null in the
10527         resolve functions, this condition only happens if we have flagged
10528         the error before.  This is the other half of the problem. 
10529
10530         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10531         not have accessibility information, that is why we were returning
10532         true in the filter function in typemanager.cs.
10533
10534         To properly report 122 (property is inaccessible because of its
10535         protection level) correctly, we report this error in ResolveAccess
10536         by failing if both the setter and the getter are lacking (ie, the
10537         lookup failed). 
10538
10539         DoResolve and DoLResolve have been modified to check for both
10540         setter/getter being null and returning silently, the reason being
10541         that I did not want to put the knowledge about this error in upper
10542         layers, like:
10543
10544         int old = Report.Errors;
10545         x = new PropertyExpr (...);
10546         if (old != Report.Errors)
10547                 return null;
10548         else
10549                 return x;
10550
10551         So the property expr is returned, but it is invalid, so the error
10552         will be flagged during the resolve process. 
10553
10554         * class.cs: Remove InheritablePropertySignatureCompare from the
10555         class, as we no longer depend on the property signature to compute
10556         whether it is possible to implement a method or not.
10557
10558         The reason is that calling PropertyInfo.GetGetMethod will return
10559         null (in .NET, in Mono it works, and we should change this), in
10560         cases where the Get Method does not exist in that particular
10561         class.
10562
10563         So this code:
10564
10565         class X { public virtual int A { get { return 1; } } }
10566         class Y : X { }
10567         class Z : Y { public override int A { get { return 2; } } }
10568
10569         Would fail in Z because the parent (Y) would not have the property
10570         defined.  So we avoid this completely now (because the alternative
10571         fix was ugly and slow), and we now depend exclusively on the
10572         method names.
10573
10574         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10575         reference method, instead of using the property.
10576
10577         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10578         routines are gone now.
10579
10580         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10581         names, they were incorrectly named.
10582
10583         * cs-tokenizer.cs: Return are more gentle token on failure. 
10584
10585         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10586         had an out-of-sync index variable, which caused it to remove from
10587         the list of pending methods the wrong method sometimes.
10588
10589 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10590
10591         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10592         CanWrite, because those refer to this particular instance of the
10593         property, and do not take into account the fact that we can
10594         override single members of a property.
10595
10596         Constructor requires an EmitContext.  The resolution process does
10597         not happen here, but we need to compute the accessors before,
10598         because the resolution does not always happen for properties.
10599
10600         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10601         subclass, before we did not update this flag, but we did update
10602         bindingflags. 
10603
10604         (GetAccessors): Drop this routine, as it did not work in the
10605         presence of partially overwritten set/get methods. 
10606
10607         Notice that this broke the cs1540 detection, but that will require
10608         more thinking. 
10609
10610 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10611
10612         * class.cs:
10613         * codegen.cs:
10614         * driver.cs: issue a warning instead of an error if we don't support
10615         debugging for the platform. Also ignore a couple of errors that may
10616         arise when trying to write the symbols. Undo my previous patch.
10617
10618 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10619
10620         * driver.cs: ignore /debug switch except for Unix platforms.
10621
10622 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10623
10624         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10625
10626 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10627
10628         * driver.cs: Do not make mcs-debug conditional, so we do not break
10629         builds that use it.
10630
10631         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10632         review this patch.  But basically after all the children variables
10633         have been merged, the value of "Breaks" was not being set to
10634         new_breaks for Switch blocks.  I think that it should be set after
10635         it has executed.  Currently I set this to the value of new_breaks,
10636         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10637         conservative, but I do not understand this code very well.
10638
10639         I did not break anything in the build, so that is good ;-)
10640
10641         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10642
10643 2002-10-20  Mark Crichton  <crichton@gimp.org>
10644
10645         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10646
10647 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10648
10649         * cfold.cs: Fixed compile blocker.
10650
10651 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10652
10653         * driver.cs: I was chekcing the key, not the file.
10654
10655 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10656
10657         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10658         message that we were generating - we just need to silently return
10659         a null.
10660
10661 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10662
10663         * class.cs (Event.Define): Change my previous commit, as this
10664         breaks the debugger.  This is a temporary hack, as it seems like
10665         the compiler is generating events incorrectly to begin with.
10666
10667         * expression.cs (Binary.ResolveOperator): Added support for 
10668         "U operator - (E x, E y)"
10669
10670         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10671         y)".
10672
10673         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10674         init-only variables, but this path did not take into account that
10675         there might be also instance readonly variables.  Correct this
10676         problem. 
10677
10678         This fixes bug 32253
10679
10680         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10681         delegates as well.
10682
10683         * driver.cs: Change the extension for modules to `netmodule'
10684
10685         * cs-parser.jay: Improved slightly the location tracking for
10686         the debugger symbols.
10687
10688         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10689         modifiers that were specified instead of the hardcoded value
10690         (FamAndAssem).  This was basically ignoring the static modifier,
10691         and others.  Fixes 32429.
10692
10693         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10694         fixed a bug in the process (32476)
10695
10696         * expression.cs (ArrayAccess.EmitAssign): Patch from
10697         hwang_rob@yahoo.ca that fixes bug 31834.3
10698
10699 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10700
10701         * driver.cs: Make the module extension .netmodule.
10702
10703 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10704
10705         * driver.cs: Report an error if the resource file is not found
10706         instead of crashing.
10707
10708         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10709         false, like Emit does.
10710
10711 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10712
10713         * typemanager.cs: Remove unused private member.  Also reported mcs
10714         bug to report this as a warning like csc.
10715
10716 2002-10-15  Martin Baulig  <martin@gnome.org>
10717
10718         * statement.cs (Statement.Emit): Made this a virtual method; emits
10719         the line number info and calls DoEmit().
10720         (Statement.DoEmit): New protected abstract method, formerly knows
10721         as Statement.Emit().
10722
10723         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10724
10725 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10726
10727         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10728         have fixed a remaining problem: not every AddXXXX was adding a
10729         fully qualified name.  
10730
10731         Now everyone registers a fully qualified name in the DeclSpace as
10732         being defined instead of the partial name.  
10733
10734         Downsides: we are slower than we need to be due to the excess
10735         copies and the names being registered this way.  
10736
10737         The reason for this is that we currently depend (on the corlib
10738         bootstrap for instance) that types are fully qualified, because
10739         we dump all the types in the namespace, and we should really have
10740         types inserted into the proper namespace, so we can only store the
10741         basenames in the defined_names array.
10742
10743 2002-10-10  Martin Baulig  <martin@gnome.org>
10744
10745         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10746         from bug #31834, see the bug report for a testcase which is
10747         miscompiled.
10748
10749 2002-10-10  Martin Baulig  <martin@gnome.org>
10750
10751         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10752         flow analysis code for this.
10753
10754         * statement.cs (Do, While, For): Tell the flow analysis code about
10755         infinite loops.
10756         (FlowBranching.UsageVector): Added support for infinite loops.
10757         (Block.Resolve): Moved the dead code elimination here and use flow
10758         analysis to do it.
10759
10760 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10761
10762         * class.cs (Field.Define): Catch cycles on struct type
10763         definitions. 
10764
10765         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10766         fields if the fields are static.  We only need to check instance
10767         fields. 
10768
10769         * expression.cs (As.DoResolve): Test for reference type.
10770
10771         * statement.cs (Using.ResolveExpression): Use
10772         ConvertImplicitRequired, not ConvertImplicit which reports an
10773         error on failture
10774         (Using.ResolveLocalVariableDecls): ditto.
10775
10776         * expression.cs (Binary.ResolveOperator): Report errors in a few
10777         places where we had to.
10778
10779         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10780
10781 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10782
10783         * expression.cs: Use StoreFromPtr instead of extracting the type
10784         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10785
10786         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10787         an enumeration value to a System.Enum, but System.Enum is not a
10788         value type, but an class type, so we need to box.
10789
10790         (Expression.ConvertExplicit): One codepath could return
10791         errors but not flag them.  Fix this.  Fixes #31853
10792
10793         * parameter.cs (Resolve): Do not allow void as a parameter type.
10794
10795 2002-10-06  Martin Baulig  <martin@gnome.org>
10796
10797         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10798         if it's a class type and not a struct.  Fixes #31815.
10799
10800 2002-10-06  Martin Baulig  <martin@gnome.org>
10801
10802         * statement.cs: Reworked the flow analysis code a bit to make it
10803         usable for dead code elimination.
10804
10805 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10806
10807         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10808
10809 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10810
10811         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10812         to fix the test 165, will investigate deeper.
10813
10814 2002-10-04  Martin Baulig  <martin@gnome.org>
10815
10816         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10817         finally blocks actually work.
10818         (Try.Resolve): We don't need to create a sibling for `finally' if
10819         there is no finally block.
10820
10821 2002-10-04  Martin Baulig  <martin@gnome.org>
10822
10823         * class.cs (Constructor.Define): The default accessibility for a
10824         non-default constructor is private, not public.
10825
10826 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10827
10828         * class.cs (Constructor): Make AllowedModifiers public, add
10829         EXTERN.
10830
10831         * cs-parser.jay: Perform the modifiers test here, as the
10832         constructor for the Constructor class usually receives a zero
10833         because of the way we create it (first we create, later we
10834         customize, and we were never checking the modifiers).
10835
10836         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10837         is a version of LookupTypeReflection that includes the type-name
10838         cache.  This can be used as a fast path for functions that know
10839         the fully qualified name and are only calling into *.GetType() to
10840         obtain a composed type.
10841
10842         This is also used by TypeManager.LookupType during its type
10843         composition.
10844
10845         (LookupType): We now also track the real type name, as sometimes
10846         we can get a quey for the real type name from things like
10847         ComposedCast.  This fixes bug 31422.
10848
10849         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10850         complete type fullname, it does not have to go through the type
10851         resolution system to obtain the composed version of the type (for
10852         obtaining arrays or pointers).
10853
10854         (Conditional.Emit): Use the EmitBoolExpression to
10855         generate nicer code, as requested by Paolo.
10856
10857         (ArrayCreation.CheckIndices): Use the patch from
10858         hwang_rob@yahoo.ca to validate the array initializers. 
10859
10860 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10861
10862         * class.cs (ConstructorInitializer.Emit): simplify code by using
10863         Invocation.EmitCall, and at the same time, fix the bugs in calling
10864         parent constructors that took variable arguments. 
10865
10866         * ecore.cs (Expression.ConvertNumericExplicit,
10867         Expression.ImplicitNumericConversion): Remove the code that
10868         manually wrapped decimal (InternalTypeConstructor call is now gone
10869         as well).
10870
10871         * expression.cs (Cast.TryReduce): Also handle decimal types when
10872         trying to perform a constant fold on the type.
10873
10874         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10875
10876         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10877         that only turned off an error report, and did nothing else. 
10878
10879 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10880
10881         * driver.cs: Handle and ignore /fullpaths
10882
10883 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10884
10885         * expression.cs (Binary.ResolveOperator): Catch the case where
10886         DoNumericPromotions returns true, 
10887
10888         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10889
10890 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10891
10892         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10893         report error 70.
10894
10895 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10896
10897         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10898         conversion exists, but it is also required that the conversion be
10899         performed.  This manifested in "(Type64Enum) 2".  
10900
10901         * class.cs (TypeManager.AddMethod): The fix is not to change
10902         AddEnum, because that one was using a fully qualified name (every
10903         DeclSpace derivative does), but to change the AddMethod routine
10904         that was using an un-namespaced name.  This now correctly reports
10905         the duplicated name.
10906
10907         Revert patch until I can properly fix it.  The issue
10908         is that we have a shared Type space across all namespaces
10909         currently, which is wrong.
10910
10911         Options include making the Namespace a DeclSpace, and merge
10912         current_namespace/current_container in the parser.
10913
10914 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10915
10916         * cs-parser.jay: Improve error reporting when we get a different
10917         kind of expression in local_variable_type and
10918         local_variable_pointer_type. 
10919
10920         Propagate this to avoid missleading errors being reported.
10921
10922         * ecore.cs (ImplicitReferenceConversion): treat
10923         TypeManager.value_type as a target just like object_type.   As
10924         code like this:
10925
10926         ValueType v = 1;
10927
10928         Is valid, and needs to result in the int 1 being boxed before it
10929         is assigned to the value type v.
10930
10931         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10932         to validate the enumeration name.
10933
10934         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10935         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10936         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10937
10938         * ecore.cs (TryImplicitIntConversion): When doing an
10939         implicit-enumeration-conversion, check if the type is 64-bits and
10940         perform a conversion before passing to EnumConstant.
10941
10942 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10943
10944         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10945         report ambiguous type references.  Unlike the MS version, we
10946         report what the ambiguity is.   Innovation at work ;-)
10947
10948         (DeclSpace.FindType): Require a location argument to
10949         display when we display an ambiguous error.
10950
10951         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10952
10953         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10954
10955         * expression.cs (EmitDynamicInitializers): Apply patch from
10956         hwang_rob@yahoo.ca that fixes the order in which we emit our
10957         initializers. 
10958
10959 2002-09-21  Martin Baulig  <martin@gnome.org>
10960
10961         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10962         delegate takes no arguments.
10963
10964 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10965
10966         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10967         from integers.
10968
10969         * expression.cs: Extract the underlying type.
10970
10971         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10972
10973         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10974
10975 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10976
10977         * class.cs (TypeContainer.DefineType): We can not use the nice
10978         PackingSize with the size set to 1 DefineType method, because it
10979         will not allow us to define the interfaces that the struct
10980         implements.
10981
10982         This completes the fixing of bug 27287
10983
10984         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10985         means also structs.  This fixes part of the problem. 
10986         (Expresion.ImplicitReferenceConversionExists): ditto.
10987
10988         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10989         error if there were no errors reported during the type lookup
10990         process, to avoid duplicates or redundant errors.  Without this
10991         you would get an ambiguous errors plus a type not found.  We have
10992         beaten the user enough with the first error.  
10993
10994         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10995         reference. 
10996
10997         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10998         during the resolution process, stop the lookup, this avoids
10999         repeated error reports (same error twice).
11000
11001         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11002
11003         * typemanager.cs (LookupType): Redo the type lookup code to match
11004         the needs of System.Reflection.  
11005
11006         The issue is that System.Reflection requires references to nested
11007         types to begin with a "+" sign instead of a dot.  So toplevel
11008         types look like: "NameSpace.TopLevelClass", and nested ones look
11009         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11010         levels. 
11011
11012 2002-09-19  Martin Baulig  <martin@gnome.org>
11013
11014         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11015         says that a method always returns or always throws an exception,
11016         don't report the CS0161.
11017
11018         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11019         set `Returns = new_returns'.
11020
11021 2002-09-19  Martin Baulig  <martin@gnome.org>
11022
11023         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11024         to an enum constant, check for a CS0176.
11025
11026 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11027
11028         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11029         for operators that must be in pairs and report errors.
11030
11031         * ecore.cs (SimpleName.DoResolveType): During the initial type
11032         resolution process, when we define types recursively, we must
11033         check first for types in our current scope before we perform
11034         lookups in the enclosing scopes.
11035
11036         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11037
11038         (Invocation.VerifyArgumentsCompat): Call
11039         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11040         I thought we were supposed to always call this, but there are a
11041         few places in the code where we dont do it.
11042
11043 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11044
11045         * driver.cs: Add support in -linkres and -resource to specify the
11046         name of the identifier.
11047
11048 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11049
11050         * ecore.cs (StandardConversionExists): Sync with the conversion
11051         code: allow anything-* to void* conversions.
11052
11053         (FindMostSpecificSource): Use an Expression argument
11054         instead of a Type, because we might be handed over a Literal which
11055         gets a few more implicit conversions that plain types do not.  So
11056         this information was being lost.
11057
11058         Also, we drop the temporary type-holder expression when not
11059         required.
11060
11061 2002-09-17  Martin Baulig  <martin@gnome.org>
11062
11063         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11064         this is an explicit interface implementation.
11065
11066 2002-09-17  Martin Baulig  <martin@gnome.org>
11067
11068         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11069         different `IndexerName' attributes.
11070
11071         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11072         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11073         virtual CommonResolve().
11074
11075 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11076
11077         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11078         and convert that to the UnderlyingType.
11079
11080         * statement.cs (Foreach.Resolve): Indexers are just like variables
11081         or PropertyAccesses.
11082
11083         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11084         inside quoted strings, we were not doing this before.
11085
11086 2002-09-16  Martin Baulig  <martin@gnome.org>
11087
11088         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11089         resolve it.  This is needed for the definite assignment check of the
11090         instance expression, fixes bug #29846.
11091         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11092
11093 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11094
11095         * parameter.cs: Fix compile error.  Cannot reference static member
11096         from an instance object.  Is this an mcs bug?
11097
11098 2002-09-14  Martin Baulig  <martin@gnome.org>
11099
11100         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11101         multiple times.  Fixes bug #30295, added test-166.cs.
11102
11103 2002-09-14  Martin Baulig  <martin@gnome.org>
11104
11105         * statement.cs (Block.Emit): Don't emit unreachable code.
11106         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11107         `break' statements.
11108         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11109
11110 2002-09-14  Martin Baulig  <martin@gnome.org>
11111
11112         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11113         is set.
11114
11115 2002-09-14  Martin Baulig  <martin@gnome.org>
11116
11117         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11118         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11119         be false on the ms runtime.
11120
11121 2002-09-13  Martin Baulig  <martin@gnome.org>
11122
11123         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11124         the CS0038 error message.
11125
11126 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11127
11128         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11129         constant inside, return it.
11130
11131 2002-09-12  Martin Baulig  <martin@gnome.org>
11132
11133         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11134         implicit conversion can be done between enum types.
11135
11136         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11137         check whether an implicit conversion to the current enum's UnderlyingType
11138         exists and report an error if not.
11139
11140         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11141         without debugging support.
11142
11143         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11144         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11145
11146 2002-09-12  Martin Baulig  <martin@gnome.org>
11147
11148         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11149
11150         * ecore.cs (IMemberExpr.DeclaringType): New property.
11151         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11152         nonstatic member of an outer type (CS0038).
11153
11154 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11155
11156         * driver.cs: Activate the using-error detector at warning level
11157         4 (at least for MS-compatible APIs).
11158
11159         * namespace.cs (VerifyUsing): Small buglett fix.
11160
11161         * pending.cs (PendingImplementation): pass the container pointer. 
11162
11163         * interface.cs (GetMethods): Allow for recursive definition.  Long
11164         term, I would like to move every type to support recursive
11165         definitions, not the current ordering mechanism that we have right
11166         now.
11167
11168         The situation is this: Attributes are handled before interfaces,
11169         so we can apply attributes to interfaces.  But some attributes
11170         implement interfaces, we will now handle the simple cases
11171         (recursive definitions will just get an error).  
11172
11173         * parameter.cs: Only invalidate types at the end if we fail to
11174         lookup all types.  
11175
11176 2002-09-09  Martin Baulig  <martin@gnome.org>
11177
11178         * ecore.cs (PropertyExpr.Emit): Also check for
11179         TypeManager.system_int_array_get_length so this'll also work when
11180         compiling corlib.  Fixes #30003.
11181
11182 2002-09-09  Martin Baulig  <martin@gnome.org>
11183
11184         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11185         and throw an exception if we can't get the type's size.  Fixed #30040,
11186         added test-165.cs.
11187
11188 2002-09-09  Martin Baulig  <martin@gnome.org>
11189
11190         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11191
11192         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11193         context.  Fixes bug #30027.
11194
11195         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11196         virtual functions.  Fixes bug #30043, added test-164.cs.
11197
11198 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11199
11200         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11201
11202 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11203
11204         * driver.cs: Use an object to get the windows codepage since it's not a
11205         static property.
11206
11207 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11208
11209         * statement.cs (For.Emit): for infinite loops (test == null)
11210         return whether there is a break inside, not always "true".
11211
11212         * namespace.cs (UsingEntry): New struct to hold the name of the
11213         using definition, the location where it is defined, and whether it
11214         has been used in a successful type lookup.
11215
11216         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11217         strings.
11218
11219         * decl.cs: ditto.
11220
11221 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11222
11223         * attribute.cs : Fix incorrect code which relied on catching
11224         a NullReferenceException to detect a null being passed in
11225         where an object was expected.
11226
11227 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11228
11229         * statement.cs (Try): flag the catch variable as assigned
11230
11231         * expression.cs (Cast): Simplified by using ResolveType instead of
11232         manually resolving.
11233
11234         * statement.cs (Catch): Fix bug by using ResolveType.
11235
11236 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11237
11238         * expression.cs (BetterConversion): Special case for when we have
11239         a NullLiteral as the argument and we have to choose between string
11240         and object types - we choose string the way csc does.
11241
11242         * attribute.cs (Attribute.Resolve): Catch the
11243         NullReferenceException and report error #182 since the Mono
11244         runtime no more has the bug and having this exception raised means
11245         we tried to select a constructor which takes an object and is
11246         passed a null.
11247
11248 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11249
11250         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11251         message (1502, 1503) when we can't locate a method after overload
11252         resolution. This is much more informative and closes the bug
11253         Miguel reported.
11254
11255         * interface.cs (PopulateMethod): Return if there are no argument
11256         types. Fixes a NullReferenceException bug.
11257
11258         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11259         expressions too. Previously we were checking only in one place for
11260         positional arguments leaving out named arguments.
11261
11262         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11263         type to the enum type is not allowed. Remove code corresponding to
11264         that.
11265
11266         (ConvertNumericExplicit): Allow explicit conversions from
11267         the underlying type to enum type. This precisely follows the spec
11268         and closes a bug filed by Gonzalo.
11269
11270 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11271
11272         * compiler.csproj:
11273         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11274
11275 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11276
11277         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11278         it was important that we stored the right value after the
11279         reduction in `converted'.
11280
11281 2002-09-04  Martin Baulig  <martin@gnome.org>
11282
11283         * location.cs (Location.SymbolDocument): Use full pathnames for the
11284         source files.
11285
11286 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11287
11288         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11289         of the expression resolve mechanism, because that will catch the
11290         SimpleName error failures.
11291
11292         (Conditional): If we can not resolve the
11293         expression, return, do not crash.
11294
11295 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11296
11297         * cs-tokenizer.cs:
11298         (location): display token name instead of its number.
11299
11300 2002-08-28  Martin Baulig  <martin@gnome.org>
11301
11302         * expression.cs (Binary.ResolveOperator): Don't silently return
11303         but return an error if an operator cannot be applied between two
11304         enum types.
11305
11306 2002-08-28  Martin Baulig  <martin@gnome.org>
11307
11308         * class.cs (Constructor.Define): Set the permission attributes
11309         correctly instead of making all constructors public.
11310
11311 2002-08-28  Martin Baulig  <martin@gnome.org>
11312
11313         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11314         for private members before reporting a CS0103; if we find anything,
11315         it's a CS0122.
11316
11317 2002-08-28  Martin Baulig  <martin@gnome.org>
11318
11319         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11320         to check whether `closure_start_type == closure_invocation_type',
11321         we also need to check whether `m.DeclaringType == closure_invocation_type'
11322         before bypassing the permission checks.  We might be accessing
11323         protected/private members from the base class.
11324         (TypeManager.RealMemberLookup): Only set private_ok if private
11325         members were requested via BindingFlags.NonPublic.
11326
11327         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11328
11329         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11330         MethodGroupExpr.IsExplicitImpl if appropriate.
11331         (Invocation.DoResolve): Don't report the CS0120 for explicit
11332         interface implementations.
11333
11334 2002-08-27  Martin Baulig  <martin@gnome.org>
11335
11336         * expression.cs (Invocation.DoResolve): If this is a static
11337         method and we don't have an InstanceExpression, we must report
11338         a CS0120.
11339
11340 2002-08-25  Martin Baulig  <martin@gnome.org>
11341
11342         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11343         `==' between a valuetype and an object.
11344
11345 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11346
11347         * ecore.cs (TypeExpr): Provide a ToString method.
11348
11349 2002-08-24  Martin Baulig  <martin@gnome.org>
11350
11351         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11352         now called proggie.dbg and it's a binary file.
11353
11354 2002-08-23  Martin Baulig  <martin@gnome.org>
11355
11356         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11357
11358 2002-08-23  Martin Baulig  <martin@gnome.org>
11359
11360         * struct.cs (MyStructInfo.ctor): Make this work with empty
11361         structs; it's not allowed to use foreach() on null.
11362
11363 2002-08-23  Martin Baulig  <martin@gnome.org>
11364
11365         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11366         writer the full pathname of the generated assembly.
11367
11368 2002-08-23  Martin Baulig  <martin@gnome.org>
11369
11370         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11371         A `finally' block never returns or breaks; improved handling of
11372         unreachable code.
11373
11374 2002-08-23  Martin Baulig  <martin@gnome.org>
11375
11376         * statement.cs (Throw.Resolve): Allow `throw null'.
11377
11378 2002-08-23  Martin Baulig  <martin@gnome.org>
11379
11380         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11381         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11382         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11383         MemberLookup would return a wrong event if this is an explicit
11384         interface implementation and the class has an event with the same
11385         name.
11386
11387 2002-08-23  Martin Baulig  <martin@gnome.org>
11388
11389         * statement.cs (Block.AddChildVariableNames): New public method.
11390         (Block.AddChildVariableName): Likewise.
11391         (Block.IsVariableNameUsedInChildBlock): Likewise.
11392         (Block.AddVariable): Check whether a variable name has already
11393         been used in a child block.
11394
11395         * cs-parser.jay (declare_local_variables): Mark all variable names
11396         from the current block as being used in a child block in the
11397         implicit block.
11398
11399 2002-08-23  Martin Baulig  <martin@gnome.org>
11400
11401         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11402         find the symbol writer.
11403
11404         * driver.cs: csc also allows the arguments to /define being
11405         separated by commas, not only by semicolons.
11406
11407 2002-08-23  Martin Baulig  <martin@gnome.org>
11408
11409         * interface.cs (Interface.GetMembers): Added static check for events.
11410
11411 2002-08-15  Martin Baulig  <martin@gnome.org>
11412
11413         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11414         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11415
11416         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11417         why the MethodData.EmitDestructor() change was necessary.
11418
11419 2002-08-20  Martin Baulig  <martin@gnome.org>
11420
11421         * class.cs (TypeContainer.FindMembers): Added static check for events.
11422
11423         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11424
11425         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11426         use Type.GetEvents(), not Type.FindMembers().
11427
11428 2002-08-20  Martin Baulig  <martin@gnome.org>
11429
11430         * decl.cs (MemberCache): Added a special method cache which will
11431         be used for method-only searched.  This ensures that a method
11432         search will return a MethodInfo with the correct ReflectedType for
11433         inherited methods.      
11434
11435 2002-08-20  Martin Baulig  <martin@gnome.org>
11436
11437         * decl.cs (DeclSpace.FindMembers): Made this public.
11438
11439 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11440
11441         * delegate.cs: fixed build on windows.
11442         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11443
11444 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11445
11446         * ecore.cs (StandardConversionExists): Return a false
11447         if we are trying to convert the void type to anything else
11448         since that is not allowed.
11449
11450         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11451         we flag error 70 in the event an event is trying to be accessed
11452         directly from outside the declaring type.
11453
11454 2002-08-20  Martin Baulig  <martin@gnome.org>
11455
11456         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11457         MemberCache from typemanager.cs to decl.cs.
11458
11459 2002-08-19  Martin Baulig  <martin@gnome.org>
11460
11461         * class.cs (TypeContainer): Implement IMemberContainer.
11462         (TypeContainer.DefineMembers): Create the MemberCache.
11463         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11464         return public members if BindingFlags.Public was given, check
11465         whether members are static.
11466
11467 2002-08-16  Martin Baulig  <martin@gnome.org>
11468
11469         * decl.cs (DeclSpace.Define): Splitted this in Define and
11470         DefineMembers.  DefineMembers is called first and initializes the
11471         MemberCache.
11472
11473         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11474         DefineMembers() on all our DeclSpaces.
11475
11476         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11477         but call DefineMembers() on all nested interfaces.  We call their
11478         Define() in our new Define() function.
11479
11480         * interface.cs (Interface): Implement IMemberContainer.
11481         (Interface.Define): Moved all code except the attribute stuf to
11482         DefineMembers().
11483         (Interface.DefineMembers): Initialize the member cache.
11484
11485         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11486         need this anymore since we can use MemberCache.FindMembers directly.
11487
11488 2002-08-19  Martin Baulig  <martin@gnome.org>
11489
11490         * typemanager.cs (MemberCache): When creating the cache for an
11491         interface type, add all inherited members.
11492         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11493         to `out bool used_cache' and documented it.
11494         (TypeManager.MemberLookup): If we already used the cache in the first
11495         iteration, we don't need to do the interfaces check.
11496
11497 2002-08-19  Martin Baulig  <martin@gnome.org>
11498
11499         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11500         here from IMemberFinder and don't implement this interface anymore.
11501         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11502
11503         * typemanager.cs (IMemberFinder): This interface is now only used by
11504         classes which actually support the member cache.
11505         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11506         since we only put DeclSpaces into this Hashtable.
11507         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11508         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11509
11510 2002-08-16  Martin Baulig  <martin@gnome.org>
11511
11512         * typemanager.cs (ICachingMemberFinder): Removed.
11513         (IMemberFinder.MemberCache): New property.
11514         (TypeManager.FindMembers): Merged this with RealFindMembers().
11515         This function will never be called from TypeManager.MemberLookup()
11516         so we can't use the cache here, just the IMemberFinder.
11517         (TypeManager.MemberLookup_FindMembers): Check whether the
11518         IMemberFinder has a MemberCache and call the cache's FindMembers
11519         function.
11520         (MemberCache): Rewrote larger parts of this yet another time and
11521         cleaned it up a bit.
11522
11523 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11524
11525         * driver.cs (LoadArgs): Support quoting.
11526
11527         (Usage): Show the CSC-like command line arguments.
11528
11529         Improved a few error messages.
11530
11531 2002-08-15  Martin Baulig  <martin@gnome.org>
11532
11533         * typemanager.cs (IMemberContainer.Type): New property.
11534         (IMemberContainer.IsInterface): New property.
11535
11536         The following changes are conditional to BROKEN_RUNTIME, which is
11537         defined at the top of the file.
11538
11539         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11540         class'es members, but add all members from TypeHandle.ObjectType
11541         if we're an interface.
11542         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11543         is the current type.
11544         (MemberCache.CacheEntry.Container): Removed this field.
11545         (TypeHandle.GetMembers): Include inherited members.
11546
11547 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11548
11549         * typemanager.cs: fixed compilation and added a comment on a field that
11550         is never used.
11551
11552 2002-08-15  Martin Baulig  <martin@gnome.org>
11553
11554         * class.cs (ConstructorInitializer.Resolve): In the
11555         Expression.MemberLookup call, use the queried_type as
11556         invocation_type.
11557
11558         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11559         declared' attribute, it's always true.
11560         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11561         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11562         temporary wrapper for FindMembers which tells MemberLookup whether
11563         members from the base classes are included in the return value.
11564         This will go away soon.
11565         (TypeManager.MemberLookup): Use this temporary hack here; once the
11566         new MemberCache is completed, we don't need to do the DeclaredOnly
11567         looping here anymore since the MemberCache will take care of this.
11568         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11569         (MemberCache): When creating the MemberCache for a class, get
11570         members from the current class and all its base classes.
11571         (MemberCache.CacheEntry.Container): New field.  This is a
11572         temporary hack until the Mono runtime is fixed to distinguish
11573         between ReflectedType and DeclaringType.  It allows us to use MCS
11574         with both the MS runtime and the unfixed Mono runtime without
11575         problems and without accecting performance.
11576         (MemberCache.SearchMembers): The DeclaredOnly looping from
11577         TypeManager.MemberLookup is now done here.      
11578
11579 2002-08-14  Martin Baulig  <martin@gnome.org>
11580
11581         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11582         Type.GetFields on dynamic types but get the fields from the
11583         corresponding TypeContainer.
11584         (MyStructInfo.GetStructInfo): Added check for enum types.
11585
11586         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11587         (MemberList.SyncRoot): Implemented.
11588         (TypeManager.FilterWithClosure): No need to check permissions if
11589         closure_start_type == closure_invocation_type, don't crash if
11590         closure_invocation_type is null.
11591
11592 2002-08-13  Martin Baulig  <martin@gnome.org>
11593
11594         Rewrote TypeContainer.FindMembers to use a member cache.  This
11595         gives us a speed increase of about 35% for the self-hosting MCS
11596         build and of about 15-20% for the class libs (both on GNU/Linux).
11597
11598         * report.cs (Timer): New class to get enhanced profiling.  This
11599         whole class is "TIMER" conditional since it remarkably slows down
11600         compilation speed.
11601
11602         * class.cs (MemberList): New class.  This is an IList wrapper
11603         which we're now using instead of passing MemberInfo[]'s around to
11604         avoid copying this array unnecessarily.
11605         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11606         (ICachingMemberFinder, IMemberContainer): New interface.
11607         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11608         has already been checked, otherwise use it for the name comparision.
11609         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11610         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11611         if possible.  Returns a MemberList, not a MemberInfo [].
11612         (TypeHandle): New class, implements IMemberContainer.  We create
11613         one instance of this class per type, it contains a MemberCache
11614         which is used to do the member lookups.
11615         (MemberCache): New class.  Each instance of this class contains
11616         all members of a type and a name-based hash table.
11617         (MemberCache.FindMembers): This is our new member lookup
11618         function.  First, it looks up all members of the requested name in
11619         the hash table.  Then, it walks this list and sorts out all
11620         applicable members and returns them.
11621
11622 2002-08-13  Martin Baulig  <martin@gnome.org>
11623
11624         In addition to a nice code cleanup, this gives us a performance
11625         increase of about 1.4% on GNU/Linux - not much, but it's already
11626         half a second for the self-hosting MCS compilation.
11627
11628         * typemanager.cs (IMemberFinder): New interface.  It is used by
11629         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11630         Enum, Delegate or Interface.
11631         (TypeManager.finder_to_member_finder): New PtrHashtable.
11632         (TypeManager.finder_to_container): Removed.
11633         (TypeManager.finder_to_delegate): Removed.
11634         (TypeManager.finder_to_interface): Removed.
11635         (TypeManager.finder_to_enum): Removed.
11636
11637         * interface.cs (Interface): Implement IMemberFinder.
11638
11639         * delegate.cs (Delegate): Implement IMemberFinder.
11640
11641         * enum.cs (Enum): Implement IMemberFinder.
11642
11643         * class.cs (TypeContainer): Implement IMemberFinder.
11644
11645 2002-08-12  Martin Baulig  <martin@gnome.org>
11646
11647         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11648
11649 2002-08-12  Martin Baulig  <martin@gnome.org>
11650
11651         * ecore.cs (ITypeExpression): New interface for expressions which
11652         resolve to a type.
11653         (TypeExpression): Renamed to TypeLookupExpression.
11654         (Expression.DoResolve): If we're doing a types-only lookup, the
11655         expression must implement the ITypeExpression interface and we
11656         call DoResolveType() on it.
11657         (SimpleName): Implement the new ITypeExpression interface.
11658         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11659         hack, the situation that we're only looking up types can't happen
11660         anymore when this method is called.  Moved the type lookup code to
11661         DoResolveType() and call it.
11662         (SimpleName.DoResolveType): This ITypeExpression interface method
11663         is now doing the types-only lookup.
11664         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11665         (ResolveFlags): Added MaskExprClass.
11666
11667         * expression.cs (MemberAccess): Implement the ITypeExpression
11668         interface.
11669         (MemberAccess.DoResolve): Added support for a types-only lookup
11670         when we're called via ITypeExpression.DoResolveType().
11671         (ComposedCast): Implement the ITypeExpression interface.
11672
11673         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11674         Expression.Resolve() with ResolveFlags.Type instead.
11675
11676 2002-08-12  Martin Baulig  <martin@gnome.org>
11677
11678         * interface.cs (Interface.Define): Apply attributes.
11679
11680         * attribute.cs (Attribute.ApplyAttributes): Added support for
11681         interface attributes.
11682
11683 2002-08-11  Martin Baulig  <martin@gnome.org>
11684
11685         * statement.cs (Block.Emit): Only check the "this" variable if we
11686         do not always throw an exception.
11687
11688         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11689         whether the property has a set accessor.
11690
11691 2002-08-11  Martin Baulig  <martin@gnome.org>
11692
11693         Added control flow analysis support for structs.
11694
11695         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11696         with control flow analysis turned off.
11697         (IVariable): New interface.
11698         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11699         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11700         (FieldExpr.DoResolve): Resolve the instance expression with flow
11701         analysis turned off and do the definite assignment check after the
11702         resolving when we know what the expression will resolve to.
11703
11704         * expression.cs (LocalVariableReference, ParameterReference):
11705         Implement the new IVariable interface, only call the flow analysis
11706         code if ec.DoFlowAnalysis is true.
11707         (This): Added constructor which takes a Block argument.  Implement
11708         the new IVariable interface.
11709         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11710         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11711         This does the definite assignment checks for struct members.
11712
11713         * class.cs (Constructor.Emit): If this is a non-static `struct'
11714         constructor which doesn't have any initializer, call
11715         Block.AddThisVariable() to tell the flow analysis code that all
11716         struct elements must be initialized before control returns from
11717         the constructor.
11718
11719         * statement.cs (MyStructInfo): New public class.
11720         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11721         argument to this indexer.  If non-zero, check an individual struct
11722         member, not the whole struct.
11723         (FlowBranching.CheckOutParameters): Check struct members.
11724         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11725         overloaded versions of these methods which take an additional
11726         `int field_idx' argument to check struct members.
11727         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11728         overloaded versions of these methods which take an additional
11729         `string field_name' argument to check struct member.s
11730         (VariableInfo): Implement the IVariable interface.
11731         (VariableInfo.StructInfo): New public property.  Returns the
11732         MyStructInfo instance of the variable if it's a struct or null.
11733         (Block.AddThisVariable): New public method.  This is called from
11734         Constructor.Emit() for non-static `struct' constructor which do
11735         not have any initializer.  It creates a special variable for the
11736         "this" instance variable which will be checked by the flow
11737         analysis code to ensure that all of the struct's fields are
11738         initialized before control returns from the constructor.
11739         (UsageVector): Added support for struct members.  If a
11740         variable/parameter is a struct with N members, we reserve a slot
11741         in the usage vector for each member.  A struct is considered fully
11742         initialized if either the struct itself (slot 0) or all its
11743         members are initialized.
11744
11745 2002-08-08  Martin Baulig  <martin@gnome.org>
11746
11747         * driver.cs (Driver.MainDriver): Only report an error CS5001
11748         if there were no compilation errors.
11749
11750         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11751         `UnsafeContext' property to determine whether the parent is in
11752         unsafe context rather than checking the parent's ModFlags:
11753         classes nested in an unsafe class are unsafe as well.
11754
11755 2002-08-08  Martin Baulig  <martin@gnome.org>
11756
11757         * statement.cs (UsageVector.MergeChildren): Distinguish between
11758         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11759         we return.  Added test17() and test18() to test-154.cs.
11760
11761 2002-08-08  Martin Baulig  <martin@gnome.org>
11762
11763         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11764         Family access, make sure the invoking type isn't a subclass of the
11765         queried type (that'd be a CS1540).
11766
11767         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11768         this method which takes an additional `Type invocation_type'.
11769
11770         * expression.cs (BaseAccess.DoResolve): Use the base type as
11771         invocation and query type.
11772         (MemberAccess.DoResolve): If the lookup failed and we're about to
11773         report a CS0122, try a lookup with the ec.ContainerType - if this
11774         succeeds, we must report a CS1540.
11775
11776 2002-08-08  Martin Baulig  <martin@gnome.org>
11777
11778         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11779         (MethodGroupExpr): Implement the IMemberExpr interface.
11780
11781         * expression (MemberAccess.ResolveMemberAccess): No need to have
11782         any special code for MethodGroupExprs anymore, they're now
11783         IMemberExprs.   
11784
11785 2002-08-08  Martin Baulig  <martin@gnome.org>
11786
11787         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11788         Family, FamANDAssem and FamORAssem permissions.
11789         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11790
11791 2002-08-08  Martin Baulig  <martin@gnome.org>
11792
11793         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11794         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11795         or loop block.
11796
11797 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11798
11799         * driver.cs: implemented /resource option to embed managed resources.
11800
11801 2002-08-07  Martin Baulig  <martin@gnome.org>
11802
11803         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11804         (FieldBase.HasFieldInitializer): New public property.
11805         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11806         returns the field initializer and makes sure it is only resolved once.
11807         (TypeContainer.EmitFieldInitializers): Call
11808         FieldBase.GetInitializerExpression to get the initializer, this ensures
11809         that it isn't resolved multiple times.
11810
11811         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11812         the resolving process (SimpleName/MemberLookup) that we're currently
11813         emitting a field initializer (which must not access any instance members,
11814         this is an error CS0236).
11815
11816         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11817         argument, if the `IsFieldInitializer' flag is set, we must report and
11818         error CS0236 and not an error CS0120.   
11819
11820 2002-08-07  Martin Baulig  <martin@gnome.org>
11821
11822         * ecore.cs (IMemberExpr): New public interface.
11823         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11824         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11825         if the expression is an IMemberExpr.
11826
11827         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11828         to be null, implicitly default to `this' if we're non-static in
11829         this case.  Simplified the code a lot by using the new IMemberExpr
11830         interface.  Also fixed bug #28176 here.
11831
11832 2002-08-06  Martin Baulig  <martin@gnome.org>
11833
11834         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11835         ParameterReferences during semantic analysis so that we can do a
11836         type-only search when resolving Cast, TypeOf and SizeOf.
11837         (block): Pass the `current_local_parameters' to the Block's
11838         constructor.
11839
11840         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11841         argument to the constructor.
11842         (ConstructorInitializer.Resolve): Create a temporary implicit
11843         block with the parameters.
11844
11845         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11846         references here if we aren't doing a type-only search.
11847
11848         * statement.cs (Block): Added constructor which takes a
11849         `Parameters parameters' argument.
11850         (Block.Parameters): New public property.
11851
11852         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11853         to `Parameters' and made it public readonly.
11854
11855 2002-08-06  Martin Baulig  <martin@gnome.org>
11856
11857         * ecore.cs (Expression.Warning): Made this public as well.
11858
11859         * report.cs (Report.Debug): Print the contents of collections.
11860
11861 2002-08-06  Martin Baulig  <martin@gnome.org>
11862
11863         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11864         used to tell Resolve() which kinds of expressions it may return.
11865         (Expression.Resolve): Added overloaded version of this method which
11866         takes a `ResolveFlags flags' argument.  This can be used to tell
11867         Resolve() which kinds of expressions it may return.  Reports a
11868         CS0118 on error.
11869         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11870         ResolveFlags.SimpleName.
11871         (Expression.Error118): Added overloaded version of this method which
11872         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11873         which kinds of expressions are allowed.
11874
11875         * expression.cs (Argument.ResolveMethodGroup): New public method.
11876         Resolves an argument, but allows a MethodGroup to be returned.
11877         This is used when invoking a delegate.
11878
11879         * TODO: Updated a bit.
11880
11881 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11882
11883         Fixed compilation with csc.
11884
11885         * ecore.cs: Expression.Error made public. Is this correct? Should
11886         Warning be made public too?
11887
11888         * expression.cs: use ea.Location instead of ea.loc.
11889         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11890
11891 2002-08-06  Martin Baulig  <martin@gnome.org>
11892
11893         * ecore.cs (Expression.loc): Moved the location here instead of
11894         duplicating it in all derived classes.
11895         (Expression.Location): New public property.
11896         (Expression.Error, Expression.Warning): Made them non-static and
11897         removed the location argument.
11898         (Expression.Warning): Added overloaded version which takes an
11899         `int level' argument.
11900         (Expression.Error118): Make this non-static and removed the
11901         expression and location arguments.
11902         (TypeExpr): Added location argument to the constructor.
11903
11904         * expression.cs (StaticCallExpr): Added location argument to
11905         the constructor.
11906         (Indirection, PointerArithmetic): Likewise.
11907         (CheckedExpr, UnCheckedExpr): Likewise.
11908         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11909         (StringPtr): Likewise.
11910
11911
11912 2002-08-05  Martin Baulig  <martin@gnome.org>
11913
11914         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11915
11916         * assign.cs (Assign.DoResolve): Check whether the source
11917         expression is a value or variable.
11918
11919         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11920         while resolving the corresponding blocks.
11921
11922         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11923         an error, don't silently return null.
11924
11925         * statement.cs (Block.AddVariable): Do the error reporting here
11926         and distinguish between CS0128 and CS0136.
11927         (Block.DoResolve): Report all unused labels (warning CS0164).
11928         (LabeledStatement): Pass the location to the constructor.
11929         (LabeledStatement.HasBeenReferenced): New property.
11930         (LabeledStatement.Resolve): Set it to true here.
11931
11932         * statement.cs (Return.Emit): Return success even after reporting
11933         a type mismatch error (CS0126 or CS0127), this is what csc does and
11934         it avoids confusing the users with any consecutive errors.
11935
11936 2002-08-05  Martin Baulig  <martin@gnome.org>
11937
11938         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11939
11940         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11941
11942         * expression.cs (MemberAccess.DoResolve): Silently return if an
11943         error has already been reported.
11944
11945         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11946         error has already been reported.
11947
11948 2002-08-05  Martin Baulig  <martin@gnome.org>
11949
11950         * statement.cs (UsageVector): Only initialize the `parameters'
11951         vector if we actually have any "out" parameters.
11952
11953 2002-08-05  Martin Baulig  <martin@gnome.org>
11954
11955         * expression.cs (Binary.ResolveOperator): When combining delegates,
11956         they must have the same type.
11957
11958 2002-08-05  Martin Baulig  <martin@gnome.org>
11959
11960         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11961         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11962         work with the ms runtime and we also don't need it: if we're a
11963         PropertyBuilder and not in the `indexer_arguments' hash, then we
11964         are a property and not an indexer.
11965
11966         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11967         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11968         since the latter one doesn't work with the ms runtime.
11969
11970 2002-08-03  Martin Baulig  <martin@gnome.org>
11971
11972         Fixed bugs #27998 and #22735.
11973
11974         * class.cs (Method.IsOperator): New public field.
11975         (Method.CheckBase): Report CS0111 if there's already a method
11976         with the same parameters in the current class.  Report CS0508 when
11977         attempting to change the return type of an inherited method.
11978         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11979         and it's not marked abstract or extern.
11980         (PropertyBase): New abstract base class for Property and Indexer.
11981         (PropertyBase.CheckBase): Moved here from Property and made it work
11982         for indexers.
11983         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11984         the same so we can reuse it there.
11985         (Property, Indexer): Derive from PropertyBase.
11986         (MethodSignature.inheritable_property_signature_filter): New delegate
11987         to find properties and indexers.
11988
11989         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11990         argument and improved error reporting.
11991
11992         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11993         EmptyReadOnlyParameters and made it a property.
11994
11995         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11996         version of this method which takes a `PropertyInfo indexer'.
11997         (TypeManager.RegisterIndexer): New method.
11998
11999         * class.cs: Added myself as author of this file :-)
12000
12001 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12002
12003         * class.cs: fixed compilation on windoze.
12004
12005 2002-08-03  Martin Baulig  <martin@gnome.org>
12006
12007         * interface.cs (Interface.GetInterfaceBases): Check whether all
12008         base interfaces are at least as accessible than the current one.
12009
12010         * class.cs (TypeContainer.GetClassBases): Check whether base types
12011         are at least as accessible than the current type.
12012         (TypeContainer.AsAccessible): Implemented and made non-static.
12013         (MemberBase.CheckParameters): Report errors if the accessibility
12014         checks fail.
12015
12016         * delegate.cs (Delegate.Delegate): The default visibility is
12017         internal for top-level types and private for nested types.
12018         (Delegate.Define): Report errors if the accessibility checks fail.
12019
12020         * enum.cs (Enum.Enum): The default visibility is internal for
12021         top-level types and private for nested types.
12022         (Enum.DefineType): Compute the correct visibility.
12023
12024         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12025         function which takes a `bool is_toplevel' instead of a TypeContainer.
12026
12027         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12028         builtin type.
12029
12030 2002-08-02  Martin Baulig  <martin@gnome.org>
12031
12032         * expression.cs (LocalVariableReferenc): Added constructor which
12033         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12034         (LocalVariableReference.IsReadOnly): New property.
12035         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12036         variable is readonly, use our own readonly flag to do this; you can
12037         use the new constructor to get a writable reference to a read-only
12038         variable.
12039
12040         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12041         reference to the local variable.
12042
12043 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12044
12045         * rootcontext.cs (ResolveCore): Also include System.Exception
12046
12047         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12048         we reach an EmptyStatement.
12049
12050         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12051         is also fine.
12052
12053         * expression.cs (Binary.ResolveOperator): Check error result in
12054         two places.
12055
12056         use brtrue/brfalse directly and avoid compares to null.
12057
12058 2002-08-02  Martin Baulig  <martin@gnome.org>
12059
12060         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12061         Fixes bug #28407, added test-155.cs.
12062
12063 2002-08-01  Martin Baulig  <martin@gnome.org>
12064
12065         * class.cs (Event.EmitDefaultMethod): Make this work with static
12066         events.  Fixes #28311, added verify-3.cs.
12067
12068 2002-08-01  Martin Baulig  <martin@gnome.org>
12069
12070         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12071         `is_disposable' fields.
12072         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12073         `hm.is_disposable' if we're using the collection pattern.
12074         (Foreach.EmitCollectionForeach): Use the correct type for the
12075         enumerator's local variable, only emit the try/finally block if
12076         necessary (fixes #27713).
12077
12078 2002-08-01  Martin Baulig  <martin@gnome.org>
12079
12080         * ecore.cs (Expression.report118): Renamed to Error118 and made
12081         it public static.
12082
12083         * statement.cs (Throw.Resolve): Check whether the expression is of
12084         the correct type (CS0118) and whether the type derives from
12085         System.Exception (CS0155).
12086         (Catch.Resolve): New method.  Do the type lookup here and check
12087         whether it derives from System.Exception (CS0155).
12088         (Catch.CatchType, Catch.IsGeneral): New public properties.
12089
12090         * typemanager.cs (TypeManager.exception_type): Added.
12091
12092 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12093
12094         * driver.cs: Updated About function.
12095
12096 2002-07-31  Martin Baulig  <martin@gnome.org>
12097
12098         Implemented Control Flow Analysis.
12099
12100         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12101         (EmitContext.CurrentBranching): Added.
12102         (EmitContext.StartFlowBranching): Added.
12103         (EmitContext.EndFlowBranching): Added.
12104         (EmitContext.KillFlowBranching): Added.
12105         (EmitContext.IsVariableAssigned): Added.
12106         (EmitContext.SetVariableAssigned): Added.
12107         (EmitContext.IsParameterAssigned): Added.
12108         (EmitContext.SetParameterAssigned): Added.
12109         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12110         Added control flow analysis stuff here.
12111
12112         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12113         resolve the expression as lvalue.
12114         (LocalVariableReference.DoResolve): Check whether the variable has
12115         already been assigned.
12116         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12117         the parameter as assigned here.
12118         (ParameterReference.DoResolve): Check whether the parameter has already
12119         been assigned.
12120         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12121         expression as lvalue.
12122
12123         * statement.cs (FlowBranching): New class for the flow analysis code.
12124         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12125         (LabeledStatement.IsDefined): New public property.
12126         (LabeledStatement.AddUsageVector): New public method to tell flow
12127         analyis that the label may be reached via a forward jump.
12128         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12129         flow analysis.
12130         (VariableInfo.Number): New public field.  This is used by flow analysis
12131         to number all locals of a block.
12132         (Block.CountVariables): New public property.  This is the number of
12133         local variables in this block (including the locals from all parent
12134         blocks).
12135         (Block.EmitMeta): Number all the variables.
12136
12137         * statement.cs: Added flow analysis support to all classes.
12138
12139 2002-07-31  Martin Baulig  <martin@gnome.org>
12140
12141         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12142         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12143         then use this argument.
12144
12145         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12146
12147         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12148         use this to specify /define options.
12149
12150 2002-07-29  Martin Baulig  <martin@gnome.org>
12151
12152         * statement.cs (Fixed): Moved all code that does variable lookups
12153         and resolvings from Emit to Resolve.
12154
12155         * statement.cs (For): Moved all code that does variable lookups
12156         and resolvings from Emit to Resolve.
12157
12158         * statement.cs (Using): Moved all code that does variable lookups
12159         and resolvings from Emit to Resolve.
12160
12161 2002-07-29  Martin Baulig  <martin@gnome.org>
12162
12163         * attribute.cs (Attribute.Resolve): Explicitly catch a
12164         System.NullReferenceException when creating the
12165         CustromAttributeBuilder and report a different warning message.
12166
12167 2002-07-29  Martin Baulig  <martin@gnome.org>
12168
12169         * support.cs (ParameterData.ParameterName): Added method to
12170         get the name of a parameter.
12171
12172         * typemanager.cs (TypeManager.IsValueType): New public method.
12173
12174 2002-07-29  Martin Baulig  <martin@gnome.org>
12175
12176         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12177         is a flag which specifies that it's either ref or out.
12178         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12179         the out parameter to `out Parameter.Modifier mod', also set the
12180         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12181
12182         * support.cs (InternalParameters.ParameterModifier): 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         * expression.cs (Argument.GetParameterModifier): Distinguish
12187         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12188         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12189
12190 2002-07-29  Martin Baulig  <martin@gnome.org>
12191
12192         * expression.cs (ParameterReference.ParameterReference): Added
12193         `Location loc' argument to the constructor.
12194
12195         * cs-parser.jay: Pass location to ParameterReference.
12196
12197 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12198
12199         * statement.cs (Try): Initialize the location.
12200
12201         * cs-parser.jay: pass location to Try.
12202
12203         * expression.cs (Unary.Reduce): Change the prototype to return
12204         whether a constant fold could be performed or not.  The result is
12205         returned in an out parameters.  In the case of Indirection and
12206         AddressOf, we want to perform the full tests.
12207
12208 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12209
12210         * statement.cs (Statement.Emit): Flag dead code.
12211
12212 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12213
12214         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12215
12216 2002-07-27  Martin Baulig  <martin@gnome.org>
12217
12218         * class.cs (MethodData.Define): Put back call to
12219         TypeManager.AddMethod(), accidentally commented this out.
12220
12221         * report.cs (Debug): New public method to print debugging information,
12222         this is `[Conditional ("DEBUG")]'.
12223
12224 2002-07-26  Martin Baulig  <martin@gnome.org>
12225
12226         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12227         (switch_statement): Push the current_block to the switch_stack and
12228         pop it again when we're done with the switch.
12229         (switch_section): The new block is a child of the current_block.
12230         Fixes bug #24007, added test-152.cs.
12231
12232 2002-07-27  Martin Baulig  <martin@gnome.org>
12233
12234         * expression.cs (Invocation.EmitArguments): When calling a varargs
12235         function with only its fixed arguments, we need to pass an empty
12236         array.
12237
12238 2002-07-27  Martin Baulig  <martin@gnome.org>
12239
12240         Mono 0.13 has been released.
12241
12242 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12243
12244         * driver.cs: Rename --resource to --linkres, because that is what
12245         we do currently, we dont support --resource yet.
12246
12247         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12248
12249 2002-07-25  Martin Baulig  <martin@gnome.org>
12250
12251         * class.cs (MethodData): New public class.  This is a `method builder'
12252         class for a method or one accessor of a Property/Indexer/Event.
12253         (MethodData.GetMethodFlags): Moved here from MemberBase.
12254         (MethodData.ApplyAttributes): Likewise.
12255         (MethodData.ApplyObsoleteAttribute): Likewise.
12256         (MethodData.ApplyConditionalAttribute): Likewise.
12257         (MethodData.ApplyDllImportAttribute): Likewise.
12258         (MethodData.CheckAbstractAndExternal): Likewise.
12259         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12260         (MethodData.Emit): Formerly known as Method.Emit().
12261         (MemberBase): Moved everything which was specific to a single
12262         accessor/method to MethodData.
12263         (Method): Create a new MethodData and call Define() and Emit() on it.
12264         (Property, Indexer, Event): Create a new MethodData objects for each
12265         accessor and call Define() and Emit() on them.
12266
12267 2002-07-25  Martin Baulig  <martin@gnome.org>
12268
12269         Made MethodCore derive from MemberBase to reuse the code from there.
12270         MemberBase now also checks for attributes.
12271
12272         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12273         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12274         as virtual.
12275         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12276         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12277         (MemberBase.ApplyAttributes): New virtual method; applies the
12278         attributes to a method or accessor.
12279         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12280         (MemberBase.ApplyConditionalAttribute): Likewise.
12281         (MemberBase.ApplyDllImportAttribute): Likewise.
12282         (MemberBase.CheckAbstractAndExternal): Likewise.
12283         (MethodCore.ParameterTypes): This is now a property instead of a
12284         method, it's initialized from DoDefineParameters().
12285         (MethodCore.ParameterInfo): Removed the set accessor.
12286         (MethodCore.DoDefineParameters): New protected virtual method to
12287         initialize ParameterTypes and ParameterInfo.
12288         (Method.GetReturnType): We can now simply return the MemberType.
12289         (Method.GetMethodFlags): Override the MemberBase version and add
12290         the conditional flags.
12291         (Method.CheckBase): Moved some code from Define() here, call
12292         DoDefineParameters() here.
12293         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12294         here to avoid some larger code duplication.
12295         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12296         ensure that abstract and external accessors don't declare a body.
12297
12298         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12299         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12300         lookup in the attribute's parent classes, so we need to abort as soon
12301         as we found the first match.
12302         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12303         the attribute has no arguments.
12304
12305         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12306         of a Method.
12307
12308 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12309
12310         * cs-parser.jay: reverted previous patch.
12311
12312 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12313
12314         * cs-parser.jay: fixed bug #22119.
12315
12316 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12317
12318         * attribute.cs: fixed compilation. The error was:
12319         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12320         be assigned to before control leaves the current method."
12321         [FIXME:  Filed as bug #28186: MCS must report this error.]
12322
12323 2002-07-25  Martin Baulig  <martin@gnome.org>
12324
12325         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12326         method to pull the condition name ouf of a Conditional attribute.
12327         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12328         the obsolete message and error flag out of an Obsolete attribute.
12329
12330         * class.cs (Method.GetMethodFlags): New public method to get the
12331         TypeManager.MethodFlags for this method.
12332         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12333         private methods.
12334         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12335         if we're overriding a virtual function, set the new private variable
12336         `parent_method'; call the new TypeManager.AddMethod().
12337
12338         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12339         the MethodBuilder and the Method in a PtrHashtable.
12340         (TypeManager.builder_to_method): Added for this purpose.
12341         (TypeManager.MethodFlags): Added IsObsoleteError.
12342         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12343         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12344         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12345         the message from the attribute.
12346
12347 2002-07-24  Martin Baulig  <martin@gnome.org>
12348
12349         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12350         preprocessor directives, ensure that the argument to #define/#undef is
12351         exactly one identifier and that it's actually an identifier.
12352
12353         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12354         did not work ....
12355
12356 2002-07-24  Martin Baulig  <martin@gnome.org>
12357
12358         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12359         initialize it to TypeManager.object_type in the constructor.
12360         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12361         of the `hm.get_current' method if we're using the collection pattern.
12362         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12363         for the explicit conversion to make it work when we're using the collection
12364         pattern and the `Current' property has a different return type than `object'.
12365         Fixes #27713.
12366
12367 2002-07-24  Martin Baulig  <martin@gnome.org>
12368
12369         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12370         does not match, but don't report any errors.  This method is called in
12371         order for all methods in a MethodGroupExpr until a matching method is
12372         found, so we don't want to bail out if the first method doesn't match.
12373         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12374         matches, report the 123.  Fixes #28070.
12375
12376 2002-07-24  Martin Baulig  <martin@gnome.org>
12377
12378         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12379         TypeManager.TypeToCoreType() to the top of the method so the
12380         following equality checks will work.  Fixes #28107.
12381
12382 2002-07-24  Martin Baulig  <martin@gnome.org>
12383
12384         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12385         operand is of type uint, and the other operand is of type sbyte,
12386         short or int, the operands are converted to type long." -
12387         Actually do what this comment already told us.  Fixes bug #28106,
12388         added test-150.cs.
12389
12390 2002-07-24  Martin Baulig  <martin@gnome.org>
12391
12392         * class.cs (MethodBase): New abstract class.  This is now a base
12393         class for Property, Indexer and Event to avoid some code duplication
12394         in their Define() and DefineMethods() methods.
12395         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12396         generic methods for Define() and DefineMethods().
12397         (FieldBase): Derive from MemberBase, not MemberCore.
12398         (Property): Derive from MemberBase, not MemberCore.
12399         (Property.DefineMethod): Moved all the code from this method to the
12400         new MethodBase.DefineAccessor(), just call it with appropriate
12401         argumetnts.
12402         (Property.Define): Call the new Property.DoDefine(), this does some
12403         sanity checks and we don't need to duplicate the code everywhere.
12404         (Event): Derive from MemberBase, not MemberCore.
12405         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12406         accessors, this will also make them work with interface events.
12407         (Indexer): Derive from MemberBase, not MemberCore.
12408         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12409         (Indexer.Define): Use the new MethodBase functions.
12410
12411         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12412         argument to the constructor.
12413         (Interface.FindMembers): Added support for interface events.
12414         (Interface.PopluateEvent): Implemented.
12415
12416         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12417
12418 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12419
12420         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12421         but this is required to check for a method name being the same as
12422         the containing class.  
12423
12424         Handle this now.
12425
12426 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12427
12428         * interface.cs: initialize variable.
12429
12430 2002-07-23  Martin Baulig  <martin@gnome.org>
12431
12432         Implemented the IndexerName attribute in interfaces.
12433
12434         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12435         name if this is an explicit interface implementation.
12436         (Indexer.InterfaceIndexerName): New public variable.  If we're
12437         implementing an interface indexer, this is the IndexerName in that
12438         interface.  Otherwise, it's the IndexerName.
12439         (Indexer.DefineMethod): If we're implementing interface indexer,
12440         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12441         and Pending.ImplementIndexer methods.
12442         (Indexer.Define): Also define the PropertyBuilder if we're
12443         implementing an interface indexer and this is neither an explicit
12444         interface implementation nor do the IndexerName match the one in
12445         the interface.
12446
12447         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12448         If a method is defined here, then we always need to create a proxy
12449         for it.  This is used when implementing interface indexers.
12450         (Pending.IsInterfaceIndexer): New public method.
12451         (Pending.ImplementIndexer): New public method.
12452         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12453         This is used when implementing interface indexers to define a proxy
12454         if necessary.
12455         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12456         define a proxy if necessary.
12457
12458         * interface.cs (Interface.IndexerName): New public variable.
12459         (Interface.PopulateIndexer): Set the IndexerName.
12460         (Interface.DefineIndexers): New private method.  Populate all the
12461         indexers and make sure their IndexerNames match.
12462
12463         * typemanager.cs (IndexerPropertyName): Added support for interface
12464         indexers.
12465
12466 2002-07-22  Martin Baulig  <martin@gnome.org>
12467
12468         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12469         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12470         ret if HasReturnLabel.
12471         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12472         variables.
12473
12474         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12475         and set the ec.LoopBeginTryCatchLevel.
12476         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12477         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12478         the current ec.TryCatchLevel, the branch goes out of an exception
12479         block.  In this case, we need to use Leave and not Br.
12480
12481 2002-07-22  Martin Baulig  <martin@gnome.org>
12482
12483         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12484         block unless the block does not always return or it is contained in
12485         another try { ... } catch { ... } block.  Fixes bug #26506.
12486         Added verify-1.cs to the test suite.
12487
12488 2002-07-22  Martin Baulig  <martin@gnome.org>
12489
12490         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12491         then we do not always return.  Fixes bug #24985.
12492
12493 2002-07-22  Martin Baulig  <martin@gnome.org>
12494
12495         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12496         lookup on a per-class level; ie. walk up the class hierarchy until we
12497         found at least one applicable method, then choose the best among them.
12498         Fixes bug #24463 and test-29.cs.
12499
12500 2002-07-22  Martin Baulig  <martin@gnome.org>
12501
12502         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12503         return types of the methods.  The return type is not part of the
12504         signature and we must not check it to make the `new' modifier work.
12505         Fixes bug #27999, also added test-147.cs.
12506         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12507
12508         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12509         on the method's return type.
12510
12511 2002-07-21  Martin Baulig  <martin@gnome.org>
12512
12513         * assign.cs: Make this work if the rightmost source is a constant and
12514         we need to do an implicit type conversion.  Also adding a few more tests
12515         to test-38.cs which should have caught this.
12516
12517         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12518         target in the makefile for this.  The makefile.gnu is primarily intended
12519         for end-users who don't want to debug the compiler.
12520
12521 2002-07-21  Martin Baulig  <martin@gnome.org>
12522
12523         * assign.cs: Improved the Assign class so it can now handle embedded
12524         assignments (X = Y = Z = something).  As a side-effect this'll now also
12525         consume less local variables.  test-38.cs now passes with MCS, added
12526         a few new test cases to that test.
12527
12528 2002-07-20  Martin Baulig  <martin@gnome.org>
12529
12530         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12531         instructions.  Fixes bug #27977, also added test-146.cs.
12532
12533 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12534
12535         * cs-tokenizer.cs: fixed getHex ().
12536
12537 2002-07-19  Martin Baulig  <martin@gnome.org>
12538
12539         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12540         not Type.GetType() to lookup the array type.  This is needed when
12541         we're constructing an array of a user-defined type.
12542         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12543         single-dimensional arrays, but also for single-dimensial arrays of
12544         type decimal.
12545
12546 2002-07-19  Martin Baulig  <martin@gnome.org>
12547
12548         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12549         this function is called, it's not allowed to share LocalBuilders
12550         among ILGenerators.
12551
12552 2002-07-19  Martin Baulig  <martin@gnome.org>
12553
12554         * expression.cs (Argument.Resolve): Report an error 118 when trying
12555         to pass a type as argument.
12556
12557 2002-07-18  Martin Baulig  <martin@gnome.org>
12558
12559         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12560         Conv_R_Un for the signed `long' type.
12561
12562 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12563
12564         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12565         `expr' for the temporary result, as that will fail if we do
12566         multiple resolves on the same expression.
12567
12568 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12569
12570         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12571         ec.TypeContainer for looking up aliases. 
12572
12573         * class.cs (TypeContainer): Remove LookupAlias from here.
12574
12575         * decl.cs (DeclSpace); Move here.
12576
12577 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12578
12579         * class.cs (FindMembers): Only call filter if the constructor
12580         bulider is not null.
12581
12582         Also handle delegates in `NestedTypes' now.  Now we will perform
12583         type lookups using the standard resolution process.  This also
12584         fixes a bug.
12585
12586         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12587         This uses Expressions (the limited kind that can be parsed by the
12588         tree) instead of strings.
12589
12590         * expression.cs (ComposedCast.ToString): Implement, used to flag
12591         errors since now we have to render expressions.
12592
12593         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12594         FormArrayType. 
12595
12596         * ecore.cs (SimpleName.ToString): ditto.
12597
12598         * cs-parser.jay: Instead of using strings to assemble types, use
12599         Expressions to assemble the type (using SimpleName, ComposedCast,
12600         MemberAccess).  This should fix the type lookups in declarations,
12601         because we were using a different code path for this.
12602
12603         * statement.cs (Block.Resolve): Continue processing statements
12604         even when there is an error.
12605
12606 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12607
12608         * class.cs (Event.Define): Also remove the `remove' method from
12609         the list of pending items.
12610
12611         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12612         generate more compact code. 
12613
12614 2002-07-17  Martin Baulig  <martin@gnome.org>
12615
12616         * const.cs (Const.LookupConstantValue): Add support for constant
12617         `unchecked' and `checked' expressions.
12618         Also adding test case test-140.cs for this.
12619
12620 2002-07-17  Martin Baulig  <martin@gnome.org>
12621
12622         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12623         check whether mi.ReturnType implements the IEnumerator interface; the
12624         `==' and the IsAssignableFrom() will fail in this situation.
12625
12626 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12627
12628         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12629         here too.
12630
12631 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12632
12633         * expression.cs: fixed bug #27811.
12634
12635 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12636
12637         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12638         Molaro: when we are a ref, the value already contains a pointer
12639         value, do not take the address of it.
12640
12641 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12642         * removed mb-parser.jay and mb-tokenizer.cs
12643
12644 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12645
12646         * expression.cs: check against the building corlib void type.
12647
12648 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12649
12650         * ecore.cs: fix for valuetype static readonly fields: when 
12651         initializing them, we need their address, not the address of a copy.
12652
12653 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12654
12655         * typemanager.cs: register also enum_type in corlib.
12656
12657 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12658
12659         * class.cs: allow calling this (but not base) initializers in structs.
12660
12661 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12662
12663         * ecore.cs: make sure we compare against the building base types
12664         in GetTypeSize ().
12665
12666 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12667
12668         * typemanager.cs: fix TypeToCoreType() to handle void and object
12669         (corlib gets no more typerefs after this change).
12670
12671 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12672
12673         * expression.cs (ArrayCreation.EmitArrayArguments): use
12674         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12675
12676         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12677         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12678         array indexes, the runtime actually forbids them.
12679
12680         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12681         for array arguments here.
12682
12683         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12684         instead of the default for ValueTypes.
12685
12686         (New.DoEmit): Use IsValueType instead of
12687         IsSubclassOf (value_type)
12688         (New.DoResolve): ditto.
12689         (Invocation.EmitCall): ditto.
12690
12691         * assign.cs (Assign): ditto.
12692
12693         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12694         Statements *are* currently doing part of their resolution during
12695         Emit.  
12696
12697         Expressions do always resolve during resolve, but statements are
12698         only required to propagate resolution to their children.
12699
12700 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12701
12702         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12703
12704         (LoadAssembly): Do not add the dll if it is already specified
12705
12706         (MainDriver): Add the System directory to the link path at the end,
12707         after all the other -L arguments. 
12708
12709         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12710         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12711         ldelem.u1) and using the opposite for sbytes.
12712
12713         This fixes Digger, and we can finally run it.
12714
12715         * driver.cs (UnixParseOption): Move the option parsing here.  
12716         (CSCParseOption): Implement CSC-like parsing of options.
12717
12718         We now support both modes of operation, the old Unix way, and the
12719         new CSC-like way.  This should help those who wanted to make cross
12720         platform makefiles.
12721
12722         The only thing broken is that /r:, /reference: and /lib: are not
12723         implemented, because I want to make those have the same semantics
12724         as the CSC compiler has, and kill once and for all the confussion
12725         around this.   Will be doing this tomorrow.
12726
12727         * statement.cs (Unsafe.Resolve): The state is checked during
12728         resolve, not emit, so we have to set the flags for IsUnsfe here.
12729
12730 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12731
12732         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12733         not catch the Error_ObjectRefRequired in SimpleName (as it is
12734         possible to have a class/instance variable name that later gets
12735         deambiguated), we have to check this here.      
12736
12737 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12738
12739         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12740         make static and put into Expression.
12741
12742         (Event.Define): Register the private field of the event with the 
12743         TypeManager so that GetFieldFromEvent can get at it.
12744
12745         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12746         keep track of the private field associated with an event which
12747         has no accessors.
12748
12749         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12750         private field.
12751
12752         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12753
12754 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12755
12756         * expression.cs (Binary.EmitBranchable): this routine emits the
12757         Binary expression in a branchable context.  This basically means:
12758         we need to branch somewhere, not just get the value on the stack.
12759
12760         This works together with Statement.EmitBoolExpression.
12761
12762         * statement.cs (Statement.EmitBoolExpression): Use
12763         EmitBranchable. 
12764
12765 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12766
12767         * statement.cs (For): Reduce the number of jumps in loops.
12768
12769         (For): Implement loop inversion for the For statement.
12770
12771         (Break): We can be breaking out of a Try/Catch controlled section
12772         (foreach might have an implicit try/catch clause), so we need to
12773         use Leave instead of Br.
12774
12775         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12776         now).  If the instace expression supports IMemoryLocation, we use
12777         the AddressOf method from the IMemoryLocation to extract the
12778         address instead of emitting the instance.
12779
12780         This showed up with `This', as we were emitting the instance
12781         always (Emit) instead of the Address of This.  Particularly
12782         interesting when This is a value type, as we dont want the Emit
12783         effect (which was to load the object).
12784
12785 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12786
12787         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12788
12789         * statement.cs (Checked): Set the CheckedState during the resolve
12790         process too, as the ConvCast operations track the checked state on
12791         the resolve process, and not emit.
12792
12793         * cs-parser.jay (namespace_member_declaration): Flag that we have
12794         found a declaration when we do.  This is used to flag error 1529
12795
12796         * driver.cs: Report ok when we display the help only.
12797
12798 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12799
12800         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12801
12802 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12803
12804         * cs-tokenizer.cs (define): We also have to track locally the
12805         defines.  AllDefines is just used for the Conditional Attribute,
12806         but we also need the local defines for the current source code. 
12807
12808 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12809
12810         * statement.cs (While, For, Do): These loops can exit through a
12811         Break statement, use this information to tell whether the
12812         statement is the last piece of code.
12813
12814         (Break): Flag that we break.
12815
12816         * codegen.cs (EmitContexts): New `Breaks' state variable.
12817
12818 2002-07-03  Martin Baulig  <martin@gnome.org>
12819
12820         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12821         modifiers in method declarations in structs.  Otherwise, you won't
12822         be able to override things like Object.Equals().
12823
12824 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12825
12826         * class.cs (Method, Property, Indexer): Do not allow the public
12827         modifier to be used in explicit interface implementations.
12828
12829         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12830         override modifiers in method declarations in structs
12831
12832 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12833
12834         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12835         integer or real overflow, report an error
12836
12837 2002-07-02  Martin Baulig  <martin@gnome.org>
12838
12839         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12840         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12841         to tell the runtime about our newly created System.Object and
12842         System.ValueType types.
12843
12844 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12845
12846         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12847         struct instead of Ldarg/Starg.
12848
12849 2002-07-02  Martin Baulig  <martin@gnome.org>
12850
12851         * expression.cs (Indirection.Indirection): Call
12852         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12853
12854 2002-07-02  Martin Baulig  <martin@gnome.org>
12855
12856         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12857         ValueType, call TypeManager.TypeToCoreType() on it.
12858         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12859         the OpCodes.Newarr argument.
12860
12861 2002-07-02  Martin Baulig  <martin@gnome.org>
12862
12863         * expression.cs (Invocation.EmitCall): When compiling corlib,
12864         replace all calls to the system's System.Array type to calls to
12865         the newly created one.
12866
12867         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12868         System.Array methods.
12869         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12870         from the system's System.Array type which must be replaced.
12871
12872 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12873
12874         * typemanager.cs: load unverifiable_code_ctor so we can build
12875         corlib using the correct type. Avoid using GetTypeCode() with
12876         TypeBuilders.
12877         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12878         TypeManager.object_type to allow building corlib.
12879
12880 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12881
12882         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12883
12884 2002-07-01  Martin Baulig  <martin@gnome.org>
12885
12886         * class.cs: Make the last change actually work, we need to check
12887         whether `ifaces != null' to avoid a crash.
12888
12889 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12890
12891         * class.cs: when we build structs without fields that implement
12892         interfaces, we need to add the interfaces separately, since there is
12893         no API to both set the size and add the interfaces at type creation
12894         time.
12895
12896 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12897
12898         * expression.cs: the dimension arguments to the array constructors
12899         need to be converted if they are a long.
12900
12901 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12902
12903         * class.cs: don't emit ldarg.0 if there is no parent constructor
12904         (fixes showstopper for corlib).
12905
12906 2002-06-29  Martin Baulig  <martin@gnome.org>
12907
12908         MCS now compiles corlib on GNU/Linux :-)
12909
12910         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12911         ie. check for MethodImplOptions.InternalCall.
12912
12913         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12914         and TypeManager.attribute_type are null, so we must explicitly check
12915         whether parent is not null to find out whether it's an attribute type.
12916         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12917         and SetBuilder, not only if the property is neither abstract nor external.
12918         This is necessary to set the MethodImplOptions on the accessor methods.
12919         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12920         SetBuilder, see Property.Emit().
12921
12922         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12923         populate "System.Object", "System.ValueType" and "System.Attribute" since
12924         they've already been populated from BootCorlib_PopulateCoreTypes().
12925
12926 2002-06-29  Martin Baulig  <martin@gnome.org>
12927
12928         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12929         is the NullLiteral, we also need to make sure that target_type is not
12930         an enum type.   
12931
12932 2002-06-29  Martin Baulig  <martin@gnome.org>
12933
12934         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12935         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12936         before calling BootstrapCorlib_ResolveDelegate ().
12937
12938 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12939
12940         * statement.cs: fixed build-breaker. All tests passed ok.
12941
12942 2002-06-27  Martin Baulig  <martin@gnome.org>
12943
12944         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12945         for System.Decimal when compiling corlib.
12946
12947 2002-06-27  Martin Baulig  <martin@gnome.org>
12948
12949         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12950         switch blocks which contain nothing but a default clause.
12951
12952 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12953
12954        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12955
12956 2002-06-27  Martin Baulig  <martin@gnome.org>
12957
12958         * ecore.cs (PropertyExpr.PropertyExpr): Call
12959         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12960
12961         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12962         is already a TypeBuilder.
12963
12964 2002-06-27  Martin Baulig  <martin@gnome.org>
12965
12966         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12967         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12968         the "from an array-type to System.Array" case.  This makes it work
12969         when compiling corlib.
12970
12971 2002-06-27  Martin Baulig  <martin@gnome.org>
12972
12973         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12974         non-static PropertyExpr, set its InstanceExpression.  This makes
12975         the `ICollection.Count' property work in System/Array.cs.
12976
12977 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12978
12979         * driver.cs: Made error handling more consistent.  Errors now
12980         tracked by Report class, so many methods which used to return int
12981         now return void.  Main() now prints success/failure and 
12982         errors/warnings message.
12983
12984         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12985         the magic number return values (123 and 124).  Now, if the
12986         expected error occurs, the compiler exits with success (exit value
12987         0).  If the compilation completes without seeing that particular
12988         error, the compiler exits with failure (exit value 1).  The
12989         makefile in mcs/errors has been changed to handle the new behaviour.
12990
12991         * report.cs: Made 'expected error' number a property and renamed
12992         it from 'Probe' to 'ExpectedError'.
12993
12994         * genericparser.cs: Removed error handling support, since it is
12995         now all done by Report class.
12996
12997         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12998         class, so parse() no longer returns an int.
12999
13000         * namespace.cs: Use Report.Error instead of GenericParser.error
13001
13002 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13003
13004         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13005         TypeContainer.AddOperator): At the front of the list put the
13006         explicit implementations, so they get resolved/defined first. 
13007
13008 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13009
13010         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13011         interface type is implemented by this TypeContainer.  Used during
13012         explicit interface implementation.
13013
13014         (Property.Define, Indexer.Define, Method.Define): Validate that
13015         the given interface in the explicit implementation is one of the
13016         base classes for the containing type.
13017
13018         Also if we are explicitly implementing an interface, but there is
13019         no match in the pending implementation table, report an error.
13020
13021         (Property.Define): Only define the property if we are
13022         not explicitly implementing a property from an interface.  Use the
13023         correct name also for those properties (the same CSC uses,
13024         although that is really not needed).
13025
13026         (Property.Emit): Do not emit attributes for explicitly implemented
13027         properties, as there is no TypeBuilder.
13028
13029         (Indexer.Emit): ditto.
13030
13031         Hiding then means that we do not really *implement* a pending
13032         implementation, which makes code fail.
13033
13034 2002-06-22  Martin Baulig  <martin@gnome.org>
13035
13036         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13037         the return value of Object.GetType().  [FIXME: we need to do this whenever
13038         we get a type back from the reflection library].
13039
13040 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13041
13042         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13043
13044 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13045
13046         * attribute.cs: Return null if we can not look up the type.
13047
13048         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13049         the interface types found.
13050
13051         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13052         interface types found.
13053
13054         * typemanager.cs (GetInterfaces): Make this routine returns alll
13055         the interfaces and work around the lame differences between
13056         System.Type and System.Reflection.Emit.TypeBuilder in the results
13057         result for GetInterfaces.
13058
13059         (ExpandInterfaces): Given an array of interface types, expand and
13060         eliminate repeated ocurrences of an interface.  This expands in
13061         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13062         be IA, IB, IC.
13063
13064 2002-06-21  Martin Baulig  <martin@gnome.org>
13065
13066         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13067         on System.Enum.
13068
13069 2002-06-21  Martin Baulig  <martin@gnome.org>
13070
13071         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13072         and called with one of the core types, return the corresponding typebuilder for
13073         that type.
13074
13075         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13076         element type.
13077
13078 2002-06-21  Martin Baulig  <martin@gnome.org>
13079
13080         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13081         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13082         (Expression.ConvertReferenceExplicit): Likewise.
13083
13084         * expression.cs (ElementAccess.DoResolve): Likewise.
13085         (ElementAccess.DoResolveLValue): Likewise.
13086
13087 2002-06-10  Martin Baulig  <martin@gnome.org>
13088
13089         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13090         add the "value" parameter to the parameter list.
13091
13092         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13093         to our caller.
13094
13095 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13096
13097         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13098         the argument to an int, uint, long or ulong, per the spec.  Also
13099         catch negative constants in array creation.
13100
13101 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13102
13103         * class.cs: do not allow the same interface to appear twice in
13104         the definition list.
13105
13106 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13107
13108         * ecore.cs: don't use ldlen with System.Array.
13109
13110 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13111
13112         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13113
13114 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13115
13116         * modifiers.cs: produce correct field attributes for protected
13117         internal. Easy fix so miguel can work on ther harder stuff:-)
13118
13119 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13120
13121         * pending.cs: New file.  Move the code from class.cs here.
13122         Support clearning the pending flag for all methods (when not doing
13123         explicit interface implementation).
13124
13125 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13126
13127         * rootcontext.cs: added a couple more types needed to bootstrap.
13128
13129 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13130
13131         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13132         constructor in the type, instead of any constructor in the type
13133         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13134         a bug in the Mono runtime when applying the params attribute). 
13135
13136 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13137         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13138
13139 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13140
13141         * expression.cs (Unary.ResolveOperator): Use TypeManager
13142         to resolve the type.
13143
13144 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13145
13146         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13147         attached.
13148
13149         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13150         with each member too.
13151
13152         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13153         field builders too - this takes care of the enum member case.
13154
13155 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13156
13157         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13158         address-of operator on both value types and pointers.
13159
13160 2002-06-10  Martin Baulig  <martin@gnome.org>
13161
13162         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13163         PropertyBuilder to the `property_builders' list.
13164
13165         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13166         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13167         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13168         find any indexers which are inherited from an interface.
13169
13170 2002-06-09  Martin Baulig  <martin@gnome.org>
13171
13172         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13173         the same type as the constant if necessary.  There's also a test-130.cs
13174         for this.
13175
13176         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13177
13178         * typemanager.cs (TypeManager.ChangeType): Previously known as
13179         Enum.ChangeEnumType().
13180
13181 2002-06-09  Martin Baulig  <martin@gnome.org>
13182
13183         * expression.cs (Cast.TryReduce): Added support for consts.
13184
13185 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13186
13187         * class.cs (Accessor): Hold attributes information so we can pass
13188         it along.
13189
13190         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13191         Modify to pass in attributes attached to the methods.
13192
13193         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13194
13195         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13196         to handle the Accessor kind :-)
13197
13198         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13199
13200 2002-06-08  Martin Baulig  <martin@gnome.org>
13201
13202         * expression.cs (Unary.TryReduceNegative): Added support for
13203         ULongConstants.
13204
13205 2002-06-08  Martin Baulig  <martin@gnome.org>
13206
13207         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13208         name can't be found in the `defined_names' - the caller will do a
13209         MemberLookup in this case and thus find methods in System.Enum
13210         such as Enum.IsDefined().
13211
13212 2002-06-08  Martin Baulig  <martin@gnome.org>
13213
13214         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13215         Convert.ChangeType() which works with TypeBuilder created types.
13216         (Enum.LookupEnumValue, Enum.Define): Use it here.
13217
13218         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13219         `TypeBuilder.BaseType != null' check.
13220         (TypeContainer.FindMembers): Only lookup parent members if we
13221         actually have a parent.
13222         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13223         (ConstructorInitializer.Resolve): Likewise.
13224
13225         * interface.cs (Interface.FindMembers): Added
13226         `TypeBuilder.BaseType != null' check.
13227
13228         * rootcontext.cs (RootContext.ResolveCore): Added
13229         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13230         classes_second_stage.
13231
13232         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13233         debug_type and trace_type when compiling with --nostdlib.       
13234
13235 2002-06-07  Martin Baulig  <martin@gnome.org>
13236
13237         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13238         (AddField): Set it to true when adding a non-static field.
13239         (DefineType): Use `have_nonstatic_fields' to find out whether we
13240         have non-static fields, not `Fields != null'.
13241
13242 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13243
13244         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13245         dereferencing a null on the static-field code path)
13246
13247 2002-05-30  Martin Baulig  <martin@gnome.org>
13248
13249         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13250         to take command line arguments.  Use reflection to call the new
13251         custom `Initialize' function on the symbol writer and pass it the
13252         command line arguments.
13253
13254         * driver.cs (--debug-args): New command line argument to pass command
13255         line arguments to the symbol writer.
13256
13257 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13258
13259         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13260         the target type for indexers and properties.  Thanks to Joe for
13261         catching this.
13262
13263 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13264
13265         * typemanager.cs (MethodFlags): returns the method flags
13266         (Obsolete/ShouldIgnore) that control warning emission and whether
13267         the invocation should be made, or ignored. 
13268
13269         * expression.cs (Invocation.Emit): Remove previous hack, we should
13270         not do this on matching a base type, we should do this based on an attribute
13271
13272         Only emit calls to System.Diagnostics.Debug and
13273         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13274         on the command line.
13275
13276         * rootcontext.cs: Global settings for tracing and debugging.
13277
13278         * cs-tokenizer.cs (define): New utility function to track
13279         defines.   Set the global settings for TRACE and DEBUG if found.
13280
13281 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13282
13283         * interface.cs (Populate*): Pass in the TypeContainer as well as
13284         the DeclSpace as parameters so that we can create EmitContexts and
13285         then use that to apply attributes etc.
13286
13287         (PopulateMethod, PopulateEvent, PopulateProperty)
13288         (PopulateIndexer): Apply attributes everywhere.
13289
13290         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13291         etc.
13292
13293         (ApplyAttributes): Update accordingly.
13294
13295         We now apply interface attributes for all members too.
13296
13297 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13298
13299         * class.cs (Indexer.Define); Correctly check if we are explicit
13300         implementation (instead of checking the Name for a ".", we
13301         directly look up if the InterfaceType was specified).
13302
13303         Delay the creation of the PropertyBuilder.
13304
13305         Only create the PropertyBuilder if we are not an explicit
13306         interface implementation.   This means that explicit interface
13307         implementation members do not participate in regular function
13308         lookups, and hence fixes another major ambiguity problem in
13309         overload resolution (that was the visible effect).
13310
13311         (DefineMethod): Return whether we are doing an interface
13312         implementation. 
13313
13314         * typemanager.cs: Temporary hack until we get attributes in
13315         interfaces (Ravi is working on that) and we get IndexerName
13316         support in interfaces.
13317
13318         * interface.cs: Register the indexers as properties.
13319
13320         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13321         warning, I have verified that this is a bug in the .NET runtime
13322         (JavaScript suffers of the same problem).
13323
13324         * typemanager.cs (MemberLookup): When looking up members for
13325         interfaces, the parent of an interface is the implicit
13326         System.Object (so we succeed in searches of Object methods in an
13327         interface method invocation.  Example:  IEnumerable x;  x.ToString
13328         ()) 
13329
13330 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13331
13332         * class.cs (Event): Events should also register if they do
13333         implement the methods that an interface requires.
13334
13335         * typemanager.cs (MemberLookup); use the new GetInterfaces
13336         method. 
13337
13338         (GetInterfaces): The code used to lookup interfaces for a type is
13339         used in more than one place, factor it here. 
13340
13341         * driver.cs: Track the errors at the bottom of the file, we kept
13342         on going.
13343
13344         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13345         instance if the method we are calling is static!
13346
13347 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13348
13349         * attribute.cs (ApplyAttributes): Make this function filter out
13350         the IndexerName attribute (as that attribute in reality is never
13351         applied) and return the string constant for the IndexerName
13352         attribute. 
13353
13354         * class.cs (TypeContainer.Emit): Validate that all the indexers
13355         have the same IndexerName attribute, and if so, set the
13356         DefaultName attribute on the class. 
13357
13358         * typemanager.cs: The return value might contain other stuff (not
13359         only methods).  For instance, consider a method with an "Item"
13360         property and an Item method.
13361
13362         * class.cs: If there is a problem with the parameter types,
13363         return. 
13364
13365 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13366
13367         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13368         looks at user defined conversion after making a call to 
13369         StandardConversionExists - we need this for overload resolution.
13370
13371         * expression.cs : Update accordingly the various method calls.
13372
13373         This fixes 2 bugs filed against implicit user defined conversions 
13374
13375 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13376
13377         * statement.cs: Track the result of the assignment.
13378
13379 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13380
13381         * expression.cs (MemberAccess): Improved error reporting for
13382         inaccessible members.
13383
13384 2002-05-22  Martin Baulig  <martin@gnome.org>
13385
13386         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13387         itself with debugging support.
13388
13389 2002-05-22  Martin Baulig  <martin@gnome.org>
13390
13391         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13392         Removed, this isn't needed anymore.
13393
13394 2002-05-20  Martin Baulig  <martin@gnome.org>
13395
13396         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13397         be underlying type for an enum.
13398
13399 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13400
13401         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13402         that splits out the loading of just the core types.
13403
13404         * rootcontext.cs (ResolveCore): Split the struct resolution in
13405         two, so we can load the enumeration underlying types before any
13406         enums are used.
13407
13408         * expression.cs (Is): Bandaid until we fix properly Switch (see
13409         bug #24985 for details).
13410
13411         * typemanager.cs (ImplementsInterface): The hashtable will contain
13412         a null if there are no interfaces implemented.
13413
13414 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13415
13416         * cs-parser.jay (indexer_declarator): It is fine to have array
13417         parameters
13418
13419 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13420
13421         * typemanager.cs: (RegisterBuilder): New function used to register
13422         TypeBuilders that implement interfaces.  Since
13423         TypeBuilder.GetInterfaces (as usual) does not work with lame
13424         Reflection.Emit. 
13425         (AddUserType): register interfaces.
13426
13427         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13428         dealing with TypeBuilder.  Also, arrays are showing up as
13429         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13430         methods can not be invoked on them!
13431
13432         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13433         (ImplicitReferenceConversionExists): Split out from
13434         StandardConversionExists. 
13435
13436         * expression.cs (As): We were only implementing one of the three
13437         cases for the as operator.  We now implement them all.
13438         (Is): Implement the various other cases for Is as well.
13439
13440         * typemanager.cs (CACHE): New define used to control if we want or
13441         not the FindMembers cache.  Seems to have a negative impact on
13442         performance currently
13443
13444         (MemberLookup): Nested types have full acess to
13445         enclosing type members
13446
13447         Remove code that coped with instance/static returns for events, we
13448         now catch this in RealFindMembers.
13449
13450         (RealFindMembers): only perform static lookup if the instance
13451         lookup did not return a type or an event.  
13452
13453 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13454
13455         * assign.cs (CompoundAssign): We pass more semantic information
13456         now to Compound Assignments than we did before: now we have all
13457         the information at hand, and now we resolve the target *before* we
13458         do the expression expansion, which allows the "CacheValue" method
13459         to have the effect we intended (before, a [x] += 1 would generate
13460         two differen ArrayAccess expressions from the ElementAccess,
13461         during the resolution process).
13462
13463         (CompoundAssign.DoResolve): Resolve target and original_source here.
13464
13465 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13466
13467         * expression.cs (ArrayAccess): dropped debugging information. 
13468
13469         * typemanager.cs: Small bug fix: I was always returning i_members,
13470         instead of one of i_members or s_members (depending on which had
13471         the content).
13472
13473         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13474         method is invoked before any code generation takes place, and it
13475         is a mechanism to inform that the expression will be invoked more
13476         than once, and that the method should use temporary values to
13477         avoid having side effects
13478
13479         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13480
13481         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13482         implementation.
13483
13484         * expression.cs (Indirection, ArrayAccess): Add support for
13485         CacheTemporaries in these two bad boys. 
13486
13487         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13488         ldobj or ldind_ref.  
13489         (StoreFromPtr): Handle stobj as well.
13490
13491         * expression.cs (UnaryMutator): Share more code.
13492
13493         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13494         down: I was not tracking the Filter function as well, which
13495         was affecting the results of the cache.
13496
13497 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13498
13499         * attribute.cs: Remove the hack to handle the CharSet property on
13500         StructLayouts. 
13501
13502 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13503
13504         * attribute.cs (DoResolve): More uglyness, we now only try to
13505         resolve the attribute partially, to extract the CharSet
13506         information (only if we are a StructLayout attribute).  Otherwise 
13507
13508         (GetExtraTypeInfo): Add some code to conditionally kill in the
13509         future this.   I am more and more convinced that the .NET
13510         framework has special code to handle the attribute setting on
13511         certain elements.
13512
13513         * expression.cs (IsParamsMethodApplicable): Revert my previous
13514         foreach change here, it was wrong.
13515
13516 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13517
13518         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13519         (pp_expr): do not abort on unknown input, just return.
13520         (eval): abort if there are pending chars.
13521
13522         * attribute.cs (Attribute.Resolve): Positional parameters are
13523         optional.  Deal with that case.
13524
13525         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13526         the Ansi/Unicode/Auto information for the type.
13527
13528         (TypeContainer.DefineType): instantiate the EmitContext here, as
13529         we will be using it during the type definition (to resolve
13530         attributes) and during the emit phase.
13531
13532         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13533         to pull type information out of the attributes
13534
13535         (Attribute.Resolve): track the constructor builder, and allow for
13536         multiple invocations (structs and classes will use this).
13537
13538         * ecore.cs (MemberLookupFinal): new version with all the
13539         parameters customizable.
13540
13541         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13542         constructors.  Return if the result value is null (as the error
13543         would have been flagged already by MemberLookupFinal)
13544
13545         Do not allow instances of abstract classes or interfaces to be
13546         created.
13547
13548         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13549         We have to compare the assembly property here when dealing with
13550         FamANDAssem and Assembly access modifiers, because we might be
13551         creating an assembly from *modules* (that means that we are not
13552         getting TypeBuilders for types defined in other modules that are
13553         part of this assembly).
13554
13555         (Method.Emit): If the method is marked abstract and has a body,
13556         emit an error. 
13557
13558         (TypeContainer.DefineMembers): If both the defined member and the
13559         parent name match are methods, then do not emit any warnings: let
13560         the Method.Define routine take care of flagging warnings.  But if
13561         there is a mismatch (method overrides something else, or method is
13562         overriwritten by something, then emit warning).
13563
13564         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13565         set to null, this means `do not check for the return type on the
13566         signature'. 
13567
13568         (Method.Define): set the return type for the method signature to
13569         null, so that we get methods with the same name and parameters and
13570         different return types.  This is used to flag warning 114 (you are
13571         hiding a method, and you probably want to use the new/override
13572         keywords instead).
13573
13574         * typemanager.cs (MemberLookup): Implemented proper access
13575         control, closing a long standing set of bug reports.  The problem
13576         was that the Framework only has two bits: Public and NonPublic,
13577         and NonPublic includes private and protected methods, but we need
13578         to enforce the FamANDAssem, FamOrAssem and Family. 
13579
13580 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13581
13582         * statement.cs (GotoCase): Return true: Ammounts to giving up
13583         knowledge on whether we return or not, and letting the other case
13584         be responsible for it.
13585
13586 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13587
13588         * driver.cs: Do not load directories for each file processed, only
13589         do it if there is a pattern.
13590
13591         * ecore.cs: Report readonly assigns here as well, as we might have
13592         been resolved only by MemberAccess.
13593
13594         (SimpleName.SimpleNameResolve): Also be useful for LValue
13595         resolution.   We need this to propagate assign to local readonly variables
13596
13597         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13598         do not want to reuse potential criteria memory.
13599
13600         * class.cs (MyEventBuilder): Set reflected_type;
13601
13602         * ecore.cs (Constantify): Added support for constifying bools.
13603
13604         (RootContext.LookupType): Added a cache for values looked up in
13605         the declaration space.
13606
13607         * typemanager.cs (FindMembers): Now is a front-end to
13608         RealFindMembers, and provides a two-level hashtable-based cache to
13609         the request.  
13610
13611         15% performance improvement: from 22.5 to 19.2 seconds.
13612
13613         * expression.cs (IsParamsMethodApplicable): use foreach.
13614         (Invocation.DoResolve): ditto.
13615         (New.DoResolve): ditto.
13616         (ArrayCreation.DoResolve): ditto.
13617
13618         * ecore.cs (FindMostEncompassingType): use foreach.
13619
13620         * delegate.cs (NewDelegate.DoResolve): Use foreach
13621
13622         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13623         (RemoveMethods): use foreach.
13624
13625         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13626         nested foreach statements instead of for, and also break out of
13627         the inner loop once a match is found.
13628
13629         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13630
13631 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13632
13633         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13634         we actually unwrap the expression to allow for extra information
13635         to be extracted. 
13636
13637         * expression.cs: Use Shr_Un on unsigned operations. 
13638
13639 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13640
13641         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13642         applicable operators was not being considered correctly. This closes
13643         the bug Miguel reported.
13644
13645 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13646
13647         * attribute.cs: check that the type derives from System.Attribute
13648         and report the correct error in that case (moved the duplicate code to
13649         its own method, too).
13650
13651 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13652
13653         * attribute.cs: lookup attribute type name as the spec says: first the
13654         bare attribute name and then name + "Attribute" (nant compiles with
13655         mcs after this fix).
13656
13657 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13658
13659         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13660         Because of the way we parse things, we should try to see if a
13661         UIntConstant can fit in an integer.
13662
13663 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13664
13665         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13666         when we are in an explicit context.
13667
13668         (ConvertReferenceExplicit): When converting from Iface type S to Class
13669         T make sure the rules are implemented as an OR.
13670
13671         * parameter.cs (ParameterType): Make it a property for now although the
13672         purpose really isn't anything immediate.
13673
13674         * expression.cs (Is*Applicable): Do better checking on the parameter type
13675         of a ref/out parameter. The ones from the system assemblies are already 
13676         marked with the correct type so we don't need to do any correction.
13677
13678         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13679         the object type is standard too so include that.
13680
13681 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13682
13683         * ecore.cs (StandardConversionExists): Augment with missing code:
13684         deal with IntConstant, LongConstants and Enumerations.
13685
13686         * assign.cs: Report the error, instead of failing silently
13687
13688         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13689         typecontainer that they are declared, because the
13690         typecontainer/namespace will have the list of using clauses that
13691         need to be applied.
13692
13693         Assembly Attributes were escaping the normal registration
13694         mechanism. 
13695
13696         (EmitCode): Apply attributes within an EmitContext that represents
13697         the container they were declared on.
13698
13699         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13700
13701 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13702
13703         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13704         Revamp completely - make much cleaner as we now operate only
13705         on a set of Types.
13706
13707         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13708         to implement the logic detailed in the spec more correctly.
13709
13710         (UserDefinedConversion): Update accordingly.
13711
13712 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13713
13714         * statement.cs: Return flow analysis information up.
13715
13716         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13717         and the default.
13718
13719         (token): Do not consume an extra character before calling
13720         decimal_digits.
13721
13722 2002-05-06  Piers Haken <piersh@friskit.com>
13723
13724         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13725
13726 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13727
13728         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13729         EmitContext during the instance constructor initializer
13730         resolution, to stop access to instance variables.
13731
13732         This is mandated by the spec, last paragraph of the `constructor
13733         initializers' section. 
13734
13735 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13736
13737         * cs-parser.jay, class.cs (Accessor): new class used to represent
13738         an accessor (get or set).  In the past we used `null' to represent
13739         a missing accessor.  But this is ambiguous because there was no
13740         way to tell in abstract indexers/properties if one of them was
13741         specified.
13742
13743         Now there is a way of addressing that.
13744
13745         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13746         instead of FindMembers.
13747
13748         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13749         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13750
13751         * attribute.cs: Treat indexers and properties as the same in terms
13752         of applying attributes
13753
13754         * ecore.cs (FindMostEncompassedType): Use statically initialized
13755         EmptyExpressions()s like we do elsewhere to avoid creating useless
13756         objects (and we take this out of the tight loop).
13757
13758         (GetConversionOperators): Move the code to extract the actual
13759         operators to a separate routine to clean things up.
13760
13761 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13762
13763         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13764         events are always registered FieldBuilders.
13765
13766         * class.cs (FieldBase): New class shared by Fields 
13767
13768         * delegate.cs: If we are a toplevel delegate, use our full name.
13769         If we are a nested delegate, then only use our tail name.
13770
13771 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13772
13773         * expression.cs (IsApplicable): Ensure that we add the "&" to
13774         ref/out types before comparing it with the type of the argument.
13775
13776         (IsParamsMethodApplicable): Ditto.
13777
13778         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13779         silly me ;-)
13780
13781         * delegate.cs : Handle the case when we have more than one applicable
13782         method. Flag an error only when we finish checking all.
13783
13784 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13785
13786         * expression.cs: Add support for boolean static initializers.
13787
13788 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13789
13790         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13791
13792         * parameter.cs (ComputeParameterTypes,
13793         ComputeAndDefineParameterTypes): Better error handling: now we
13794         clear the `types' cache if we fail during any of the type lookups.
13795         We also return the status code correctly to our caller
13796
13797         * delegate.cs: If we fail to define a delegate, abort the extra
13798         steps. 
13799
13800         * expression.cs (Binary.ResolveOperator): for
13801         operator==(object,object) and operator !=(object, object) we also
13802         have to verify that there is an implicit conversion from one to
13803         the other.
13804
13805         (ArrayAccess.DoResolve): Array Access can operate on
13806         non-variables. 
13807
13808 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13809
13810         * assign.cs (CompoundAssign): A new class used as a "flag" that
13811         the assignment actually is happening as part of a compound
13812         assignment operator.
13813
13814         During compound assignment, a few new rules exist to enable things
13815         like:
13816
13817         byte b |= 1 + 2
13818
13819         From the spec:
13820
13821         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13822         to the type of x) if y is implicitly convertible to the type of x,
13823         and the operator is a builtin operator and the return type of the
13824         operator is explicitly convertible to the type of x. 
13825
13826         * rootcontext.cs: Reset warning level to 2.  4 catches various
13827         "interesting" features in mcs, we must clean this up at some
13828         point, but currently am trying to kill other bugs ;-)
13829
13830         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13831         in container classes as well.  
13832
13833         * expression.cs (Binary.ResolveOperator): Handle string case
13834         before anything else (as operator overloading does emit an error
13835         before doing anything else).
13836
13837         This code could go away when we move to a table driven model, but
13838         i could not come up with a good plan last night.
13839
13840 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13841
13842         * typemanager.cs (CSharpName): reimplementation using regex.
13843         * class.cs: added null check for fields in Emit
13844         * rootcontext.cs: set warninglevel to 4
13845
13846 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13847
13848         * typemanager.cs (CSharpName): reimplemented with Lupus
13849         suggestion.
13850
13851 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13852
13853         * statement.cs (If): correclty implement Resolve, because we were
13854         not catching sem errors in there.  The same process is needed
13855         everywhere else. 
13856         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13857
13858
13859         (Statement.Warning_DeadCodeFound): Factorize code.
13860         (While): Report dead code here too.
13861
13862         (Statement): Added Resolve virtual method to allow
13863         for resolution split from the emit code.
13864
13865 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13866
13867         * statement.cs (EmitBoolExpression): No longer try to resolve the
13868         expression here.    
13869         (MakeBoolean): New utility function that resolve, implicitly
13870         converts to boolean and tags the expression. 
13871
13872
13873         (If, Do): Implement dead code elimination.
13874         (While): Implement loop inversion
13875
13876         (Do, While, For, If): Resolve the expression prior to calling our
13877         code generation.
13878
13879 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13880
13881         * class.cs:
13882           - added method Report28 (warning: program has more than one entry point)
13883           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13884           - modified method Method.Define, the part at the end of the method
13885
13886         * rootcontext.cs: added static public Location EntryPointLocation;
13887           
13888         * ../errors/cs0028.cs : Add test case for the above warning.              
13889
13890         * typemanager.cs:
13891           - modified method CSharpName to allow arrays of primitive type to
13892             be printed nicely (e.g. instead of System.Int32[][] it now prints
13893             int[][])
13894           - added method CSharpSignature: returns the signature of a method
13895             in string format to be used in reporting errors, warnings, etc.
13896
13897         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13898         with String.Empty.
13899
13900 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13901
13902         * delegate.cs (Define): Fix extremely silly bug where I was
13903         setting the type of the 'object' parameter of the BeginInvoke
13904         method to System.IAsyncResult instead of System.Object ;-)
13905
13906 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13907
13908         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13909         here. 
13910
13911         (Constructor.Emit): return if we fail to initialize the
13912         constructor.  Another door closed!  
13913
13914         * expression.cs (New.DoResolve): Improve error message (from -6 to
13915         1501).  Use DeclaredOnly lookup to find the exact constructor.
13916
13917         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13918         loop.  This is useful.
13919
13920         * cs-parser.jay: Adjust the default parameters so that destructors
13921         have the proper signature.
13922
13923 2002-04-26  Martin Baulig  <martin@gnome.org>
13924
13925         * driver.cs (LoadAssembly): If `assembly' contains any characters
13926         which are only valid in path names and not in assembly names
13927         (currently slash, backslash and point), use Assembly.LoadFrom ()
13928         instead of Assembly.Load () on the `assembly' (before iteration
13929         over the link_paths).
13930
13931 2002-04-26  Martin Baulig  <martin@gnome.org>
13932
13933         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13934
13935 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13936
13937         * class.cs (Property): use the new typemanager.MemberLookup
13938
13939         (TypeContainer.MemberLookup): Implement using the
13940         TypeManager.MemberLookup now. 
13941
13942         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13943         and return MemberInfos, so that these can be used without an
13944         EmitContext (what we had before).
13945
13946 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13947
13948         * expression.cs: Fix the case where the argument to params if the
13949         type of the params.  I omitted handling this before.   Fixed
13950
13951 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13952
13953         * driver.cs: Call BootCorlib_PopulateCoreType
13954
13955         * class.cs (Property.CheckBase): Check for properties only, not
13956         for all members. 
13957
13958         * interface.cs: Temporary hack: try/catch around the
13959         CustomAttributeBuilder, because I am getting an exception that I
13960         do not understand.
13961
13962         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13963         types whose definitions are required to be there (attributes are
13964         defined before standard types).
13965
13966         Compute definitions as we boot the various types, as they are used
13967         immediately (value_type class will need object_type, but if we do
13968         not initialize object_type, we will pass a null, which will let
13969         the runtime pick the System.Object from the existing corlib, which
13970         is not what we want).
13971
13972 2002-04-22  Patrik Torstensson <totte@labs2.com>
13973
13974         * cs-tokenizer.cs: fixed a number of trim() issues.
13975
13976 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13977
13978         * expression.cs (Argument.Type): Ensure that we return the correct
13979         type when we have out or ref parameters [in which case we 
13980         append a "&"].
13981
13982 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13983
13984         * class.cs (Property, Indexer): Allow extern modifier in there. 
13985
13986         * typemanager.cs (InitBaseTypes): Initializes object_type and
13987         value_type, since those will be used early on during the bootstrap
13988         process to compile corlib.
13989
13990         (InitCoreTypes): Move code from here to InitBaseTypes.
13991
13992 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13993
13994         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13995         single-dimension arrays as using the ldlen opcode.  
13996
13997         Daniel Lewis discovered this optimization.  
13998
13999         * typemanager.cs: Add signature for System.Array::get_Length
14000
14001 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14002
14003         * statement.cs: report the error when the foreach does not apply to an
14004         array nor a collection.
14005
14006 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14007
14008         * expression.cs: Add implicit conversions to the operator ~.
14009
14010         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14011
14012         * typemanager.cs: Locate the decimal constructor.
14013
14014 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14015
14016         * attribute.cs: use the new property of TypeOf.
14017         * expression.cs: added 'get' property around typearg.
14018
14019         These changes fix a build breaker reported by NickD. Is this the
14020         correct way to fix?  If not, please, revert my changes and make it
14021         work :-).
14022
14023 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14024
14025         * attribute.cs: Add support for typeof in attribute invocations.
14026         I am not sure that this is right though.
14027
14028 2002-04-14  Duncan Mak  <duncan@ximian.com>
14029
14030         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14031         Binary.Operator.Division case.
14032
14033 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14034
14035         * class.cs (DefineType): Ensure that we do a proper check on
14036         attribute types and also register it with the TypeManager.
14037
14038         (TypeContainer.Targets): The default for attribute types is
14039         AttributeTargets.All.
14040
14041         * attribute.cs (ApplyAttributes): Registering the attribute type
14042         is done elsewhere, not when we discover we have a Usage attribute.
14043
14044 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14045
14046         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14047         and get rid of is_delegate parameter.
14048
14049         * everywhere : update.
14050
14051 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14052
14053         * cs-parser.jay (compilation_unit): Revamp completely to use
14054         some new ideas that I got from Rhys' grammar to solve the problems
14055         with assembly level attributes.
14056
14057         (outer_declaration): New grammar production.
14058
14059         (attribute_sections): Add.
14060
14061         (opt_attributes): Base on attribute_sections
14062
14063         (namespace_declaration): Allow opt_attributes to tackle the case
14064         when we have assembly level attributes - we are clever in this
14065         regard now ;-)
14066
14067         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14068         attributes in the non-global context.
14069
14070         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14071         instead of SetGlobalAttributes.
14072
14073         * class.cs, rootcontext.cs : Ensure we define and generate 
14074         attribute types before anything else.
14075
14076         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14077         and flag the new error -20 for the case when the attribute type
14078         does not have valid targets specified. csc does not catch this.
14079
14080         * ../errors/errors.txt : update for error # -20
14081
14082 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14083
14084         * support.cs (InternalParameters.ParameterModifier): Do some null
14085         checking and return sane values.
14086
14087         * class.cs (Method.Define): If we are a PInvoke method, ensure
14088         that we are static and extern. Report error # 601
14089
14090         * ../errors/cs0601.cs : Add test case for the above error.
14091
14092 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14093
14094         * rootcontext.cs (attribute_types): We need to keep type of
14095         all attribute types separately and emit code for them first.
14096
14097         (RegisterAttribute) : Implement.
14098
14099         * class.cs (DefineType): Check if the current Type is a custom
14100         attribute type and register it accordingly.
14101
14102         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14103         adding the first attribute twice and rename to
14104
14105         (SetGlobalAttributes): this.
14106
14107         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14108         lookups.
14109
14110         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14111         if we are processing global arguments. Hmm, I am unsure of this.
14112
14113 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14114
14115         * expression.cs: added static array of strings to avoid calling
14116         Enum.ToString () for Operator in Binary. Significant recover of
14117         performance.
14118
14119 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14120
14121         * class.cs (FindMembers): Allow the Builders of the various
14122         members to be null.  If they are skip them.  This only happens
14123         during the PInvoke declaration.
14124
14125 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14126
14127         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14128         failure, so we do not keep going afterwards.
14129
14130         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14131         wanted to pass `false' as the `is_delegate' argument.  If this is
14132         the case, why not use delegate_type == null to mean `is_delegate =
14133         false' and anything else as is_delegate = true.
14134
14135 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14136
14137         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14138         code for the section, not the beginning of the tests.
14139
14140 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14141
14142         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14143
14144         * expression.cs (Binary): same.  Warn about errors where we have
14145         Enum/Enum in operator + as well.
14146
14147 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14148
14149         * statement.cs:
14150                 - added support for switch(bool)
14151                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14152                 - add TableSwitchEmit() to handle table-based switch statements
14153
14154 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14155
14156         * expression.cs (Invocation.OverloadResolve): Factor out code which
14157         does parameter compatibility checking with arguments so that we can 
14158         re-use the code even from Delegate.VerifyApplicability
14159
14160         (VerifyArgumentsCompat): Move above code here.
14161
14162         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14163         and instead make a call to the above method.
14164
14165 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14166
14167         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14168         We use it to keep track of classes which are attribute types.
14169
14170 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14171
14172         * delegate.cs (Delegate.Define): Correctly define the types in the
14173         presence of fixed and array parameters.
14174
14175         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14176         doing FindMembers.
14177
14178         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14179         include NonPublic after the first iteration.
14180
14181         * class.cs (Indexer.CheckBase): Only check if both parents are
14182         non-null. 
14183
14184         * cs-parser.jay (accessor_body): If empty, set to null.
14185
14186         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14187         same code path here to resolve constants names that we did have in
14188         MemberAccess.DoResolve.  There is too much code duplicated here.
14189
14190 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14191
14192         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14193
14194         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14195         to MakeUnionSet.
14196
14197         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14198         tokens, numbers and strings.
14199
14200         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14201         parenthesis.
14202
14203         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14204         asyncronous parameters and the regular parameters.  
14205
14206         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14207         specify the target directory.
14208
14209         * expression.cs: (This.DoResolve): Simplify
14210         (As.Emit): Optimize, do not generate IsInst if the expression is
14211         always of the given type.
14212
14213         (Is.DoResolve): Bug fix, we were reporting both always/never for
14214         the is expression.
14215
14216         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14217         creating too many unnecessary arrays.
14218
14219 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14220
14221         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14222         fields instead of rolling our own initializer.   Takes care of all
14223         implicit conversions, and drops unnecessary static checks/argument.
14224
14225 2002-03-31  Dick Porter  <dick@ximian.com>
14226
14227         * driver.cs: use the GetDirectories() return values properly, and
14228         use "/" as path separator.
14229
14230 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14231
14232         * expression.cs (Unary): Optimize - - expr into expr.
14233         (Binary): Optimize a + (-b) into a -b.
14234
14235         * codegen.cs (CodeGen): Made all methods static.
14236
14237 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14238
14239         * rootcontext.cs: 
14240
14241         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14242         TypeBuilder property.
14243
14244         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14245         instead. 
14246
14247         * tree.cs: Removed the various RecordXXXX, and replaced with a
14248         single RecordDecl.  Removed all the accessor methods, and just
14249         left a single access point Type 
14250
14251         * enum.cs: Rename DefineEnum to DefineType.
14252
14253         * decl.cs: New abstract method `DefineType' used to unify the
14254         Defines for Enumerations, Interfaces, TypeContainers and
14255         Delegates.
14256
14257         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14258         LookupBaseClasses method that used to live in class.cs and
14259         interface.cs here, and renamed to FindType.
14260
14261         * delegate.cs: Implement DefineType.  Take advantage of the
14262         refactored pattern for locating the parent builder without taking
14263         the parent_builder argument (which we know does not work if we are
14264         nested, and triggering a toplevel definition).
14265
14266 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14267
14268         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14269         accessibility of a member has changed during override and report
14270         an error if so.
14271
14272         * class.cs (Method.Define, Property.Define): Only complain on
14273         overrides if the method is private, any other accessibility is
14274         fine (and since we just checked the permission is the same, we are
14275         good to go).
14276
14277         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14278         and elif are processed always.  The other pre-processing
14279         directives are only processed if we are "taking" the path
14280
14281 2002-03-29  Martin Baulig  <martin@gnome.org>
14282
14283         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14284         current location is not Null.
14285
14286         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14287         a separate method so we can profile it.
14288
14289         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14290         `span.Seconds' are just seconds, but no minutes or hours.
14291         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14292
14293 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14294
14295         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14296         Remove the gratuitous set of Final:
14297
14298                                 // If an interface implementation, then we can set Final.
14299                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14300                                     implementing.DeclaringType.IsInterface)
14301                                         flags |= MethodAttributes.Final;
14302
14303         I do not know what I was smoking when I used that.
14304
14305
14306         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14307         step into fixing the name resolution issues for delegates and
14308         unifying the toplevel name resolution.
14309
14310 2002-03-28  Martin Baulig  <martin@gnome.org>
14311
14312         * class.cs (Method.Emit): If we have a symbol writer, call its
14313         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14314         tell it about the current method.
14315
14316         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14317         writer that we're going to emit the first byte of IL code for a new
14318         statement (a new source line).
14319         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14320         EmitContext.Mark() before emitting any code.
14321
14322         * location.cs (SymbolDocument): Return null when we're Null.
14323
14324         * statement.cs (Statement): Moved the `Location loc' variable here.
14325         (Statement.EmitBoolExpression): If we have a symbol writer, call
14326         ec.Mark() before emitting any code to tell it that we're at the
14327         beginning of a new statement.
14328         (StatementExpression): Added `Location' argument to the constructor.
14329         (Block): Added public readonly variable `StartLocation' and public
14330         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14331         (Block): Added constructor which takes a start and end location.
14332         (Block.SetEndLocation): New method. This sets the end location.
14333         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14334         local variables we create.
14335         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14336         each statement and do also mark the begin and end of the block.
14337
14338         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14339         tell it the current lexer.Location, use Location.Null for the end of the
14340         block.
14341         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14342         current block, set its end location using SetEndLocation().
14343         (statement_expression): StatementExpression constructor now takes the
14344         lexer.Location as additional argument.
14345         (for_statement, declare_local_variables): Likewise.
14346         (declare_local_variables): When creating a new implicit block, use the
14347         new Block constructor and pass it the lexer.Location.
14348
14349 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14350
14351         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14352         members also on the parent interfaces recursively.
14353
14354 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14355
14356         * report.cs: Use new formats, since Gonzalo finished the missing
14357         bits. 
14358
14359         * expression.cs (Binary.ResolveOperator): added missing operator|
14360         operator& and operator^ for bool/bool.
14361
14362         * cs-parser.jay: CheckDef now takes a Location argument that is
14363         used to report errors more precisly (instead of reporting the end
14364         of a definition, we try to track something which is a lot closer
14365         to the source of the problem).
14366
14367         * cs-tokenizer.cs: Track global token use, so we can properly flag
14368         the use of #define/#undef after the first token has been seen.
14369
14370         Also, rename the reportXXXX to Error_DescriptiveName
14371
14372         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14373         TypeContainer, so that Enum and Interface can use this too.
14374
14375         * class.cs (TypeContainer.LookupInterfaceOrClass,
14376         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14377         `builder' argument.  Typically this was used to pass the parent
14378         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14379         the definition).  
14380
14381         The problem is that a nested class could trigger the definition of
14382         a toplevel class, and the builder would be obviously wrong in that
14383         case. 
14384
14385         So we drop this argument, and we compute dynamically the
14386         TypeBuilder/ModuleBuilder (the correct information was available
14387         to us anyways from DeclSpace.Parent)
14388
14389         * interface.cs (Interface.DefineInterface): Drop builder
14390         parameter cleanup like class.cs
14391
14392         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14393         like class.cs
14394
14395         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14396         values. 
14397
14398         (Try.Emit): Propagate the returns value from the statement.
14399
14400         (Return.Emit): Even if we are leavning 
14401
14402         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14403
14404         * modifiers.cs: Fix the computation of MethodAttributes flags.
14405
14406 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14407
14408         * driver.cs: allow compilation of files that start with '/'.
14409         Add a default case when checking the argument of --target.
14410
14411 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14412
14413         * interface.cs: Implement the same search algorithm for types in
14414         the interface code.
14415
14416         * delegate.cs: Do not allow multiple definition.
14417
14418         * Recovered ChangeLog that got accidentally amputated
14419
14420         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14421
14422         * rootcontext.cs: Load manually enum to allow core classes to
14423         contain enumerations.
14424
14425         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14426         Update to new static methods in TypeManager.
14427
14428         * typemanager.cs (GetMethod, GetConstructor): Use our
14429         implementation of FindMembers to find the members, since during
14430         corlib compilation, the types are TypeBuilders and GetMethod and
14431         GetConstructor do not work.
14432
14433         Make all methods in TypeManager static.
14434
14435         (InitCodeHelpers): Split the functionality from
14436         the InitCodeTypes function.
14437
14438         * driver.cs: Call InitCodeHelpers after we have populated the
14439         types. 
14440
14441         * cs-parser.jay (delegate_declaration): we did not used to compute
14442         the delegate name correctly for void delegates.
14443
14444 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14445
14446         * rootcontext.cs (RootContext): Init the interface_resolve_order
14447         and type_container_resolve_order always.
14448
14449         (ResolveCore, BootstrapCorlib_ResolveClass,
14450         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14451         compiler when compiling with --nostdlib
14452
14453         * class.cs (TypeContainer.DefineType): Check that our parent is
14454         not null.  This test is most important when we are bootstraping
14455         the core types.
14456
14457         * codegen.cs: Split out the symbol writing code.
14458
14459 2002-03-25  Martin Baulig  <martin@gnome.org>
14460
14461         * driver.cs (-g): Made -g an alias for --debug.
14462
14463 2002-03-24  Martin Baulig  <martin@gnome.org>
14464
14465         * codegen.cs (SymbolWriter): New public variable. Returns the
14466         current symbol writer.
14467         (CodeGen): Added `bool want_debugging_support' argument to the
14468          constructor. If true, tell the ModuleBuild that we want debugging
14469         support and ask it for the ISymbolWriter.
14470         (Save): If we have a symbol writer, call it's Close() method after
14471         saving the assembly.
14472
14473         * driver.c (--debug): New command line argument to create a
14474         debugger information file.
14475
14476         * location.cs (SymbolDocument): New public property. Returns an
14477         ISymbolDocumentWriter object for the current source file or null
14478         if we don't have a symbol writer.
14479
14480 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14481
14482         * driver.cs (LoadAssembly): Correctly return when all the paths
14483         have been tried and not before.
14484
14485         * statement.cs (Switch.Emit): return the actual coverage for this
14486         statement (returns/not-returns)
14487
14488         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14489         switch of the statement if we are the last switch section.  That
14490         kills two problems: try/catch problems (we used to emit an empty
14491         nop at the end) and switch statements where all branches would
14492         return. 
14493
14494 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14495
14496         * driver.cs: Add default assemblies (the equivalent to the
14497         Microsoft CSC.RSP file)
14498
14499         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14500         also update tokens_seen and set it to false.
14501
14502         * driver.cs: Implement --recurse for Mike.
14503
14504         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14505         correctly splitting out the paths.
14506
14507 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14508
14509         * interface.cs (Interface.PopulateProperty): Instead of using
14510         `parent' as the declaration space for the set parameters, use
14511         `this' 
14512
14513         * support.cs (InternalParameters): InternalParameters constructor
14514         takes a DeclSpace instead of a TypeContainer.
14515
14516         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14517         types are being initialized, load the address of it before calling
14518         the function.  
14519
14520         (New): Provide a mechanism to disable the generation of local
14521         value type temporaries when the caller will be providing us with
14522         an address to store it.
14523
14524         (ArrayCreation.EmitDynamicInitializers): Use it.
14525
14526 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14527
14528         * expression.cs (Invocation.EmitArguments): Only probe for array
14529         property if there is more than one argument.  Sorry about that.
14530
14531         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14532         empty param arrays.
14533
14534         * class.cs (Method.LabelParameters): Fix incorrect code path that
14535         prevented the `ParamArrayAttribute' from being applied to the
14536         params attribute.
14537
14538 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14539
14540         * support.cs (ReflectionParameters): Correctly compute whether the
14541         last argument is a params array.  Fixes the problem with
14542         string.Split ('a')
14543
14544         * typemanager.cs: Make the assemblies array always be non-null
14545         (empty, but non-null)
14546
14547         * tree.cs (RecordDecl): New function that abstracts the recording
14548         of names.  This reports error 101, and provides a pointer to the
14549         previous declaration.  Fixes a crash in the compiler.
14550
14551         * cs-parser.jay (constructor_declaration): Update to new grammar,
14552         and provide a constructor_body that can be empty.
14553
14554 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14555
14556         * driver.cs: Add support for --resources.
14557
14558         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14559         Make all types for the various array helper methods be integer.
14560
14561         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14562         CheckState to ConvCast.
14563
14564         (ConvCast): Now it takes a `checked' state argument, to avoid
14565         depending on the emit context for the conversion, and just using
14566         the resolve time setting.
14567
14568         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14569         instead of Invocation.EmitArguments.  We do not emit the original
14570         arguments, instead we emit those which have been converted to
14571         unsigned int expressions.
14572
14573         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14574
14575         * codegen.cs: ditto.
14576
14577         * expression.cs (LocalVariableReference): Drop the use of the
14578         Store function that depended on the variable index.
14579
14580         * statement.cs (VariableInfo): Drop the `Idx' property from this
14581         class, as this is not taking into account the indexes for
14582         temporaries tat we generate during the execution, getting the
14583         indexes wrong.
14584
14585         * class.cs: First emit class initializers, then call the parent
14586         constructor. 
14587
14588         * expression.cs (Binary): Fix opcode emision.
14589         (UnaryMutator.EmitCode): Support checked code generation
14590
14591         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14592         matches for events for both the Static and Instance scans,
14593         pointing to the same element.   Fix that.
14594
14595 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14596
14597         * rootcontext.cs (ResolveTree): Always set the
14598         interface_resolve_order, because nested interfaces will be calling
14599         into us.
14600
14601         * class.cs (GetInterfaceOrClass): Track the same resolution
14602         process used by TypeManager.LookupType.  This fixes the nested
14603         type lookups in class declarations (separate path from
14604         LookupType). 
14605
14606         (TypeContainer.DefineType): Also define nested interfaces.
14607         (TypeContainer.RegisterOrder): New public function used to
14608         register the order in which child interfaces need to be closed.
14609
14610         Nested interfaces need to be closed after their parents have been
14611         created. 
14612
14613         * interface.cs (InterfaceAttr): Put all the logic for computing
14614         the interface attribute here. 
14615
14616         (DefineInterface): Register our interface order with the
14617         RootContext or with the TypeContainer depending on the case.
14618
14619 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14620
14621         * cs-parser.jay: rework foreach statement to work with the new
14622         changes to the policy on SimpleNames.
14623
14624         * report.cs: support Stacktrace on warnings as well.
14625
14626         * makefile: drop --unsafe and /unsafe from the compile.
14627
14628 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14629
14630         * ecore.cs (StandardConversionExists): Modify to take an Expression
14631         as the first parameter. Ensure we do null -> reference type conversion
14632         checking.
14633
14634         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14635         temporary Expression objects.
14636
14637 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14638
14639         * interface.cs: workaround bug in method overloading resolution
14640         (there is already a bugzilla bug for it).
14641
14642 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14643
14644         We could also solve this problem by having a separate path for
14645         performing type lookups, instead of DoResolve, we could have a
14646         ResolveType entry point, and only participating pieces of the
14647         production (simplename, deref, array) would implement this. 
14648
14649         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14650         signal SimpleName to only resolve type names and not attempt to
14651         resolve anything else.
14652
14653         * expression.cs (Cast): Set the flag.
14654
14655         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14656
14657         * class.cs: Only report 108 if there is no `new' modifier.
14658
14659         * cs-parser.jay: rework foreach statement to work with the new
14660         changes to the policy on SimpleNames.
14661         
14662         * report.cs: support Stacktrace on warnings as well.
14663
14664         * makefile: drop --unsafe and /unsafe from the compile.
14665
14666 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14667
14668         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14669         lookups here, instead of doing that at parse time.  This means
14670         that our grammar will not introduce `LocalVariableReferences' as
14671         expressions at this point.  That solves the problem of code like
14672         this:
14673
14674         class X {
14675            static void Main ()
14676            { int X = 1;
14677             { X x = null }}}
14678
14679         This is only half the fix.  The full fix requires parameters to
14680         also be handled in this way.
14681
14682         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14683         makes the use more obvious of the DeclSpace.  The
14684         ec.TypeContainer.TypeBuilder is now only used to pull the
14685         TypeBuilder for it.
14686
14687         My theory is that I can get rid of the TypeBuilder completely from
14688         the EmitContext, and have typecasts where it is used (from
14689         DeclSpace to where it matters).  
14690
14691         The only pending problem is that the code that implements Aliases
14692         is on TypeContainer, and probably should go in DeclSpace.
14693
14694         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14695         lookups here, instead of doing that at parse time.  This means
14696         that our grammar will not introduce `LocalVariableReferences' as
14697         expressions at this point.  That solves the problem of code like
14698         this:
14699
14700         class X {
14701            static void Main ()
14702            { int X = 1;
14703             { X x = null }}}
14704
14705         This is only half the fix.  The full fix requires parameters to
14706         also be handled in this way.
14707
14708         * class.cs (Property.DefineMethod): When implementing an interface
14709         method, set newslot, when implementing an abstract method, do not
14710         set the flag (before we tried never setting it, or always setting
14711         it, which is the difference).
14712         (Indexer.DefineMethod): same.
14713         (Method.DefineMethod): same.
14714
14715         * ecore.cs: Only set the status used flag if we get back a Field.
14716
14717         * attribute.cs: Temporary hack, so Paolo can keep working.
14718
14719 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14720
14721         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14722         the unmanaged type in the case we have a MarshalAs attribute.
14723
14724         (Resolve): Handle the case when we are parsing the special MarshalAs
14725         attribute [we need to store the unmanaged type to use later]
14726
14727         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14728         MarshalAs Attribute.
14729
14730         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14731         on parameters and accordingly set the marshalling info.
14732
14733 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14734
14735         * class.cs: Optimizing slightly by removing redundant code after
14736         we switched to the `NoTypes' return value.
14737         (Property.DefineMethod): use NoTypes here too.
14738
14739         This fixes the bug I introduced in my last batch of changes.
14740
14741 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14742
14743         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14744
14745         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14746         Enums since those are types too. 
14747
14748         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14749
14750         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14751         thanks to a call during the lookup process.
14752
14753 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14754
14755         * statement.cs (Foreach): Lots of work to accomodate a particular
14756         kind of foreach statement that I had not kept in mind.  It is
14757         possible to have foreachs on classes that provide a GetEnumerator
14758         method that return objects that implement the "pattern" for using
14759         a foreach, there is no need to support GetEnumerator
14760         specifically. 
14761
14762         This is needed to compile nant.
14763
14764         * decl.cs: Only report 114 if the member is not `Finalize' and if
14765         the warning level is at least 2.
14766
14767         * class.cs: Moved the compare function from Method to
14768         MethodSignature. 
14769
14770         (MethodSignature.InheritableMemberSignatureCompare): Add new
14771         filter function that is used to extract inheritable methods from a
14772         class. 
14773
14774         (Method.Define): Use the new `inheritable_method_signature_filter'
14775         delegate
14776
14777         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14778         command. 
14779
14780 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14781
14782         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14783
14784         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14785
14786         * expression.cs: Pass location information to
14787         ConvertImplicitStandard. 
14788
14789         * class.cs: Added debugging code to track return values from
14790         interfaces. 
14791
14792 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14793
14794         * expression.cs (Is.DoResolve): If either side of the `is' is an
14795         interface, do not flag the warning.
14796
14797         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14798         for interfaces
14799
14800         * report.cs: Allow for --fatal to be used with --probe.
14801
14802         * typemanager.cs (NoTypes): Move the definition for the empty Type
14803         array here. 
14804
14805         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14806         properties. 
14807         (TypeContainer.DefineProxy): New function used to proxy to parent
14808         implementations when implementing interfaces.
14809         (TypeContainer.ParentImplements): used to lookup if our parent
14810         implements a public function that is required by an interface.
14811         (TypeContainer.VerifyPendingMethods): Hook this up.
14812
14813         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14814         `modules' and `assemblies' arraylists into arrays.  We only grow
14815         these are the very early start up of the program, so this improves
14816         the speedof LookupType (nicely measured).
14817
14818         * expression.cs (MakeByteBlob): Replaced unsafe code with
14819         BitConverter, as suggested by Paolo.
14820
14821         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14822         folding of string concatenation, but if either side is a string,
14823         and the other is not, then return null, and let the runtime use
14824         the concatenation on the string plus the object (using
14825         `Object.ToString'). 
14826
14827 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14828
14829         Constant Folding has been implemented now.
14830
14831         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14832         the error instead on types that are not supported in one's
14833         complement. 
14834
14835         * constant.cs (Constant and all children): New set of functions to
14836         perform implict and explicit conversions.
14837
14838         * ecore.cs (EnumConstant): Implement the new functions to perform
14839         conversion by proxying to the child expression.
14840
14841         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14842         own separate setting that can not be turned off from the command
14843         line using --unchecked or --checked and is only controlled using
14844         the checked/unchecked statements and expressions.  This setting is
14845         used by the constant folder to flag errors.
14846
14847         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14848         ConstantCheckState as well.   
14849
14850         During Resolve, they also have to flag the state, because the
14851         constant folder runs completely in the Resolve phase.
14852
14853         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14854         well.
14855
14856 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14857
14858         * cfold.cs: New file, this file contains the constant folder.
14859
14860         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14861         argument to track whether we are using the resulting address to
14862         load or store a value and provide better error messages. 
14863
14864         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14865         new AddressOf arguments.
14866
14867         * statement.cs (Foreach.EmitCollectionForeach): Update
14868
14869         * expression.cs (Argument.Emit): Call AddressOf with proper
14870         arguments to track usage.
14871
14872         (New.DoEmit): Call AddressOf with new arguments.
14873
14874         (Unary.Emit): Adjust AddressOf call.
14875
14876 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14877
14878         * cs-parser.jay (member_access): Change the case for pre-defined types
14879         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14880         this suggestion.
14881
14882         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14883         a method body.
14884
14885         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14886         essentially like methods and apply attributes like MethodImplOptions to them too.
14887
14888         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14889         not being null.
14890
14891         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14892         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14893         is the DeclSpace.
14894
14895         * Update code everywhere accordingly.
14896
14897         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14898
14899         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14900
14901 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14902
14903         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14904         try performing lookups against those instead of jumping straight into using
14905         the 'using' clauses.
14906
14907         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14908
14909         (LookupType): Perform lookups in implicit parents too.
14910
14911         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14912         sequence as RootContext.LookupType. 
14913
14914         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14915         the various cases of namespace lookups into this method.
14916
14917 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14918
14919         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14920         in positional arguments)
14921
14922         * class.cs (Operator): Update the AllowedModifiers to contain
14923         extern. 
14924
14925         * cs-parser.jay: Update operator declaration to allow for the
14926         operator body to be empty.
14927
14928         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14929         values. 
14930
14931 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14932
14933         * class.cs (Method.Emit): Label parameters.
14934
14935         * driver.cs: Return 1 or 0 as the program exit code.
14936
14937 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14938
14939         * expression.cs: Special case the `null' object when trying to
14940         auto-compute the type, as anything can be explicitly converted to
14941         that. 
14942
14943         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14944         spotting this Paolo.
14945
14946         (Expression.ImplicitNumericConversion): Perform comparissions of
14947         the type using the underlying type in the case of an enumeration
14948         rather than using the enumeration type for the compare.
14949
14950         Cope with the underlying == type case, which is not possible to
14951         catch before. 
14952
14953         (Expression.ConvertNumericExplicit): Perform comparissions of
14954         the type using the underlying type in the case of an enumeration
14955         rather than using the enumeration type for the compare.
14956
14957         * driver.cs: If the user does not supply an extension, assume .exe
14958
14959         * cs-parser.jay (if_statement): Rewrote so that we can track the
14960         location for the if statement.
14961
14962         * expression.cs (Binary.ConstantFold): Only concat strings when
14963         the operation is "+", not everything ;-)
14964
14965         * statement.cs (Statement.EmitBoolExpression): Take a location
14966         argument. 
14967         (If, While, Do): Track location.
14968
14969         * expression.cs (Binary.ResolveOperator): In the object + string
14970         case, I was missing a call to ConvertImplicit
14971
14972 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14973
14974         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14975         Location arguments. Ensure we use RootContext.LookupType to do our work
14976         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14977
14978         * interface.cs (PopulateMethod): Handle the type of the parameter being
14979         null gracefully.
14980
14981         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14982         have a params method with no fixed arguments and a call is made with no
14983         arguments.
14984
14985 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14986
14987         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14988         the verbatim-string-literal
14989
14990         * support.cs (InternalParameters.ParameterModifier): handle null
14991         fixed parameters.
14992         (InternalParameters.ParameterType): ditto.
14993
14994         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14995         duplicating the name of the variable parameter.
14996         (GetParameterByName): Fix bug where we were not looking up array
14997         paramters if they were the only present (thanks Paolo!).
14998         (GetParameterInfo): We only have an empty set of types if both
14999         fixed and array are set to null.
15000         (GetParameterInfo-idx): Handle FixedParameter == null
15001
15002         * cs-parser.jay: Handle the case where there is no catch
15003         statements (missing null test).
15004
15005 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * driver.cs (MainDriver): Be conservative on our command line
15008         handling.
15009
15010         Catch DirectoryNotFoundException when calling GetFiles.
15011
15012         (SplitPathAndPattern): Used to split the input specification into
15013         a path and a pattern that we can feed to Directory.GetFiles.
15014
15015 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15016
15017         * statement.cs (Fixed): Implement the last case of the Fixed
15018         statement (string handling).
15019
15020         * expression.cs (StringPtr): New class used to return a char * to
15021         a string;  Used by the Fixed statement.
15022
15023         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15024
15025         * expression.cs (Binary.ResolveOperator): Remove redundant
15026         MemberLookup pn parent type.
15027         Optimize union call, we do not need a union if the types are the same.
15028         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15029         type.
15030
15031         Specialize the use of MemberLookup everywhere, instead of using
15032         the default settings. 
15033
15034         (StackAlloc): Implement stackalloc keyword.
15035
15036         * cs-parser.jay: Add rule to parse stackalloc.
15037
15038         * driver.cs: Handle /h, /help, /?
15039
15040         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15041         before we supported unsafe code.
15042
15043         * makefile: add --unsafe to the self compilation of mcs.
15044
15045 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15046
15047         * expression.cs (PointerArithmetic): New class that is used to
15048         perform pointer arithmetic.
15049         (Binary.Resolve): Handle pointer arithmetic
15050         Handle pointer comparission.
15051         (ArrayPtr): Utility expression class that is used to take the
15052         address of an array.
15053
15054         (ElementAccess): Implement array access for pointers
15055
15056         * statement.cs (Fixed): Implement fixed statement for arrays, we
15057         are missing one more case before we are done.
15058
15059         * expression.cs (Indirection): Implement EmitAssign and set the
15060         ExprClass to Variable.  This allows pointer dereferences to be
15061         treated as variables, and to have values assigned to them.
15062
15063         * ecore.cs (Expression.StoreFromPtr): New utility function to
15064         store values dereferencing.
15065
15066 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15067
15068         * expression.cs (Binary.ResolveOperator): Ensure that we are
15069         not trying to operate on a void type - this fixes the reported
15070         bug.
15071
15072         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15073         the parent implementation is sealed.
15074
15075         * ../errors/cs0239.cs : Add.
15076
15077         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15078
15079         * typemanager.cs (unverifiable_code_type): Corresponds to 
15080         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15081         which have unsafe code in them.
15082
15083         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15084         unsafe context.
15085
15086 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15087
15088         * cs-tokenizer.cs: Add support for @"litreal strings"
15089
15090         Make tokenizer accept pre-processor directives
15091         on any column (remove the old C-like limitation). 
15092
15093         * rootcontext.cs (EmitCode): Emit any global attributes.
15094         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15095
15096         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15097
15098         * cs-parser.jay: Add support for global attributes.  
15099
15100 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15101
15102         * expression.cs (Indirection): New helper class.  Unary will
15103         create Indirection classes to be able to implement the
15104         IMemoryLocation interface on it.
15105
15106 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15107
15108         * cs-parser.jay (fixed_statement): reference the right statement.
15109
15110         * statement.cs (Fixed.Emit): Finish implementing the fixed
15111         statement for the &x case.
15112
15113 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15114
15115         * class.cs (Property.Define, Method.Define): Remove newslot when
15116         `implementing'.  
15117
15118         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15119         wrong.  NewSlot should only be used if the `new' keyword is present.
15120
15121         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15122         locating our system dir.  Sorry about this.
15123
15124 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15125
15126         * driver.cs (GetSystemDir): Compute correctly the location of our
15127         system assemblies.  I was using the compiler directory instead of
15128         the library directory.
15129
15130 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15131
15132         * expression.cs (BetterFunction): Put back in what Miguel commented out
15133         since it is the correct fix. The problem is elsewhere ;-)
15134
15135         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15136         parameters of the parms method are themselves compatible or not !
15137
15138         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15139         to check that a class implements an interface before saying that an implicit
15140         conversion was allowed. Use ImplementsInterface to do the checking.
15141
15142 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15143
15144         * class.cs (Method.Define): Track whether we are an explicit
15145         implementation or not.  And only call DefineMethodOverride if we
15146         are an explicit implementation.
15147
15148         (Property.DefineMethod): Ditto.
15149
15150 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15151
15152         * expression.cs (BetterFunction): Catch hideous bug which was
15153          preventing us from detecting ambiguous calls due to implicit casts i.e
15154         cs0121.
15155
15156 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15157
15158         * support.cs (Pair): Remove un-needed method.  I figured why I was
15159         getting the error in cs-parser.jay, the variable in a foreach loop
15160         is readonly, and the compiler does not really treat this as a variable.
15161
15162         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15163         instead of EQUALS in grammar.  
15164
15165         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15166
15167         * expression.cs (Unary.DoResolve): Check whether the argument is
15168         managed or not.
15169
15170 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15171
15172         * support.cs: Api for Pair to set a value.  Despite the fact that
15173         the variables are public the MS C# compiler refuses to compile
15174         code that accesses the field if the variable is part of a foreach
15175         statement. 
15176
15177         * statement.cs (Fixed): Begin implementation of the fixed
15178         statement.
15179
15180         (Block.AddVariable): Return the VariableInfo on success and null
15181         on failure instead of true/false. 
15182
15183         * cs-parser.jay (foreach): Catch errors on variables already
15184         defined (we were ignoring this value before) and properly unwind
15185         the block hierarchy
15186
15187         (fixed_statement): grammar for the fixed statement.
15188
15189 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15190
15191         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15192         pointer types to be incretemented.
15193
15194         (SizeOf): Implement.
15195
15196         * cs-parser.jay (pointer_member_access): Implement
15197         expr->IDENTIFIER production.
15198
15199         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15200         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15201         on safe contexts.
15202
15203         (Unary): Implement indirection.
15204
15205         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15206         use in non-unsafe context).
15207
15208         (SimpleName.DoResolve): Check for pointers in field access on safe
15209         contexts. 
15210
15211         (Expression.LoadFromPtr): Factor the load-indirect code in this
15212         function.  This was duplicated in UnboxCast and ParameterReference
15213
15214 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15215
15216         * expression.cs (ComposedCast): report an error if a pointer cast
15217         is used in a safe region.
15218
15219         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15220         pointer type casts in unsafe context.
15221
15222         * codegen.cs (EmitContext): Set up IsUnsafe.
15223
15224         * cs-parser.jay (non_expression_type): Add productions for pointer
15225         casts. 
15226
15227         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15228         code.  We should not use force into static mode if the method is
15229         not virtual.  Fixes bug in MIS
15230
15231         * statement.cs (Do.Emit, While.Emit, For.Emit,
15232         Statement.EmitBoolExpression): Add support to Do and While to
15233         propagate infinite loop as `I do return' semantics.
15234
15235         Improve the For case to also test for boolean constants.
15236
15237         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15238         to the list of attributes we can add.
15239
15240         Remove `EmitContext' argument.
15241
15242         * class.cs (Method.Define): Apply parameter attributes.
15243         (Constructor.Define): Apply parameter attributes.
15244         (MethodCore.LabelParameters): Move here the core of labeling
15245         parameters. 
15246
15247         * support.cs (ReflectionParameters.ParameterModifier,
15248         InternalParameters.ParameterModifier): Use IsByRef on the type and
15249         only return the OUT bit for these parameters instead of in/out/ref
15250         flags.
15251
15252         This is because I miss-understood things.  The ParameterInfo.IsIn
15253         and IsOut represent whether the parameter has the [In] and [Out]
15254         attributes set.  
15255
15256 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15257
15258         * ecore.cs (FieldExpr.Emit): Release temporaries.
15259
15260         * assign.cs (LocalTemporary.Release): new function.
15261
15262         * codegen.cs (EmitContext.GetTemporaryStorage,
15263         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15264         temporary storage.  Now we can "put back" localbuilders when we
15265         are done with them
15266
15267 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15268
15269         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15270         need to make a copy of the variable to generate verifiable code.
15271
15272 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15273
15274         * driver.cs: Compute dynamically the system directory.
15275
15276         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15277         Slower, but more generally useful.  Used by the abstract
15278         registering implementation. 
15279
15280         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15281         the rules for the special rule on Type/instances.  First check if
15282         we have the same name, and if so, try that special static path
15283         rather than the instance path.
15284
15285 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15286
15287         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15288         for, while and if.
15289
15290         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15291         Enum, ValueType, Delegate or Array for non-corlib compiles.
15292
15293         * cs-tokenizer.cs: Catch long identifiers (645)
15294
15295         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15296         piece of code.
15297
15298         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15299         fix, we were returning too early, so we were not registering
15300         pending methods from abstract classes.
15301
15302         Do not register pending methods if the class is abstract.
15303
15304         * expression.cs (Conditional.DoResolve): Report circular implicit
15305         conversions when we neecd to compute it for conditional
15306         expressions. 
15307
15308         (Is.DoResolve): If the expression is always of the provided type,
15309         flag warning 183.  If the expression can not ever be of the
15310         provided type flag warning 184.
15311
15312         * class.cs: Catch 169 as well.
15313
15314         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15315         read. 
15316
15317 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15318
15319         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15320
15321 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15322
15323         * interface.cs: (PopulateMethod): Check for pointers being defined
15324         only if the unsafe context is active.
15325         (PopulateProperty): ditto.
15326         (PopulateIndexer): ditto.
15327
15328         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15329         specified.  If pointers are present, make sure that they are
15330         present in an unsafe context.
15331         (Constructor, Constructor.Define): ditto.
15332         (Field, Field.Define): ditto.
15333         (Property, Property.Define): ditto.
15334         (Event, Event.Define): ditto.
15335
15336         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15337         hashtable if there are classes or structs defined.
15338
15339         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15340         code, as the constant resolution moved.
15341
15342         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15343         the metadata, so we can flag error 133. 
15344
15345         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15346         pointer is being declared in an unsafe context.
15347
15348 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15349
15350         * modifiers.cs (Modifiers.Check): Require a Location argument.
15351         Report error 227 for Unsafe use.
15352
15353         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15354
15355         * statement.cs (For.Emit): If the test is null, then report that
15356         we do `return', as we wont reach anything afterwards.
15357
15358         (Switch.SwitchGoverningType): Track the expression that matched
15359         the conversion.
15360
15361         * driver.cs: Allow negative numbers as an error code to flag.
15362
15363         * cs-parser.jay: Handle 1551.
15364
15365         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15366
15367 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15368
15369         * cs-parser.jay: Report 1518 (type declaration can only contain
15370         class, struct, interface, enum or delegate)
15371
15372         (switch_label): Report 1523 (keywords `case' or `default' must
15373         preced code)
15374
15375         (opt_switch_sections): Report 1522 (empty switch)
15376
15377         * driver.cs: Report 1515 (response file specified multiple times)
15378         Report 1516 (Source file specified multiple times).
15379
15380         * expression.cs (Argument.Resolve): Signal 1510
15381
15382         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15383         access not allowed in static code)
15384
15385 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15386
15387         * typemanager.cs (IsPointerType): Utility method which we are going
15388         to need a lot.
15389
15390         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15391         the object type, so we take care of that.
15392
15393         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15394
15395         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15396         added to non-params parameters :-)
15397
15398         * typemanager.cs (CSharpName): Include 'void' type too. 
15399
15400         (void_ptr_type): Include in the set of core types.
15401
15402         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15403         duplicating code.
15404
15405         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15406         an unsafe context.
15407
15408         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15409         completely forgotten about it.
15410
15411 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15412
15413         * cs-parser.jay (pointer_type): Add. This begins our implementation
15414         of parsing rules for unsafe code.
15415
15416         (unsafe_statement): Implement.
15417
15418         (embedded_statement): Modify to include the above.
15419
15420         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15421
15422         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15423         if the current context is an unsafe one.
15424
15425         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15426         are handled differently, we need separate rules for them.
15427
15428         (local_variable_declaration): Update to use local_variable_pointer_type
15429         to allow variable declarations of unmanaged pointer types.
15430
15431         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15432         in unsafe contexts.
15433
15434         * ../errors/cs0214.cs : Add.
15435
15436 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15437
15438         * makefile: remove 'response' file when cleaning.
15439
15440 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15441
15442         * cs-parser.jay: Report 1524.
15443
15444 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15445
15446         * typemanager.cs (RegisterMethod): drop checking if we have
15447         registered this from here
15448
15449 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15450
15451         * class.cs (Method.EmitDestructor): Implement calling our base
15452         destructor. 
15453
15454         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15455         value of InFinally.
15456
15457         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15458         this routine and will wrap the call in a try/catch block.  Deal
15459         with the case.
15460
15461 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15462
15463         * ecore.cs (Expression.MemberLookup): instead of taking a
15464         parameter `same_type' that was used to tell whether we could
15465         access private members we compute our containing type from the
15466         EmitContext.
15467
15468         (FieldExpr): Added partial support for volatile fields.  This does
15469         not work for volatile fields exposed from assemblies, as I can not
15470         figure out how to extract the modreq from it.
15471
15472         Updated all the source files to use this.
15473
15474         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15475         because it is referenced by MemberLookup very often. 
15476
15477 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15478
15479         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15480         TypeBuilder.GetCustomAttributes to retrieve what we need.
15481
15482         Get rid of redundant default_member_attr_type as this is the same as
15483         default_member_type which already exists.
15484
15485         * interface.cs, attribute.cs : Update accordingly.
15486
15487 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15488
15489         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15490         work for TYpeBuilders though.  Ravi, can you please fix this?
15491
15492         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15493
15494         * expression.cs (Argument.Emit): Handle the case of ref objects
15495         being passed to ref functions;  
15496
15497         (ParameterReference.EmitLoad): Loads the content of the pointer
15498         without dereferencing.
15499
15500 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15501
15502         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15503
15504 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15505
15506         * class.cs (Indexer.DefineMethod): Incorporate the interface
15507         type in the name of the method if we are doing explicit interface
15508         implementation.
15509
15510         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15511
15512         (BetterConversion): Fix extremely trivial bug where we were referring to
15513         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15514         again !
15515
15516         * ../errors/bug16.cs : Add although we have fixed it.
15517
15518 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15519
15520         * expression.cs (BaseIndexer): Begin implementation.
15521
15522         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15523
15524         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15525         production directly to remove a shift/reduce, and implement
15526         explicit interface implementation.
15527
15528         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15529         after a floating point suffix.
15530
15531         * expression.cs (DoNumericPromotions): Improved the conversion for
15532         uint/uint.  If we have a constant, we avoid doing a typecast to a
15533         larger type.
15534
15535         * class.cs (Indexer): Implement explicit interface implementation
15536         for indexers.
15537
15538 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15539
15540         * class.cs: make the default instance constructor public and hidebysig.
15541
15542 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15543
15544         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15545         so we can call it from elsewhere.
15546
15547         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15548         we emit it internally if the class has a defined indexer; otherwise the user
15549         emits it by decorating the class definition with the DefaultMemberAttribute.
15550
15551         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15552         attribute is not used on a type which defines an indexer.
15553
15554         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15555         character when we skip whitespace.
15556
15557         * ../errors/cs0646.cs : Add.
15558
15559 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15560
15561         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15562         again. 
15563
15564         * makefile: Add practical target `mcs3.exe' which builds the third
15565         generation compiler. 
15566
15567         * expression.cs (New): Fix structures constructor calling.
15568
15569         * class.cs (Property, Method, Indexer): Emit Final flag on the
15570         method if we are an interface implementation and we are not
15571         abstract. 
15572
15573         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15574         whether this property is referencing a `base' method.
15575
15576         * expression.cs (Invocation.EmitCall): take an extra argument:
15577         is_base, this is used to determine whether the `call' or
15578         `callvirt' opcode should be used.
15579
15580
15581         * delegate.cs: update EmitCall.
15582
15583         * class.cs (Method.Define): Set NewSlot for the cases where we are
15584         not implementing an interface method.
15585
15586         (Property.Define): ditto.
15587
15588 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15589
15590         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15591         'r'.  Allows mcs to parse itself fully.
15592
15593 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15594
15595         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15596         of the number of initializers that require the InitializeArray method.
15597
15598         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15599         update the above field where necessary.
15600
15601         (MakeByteBlob): Update accordingly.
15602
15603         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15604         greater than 2.
15605
15606         (EmitDynamicInitializers): Update in accordance with the new optimization.
15607
15608         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15609         same OpCode applies.
15610
15611         * cs-parser.jay : Fix some glaring errors I introduced.
15612
15613 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15614
15615         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15616         so that we can check for name clashes there too.
15617
15618         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15619         for interface indexers.
15620
15621         * interfaces.cs (Define): Emit the default member attribute.
15622
15623         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15624         variable was being referred to while setting the value ;-)
15625
15626 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15627
15628         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15629         byte-by-byte information when we know the data is zero.
15630
15631         Make the block always a multiple of 4, because
15632         DefineInitializedData has a bug.
15633
15634         * assign.cs: Fix, we should assign from the temporary, not from
15635         the source. 
15636
15637         * expression.cs (MakeByteBlob): Fix my incorrect code.
15638
15639 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15640
15641         * typemanager.cs (EnumToUnderlying): This function is used to get
15642         the underlying type from an enumeration, because it does not
15643         always work. 
15644
15645         * constant.cs: Use the I4_S form for values between -128 and 127.
15646
15647         * statement.cs (Block.LookupLabel): Looks up a label.
15648         (Block): Drop support for labeled blocks.
15649
15650         (LabeledStatement): New kind of statement that represents a label
15651         only.
15652
15653         (Goto): Finally implement this bad boy.
15654
15655         * cs-parser.jay: Update to reflect new mechanism to implement
15656         labels.
15657
15658 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15659
15660         * codegen.cs (EmitContext.This): a codegen property that keeps the
15661         a single instance of this instead of creating many different this
15662         instances. 
15663
15664         * delegate.cs (Delegate.DoResolve): Update to use the property;
15665
15666         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15667
15668         * expression.cs (BaseAccess.DoResolve): Ditto.
15669
15670 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15671
15672         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15673         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15674
15675         (InitCoreTypes): Update accordingly.
15676
15677         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15678         so we can quickly store the state.
15679
15680         (ApplyAttributes): Set the correct implementation flags
15681         for InternalCall methods.
15682
15683 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15684
15685         * expression.cs (EmitCall): if a method is not virtual, then do
15686         not use callvirt on it.
15687
15688         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15689         user defined stuff) requires the use of stobj, which takes an
15690         address on the stack instead of an array and an index.  So emit
15691         the Ldelema operation for it.
15692
15693         (EmitStoreOpcode): Use stobj for valuetypes.
15694
15695         (UnaryMutator.EmitCode): Use the right 1 value depending on
15696         whether we are dealing with int64/uint64, float or doubles.
15697
15698         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15699         constructors that I implemented last night.
15700
15701         (Constructor.IsDefault): Fix to work properly for static
15702         constructors.
15703
15704         * cs-parser.jay (CheckDef): report method signature errors.
15705         Update error number 103 to be 132.
15706
15707         * decl.cs: New AdditionResult enumeration value: MethodExists.
15708         Although we do this check for methods later on in the semantic
15709         analysis, catching repeated default constructors is so easy that
15710         we catch these here. 
15711
15712         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15713         promotions code.
15714
15715         (ParameterReference.EmitAssign, Emit): handle
15716         bools as bytes.
15717
15718         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15719         (ArrayAccess.EmitStoreOpcode): ditto.
15720
15721         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15722
15723         * expression.cs (MakeByteBlob): Complete all the missing types
15724         (uint, short, ushort, byte, sbyte)
15725
15726         * class.cs: Only init instance field initializers on instance
15727         constructors. 
15728
15729         Rename `constructors' to instance_constructors. 
15730
15731         (TypeContainer.AddConstructor): Only add constructors to the list
15732         if it is not static.
15733
15734         Make sure that we handle default_static_constructor independently
15735         everywhere where we handle instance_constructors
15736
15737 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15738
15739         * class.cs: Do not lookup or create a base initializer for a
15740         static constructor.
15741
15742         (ConstructorInitializer.Resolve): use the proper type to lookup
15743         for constructors.
15744
15745         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15746
15747         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15748         in DeclSpace. 
15749
15750         * decl.cs: CloseType is now an virtual method, the default
15751         implementation just closes this type.
15752
15753 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15754
15755         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15756         to PreserveSig by default. Also emit HideBySig on such methods.
15757
15758         Basically, set the defaults to standard values.
15759
15760         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15761         argument, if candidate is better, it can't be worse than the best !
15762
15763         (Invocation): Re-write bits to differentiate between methods being
15764         applicable in their expanded form and their normal form - for params
15765         methods of course.
15766
15767         Get rid of use_standard everywhere as only standard conversions are allowed
15768         in overload resolution. 
15769
15770         More spec conformance.
15771
15772 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15773
15774         * driver.cs: Add --timestamp, to see where the compiler spends
15775         most of its time.
15776
15777         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15778         `this' in static code.
15779
15780         (SimpleName.DoResolve): Implement in terms of a helper function
15781         that allows static-references to be passed upstream to
15782         MemberAccess.
15783
15784         (Expression.ResolveWithSimpleName): Resolve specially simple
15785         names when called by MemberAccess to implement the special
15786         semantics. 
15787
15788         (Expression.ImplicitReferenceConversion): Handle conversions from
15789         Null to reference types before others, as Null's type is
15790         System.Object. 
15791
15792         * expression.cs (Invocation.EmitCall): Handle the special case of
15793         calling methods declared on a reference type from a ValueType
15794         (Base classes System.Object and System.Enum)
15795
15796         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15797         the left hand side is a TypeExpr, not on every enumeration. 
15798
15799         (Binary.Resolve): If types are reference types, then do a cast to
15800         object on operators != and == of both arguments.
15801
15802         * typemanager.cs (FindMembers): Extract instance and static
15803         members if requested.
15804
15805         * interface.cs (PopulateProperty): Use void_type instead of null
15806         as the return type for the setter method.
15807
15808         (PopulateIndexer): ditto.
15809
15810 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15811
15812         * support.cs (ReflectionParameters): Fix minor bug where we
15813         were examining the wrong parameter for the ParamArray attribute.
15814
15815         Cope with requests for the type of the parameter at position
15816         greater than the params parameter's. We now return the element
15817         type of the params array as that makes more sense.
15818
15819         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15820         accordingly as we no longer have to extract the element type
15821         ourselves.
15822
15823         (Invocation.OverloadResolve): Update.
15824
15825 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15826
15827         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15828         against IEnumerator, test whether the return value is a descendant
15829         of the IEnumerator interface.
15830
15831         * class.cs (Indexer.Define): Use an auxiliary method to implement
15832         the other bits of the method definition.  Begin support for
15833         explicit interface implementation.
15834
15835         (Property.DefineMethod): Use TypeManager.void_type instead of null
15836         for an empty return value.
15837
15838 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15839
15840         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15841         dealing with a FieldExpr which is composed of a FieldBuilder, in
15842         the code path we did extract the constant, but we should have
15843         obtained the underlying value to be able to cast it (otherwise we
15844         end up in an infinite loop, this is what Ravi was running into).
15845
15846         (ArrayCreation.UpdateIndices): Arrays might be empty.
15847
15848         (MemberAccess.ResolveMemberAccess): Add support for section
15849         14.5.4.1 that deals with the special case of E.I when E is a type
15850         and something else, that I can be a reference to a static member.
15851
15852         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15853         handle a particular array type to create byte blobs, it is just
15854         something we dont generate byteblobs for.
15855
15856         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15857         arguments. 
15858
15859         * location.cs (Push): remove the key from the hashtable that we
15860         are about to add.   This happens for empty files.
15861
15862         * driver.cs: Dispose files after we have parsed them.
15863
15864         (tokenize): new function that only runs the tokenizer on its
15865         input, for speed testing.
15866
15867 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15868
15869         * class.cs (Event.Define): Define the private field only if there
15870         are no accessors defined.
15871
15872         * expression.cs (ResolveMemberAccess): If there is no associated
15873         field with the event, that means we have an event defined with its
15874         own accessors and we should flag error cs0070 since transforming
15875         ourselves into a field is not valid in that case.
15876
15877         * ecore.cs (SimpleName.DoResolve): Same as above.
15878
15879         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15880         and charset to sane values.
15881
15882 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15883
15884         * assign.cs (DoResolve): Perform check on events only if they 
15885         are being accessed outside the declaring type.
15886
15887         * cs-parser.jay (event_declarations): Update rules to correctly
15888         set the type of the implicit parameter etc.
15889
15890         (add_accessor, remove_accessor): Set current local parameters.
15891
15892         * expression.cs (Binary): For delegate addition and subtraction,
15893         cast the return value from the method into the appropriate delegate
15894         type.
15895
15896 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15897
15898         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15899         of these as the workaround is unnecessary.
15900
15901         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15902         delegate data - none of that is needed at all.
15903
15904         Re-write bits to extract the instance expression and the delegate method
15905         correctly.
15906
15907         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15908         on delegates too.
15909
15910         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15911         of attaching attributes instead of duplicating code everywhere.
15912
15913         * everywhere : Update code to do attribute emission using the above method.
15914
15915 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15916
15917         * expression.cs (IsParamsMethodApplicable): if there are not
15918         parameters, return immediately.
15919
15920         * ecore.cs: The 0 literal can be implicity converted to an enum
15921         type. 
15922
15923         (SimpleName.DoResolve): First lookup the type, then lookup the
15924         members. 
15925
15926         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15927         want to get its address.  If the InstanceExpression is not
15928         addressable, store the result in a temporary variable, then get
15929         the address of it.
15930
15931         * codegen.cs: Only display 219 errors on warning level or above. 
15932
15933         * expression.cs (ArrayAccess): Make it implement the
15934         IMemoryLocation interface.
15935
15936         (Binary.DoResolve): handle the operator == (object a, object b)
15937         and operator != (object a, object b) without incurring into a
15938         BoxedCast (because 5 != o should never be performed).
15939
15940         Handle binary enumerator operators.
15941
15942         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15943         value type, otherwise use Ldelem_ref.
15944
15945         Use precomputed names;
15946
15947         (AddressOf): Implement address of
15948
15949         * cs-parser.jay (labeled_statement): Fix recursive block
15950         addition by reworking the production.
15951
15952         * expression.cs (New.DoEmit): New has a special case:
15953                 
15954                  If we are dealing with a ValueType, we have a few
15955                  situations to deal with:
15956                 
15957                     * The target of New is a ValueType variable, that is
15958                       easy, we just pass this as the variable reference
15959                 
15960                     * The target of New is being passed as an argument,
15961                       to a boxing operation or a function that takes a
15962                       ValueType.
15963                 
15964                       In this case, we need to create a temporary variable
15965                       that is the argument of New.
15966
15967
15968 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15969
15970         * rootcontext.cs (LookupType): Check that current_type is not null before
15971         going about looking at nested types.
15972
15973         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15974         not implement the IAssignMethod interface any more.
15975
15976         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15977         where we tranform them into FieldExprs if they are being resolved from within
15978         the declaring type.
15979
15980         * ecore.cs (SimpleName.DoResolve): Do the same here.
15981
15982         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15983
15984         * ../errors/bug10.cs : Add.
15985
15986         * ../errors/cs0070.cs : Add.
15987
15988         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15989
15990         * assign.cs : Get rid of EventIsLocal everywhere.
15991
15992 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15993
15994         * ecore.cs (ConvertIntLiteral): finished the implementation.
15995
15996         * statement.cs (SwitchLabel): Convert the value we are using as a
15997         key before looking up the table.
15998
15999 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16000
16001         * codegen.cs (EmitTopBlock): Require a Location argument now.
16002
16003         * cs-parser.jay (constructor_declarator): We need to setup
16004         current_local_parameters before we parse the
16005         opt_constructor_initializer, to allow the variables to be bound
16006         to the constructor arguments.
16007
16008         * rootcontext.cs (LookupType): First lookup nested classes in our
16009         class and our parents before we go looking outside our class.
16010
16011         * expression.cs (ConstantFold): Extract/debox the values at the
16012         beginnning. 
16013
16014         * rootcontext.cs (EmitCode): Resolve the constants first before we
16015         resolve the types.  This is not really needed, but it helps debugging.
16016
16017         * statement.cs: report location.
16018
16019         * cs-parser.jay: pass location to throw statement.
16020
16021         * driver.cs: Small bug fix.
16022
16023         * report.cs: Updated format to be 4-zero filled digits.
16024
16025 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16026
16027         * expression.cs (CheckIndices): Fix minor bug where the wrong
16028         variable was being referred to ;-)
16029
16030         (DoEmit): Do not call EmitStaticInitializers when the 
16031         underlying type is System.Object.
16032
16033 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16034
16035         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16036         and do the usual workaround for SRE.
16037
16038         * class.cs (MyEventBuilder.EventType): New member to get at the type
16039         of the event, quickly.
16040
16041         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16042
16043         * assign.cs (Assign.DoResolve): Handle the case when the target
16044         is an EventExpr and perform the necessary checks.
16045
16046         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16047         interface.
16048
16049         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16050
16051         (EventExpr): Set the type in the constructor itself since we 
16052         are meant to be born fully resolved.
16053
16054         (EventExpr.Define): Revert code I wrote earlier.
16055                 
16056         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16057         instance expression is null. The instance expression is a This in that case
16058         or a null, depending on whether it is a static method or not.
16059
16060         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16061         refers to more than one method.
16062
16063         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16064         and accordingly flag errors.
16065
16066 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16067
16068         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16069
16070 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16071
16072         * location.cs (ToString): Provide useful rutine.
16073
16074 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16075
16076         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16077         objects, return the actual integral boxed.
16078
16079         * statement.cs (SwitchLabel): define an ILLabel for each
16080         SwitchLabel. 
16081
16082         (Switch.CheckSwitch): If the value is a Literal, extract
16083         the underlying literal.
16084
16085         Also in the unused hashtable we had, add the SwitchLabel so we can
16086         quickly look this value up.
16087
16088         * constant.cs: Implement a bunch of new constants.  Rewrite
16089         Literal based on this.  Made changes everywhere to adapt to this.
16090
16091         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16092         dereferencing array only once, and also copes with enumrations.
16093
16094         bytes are two bytes wide, not one.
16095
16096         (Cast): Perform constant conversions.
16097
16098         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16099         wrappers to the literals here.
16100
16101         * expression.cs (DoNumericPromotions): long literals can converted
16102         to ulong implicity (this is taken care of elsewhere, but I was
16103         missing this spot).
16104
16105         * ecore.cs (Expression.Literalize): Make the return type Literal,
16106         to improve type checking.
16107
16108         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16109
16110 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16111
16112         * literal.cs: Revert code from ravi that checked the bounds.  The
16113         bounds are sane by the definition of the type itself. 
16114
16115         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16116         need to actually look up in our parent hierarchy for interfaces
16117         implemented. 
16118
16119         * const.cs: Use the underlying type for enumerations
16120
16121         * delegate.cs: Compute the basename for the delegate creation,
16122         that should fix the delegate test case, and restore the correct
16123         Type Lookup semantics in rootcontext
16124
16125         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16126         referencing a nested type with the Reflection API is using the "+"
16127         sign. 
16128
16129         * cs-parser.jay: Do not require EOF token at the end.
16130
16131 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16132
16133         * rootcontext.cs (LookupType): Concatenate type names with
16134         a '.' instead of a '+' The test suite passes again.
16135
16136         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16137         field of the enumeration.
16138
16139         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16140         the case when the member is an EventExpr.
16141
16142         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16143         static has an associated instance expression.
16144
16145         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16146
16147         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16148
16149         * class.cs (Event.Define): Register event and perform appropriate checks
16150         for error #111.
16151
16152         We define the Add and Remove methods even if the use provides none because
16153         in that case, we provide default implementations ourselves.
16154
16155         Define a private field of the type of the event. This is done by the CSC compiler
16156         and we should be doing it too ;-)
16157
16158         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16159         More methods we use in code we generate.
16160
16161         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16162         is important.
16163
16164         (InitCoreTypes): Update accordingly for the above.
16165
16166         * class.cs (Event.Emit): Generate code for default accessors that we provide
16167
16168         (EmitDefaultMethod): Do the job in the above.
16169
16170         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16171         appropriate place.
16172
16173 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16174
16175         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16176         builders even if we were missing one.
16177
16178         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16179         pass the Basename as our class name instead of the Name.  The
16180         basename will be correctly composed for us.
16181
16182         * parameter.cs (Paramters): Now takes a Location argument.
16183
16184         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16185         make all the code call directly LookupType in RootContext and take
16186         this chance to pass the Location information everywhere.
16187
16188         * Everywhere: pass Location information.
16189
16190 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16191
16192         * class.cs (Constructor.Define): Updated way of detecting the
16193         length of the parameters.
16194
16195         (TypeContainer.DefineType): Use basename as the type name for
16196         nested types.
16197
16198         (TypeContainer.Define): Do not recursively define types here, as
16199         definition is taken care in order by the RootContext.
16200
16201         * tree.cs: Keep track of namespaces in a per-file basis.
16202
16203         * parameter.cs (Parameter.ComputeSignature): Update to use
16204         DeclSpace. 
16205
16206         (Parameters.GetSignature): ditto.
16207
16208         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16209         instead of a TypeContainer.
16210
16211         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16212         resolve names.  Because we need to be resolve in our context, not
16213         our parents.
16214
16215         * driver.cs: Implement response files.
16216
16217         * class.cs (TypeContainer.DefineType): If we are defined, do not
16218         redefine ourselves.
16219
16220         (Event.Emit): Emit the code for add/remove handlers.
16221         (Event.Define): Save the MethodBuilders for add/remove.
16222
16223         * typemanager.cs: Use pair here too.
16224
16225         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16226         DictionaryEntry requires the first argument to be non-null.  
16227
16228         (enum_declaration): Compute full name for registering the
16229         enumeration.
16230
16231         (delegate_declaration): Instead of using
16232         formal_parameter_list, use opt_formal_parameter_list as the list
16233         can be empty.
16234
16235         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16236         (EventParsing): New property that controls whether `add' and
16237         `remove' are returned as tokens or identifiers (for events);
16238
16239 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16240
16241         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16242         use MyEventBuilder only and let it wrap the real builder for us.
16243
16244         (MyEventBuilder): Revamp constructor etc.
16245
16246         Implement all operations that we perform on EventBuilder in precisely the same
16247         way here too.
16248
16249         (FindMembers): Update to use the EventBuilder member.
16250
16251         (Event.Emit): Update accordingly.
16252
16253 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16254
16255         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16256         by calling the appropriate methods.
16257
16258         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16259         useful.
16260
16261         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16262
16263 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16264
16265         * delegate.cs (Delegate.Populate): Check that the return type
16266         and various parameters types are indeed accessible.
16267
16268         * class.cs (Constructor.Define): Same here.
16269
16270         (Field.Define): Ditto.
16271
16272         (Event.Define): Ditto.
16273
16274         (Operator.Define): Check that the underlying Method defined itself
16275         correctly - so it's MethodBuilder should not be null.
16276
16277         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16278         expression happens to be null.
16279
16280         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16281         members but as of now we don't seem to be able to do anything really useful with it.
16282
16283         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16284         not the EventBuilder.
16285
16286 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16287
16288         * cs-tokenizer.cs: Add support for defines.
16289         Add support for #if, #elif, #else, #endif
16290
16291         (eval_var): evaluates a variable.
16292         (eval): stubbed for evaluating functions.
16293
16294         * cs-parser.jay: Pass the defines information
16295
16296         * driver.cs: Add --define command line option.
16297
16298         * decl.cs: Move MemberCore here.
16299
16300         Make it the base class for DeclSpace.  This allows us to catch and
16301         report 108 and 109 for everything now.
16302
16303         * class.cs (TypeContainer.Define): Extract all the members
16304         before populating and emit the warning 108 (new keyword required
16305         to override) instead of having each member implement this.
16306
16307         (MemberCore.Define): New abstract method, we will be using this in
16308         the warning reporting engine in Populate.
16309
16310         (Operator.Define): Adjust to new MemberCore protocol. 
16311
16312         * const.cs (Const): This does not derive from Expression, it is a
16313         temporary object we use to create fields, it is a MemberCore. 
16314
16315         * class.cs (Method.Define): Allow the entry point to be in a
16316         specific class.
16317
16318         * driver.cs: Rewrite the argument handler to clean it up a bit.
16319
16320         * rootcontext.cs: Made it just an auxiliary namespace feature by
16321         making everything static.
16322
16323         * driver.cs: Adapt code to use RootContext type name instead of
16324         instance variable.
16325
16326         * delegate.cs: Remove RootContext argument.
16327
16328         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16329         argument. 
16330
16331         * class.cs (Event.Define): The lookup can fail.
16332
16333         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16334
16335         * expression.cs: Resolve the this instance before invoking the code.
16336
16337 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16338
16339         * cs-parser.jay: Add a production in element_access that allows
16340         the thing to become a "type" reference.  This way we can parse
16341         things like "(string [])" as a type.
16342
16343         Note that this still does not handle the more complex rules of
16344         casts. 
16345
16346
16347         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16348
16349         * ecore.cs: (CopyNewMethods): new utility function used to
16350         assemble the list of methods from running FindMembers.
16351
16352         (MemberLookup): Rework FindMembers so that 
16353
16354 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16355
16356         * class.cs (TypeContainer): Remove Delegates who fail to be
16357         defined.
16358
16359         * delegate.cs (Populate): Verify that we dont get null return
16360         values.   TODO: Check for AsAccessible.
16361
16362         * cs-parser.jay: Use basename to emit error 574 (destructor should
16363         have the same name as container class), not the full name.
16364
16365         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16366         possible representation.  
16367
16368         Also implements integer type suffixes U and L.
16369
16370 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16371
16372         * expression.cs (ArrayCreation.DoResolve): We need to do the
16373         argument resolution *always*.
16374
16375         * decl.cs: Make this hold the namespace.  Hold the root context as
16376         well.
16377         (LookupType): Move here.
16378
16379         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16380
16381         * location.cs (Row, Name): Fixed the code, it was always returning
16382         references to the first file.
16383
16384         * interface.cs: Register properties defined through interfaces.
16385
16386         * driver.cs: Add support for globbing on the command line
16387
16388         * class.cs (Field): Make it derive from MemberCore as well.
16389         (Event): ditto.
16390
16391 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16392
16393         * class.cs (Event::Define): Check that the type of the event is a delegate
16394         type else flag error #66.
16395
16396         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16397         same.
16398
16399         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16400         values of EntryPoint, CharSet etc etc.
16401
16402         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16403
16404         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16405         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16406         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16407         which needs this to do its work.
16408
16409         * ../errors/cs0066.cs : Add.
16410
16411 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16412
16413         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16414         helper functions.
16415
16416         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16417         clears out the parameters field.
16418         (MemberSignatureCompare): Cleanup
16419
16420         (MemberCore): New base class used to share code between MethodCore
16421         and Property.
16422
16423         (RegisterRequiredImplementations) BindingFlags.Public requires
16424         either BindingFlags.Instace or Static.  Use instance here.
16425
16426         (Property): Refactored code to cope better with the full spec.
16427
16428         * parameter.cs (GetParameterInfo): Return an empty array instead
16429         of null on error.
16430
16431         * class.cs (Property): Abstract or extern properties have no bodies.
16432
16433         * parameter.cs (GetParameterInfo): return a zero-sized array.
16434
16435         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16436         method modifier validation to the typecontainer so we can reuse
16437         this on properties.
16438
16439         (MethodCore.ParameterTypes): return an empty sized array of types.
16440
16441         (Property.Define): Test property modifier validity.
16442
16443         Add tests for sealed/override too.
16444
16445         (Method.Emit): abstract or extern methods have no bodies.
16446
16447 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16448
16449         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16450         thing.
16451
16452         (Method::Define, ::Emit): Modify accordingly.
16453
16454         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16455
16456         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16457
16458         * makefile: Pass in /unsafe.
16459
16460 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16461
16462         * class.cs (MakeKey): Kill routine.
16463
16464         * class.cs (TypeContainer.Define): Correctly define explicit
16465         method implementations (they require the full interface name plus
16466         the method name).
16467
16468         * typemanager.cs: Deply the PtrHashtable here and stop using the
16469         lame keys.  Things work so much better.
16470
16471         This of course broke everyone who depended on `RegisterMethod' to
16472         do the `test for existance' test.  This has to be done elsewhere.
16473
16474         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16475         the object stupid Equals method (because, that like fails all over
16476         the place).  We still do not use it.
16477
16478         * class.cs (TypeContainer.SetRequiredInterface,
16479         TypeContainer.RequireMethods): Killed these two routines and moved
16480         all the functionality to RegisterRequiredImplementations.
16481
16482         (TypeContainer.RegisterRequiredImplementations): This routine now
16483         registers all the implementations required in an array for the
16484         interfaces and abstract methods.  We use an array of structures
16485         which can be computed ahead of time to reduce memory usage and we
16486         also assume that lookups are cheap as most classes will not
16487         implement too many interfaces.
16488
16489         We also avoid creating too many MethodSignatures.
16490
16491         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16492         clear the "pending" bit if we find that there are problems with
16493         the declaration.
16494
16495         (TypeContainer.VerifyPendingMethods): Update to report errors of
16496         methods that look like implementations but are not.
16497
16498         (TypeContainer.Define): Add support for explicit interface method
16499         implementation. 
16500
16501 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16502
16503         * typemanager.cs: Keep track of the parameters here instead of
16504         being a feature of the TypeContainer.
16505
16506         * class.cs: Drop the registration of parameters here, as
16507         InterfaceMethods are also interface declarations.
16508
16509         * delegate.cs: Register methods with the TypeManager not only with
16510         the TypeContainer.  This code was buggy.
16511
16512         * interface.cs: Full registation here.
16513
16514 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16515
16516         * expression.cs: Remove reducer for binary expressions, it can not
16517         be done this way.
16518
16519         * const.cs: Put here the code that used to go into constant.cs
16520
16521         * constant.cs: Put here the code for constants, this is a new base
16522         class for Literals.
16523
16524         * literal.cs: Make Literal derive from Constant.
16525
16526 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16527
16528         * statement.cs (Return.Emit): Report error 157 if the user
16529         attempts to return from a finally block.
16530
16531         (Return.Emit): Instead of emitting a return, jump to the end of
16532         the function.
16533
16534         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16535         LocalBuilder to store the result of the function.  ReturnLabel is
16536         the target where we jump.
16537
16538
16539 2001-12-09  Radek Doulik  <rodo@ximian.com>
16540
16541         * cs-parser.jay: remember alias in current namespace
16542
16543         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16544         namespaces
16545
16546         * class.cs (LookupAlias): lookup alias in my_namespace
16547
16548         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16549         aliases hashtable
16550         (LookupAlias): lookup alias in this and if needed in parent
16551         namespaces
16552
16553 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16554
16555         * support.cs: 
16556
16557         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16558         making things static.  I need this to avoid passing the
16559         TypeContainer when calling ParameterType.
16560
16561         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16562         that did string manipulation to compute the type and then call
16563         GetType.  Use Parameter.ParameterType instead.
16564
16565         * cs-tokenizer.cs: Consume the suffix for floating values.
16566
16567         * expression.cs (ParameterReference): figure out whether this is a
16568         reference parameter or not.  Kill an extra variable by computing
16569         the arg_idx during emission.
16570
16571         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16572         function that returns whether a parameter is an out/ref value or not.
16573
16574         (Parameter.ParameterType): The type of the parameter (base,
16575         without ref/out applied).
16576
16577         (Parameter.Resolve): Perform resolution here.
16578         (Parameter.ExternalType): The full type (with ref/out applied).
16579
16580         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16581         support for expressions on the using statement.
16582
16583 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16584
16585         * statement.cs (Using.EmitLocalVariableDecls): Split the
16586         localvariable handling of the using statement.
16587
16588         (Block.EmitMeta): Keep track of variable count across blocks.  We
16589         were reusing slots on separate branches of blocks.
16590
16591         (Try.Emit): Emit the general code block, we were not emitting it. 
16592
16593         Check the type of the declaration to be an IDisposable or
16594         something that can be implicity converted to it. 
16595
16596         Emit conversions if required.
16597
16598         * ecore.cs (EmptyExpression): New utility class.
16599         (Expression.ImplicitConversionExists): New utility function.
16600
16601 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16602
16603         * statement.cs (Using): Implement.
16604
16605         * expression.cs (LocalVariableReference): Support read only variables.
16606
16607         * statement.cs: Remove the explicit emit for the Leave opcode.
16608         (VariableInfo): Add a readonly field.
16609
16610 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16611
16612         * ecore.cs (ConvCast): new class used to encapsulate the various
16613         explicit integer conversions that works in both checked and
16614         unchecked contexts.
16615
16616         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16617         properly generate the overflow opcodes.
16618
16619 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16620
16621         * statement.cs: The correct type for the EmptyExpression is the
16622         element_type, not the variable type.  Ravi pointed this out.
16623
16624 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16625
16626         * class.cs (Method::Define): Handle PInvoke methods specially
16627         by using DefinePInvokeMethod instead of the usual one.
16628
16629         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16630         above to do the task of extracting information and defining the method.
16631
16632 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16633
16634         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16635         of the condition for string type.
16636
16637         (Emit): Move that here. 
16638
16639         (ArrayCreation::CheckIndices): Keep string literals in their expression
16640         form.
16641
16642         (EmitDynamicInitializers): Handle strings appropriately.
16643
16644 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16645
16646         * codegen.cs (EmitContext): Replace multiple variables with a
16647         single pointer to the current Switch statement.
16648
16649         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16650         EmitContext.
16651
16652 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16653
16654         * statement.cs 
16655
16656         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16657         default'.
16658
16659         (Foreach.Emit): Foreach on arrays was not setting
16660         up the loop variables (for break/continue).
16661
16662         (GotoCase): Semi-implented.
16663
16664 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16665
16666         * attribute.cs (CheckAttribute): Handle system attributes by using
16667         Attribute.GetAttributes to examine information we need.
16668
16669         (GetValidPlaces): Same here.
16670
16671         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16672
16673         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16674
16675         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16676
16677         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16678
16679         (Method::Emit): Handle the case when we are a PInvoke method.
16680
16681 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16682
16683         * expression.cs: Use ResolveWithSimpleName on compound names.
16684
16685 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16686
16687         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16688         before trying to reduce it.
16689
16690         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16691
16692         * constant.cs (LookupConstantValue): Implement.
16693
16694         (EmitConstant): Use the above in emitting the constant.
16695
16696         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16697         that are user-defined by doing a LookupConstantValue on them.
16698
16699         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16700         too, like above.
16701
16702 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16703
16704         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16705
16706         (BaseAccess.DoResolve): Implement.
16707
16708         (MemberAccess.DoResolve): Split this routine into a
16709         ResolveMemberAccess routine that can be used independently
16710
16711 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16712
16713         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16714         As that share bits of the implementation.  Is returns a boolean,
16715         while As returns the Type that is being probed.
16716
16717 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16718
16719         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16720         instead of a Literal - much easier.
16721
16722         (EnumInTransit): Remove - utterly useless :-)
16723
16724         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16725
16726         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16727
16728         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16729         chain when we have no associated expression.
16730
16731 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16732
16733         * constant.cs (Define): Use Location while reporting the errror.
16734
16735         Also emit a warning when 'new' is used and there is no inherited
16736         member to hide.
16737
16738         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16739         populated.
16740
16741         (LookupEnumValue): Implement to lookup an enum member's value and define it
16742         if necessary.
16743
16744         (Populate): Re-write accordingly to use the above routine.
16745
16746 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16747
16748         * expression.cs (This): Fix prototype for DoResolveLValue to
16749         override the base class DoResolveLValue.
16750
16751         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16752         declarations) 
16753
16754         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16755         (we need to load the address of the field here).  This fixes
16756         test-22. 
16757
16758         (FieldExpr.DoResolveLValue): Call the DoResolve
16759         function to initialize the Instance expression.
16760
16761         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16762         correctly the GetEnumerator operation on a value type.
16763
16764         * cs-parser.jay: Add more simple parsing error catches.
16765
16766         * statement.cs (Switch): Add support for string switches.
16767         Handle null specially.
16768
16769         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16770
16771 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16772
16773         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16774
16775         (declare_local_constant): New helper function.
16776
16777         * statement.cs (AddConstant): Keep a separate record of constants
16778
16779         (IsConstant): Implement to determine if a variable is a constant.
16780
16781         (GetConstantExpression): Implement.
16782
16783         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16784
16785         * statement.cs (IsVariableDefined): Re-write.
16786
16787 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16788
16789         * class.cs (TypeContainer::FindMembers): Look for constants
16790         in the case when we are looking for MemberTypes.Field
16791
16792         * expression.cs (MemberAccess::DoResolve): Check that in the
16793         case we are a FieldExpr and a Literal, we are not being accessed
16794         by an instance reference.
16795
16796         * cs-parser.jay (local_constant_declaration): Implement.
16797
16798         (declaration_statement): Implement for constant declarations.
16799
16800 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16801
16802         * statement.cs (Switch): Catch double defaults.
16803
16804         (Switch): More work on the switch() statement
16805         implementation.  It works for integral values now, need to finish
16806         string support.
16807
16808
16809 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16810
16811         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16812         integer literals into other integer literals.  To be used by
16813         switch. 
16814
16815 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16816
16817         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16818         some memory.
16819
16820         (EmitDynamicInitializers): Cope with the above since we extract data
16821         directly from ArrayData now.
16822
16823         (ExpectInitializers): Keep track of whether initializers are mandatory
16824         or not.
16825
16826         (Bounds): Make it a hashtable to prevent the same dimension being 
16827         recorded for every element in that dimension.
16828
16829         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16830         from being found.
16831
16832         Also fix bug which was causing the indices to be emitted in the reverse
16833         order.
16834
16835 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16836
16837         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16838         unfinished.  They do not work, because the underlying code is
16839         sloppy.
16840
16841 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16842
16843         * cs-parser.jay: Remove bogus fixme.
16844
16845         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16846         on Switch statement.
16847
16848 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16849
16850         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16851         the same. 
16852
16853         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16854         parameter. Apparently, any expression is allowed. 
16855
16856         (ValidateInitializers): Update accordingly.
16857
16858         (CheckIndices): Fix some tricky bugs thanks to recursion.
16859
16860         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16861         I was being completely brain-dead.
16862
16863         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16864         and re-write acordingly.
16865
16866         (DelegateInvocation): Re-write accordingly.
16867
16868         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16869
16870         (MakeByteBlob): Handle types more correctly.
16871
16872         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16873         initialization from expressions but it is incomplete because I am a complete
16874         Dodo :-|
16875
16876 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16877
16878         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16879         on If.  Basically, we have to return `true' (ie, we do return to
16880         our caller) only if both branches of the if return.
16881
16882         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16883         short-circuit operators, handle them as short circuit operators. 
16884
16885         (Cast.DoResolve): Resolve type.
16886         (Cast.Cast): Take an expression as the target type.
16887
16888         * cs-parser.jay (cast_expression): Remove old hack that only
16889         allowed a limited set of types to be handled.  Now we take a
16890         unary_expression and we resolve to a type during semantic
16891         analysis.
16892
16893         Use the grammar productions from Rhys to handle casts (this is
16894         not complete like Rhys syntax yet, we fail to handle that corner
16895         case that C# has regarding (-x), but we will get there.
16896
16897 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16898
16899         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16900         field which is an array type.
16901
16902         * cs-parser.jay (declare_local_variables): Support array initialization too.
16903
16904         * typemanager.cs (MakeKey): Implement.
16905
16906         (everywhere): Use the above appropriately.
16907
16908         * cs-parser.jay (for_statement): Update for array initialization while
16909         declaring variables.
16910
16911         * ecore.cs : The error message was correct, it's the variable's names that
16912         were misleading ;-) Make the code more readable.
16913
16914         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16915         the correct type etc.
16916
16917         (ConvertExplicit): Handle Enum types by examining the underlying type.
16918
16919 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16920
16921         * parameter.cs (GetCallingConvention): Always return
16922         CallingConventions.Standard for now.
16923
16924 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16925
16926         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16927         and `r' after calling DoNumericPromotions.
16928
16929         * ecore.cs: Fix error message (the types were in the wrong order).
16930
16931         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16932         BindingFlags.Instance as well 
16933
16934         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16935         implicit int literal conversion in an empty cast so that we
16936         propagate the right type upstream.
16937
16938         (UnboxCast): new class used to unbox value types.
16939         (Expression.ConvertExplicit): Add explicit type conversions done
16940         by unboxing.
16941
16942         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16943         the target type before applying the implicit LongLiterals to ULong
16944         literal cast.
16945
16946 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16947
16948         * cs-parser.jay (for_statement): Reworked the way For works: now
16949         we declare manually any variables that are introduced in
16950         for_initializer to solve the problem of having out-of-band code
16951         emition (that is what got for broken).
16952
16953         (declaration_statement): Perform the actual variable declaration
16954         that used to be done in local_variable_declaration here.
16955
16956         (local_variable_declaration): Do not declare anything, just pass
16957         the information on a DictionaryEntry
16958
16959 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16960
16961         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16962         re-write of the logic to now make it recursive.
16963
16964         (UpdateIndices): Re-write accordingly.
16965
16966         Store element data in a separate ArrayData list in the above methods.
16967
16968         (MakeByteBlob): Implement to dump the array data into a byte array.
16969
16970 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16971
16972         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16973         into CheckIndices.
16974
16975         * constant.cs (Define): Implement.
16976
16977         (EmitConstant): Re-write fully.
16978
16979         Pass in location info.
16980
16981         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16982         respectively.
16983
16984         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16985         DictionaryEntry since we need location info too.
16986
16987         (constant_declaration): Update accordingly.
16988
16989         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16990         code into another method : UpdateIndices.
16991
16992 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16993
16994         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16995         some type checking etc.
16996
16997 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16998
16999         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17000         bits to provide dimension info if the user skips doing that.
17001
17002         Update second constructor to store the rank correctly.
17003
17004 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17005
17006         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17007         and try to implement.
17008
17009         * ../errors/cs0150.cs : Add.
17010
17011         * ../errors/cs0178.cs : Add.
17012
17013 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17014
17015         * statement.cs: Implement foreach on multi-dimensional arrays. 
17016
17017         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17018         name of the params argument.
17019
17020         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17021         initializing the array.
17022
17023         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17024         we can use this elsewhere.
17025
17026         * statement.cs: Finish implementation of foreach for single
17027         dimension arrays.
17028
17029         * cs-parser.jay: Use an out-of-band stack to pass information
17030         around, I wonder why I need this.
17031
17032         foreach_block: Make the new foreach_block the current_block.
17033
17034         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17035         function used to return a static Parameters structure.  Used for
17036         empty parameters, as those are created very frequently.
17037
17038         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17039
17040 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17041
17042         * interface.cs : Default modifier is private, not public. The
17043         make verify test passes again.
17044
17045 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17046
17047         * support.cs (ReflectionParameters): Fix logic to determine
17048         whether the last parameter is a params one. Test 9 passes again.
17049
17050         * delegate.cs (Populate): Register the builders we define with
17051         RegisterParameterForBuilder. Test 19 passes again.
17052
17053         * cs-parser.jay (property_declaration): Reference $6 instead
17054         of $$ to get at the location.
17055
17056         (indexer_declaration): Similar stuff.
17057
17058         (attribute): Ditto.
17059
17060         * class.cs (Property): Register parameters for the Get and Set methods
17061         if they exist. Test 23 passes again.
17062
17063         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17064         call to EmitArguments as we are sure there aren't any params arguments. 
17065         Test 32 passes again.
17066
17067         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17068         IndexOutOfRangeException. 
17069
17070         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17071         Test 33 now passes again.
17072
17073 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17074
17075         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17076         broke a bunch of things.  Will have to come up with a better way
17077         of tracking locations.
17078
17079         * statement.cs: Implemented foreach for single dimension arrays.
17080
17081 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17082
17083         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17084         an error.  This removes the lookup from the critical path.
17085
17086         * cs-parser.jay: Removed use of temporary_loc, which is completely
17087         broken. 
17088
17089 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17090
17091         * support.cs (ReflectionParameters.ParameterModifier): Report
17092         whether the argument is a PARAMS argument or not.
17093
17094         * class.cs: Set the attribute `ParamArrayAttribute' on the
17095         parameter argument.
17096
17097         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17098         and cons_param_array_attribute (ConstructorInfo for
17099         ParamArrayAttribute)., 
17100
17101         * codegen.cs: Emit the return using the `Return' statement, that
17102         way we can report the error correctly for missing return values. 
17103
17104         * class.cs (Method.Emit): Clean up.
17105
17106         * expression.cs (Argument.Resolve): Take another argument: the
17107         location where this argument is used.  Notice that this is not
17108         part of the "Argument" class as to reduce the size of the
17109         structure (we know the approximate location anyways).
17110
17111         Test if the argument is a variable-reference, if not, then
17112         complain with a 206.
17113
17114         (Argument.Emit): Emit addresses of variables.
17115
17116         (Argument.FullDesc): Simplify.
17117
17118         (Invocation.DoResolve): Update for Argument.Resolve.
17119
17120         (ElementAccess.DoResolve): ditto.
17121
17122         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17123         method should be virtual, as this method is always virtual.
17124
17125         (NewDelegate.DoResolve): Update for Argument.Resolve.
17126
17127         * class.cs (ConstructorInitializer.DoResolve): ditto.
17128
17129         * attribute.cs (Attribute.Resolve): ditto.
17130
17131 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17132
17133         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17134
17135         * expression.cs (ParameterReference): Drop IStackStorage and implement
17136         IAssignMethod instead. 
17137
17138         (LocalVariableReference): ditto.
17139
17140         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17141         IAssignMethod instead. 
17142
17143 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17144
17145         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17146         enumerations that are used in heavily used structures derive from
17147         byte in a laughable and pathetic attempt to reduce memory usage.
17148         This is the kind of pre-optimzations that you should not do at
17149         home without adult supervision.
17150
17151         * expression.cs (UnaryMutator): New class, used to handle ++ and
17152         -- separatedly from the other unary operators.  Cleans up the
17153         code, and kills the ExpressionStatement dependency in Unary.
17154
17155         (Unary): Removed `method' and `Arguments' from this class, making
17156         it smaller, and moving it all to SimpleCall, so I can reuse this
17157         code in other locations and avoid creating a lot of transient data
17158         strucutres when not required.
17159
17160         * cs-parser.jay: Adjust for new changes.
17161
17162 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17163
17164         * enum.cs (Enum.Populate): If there is a failure during
17165         definition, return
17166
17167         * cs-parser.jay (opt_enum_base): we used to catch type errors
17168         here, but this is really incorrect.  The type error should be
17169         catched during semantic analysis.
17170
17171 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17172
17173         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17174         current_local_parameters as expected since I, in my stupidity, had forgotten
17175         to do this :-)
17176
17177         * attribute.cs (GetValidPlaces): Fix stupid bug.
17178
17179         * class.cs (Method::Emit): Perform check on applicability of attributes.
17180
17181         (Constructor::Emit): Ditto.
17182
17183         (Field::Emit): Ditto.
17184
17185         (Field.Location): Store location information.
17186
17187         (Property, Event, Indexer, Operator): Ditto.
17188
17189         * cs-parser.jay (field_declaration): Pass in location for each field.
17190
17191         * ../errors/cs0592.cs : Add.
17192
17193 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17194
17195         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17196
17197         (InitCoreTypes): Update accordingly.
17198
17199         (RegisterAttrType, LookupAttr): Implement.
17200
17201         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17202         info about the same.
17203
17204         (Resolve): Update to populate the above as necessary.
17205
17206         (Error592): Helper.
17207
17208         (GetValidPlaces): Helper to the above.
17209
17210         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17211
17212         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17213
17214 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17215
17216         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17217
17218         * ../errors/cs0617.cs : Add.
17219
17220 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17221
17222         * enum.cs (Emit): Rename to Populate to be more consistent with what
17223         we expect it to do and when exactly it is called.
17224
17225         * class.cs, rootcontext.cs : Update accordingly.
17226
17227         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17228         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17229
17230         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17231
17232         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17233         of a fieldinfo using the above, when dealing with a FieldBuilder.
17234
17235 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17236
17237         * ../errors/cs0031.cs : Add.
17238
17239         * ../errors/cs1008.cs : Add.
17240
17241         * ../errrors/cs0543.cs : Add.
17242
17243         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17244         enum type.
17245
17246         (FindMembers): Implement.
17247
17248         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17249         enums and delegates too.
17250
17251         (enum_types): Rename to builder_to_enum.
17252
17253         (delegate_types): Rename to builder_to_delegate.
17254
17255         * delegate.cs (FindMembers): Implement.
17256
17257 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17258
17259         * typemanager.cs (IsEnumType): Implement.
17260
17261         * enum.cs (Emit): Re-write parts to account for the underlying type
17262         better and perform checking etc.
17263
17264         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17265         of the underlying type.
17266
17267         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17268         value
17269
17270         * enum.cs (error31): Helper to report error #31.
17271
17272         * cs-parser.jay (enum_declaration): Store location of each member too.
17273
17274         * enum.cs (member_to_location): New hashtable. 
17275
17276         (AddEnumMember): Update location hashtable.
17277
17278         (Emit): Use the location of each member while reporting errors.
17279
17280 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17281
17282         * cs-parser.jay: A for_initializer if is a
17283         local_variable_declaration really ammount to have an implicit
17284         block with the variable declaration and no initializer for for.
17285
17286         * statement.cs (For.Emit): Cope with null initializers.
17287
17288         This fixes the infinite loop on for initializers.
17289
17290 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17291
17292         * enum.cs: More cleanup.
17293
17294         * ecore.cs: Remove dead code.
17295
17296         * class.cs (Property.Emit): More simplification.
17297         (Event.Emit): ditto.
17298
17299         Reworked to have less levels of indentation.
17300
17301 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17302
17303         * class.cs (Property): Emit attributes.
17304
17305         (Field): Ditto.
17306
17307         (Event): Ditto.
17308
17309         (Indexer): Ditto.
17310
17311         (Operator): Ditto.
17312
17313         * enum.cs (Emit): Ditto.
17314
17315         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17316         Enums too.
17317
17318         * class.cs (Field, Event, etc.): Move attribute generation into the
17319         Emit method everywhere.
17320
17321         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17322         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17323         as we had no way of defining nested enums !
17324
17325         * rootcontext.cs : Adjust code accordingly.
17326
17327         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17328
17329 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17330
17331         * expression.cs (EvalConstantExpression): Move into ecore.cs
17332
17333         * enum.cs (Enum): Rename some members and make them public and readonly
17334         according to our convention.
17335
17336         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17337         nothing else.
17338
17339         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17340
17341         (Enum::Emit): Write a simple version for now which doesn't try to compute
17342         expressions. I shall modify this to be more robust in just a while.
17343
17344         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17345
17346         (TypeContainer::CloseType): Create the Enum types too.
17347
17348         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17349
17350         * expression.cs (EvalConstantExpression): Get rid of completely.
17351
17352         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17353         user-defined values and other cases.
17354
17355         (IsValidEnumLiteral): Helper function.
17356
17357         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17358         out there in the case we had a literal FieldExpr.
17359
17360         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17361
17362         (Literalize): Revamp a bit to take two arguments.
17363
17364         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17365
17366 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17367
17368         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17369
17370         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17371
17372         (Resolve): Use the above to ensure we have proper initializers.
17373
17374 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17375
17376         * expression.cs (Expression::EvalConstantExpression): New method to 
17377         evaluate constant expressions.
17378
17379         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17380
17381 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17382
17383         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17384         in an array.
17385
17386         (Binary.ResolveOperator): Handle operator != (object a, object b)
17387         and operator == (object a, object b);
17388
17389         (Binary.DoNumericPromotions): Indicate whether the numeric
17390         promotion was possible.
17391
17392         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17393         Implement.  
17394
17395         Made the ArrayAccess implement interface IAssignMethod instead of
17396         IStackStore as the order in which arguments are passed reflects
17397         this.
17398
17399         * assign.cs: Instead of using expr.ExprClass to select the way of
17400         assinging, probe for the IStackStore/IAssignMethod interfaces.
17401
17402         * typemanager.cs: Load InitializeArray definition.
17403
17404         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17405         static data that can be used to initialize arrays. 
17406
17407 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17408
17409         * expression.cs: Handle operator== and operator!= for booleans.
17410
17411         (Conditioal.Reduce): Implement reducer for the ?: operator.
17412
17413         (Conditional.Resolve): Implement dead code elimination.
17414
17415         (Binary.Resolve): Catch string literals and return a new
17416         concatenated string.
17417
17418         (Unary.Reduce): Implement reduction of unary expressions.
17419
17420         * ecore.cs: Split out the expression core handling here.
17421
17422         (Expression.Reduce): New method used to perform constant folding
17423         and CSE.  This is needed to support constant-expressions. 
17424
17425         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17426         targets, and optimize for !x.
17427
17428 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17429
17430         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17431         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17432         set custom atttributes.
17433
17434         * literal.cs (Literal::GetValue): New abstract method to return the actual
17435         value of the literal, cast as an object.
17436
17437         (*Literal): Implement GetValue method.
17438
17439         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17440         expressions to the arraylist but objects of type Argument.
17441
17442         * class.cs (TypeContainer::Emit): Emit our attributes too.
17443
17444         (Method::Emit, Constructor::Emit): Ditto.
17445
17446         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17447         to be ignoring earlier.
17448
17449 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17450
17451         * attribute.cs (AttributeSection::Define): Implement to do the business
17452         of constructing a CustomAttributeBuilder.
17453
17454         (Attribute): New trivial class. Increases readability of code.  
17455
17456         * cs-parser.jay : Update accordingly.
17457
17458         (positional_argument_list, named_argument_list, named_argument): New rules
17459
17460         (attribute_arguments): Use the above so that we are more correct.
17461
17462 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17463
17464         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17465         to perform all checks for a method with a params parameter.
17466
17467         (Invocation::OverloadResolve): Update to use the above method and therefore
17468         cope correctly with params method invocations.
17469
17470         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17471         params too.
17472
17473         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17474         constructors in our parent too because we can't afford to miss out on 
17475         protected ones ;-)
17476
17477         * attribute.cs (AttributeSection): New name for the class Attribute
17478
17479         Other trivial changes to improve readability.
17480
17481         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17482         use the new class names.
17483
17484 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17485
17486         * class.cs (Method::Define): Complete definition for params types too
17487
17488         (Indexer::Define): Ditto.
17489
17490         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17491         Cope everywhere with a request for info about the array parameter.
17492
17493 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17494
17495         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17496
17497         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17498         local_variable_type to extract the string corresponding to the type.
17499
17500         (local_variable_type): Fixup the action to use the new helper method.
17501
17502         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17503         go.
17504
17505         * expression.cs : Clean out code which uses the above.
17506
17507 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17508
17509         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17510         and bale out if necessary by returning a false.
17511
17512         (RegisterProperty): Ditto.
17513
17514         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17515         and print out appropriate error messages.
17516
17517         * interface.cs (everywhere): Ditto.
17518
17519         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17520         location to constructor.
17521
17522         * class.cs (Property, Event, Indexer): Update accordingly.
17523
17524         * ../errors/cs111.cs : Added.
17525
17526         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17527         of a method, as laid down by the spec.
17528
17529         (Invocation::OverloadResolve): Use the above method.
17530
17531 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17532
17533         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17534         now take a TypeContainer and a Parameters object.
17535
17536         (ParameterData): Modify return type of ParameterModifier method to be 
17537         Parameter.Modifier and not a string.
17538
17539         (ReflectionParameters, InternalParameters): Update accordingly.
17540
17541         * expression.cs (Argument::GetParameterModifier): Same here.
17542
17543         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17544         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17545         symbol in it at all so maybe this is only for now.
17546
17547 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17548
17549         * support.cs (InternalParameters): Constructor now takes an extra argument 
17550         which is the actual Parameters class.
17551
17552         (ParameterDesc): Update to provide info on ref/out modifiers.
17553
17554         * class.cs (everywhere): Update call to InternalParameters to pass in
17555         the second argument too.
17556
17557         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17558         to return the modifier info [ref/out etc]
17559
17560         (InternalParameters, ReflectionParameters): Implement the above.
17561
17562         * expression.cs (Argument::ParameterModifier): Similar function to return
17563         info about the argument's modifiers.
17564
17565         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17566         too.
17567
17568         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17569         a new SetFormalParameters object which we pass to InternalParameters.
17570
17571 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17572
17573         * expression.cs (NewArray): Merge into the ArrayCreation class.
17574
17575 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17576
17577         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17578         NewUserdefinedArray into one as there wasn't much of a use in having
17579         two separate ones.
17580
17581         * expression.cs (Argument): Change field's name to ArgType from Type.
17582
17583         (Type): New readonly property which returns the proper type, taking into 
17584         account ref/out modifiers.
17585
17586         (everywhere): Adjust code accordingly for the above.
17587
17588         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17589         whether we are emitting for a ref or out parameter.
17590
17591         * expression.cs (Argument::Emit): Use the above field to set the state.
17592
17593         (LocalVariableReference::Emit): Update to honour the flag and emit the
17594         right stuff.
17595
17596         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17597
17598         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17599
17600         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17601
17602         (ReflectionParameters, InternalParameters): Implement the above method.
17603
17604         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17605         reporting errors.
17606
17607         (Invocation::FullMethodDesc): Ditto. 
17608
17609 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17610
17611         * cs-parser.jay: Add extra production for the second form of array
17612         creation. 
17613
17614         * expression.cs (ArrayCreation): Update to reflect the above
17615         change. 
17616
17617         * Small changes to prepare for Array initialization.
17618
17619 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17620
17621         * typemanager.cs (ImplementsInterface): interface might be null;
17622         Deal with this problem;
17623
17624         Also, we do store negative hits on the cache (null values), so use
17625         this instead of calling t.GetInterfaces on the type everytime.
17626
17627 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17628
17629         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17630
17631         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17632         split functionality out into different classes.
17633
17634         (New::FormArrayType): Move into NewBuiltinArray.
17635
17636         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17637         quite useless.
17638
17639         (NewBuiltinArray): New class to handle creation of built-in arrays.
17640
17641         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17642         account creation of one-dimensional arrays.
17643
17644         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17645
17646         (NewUserdefinedArray::DoResolve): Implement.
17647
17648         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17649
17650         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17651         we maintain inside the TypeManager. This is necessary to perform lookups on the
17652         module builder.
17653
17654         (LookupType): Update to perform GetType on the module builders too.     
17655
17656         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17657
17658         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17659
17660 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17661
17662         * expression.cs (New::DoResolve): Implement guts of array creation.
17663
17664         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17665
17666 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17667
17668         * expression.cs: Fix bug I introduced lsat night that broke
17669         Delegates. 
17670
17671         (Expression.Resolve): Report a 246 error (can not resolve name)
17672         if we find a SimpleName in the stream.
17673
17674         (Expression.ResolveLValue): Ditto.
17675
17676         (Expression.ResolveWithSimpleName): This function is a variant of
17677         ResolveName, this one allows SimpleNames to be returned without a
17678         warning.  The only consumer of SimpleNames is MemberAccess
17679
17680 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17681
17682         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17683         might arrive here.  I have my doubts that this is correct.
17684
17685         * statement.cs (Lock): Implement lock statement.
17686
17687         * cs-parser.jay: Small fixes to support `lock' and `using'
17688
17689         * cs-tokenizer.cs: Remove extra space
17690
17691         * driver.cs: New flag --checked, allows to turn on integer math
17692         checking. 
17693
17694         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17695         Threading.Monitor.Exit 
17696
17697 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17698
17699         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17700         Expression Class to be IndexerAccess.
17701
17702         Notice that Indexer::DoResolve sets the eclass to Value.
17703
17704 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17705
17706         * class.cs (TypeContainer::Emit): Emit code for indexers.
17707
17708         * assign.cs (IAssignMethod): New interface implemented by Indexers
17709         and Properties for handling assignment.
17710
17711         (Assign::Emit): Simplify and reuse code. 
17712
17713         * expression.cs (IndexerAccess, PropertyExpr): Implement
17714         IAssignMethod, clean up old code. 
17715
17716 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17717
17718         * typemanager.cs (ImplementsInterface): New method to determine if a type
17719         implements a given interface. Provides a nice cache too.
17720
17721         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17722         method.
17723
17724         (ConvertReferenceExplicit): Ditto.
17725
17726         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17727         various methods, with correct names etc.
17728
17729         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17730         Operator.UnaryNegation.
17731
17732         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17733         we have a unary plus or minus operator.
17734
17735         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17736         UnaryMinus.
17737
17738         * everywhere : update accordingly.
17739
17740         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17741         respectively.
17742
17743         * class.cs (Method::Define): For the case where we are implementing a method
17744         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17745         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17746
17747 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17748
17749         * interface.cs (FindMembers): Implement to work around S.R.E
17750         lameness.
17751
17752         * typemanager.cs (IsInterfaceType): Implement.
17753
17754         (FindMembers): Update to handle interface types too.
17755
17756         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17757         use IsAssignableFrom as that is not correct - it doesn't work.
17758
17759         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17760         and accordingly override EmitStatement.
17761
17762         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17763         using the correct logic :-)
17764
17765 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17766
17767         * ../errors/cs-11.cs : Add to demonstrate error -11 
17768
17769 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17770
17771         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17772         then pass this as a hint to ResolveLValue.
17773
17774         * expression.cs (FieldExpr): Add Location information
17775
17776         (FieldExpr::LValueResolve): Report assignment to readonly
17777         variable. 
17778
17779         (Expression::ExprClassFromMemberInfo): Pass location information.
17780
17781         (Expression::ResolveLValue): Add new method that resolves an
17782         LValue. 
17783
17784         (Expression::DoResolveLValue): Default invocation calls
17785         DoResolve. 
17786
17787         (Indexers): New class used to keep track of indexers in a given
17788         Type. 
17789
17790         (IStackStore): Renamed from LValue, as it did not really describe
17791         what this did.  Also ResolveLValue is gone from this interface and
17792         now is part of Expression.
17793
17794         (ElementAccess): Depending on the element access type
17795
17796         * typemanager.cs: Add `indexer_name_type' as a Core type
17797         (System.Runtime.CompilerServices.IndexerNameAttribute)
17798
17799         * statement.cs (Goto): Take a location.
17800
17801 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17802
17803         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17804         if two delegates are compatible.
17805
17806         (NewDelegate::DoResolve): Update to take care of the case when
17807         we instantiate a delegate from another delegate.
17808
17809         * typemanager.cs (FindMembers): Don't even try to look up members
17810         of Delegate types for now.
17811
17812 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17813
17814         * delegate.cs (NewDelegate): New class to take care of delegate
17815         instantiation.
17816
17817         * expression.cs (New): Split the delegate related code out into 
17818         the NewDelegate class.
17819
17820         * delegate.cs (DelegateInvocation): New class to handle delegate 
17821         invocation.
17822
17823         * expression.cs (Invocation): Split out delegate related code into
17824         the DelegateInvocation class.
17825
17826 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17827
17828         * expression.cs (New::DoResolve): Implement delegate creation fully
17829         and according to the spec.
17830
17831         (New::DoEmit): Update to handle delegates differently.
17832
17833         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17834         because of which we were printing out arguments in reverse order !
17835
17836         * delegate.cs (VerifyMethod): Implement to check if the given method
17837         matches the delegate.
17838
17839         (FullDelegateDesc): Implement.
17840
17841         (VerifyApplicability): Implement.
17842
17843         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17844         delegate invocations too.
17845
17846         (Invocation::Emit): Ditto.
17847
17848         * ../errors/cs1593.cs : Added.
17849
17850         * ../errors/cs1594.cs : Added.
17851
17852         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17853
17854 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17855
17856         * typemanager.cs (intptr_type): Core type for System.IntPtr
17857
17858         (InitCoreTypes): Update for the same.
17859
17860         (iasyncresult_type, asynccallback_type): Ditto.
17861
17862         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17863         correct.
17864
17865         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17866         too.
17867
17868         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17869         the builders for the 4 members of a delegate type :-)
17870
17871         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17872         type.
17873
17874         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17875
17876         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17877
17878 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17879
17880         * statement.cs (Break::Emit): Implement.   
17881         (Continue::Emit): Implement.
17882
17883         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17884         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17885         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17886         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17887         end loop
17888
17889         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17890         properties that track the label for the current loop (begin of the
17891         loop and end of the loop).
17892
17893 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17894
17895         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17896         use of emitting anything at all.
17897
17898         * class.cs, rootcontext.cs : Get rid of calls to the same.
17899
17900         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17901
17902         (Populate): Define the constructor correctly and set the implementation
17903         attributes.
17904
17905         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17906         have been defined.
17907
17908         (AddDelegateType): Implement.
17909
17910         (IsDelegateType): Implement helper method.
17911
17912         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17913
17914         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17915         and accordingly handle it.
17916
17917         * delegate.cs (Populate): Take TypeContainer argument.
17918         Implement bits to define the Invoke method. However, I still haven't figured out
17919         how to take care of the native int bit :-(
17920
17921         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17922         Qualify the name of the delegate, not its return type !
17923
17924         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17925         conversion.
17926
17927         (StandardConversionExists): Checking for array types turns out to be recursive.
17928
17929         (ConvertReferenceExplicit): Implement array conversion.
17930
17931         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17932
17933 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17934
17935         * cs-parser.jay (delegate_declaration): Store the fully qualified
17936         name as it is a type declaration.
17937
17938         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17939         readonly.
17940
17941         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17942         as TypeContainer::DefineType.
17943
17944         (Populate): Method in which all the definition of the various methods (Invoke)
17945         etc is done.
17946
17947         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17948         see.
17949
17950         (CloseDelegate): Finally creates the delegate.
17951
17952         * class.cs (TypeContainer::DefineType): Update to define delegates.
17953         (Populate, Emit and CloseType): Do the same thing here too.
17954
17955         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17956         delegates in all these operations.
17957
17958 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17959
17960         * expression.cs: LocalTemporary: a new expression used to
17961         reference a temporary that has been created.
17962
17963         * assign.cs: Handle PropertyAccess back here, so that we can
17964         provide the proper semantic access to properties.
17965
17966         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17967         a few more explicit conversions. 
17968
17969         * modifiers.cs: `NEW' modifier maps to HideBySig.
17970
17971         * expression.cs (PropertyExpr): Make this into an
17972         ExpressionStatement, and support the EmitStatement code path. 
17973
17974         Perform get/set error checking, clean up the interface.
17975
17976         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17977         them into toplevel access objects.
17978
17979 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17980
17981         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17982         SRE.
17983
17984         * typemanager.cs: Keep track here of our PropertyBuilders again to
17985         work around lameness in SRE.
17986
17987 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17988
17989         * expression.cs (LValue::LValueResolve): New method in the
17990         interface, used to perform a second resolution pass for LValues. 
17991
17992         (This::DoResolve): Catch the use of this in static methods.
17993
17994         (This::LValueResolve): Implement.
17995
17996         (This::Store): Remove warning, assigning to `this' in structures
17997         is 
17998
17999         (Invocation::Emit): Deal with invocation of
18000         methods on value types.  We need to pass the address to structure
18001         methods rather than the object itself.  (The equivalent code to
18002         emit "this" for structures leaves the entire structure on the
18003         stack instead of a pointer to it). 
18004
18005         (ParameterReference::DoResolve): Compute the real index for the
18006         argument based on whether the method takes or not a `this' pointer
18007         (ie, the method is static).
18008
18009         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18010         value types returned from functions when we need to invoke a
18011         method on the sturcture.
18012
18013
18014 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18015
18016         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18017         defining the type in the Modulebuilder or Typebuilder. This is to take
18018         care of nested types which need to be defined on the TypeBuilder using
18019         DefineNestedMethod.
18020
18021         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18022         methods in RootContext, only ported to be part of TypeContainer.
18023
18024         (TypeContainer::GetInterfaceOrClass): Ditto.
18025
18026         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18027
18028         * interface.cs (Interface::DefineInterface): New method. Does exactly
18029         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18030         too.
18031
18032         (Interface::GetInterfaces): Move from RootContext here and port.
18033
18034         (Interface::GetInterfaceByName): Same here.
18035
18036         * rootcontext.cs (ResolveTree): Re-write.
18037
18038         (PopulateTypes): Re-write.
18039
18040         * class.cs (TypeContainer::Populate): Populate nested types too.
18041         (TypeContainer::Emit): Emit nested members too.
18042
18043         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18044         instead just use the name argument passed in as it is already fully
18045         qualified.
18046
18047         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18048         to TypeContainer mapping to see if a type is user-defined.
18049
18050         * class.cs (TypeContainer::CloseType): Implement. 
18051
18052         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18053         the default constructor.
18054
18055         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18056         twice.
18057
18058         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18059
18060         * interface.cs (CloseType): Create the type here.
18061
18062         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18063         the hierarchy.
18064
18065         Remove all the methods which are now in TypeContainer.
18066
18067 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18068
18069         * delegate.cs (Define): Re-write bits to define the delegate
18070         correctly.
18071
18072 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18073
18074         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18075
18076         * expression.cs (ImplicitReferenceConversion): handle null as well
18077         as a source to convert to any reference type.
18078
18079         * statement.cs (Return): Perform any implicit conversions to
18080         expected return type.  
18081
18082         Validate use of return statement.  
18083
18084         * codegen.cs (EmitContext): Pass the expected return type here.
18085
18086         * class.cs (Method, Constructor, Property): Pass expected return
18087         type to EmitContext.
18088
18089 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18090
18091         * expression.cs: Make DoResolve take an EmitContext instead of a
18092         TypeContainer.
18093
18094         Replaced `l' and `location' for `loc', for consistency.
18095
18096         (Error, Warning): Remove unneeded Tc argument.
18097
18098         * assign.cs, literal.cs, constant.cs: Update to new calling
18099         convention. 
18100
18101         * codegen.cs: EmitContext now contains a flag indicating whether
18102         code is being generated in a static method or not.
18103
18104         * cs-parser.jay: DecomposeQI, new function that replaces the old
18105         QualifiedIdentifier.  Now we always decompose the assembled
18106         strings from qualified_identifier productions into a group of
18107         memberaccesses.
18108
18109 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18110
18111         * rootcontext.cs: Deal with field-less struct types correctly now
18112         by passing the size option to Define Type.
18113
18114         * class.cs: Removed hack that created one static field. 
18115
18116 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18117
18118         * statement.cs: Moved most of the code generation here. 
18119
18120 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18121
18122         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18123         seem very right.
18124
18125         (ElementAccess): Remove useless bits for now - keep checks as the spec
18126         says.
18127
18128 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18129
18130         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18131         and start performing checks according to the spec.
18132
18133 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18134
18135         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18136         rank_specifiers instead.
18137
18138         (rank_specifiers): Change the order in which the rank specifiers are stored
18139
18140         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18141
18142         * expression.cs (ElementAccess): Implement the LValue interface too.
18143
18144 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18145
18146         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18147         except that user defined conversions are not included.
18148
18149         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18150         perform the conversion of the return type, if necessary.
18151
18152         (New::DoResolve): Check whether we are creating an array or an object
18153         and accordingly do the needful.
18154
18155         (New::Emit): Same here.
18156
18157         (New::DoResolve): Implement guts of array creation.
18158
18159         (New::FormLookupType): Helper function.
18160
18161 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18162
18163         * codegen.cs: Removed most of the code generation here, and move the
18164         corresponding code generation bits to the statement classes. 
18165
18166         Added support for try/catch/finalize and throw.
18167
18168         * cs-parser.jay: Added support for try/catch/finalize.
18169
18170         * class.cs: Catch static methods having the flags override,
18171         virtual or abstract.
18172
18173         * expression.cs (UserCast): This user cast was not really doing
18174         what it was supposed to do.  Which is to be born in fully resolved
18175         state.  Parts of the resolution were being performed at Emit time! 
18176
18177         Fixed this code.
18178
18179 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18180
18181         * expression.cs: Implicity convert the result from UserCast.
18182
18183 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18184
18185         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18186         prevented it from working correctly. 
18187
18188         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18189         merely ConvertImplicit.
18190
18191 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18192
18193         * typemanager.cs: Make the LookupTypeContainer function static,
18194         and not per-instance.  
18195
18196         * class.cs: Make static FindMembers (the one that takes a Type
18197         argument). 
18198
18199         * codegen.cs: Add EmitForeach here.
18200
18201         * cs-parser.jay: Make foreach a toplevel object instead of the
18202         inline expansion, as we need to perform semantic analysis on it. 
18203
18204 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18205
18206         * expression.cs (Expression::ImplicitUserConversion): Rename to
18207         UserDefinedConversion.
18208
18209         (Expression::UserDefinedConversion): Take an extra argument specifying 
18210         whether we look for explicit user conversions too.
18211
18212         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18213
18214         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18215
18216         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18217         with the appropriate arguments.
18218
18219         * cs-parser.jay (cast_expression): Record location too.
18220
18221         * expression.cs (Cast): Record location info.
18222
18223         (Expression::ConvertExplicit): Take location argument.
18224
18225         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18226         to determine if we are doing explicit conversions.
18227
18228         (UserCast::Emit): Update accordingly.
18229
18230         (Expression::ConvertExplicit): Report an error if everything fails.
18231
18232         * ../errors/cs0030.cs : Add.
18233
18234 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18235
18236         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18237         virtual and newslot bits. 
18238
18239         * class.cs (TypeContainer::RegisterRequiredImplementations):
18240         Record methods we need.
18241
18242         (TypeContainer::MakeKey): Helper function to make keys for
18243         MethodBases, since the Methodbase key is useless.
18244
18245         (TypeContainer::Populate): Call RegisterRequiredImplementations
18246         before defining the methods.   
18247
18248         Create a mapping for method_builders_to_methods ahead of time
18249         instead of inside a tight loop.
18250
18251         (::RequireMethods):  Accept an object as the data to set into the
18252         hashtable so we can report interface vs abstract method mismatch.
18253
18254 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18255
18256         * report.cs: Make all of it static.
18257
18258         * rootcontext.cs: Drop object_type and value_type computations, as
18259         we have those in the TypeManager anyways.
18260
18261         Drop report instance variable too, now it is a global.
18262
18263         * driver.cs: Use try/catch on command line handling.
18264
18265         Add --probe option to debug the error reporting system with a test
18266         suite. 
18267
18268         * report.cs: Add support for exiting program when a probe
18269         condition is reached.
18270
18271 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18272
18273         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18274         we do a forcible conversion regardless of type, to check if 
18275         ForceConversion returns a null.
18276
18277         (Binary::error19): Use location to report error.
18278
18279         (Unary::error23): Use location here too.
18280
18281         * ../errors/cs0019.cs : Check in.
18282
18283         * ../errors/cs0023.cs : Check in.
18284
18285         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18286         case of a non-null MethodInfo object with a length of 0 !
18287
18288         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18289         an applicable member - according to the spec :-)
18290         Also fix logic to find members in base types.
18291
18292         (Unary::ResolveOperator): Same here.
18293
18294         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18295         as I was getting thoroughly confused between this and error19 :-)
18296
18297         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18298         (::FindMostEncompassedType): Implement.
18299         (::FindMostEncompassingType): Implement.
18300         (::StandardConversionExists): Implement.
18301
18302         (UserImplicitCast): Re-vamp. We now need info about most specific
18303         source and target types so that we can do the necessary conversions.
18304
18305         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18306         mathematical union with no duplicates.
18307
18308 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18309
18310         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18311         in order from base classes to child classes, so that we can in
18312         child classes look up in our parent for method names and
18313         attributes (required for handling abstract, virtual, new, override
18314         constructs: we need to instrospect our base class, and if we dont
18315         populate the classes in order, the introspection might be
18316         incorrect.  For example, a method could query its parent before
18317         the parent has any methods and would determine that the parent has
18318         no abstract methods (while it could have had them)).
18319
18320         (RootContext::CreateType): Record the order in which we define the
18321         classes.
18322
18323 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18324
18325         * class.cs (TypeContainer::Populate): Also method definitions can
18326         fail now, keep track of this.
18327
18328         (TypeContainer::FindMembers): Implement support for
18329         DeclaredOnly/noDeclaredOnly flag.
18330
18331         (Constructor::Emit) Return the ConstructorBuilder.
18332
18333         (Method::Emit) Return the MethodBuilder. 
18334         Check for abstract or virtual methods to be public.
18335
18336         * rootcontext.cs (RootContext::CreateType): Register all the
18337         abstract methods required for the class to be complete and the
18338         interface methods that must be implemented. 
18339
18340         * cs-parser.jay: Report error 501 (method requires body if it is
18341         not marked abstract or extern).
18342
18343         * expression.cs (TypeOf::Emit): Implement.
18344
18345         * typemanager.cs: runtime_handle_type, new global type.
18346
18347         * class.cs (Property::Emit): Generate code for properties.
18348
18349 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18350
18351         * expression.cs (Unary::ResolveOperator): Find operators on base type
18352         too - we now conform exactly to the spec.
18353
18354         (Binary::ResolveOperator): Same here.
18355
18356         * class.cs (Operator::Define): Fix minor quirk in the tests.
18357
18358         * ../errors/cs0215.cs : Added.
18359
18360         * ../errors/cs0556.cs : Added.
18361
18362         * ../errors/cs0555.cs : Added.
18363
18364 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18365
18366         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18367         single integer which is really efficient
18368
18369 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18370
18371         *  expression.cs (Expression::ImplicitUserConversion): Use location
18372         even in the case when we are examining True operators.
18373  
18374         * class.cs (Operator::Define): Perform extensive checks to conform
18375         with the rules for operator overloading in the spec.
18376
18377         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18378         some of the other conversions mentioned in the spec.
18379
18380         * typemanager.cs (array_type): New static member for the System.Array built-in
18381         type.
18382
18383         (cloneable_interface): For System.ICloneable interface.
18384
18385         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18386         we start resolving the tree and populating types.
18387
18388         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18389  
18390 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18391
18392         * expression.cs (Expression::ExprClassFromMemberInfo,
18393         Expression::Literalize): Create literal expressions from
18394         FieldInfos which are literals.
18395
18396         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18397         type casts, because they were wrong.  The test suite in tests
18398         caught these ones.
18399
18400         (ImplicitNumericConversion): ushort to ulong requires a widening
18401         cast. 
18402
18403         Int32 constant to long requires widening cast as well.
18404
18405         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18406         for integers because the type on the stack is not i4.
18407
18408 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18409
18410         * expression.cs (report118): require location argument. 
18411
18412         * parameter.cs: Do not dereference potential null value.
18413
18414         * class.cs: Catch methods that lack the `new' keyword when
18415         overriding a name.  Report warnings when `new' is used without
18416         anything being there to override.
18417
18418         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18419
18420         * class.cs: Only add constructor to hashtable if it is non-null
18421         (as now constructors can fail on define).
18422
18423         (TypeManager, Class, Struct): Take location arguments.
18424
18425         Catch field instance initialization in structs as errors.
18426
18427         accepting_filter: a new filter for FindMembers that is static so
18428         that we dont create an instance per invocation.
18429
18430         (Constructor::Define): Catch errors where a struct constructor is
18431         parameterless 
18432
18433         * cs-parser.jay: Pass location information for various new
18434         constructs. 
18435
18436         * delegate.cs (Delegate): take a location argument.
18437
18438         * driver.cs: Do not call EmitCode if there were problesm in the
18439         Definition of the types, as many Builders wont be there. 
18440
18441         * decl.cs (Decl::Decl): Require a location argument.
18442
18443         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18444         into integers, and find the most appropiate integer for it.
18445
18446         * literal.cs: Implement ULongLiteral.
18447
18448         * rootcontext.cs: Provide better information about the location of
18449         failure when CreateType fails.
18450
18451 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18452
18453         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18454         as well.
18455
18456         * expression.cs (Binary::CheckShiftArguments): Add missing type
18457         computation.
18458         (Binary::ResolveOperator): Add type to the logical and and logical
18459         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18460         before.
18461
18462         (Binary::DoNumericPromotions): In the case where either argument
18463         is ulong (and most signed types combined with ulong cause an
18464         error) perform implicit integer constant conversions as well.
18465
18466 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18467
18468         * expression.cs (UserImplicitCast): Method should always be
18469         non-null. 
18470         (Invocation::BetterConversion): Simplified test for IntLiteral.
18471
18472         (Expression::ImplicitNumericConversion): Split this routine out.
18473         Put the code that performs implicit constant integer conversions
18474         here. 
18475
18476         (Expression::Resolve): Become a wrapper around DoResolve so we can
18477         check eclass and type being set after resolve.
18478
18479         (Invocation::Badness): Remove this dead function
18480
18481         (Binary::ResolveOperator): Do not compute the expensive argumnets
18482         unless we have a union for it.
18483
18484         (Probe::Emit): Is needs to do an isinst and then
18485         compare against null.
18486
18487         (::CanConvert): Added Location argument.  If the Location argument
18488         is null (Location.Null), then we do not report errors.  This is
18489         used by the `probe' mechanism of the Explicit conversion.  We do
18490         not want to generate an error for something that the user
18491         explicitly requested to be casted.  But the pipeline for an
18492         explicit cast first tests for potential implicit casts.
18493
18494         So for now, if the Location is null, it means `Probe only' to
18495         avoid adding another argument.   Might have to revise this
18496         strategy later.
18497
18498         (ClassCast): New class used to type cast objects into arbitrary
18499         classes (used in Explicit Reference Conversions).
18500
18501         Implement `as' as well.
18502
18503         Reverted all the patches from Ravi below: they were broken:
18504
18505                 * The use of `level' as a mechanism to stop recursive
18506                   invocations is wrong.  That was there just to catch the
18507                   bug with a strack trace but not as a way of addressing
18508                   the problem.
18509
18510                   To fix the problem we have to *understand* what is going
18511                   on and the interactions and come up with a plan, not
18512                   just get things going.
18513
18514                 * The use of the type conversion cache that I proposed
18515                   last night had an open topic: How does this work across
18516                   protection domains.  A user defined conversion might not
18517                   be public in the location where we are applying the
18518                   conversion, a different conversion might be selected
18519                   (ie, private A->B (better) but public B->A (worse),
18520                   inside A, A->B applies, but outside it, B->A will
18521                   apply).
18522
18523                 * On top of that (ie, even if the above is solved),
18524                   conversions in a cache need to be abstract.  Ie, `To
18525                   convert from an Int to a Short use an OpcodeCast', not
18526                   `To convert from an Int to a Short use the OpcodeCast on
18527                   the variable 5' (which is what this patch was doing).
18528
18529 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18530
18531         * expression.cs (Invocation::ConversionExists): Re-write to use
18532         the conversion cache
18533
18534         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18535         cache all conversions done, not just user-defined ones.
18536
18537         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18538         to determine if a conversion exists instead of acutually trying to 
18539         perform the conversion. It's faster too.
18540
18541         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18542         and only then attempt the implicit conversion.
18543
18544 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18545
18546         * expression.cs (ConvertImplicit): Use a cache for conversions
18547         already found. Check level of recursion and bail out if necessary.
18548
18549 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18550
18551         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18552         Export standard methods that we expect for string operations.
18553
18554         * statement.cs (Block::UsageWarning): Track usage of variables and
18555         report the errors for not used variables.
18556
18557         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18558         operator. 
18559
18560 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18561
18562         * codegen.cs: remove unnneded code 
18563
18564         * expression.cs: Removed BuiltinTypeAccess class
18565
18566         Fix the order in which implicit conversions are
18567         done.  
18568
18569         The previous fixed dropped support for boxed conversions (adding a
18570         test to the test suite now)
18571
18572         (UserImplicitCast::CanConvert): Remove test for source being null,
18573         that code is broken.  We should not feed a null to begin with, if
18574         we do, then we should track the bug where the problem originates
18575         and not try to cover it up here.
18576
18577         Return a resolved expression of type UserImplicitCast on success
18578         rather than true/false.  Ravi: this is what I was talking about,
18579         the pattern is to use a static method as a "constructor" for
18580         objects. 
18581
18582         Also, do not create arguments until the very last minute,
18583         otherwise we always create the arguments even for lookups that
18584         will never be performed. 
18585
18586         (UserImplicitCast::Resolve): Eliminate, objects of type
18587         UserImplicitCast are born in a fully resolved state. 
18588
18589         * typemanager.cs (InitCoreTypes): Init also value_type
18590         (System.ValueType). 
18591
18592         * expression.cs (Cast::Resolve): First resolve the child expression.
18593
18594         (LValue): Add new method AddressOf to be used by
18595         the `&' operator.  
18596
18597         Change the argument of Store to take an EmitContext instead of an
18598         ILGenerator, because things like FieldExpr need to be able to call
18599         their children expression to generate the instance code. 
18600
18601         (Expression::Error, Expression::Warning): Sugar functions for
18602         reporting errors.
18603
18604         (Expression::MemberLookup): Accept a TypeContainer instead of a
18605         Report as the first argument.
18606
18607         (Expression::ResolvePrimary): Killed.  I still want to improve
18608         this as currently the code is just not right.
18609
18610         (Expression::ResolveMemberAccess): Simplify, but it is still
18611         wrong. 
18612
18613         (Unary::Resolve): Catch errors in AddressOf operators.
18614
18615         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18616         index to a byte for the short-version, or the compiler will choose
18617         the wrong Emit call, which generates the wrong data.
18618
18619         (ParameterReference::Emit, ::Store): same.
18620
18621         (FieldExpr::AddressOf): Implement.
18622
18623         * typemanager.cs: TypeManager: made public variable instead of
18624         property.
18625
18626         * driver.cs: document --fatal.
18627
18628         * report.cs (ErrorMessage, WarningMessage): new names for the old
18629         Error and Warning classes.
18630
18631         * cs-parser.jay (member_access): Turn built-in access to types
18632         into a normal simplename
18633
18634 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18635
18636         * expression.cs (Invocation::BetterConversion): Fix to cope
18637         with q being null, since this was introducing a bug.
18638
18639         * expression.cs (ConvertImplicit): Do built-in conversions first.
18640
18641 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18642
18643         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18644
18645 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18646
18647         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18648         I had introduced long ago (what's new ?).
18649
18650         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18651         the work of all the checking. 
18652         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18653         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18654
18655         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18656         that is the right way. 
18657
18658         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18659         overloading resolution. Use everywhere instead of cutting and pasting code.
18660
18661         (Binary::ResolveOperator): Use MakeUnionSet.
18662
18663         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18664         we have to convert to bool types. Not complete yet.
18665
18666 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18667
18668         * typemanager.cs (TypeManager::CSharpName): support ushort.
18669
18670         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18671         to provide an expression that performsn an implicit constant int
18672         conversion (section 6.1.6).
18673         (Expression::ConvertImplicitRequired): Reworked to include
18674         implicit constant expression conversions.
18675
18676         (Expression::ConvertNumericExplicit): Finished.
18677
18678         (Invocation::Emit): If InstanceExpression is null, then it means
18679         that we perform a call on this.
18680
18681 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18682
18683         * expression.cs (Unary::Emit): Remove some dead code.
18684         (Probe): Implement Resolve and Emit for `is'.
18685         (Expression::ConvertImplicitRequired): Attempt to do constant
18686         expression conversions here.  Maybe should be moved to
18687         ConvertImplicit, but I am not sure.
18688         (Expression::ImplicitLongConstantConversionPossible,
18689         Expression::ImplicitIntConstantConversionPossible): New functions
18690         that tell whether is it possible to apply an implicit constant
18691         expression conversion.
18692
18693         (ConvertNumericExplicit): Started work on explicit numeric
18694         conversions.
18695
18696         * cs-parser.jay: Update operator constants.
18697
18698         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18699         (Parameters::GetSignature): Hook up VerifyArgs here.
18700         (Parameters::VerifyArgs): Verifies that no two arguments have the
18701         same name. 
18702
18703         * class.cs (Operator): Update the operator names to reflect the
18704         ones that the spec expects (as we are just stringizing the
18705         operator names).
18706
18707         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18708         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18709         previous usage did only work for our methods.
18710         (Expression::ConvertImplicit): Handle decimal implicit numeric
18711         conversions as well.
18712         (Expression::InternalTypeConstructor): Used to invoke constructors
18713         on internal types for default promotions.
18714
18715         (Unary::Emit): Implement special handling for the pre/post
18716         increment/decrement for overloaded operators, as they need to have
18717         the same semantics as the other operators.
18718
18719         (Binary::ResolveOperator): ditto.
18720         (Invocation::ConversionExists): ditto.
18721         (UserImplicitCast::Resolve): ditto.
18722
18723 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18724
18725         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18726         operator, return after emitting body. Regression tests pass again !
18727
18728         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18729         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18730         (Invocation::OverloadResolve): Ditto.
18731         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18732
18733         * everywhere : update calls to the above methods accordingly.
18734
18735 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18736
18737         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18738
18739         * expression.cs (ExpressionStatement): New base class used for
18740         expressions that can appear in statements, so that we can provide
18741         an alternate path to generate expression that do not leave a value
18742         on the stack.
18743
18744         (Expression::Emit, and all the derivatives): We no longer return
18745         whether a value is left on the stack or not.  Every expression
18746         after being emitted leaves a single value on the stack.
18747
18748         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18749         facilties of ExpressionStatement if possible.
18750
18751         * cs-parser.jay: Update statement_expression.
18752
18753 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18754
18755         * driver.cs: Change the wording of message
18756
18757 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18758
18759         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18760         the type of the expression to the return type of the method if
18761         we have an overloaded operator match ! The regression tests pass again !
18762         (Unary::ResolveOperator): Ditto.
18763
18764         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18765         to find "op_Implicit", not "implicit" ;-)
18766         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18767         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18768
18769         * everywhere : Correct calls to the above accordingly.
18770
18771         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18772         (ConvertImplicit): Do user-defined conversion if it exists.
18773
18774 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18775
18776         * assign.cs: track location.
18777         (Resolve): Use implicit conversions on assignment.
18778
18779         * literal.cs: Oops.  Not good, Emit of short access values should
18780         pass (Bytes) or the wrong argument will be selected.
18781
18782         * expression.cs (Unary::Emit): Emit code for -expr.
18783
18784         (Unary::ResolveOperator): Handle `Substract' for non-constants
18785         (substract from zero from the non-constants).
18786         Deal with Doubles as well. 
18787
18788         (Expression::ConvertImplicitRequired): New routine that reports an
18789         error if no implicit conversion exists. 
18790
18791         (Invocation::OverloadResolve): Store the converted implicit
18792         expressions if we make them
18793
18794 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18795
18796         * class.cs (ConstructorInitializer): Take a Location argument.
18797         (ConstructorBaseInitializer): Same here.
18798         (ConstructorThisInitializer): Same here.
18799
18800         * cs-parser.jay : Update all calls accordingly.
18801
18802         * expression.cs (Unary, Binary, New): Take location argument.
18803         Update accordingly everywhere.
18804
18805         * cs-parser.jay : Update all calls to the above to take a location
18806         argument.
18807
18808         * class.cs : Ditto.
18809
18810 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18811
18812         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18813         (Invocation::BetterConversion): Same here
18814         (Invocation::ConversionExists): Ditto.
18815
18816         (Invocation::ConversionExists): Implement.
18817
18818 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18819
18820         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18821         Also take an additional TypeContainer argument.
18822
18823         * All over : Pass in TypeContainer as argument to OverloadResolve.
18824
18825         * typemanager.cs (CSharpName): Update to check for the string type and return
18826         that too.
18827
18828         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18829         a given method.
18830
18831 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18832
18833         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18834         (Invocation::BetterFunction): Implement.
18835         (Invocation::BetterConversion): Implement.
18836         (Invocation::ConversionExists): Skeleton, no implementation yet.
18837
18838         Okay, things work fine !
18839
18840 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18841
18842         * typemanager.cs: declare and load enum_type, delegate_type and
18843         void_type. 
18844
18845         * expression.cs (Expression::Emit): Now emit returns a value that
18846         tells whether a value is left on the stack or not.  This strategy
18847         might be reveted tomorrow with a mechanism that would address
18848         multiple assignments.
18849         (Expression::report118): Utility routine to report mismatches on
18850         the ExprClass.
18851
18852         (Unary::Report23): Report impossible type/operator combination
18853         utility function.
18854
18855         (Unary::IsIncrementableNumber): Whether the type can be
18856         incremented or decremented with add.
18857         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18858         complemented. 
18859         (Unary::ResolveOperator): Implement ++, !, ~,
18860
18861         (Invocation::Emit): Deal with new Emit convetion.
18862
18863         * All Expression derivatives: Updated their Emit method to return
18864         whether they leave values on the stack or not.
18865
18866         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18867         stack for expressions that are statements. 
18868
18869 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18870
18871         * expression.cs (LValue): New interface.  Must be implemented by
18872         LValue objects.
18873         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18874         LValue interface.
18875
18876         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18877         interface for generating code, simplifies the code.
18878
18879 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18880
18881         * expression.cs (everywhere): Comment out return statements in ::Resolve
18882         methods to avoid the warnings.
18883
18884 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18885
18886         * driver.cs (parse): Report error 2001 if we can not open the
18887         source file.
18888
18889         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18890         not resolve it.
18891
18892         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18893         object. 
18894
18895         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18896         otherwise nested blocks end up with the same index.
18897
18898         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18899
18900         * expression.cs:  Instead of having FIXMEs in the Resolve
18901         functions, throw exceptions so it is obvious that we are facing a
18902         bug. 
18903
18904         * cs-parser.jay (invocation_expression): Pass Location information.
18905
18906         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18907         Use a basename for those routines because .NET does not like paths
18908         on them. 
18909
18910         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18911         already defined.
18912
18913 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18914
18915         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18916         are loading the correct data types (throws an exception if not).
18917         (TypeManager::InitCoreTypes): Use CoreLookupType
18918
18919         * expression.cs (Unary::ResolveOperator): return the child
18920         expression for expressions which are just +expr.
18921         (Unary::ResolveOperator): Return negative literals for -LITERAL
18922         expressions (otherwise they are Unary {Literal}).
18923         (Invocation::Badness): Take into account `Implicit constant
18924         expression conversions'.
18925
18926         * literal.cs (LongLiteral): Implement long literal class.
18927         (IntLiteral): export the `Value' of the intliteral. 
18928
18929 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18930
18931         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18932
18933         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18934         instead of 'Operator'
18935
18936         * expression.cs (Binary::ResolveOperator): Update accordingly.
18937         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18938         and 'Minus'
18939
18940         * cs-parser.jay (unary_expression): Update to use the new names.
18941
18942         * gen-treedump.cs (GetUnary): Same here.
18943
18944         * expression.cs (Unary::Resolve): Implement.
18945         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18946         operators are found instead of making noise ;-)
18947         (Unary::ResolveOperator): New method to do precisely the same thing which
18948         Binary::ResolveOperator does for Binary expressions.
18949         (Unary.method, .Arguments): Add.
18950         (Unary::OperName): Implement.   
18951         (Unary::ForceConversion): Copy and Paste !
18952
18953         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18954         a unary operator.
18955
18956         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18957         for the inbuilt operators. Only overloading works for now ;-)
18958
18959 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18960
18961         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18962         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18963
18964         * expression.cs (This::Emit): Implement. 
18965         (This::Resolve): Implement.
18966         (TypeOf:Resolve): Implement.
18967         (Expression::ResolveSimpleName): Add an implicit this to instance
18968         field references. 
18969         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18970         Bind instance variable to Field expressions.
18971         (FieldExpr::Instance): New field used to track the expression that
18972         represents the object instance.
18973         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18974         binding 
18975         (FieldExpr::Emit): Implement.
18976
18977         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18978         the last instruction contains a return opcode to avoid generating
18979         the last `ret' instruction (this generates correct code, and it is
18980         nice to pass the peverify output).
18981
18982         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18983         initializer for static and instance variables.
18984         (Constructor::Emit): Allow initializer to be null in the case of
18985         static constructors.  Only emit initializer for instance
18986         constructors. 
18987
18988         (TypeContainer::FindMembers): Return a null array if there are no
18989         matches.
18990
18991         Also fix the code for the MemberTypes.Method branch, as it was not
18992         scanning that for operators (or tried to access null variables before).
18993
18994         * assign.cs (Assign::Emit): Handle instance and static fields. 
18995
18996         * TODO: Updated.
18997
18998         * driver.cs: Stop compilation if there are parse errors.
18999
19000         * cs-parser.jay (constructor_declaration): Provide default base
19001         initializer for non-static constructors.
19002         (constructor_declarator): Do not provide a default base
19003         initializers if none was specified.
19004         Catch the fact that constructors should not have parameters.
19005
19006         * class.cs: Do not emit parent class initializers for static
19007         constructors, that should be flagged as an error.
19008
19009 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19010
19011         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19012         Move back code into TypeContainer::Populate.
19013
19014 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19015
19016         * class.cs (TypeContainer::AddConstructor): Fix the check to
19017         compare against Name, not Basename. 
19018         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19019
19020         * cs-parser.jay : Update accordingly.
19021
19022         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19023         for methods, don't forget to look into the operators too.
19024         (RegisterMethodBuilder): Helper method to take care of this for
19025         methods, constructors and operators.
19026         (Operator::Define): Completely revamp.
19027         (Operator.OperatorMethod, MethodName): New fields.
19028         (TypeContainer::Populate): Move the registering of builders into
19029         RegisterMethodBuilder.
19030         (Operator::Emit): Re-write.
19031
19032         * expression.cs (Binary::Emit): Comment out code path to emit method
19033         invocation stuff for the case when we have a user defined operator. I am
19034         just not able to get it right !
19035
19036 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19037
19038         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19039         argument. 
19040
19041         (Expression::MemberLookup): Provide a version that allows to
19042         specify the MemberTypes and BindingFlags. 
19043
19044         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19045         so it was not fetching variable information from outer blocks.
19046
19047         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19048         Beforefieldinit as it was buggy.
19049
19050         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19051         that Ravi put here.  
19052
19053         * class.cs (Constructor::Emit): Only emit if block is not null.
19054         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19055         deal with this by semantically definining it as if the user had
19056         done it.
19057
19058         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19059         constructors as we now "emit" them at a higher level.
19060
19061         (TypeContainer::DefineDefaultConstructor): Used to define the
19062         default constructors if none was provided.
19063
19064         (ConstructorInitializer): Add methods Resolve and Emit. 
19065
19066         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19067
19068 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19069
19070         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19071         the default constructor builder with our hashtable for methodbuilders
19072         to methodcores.
19073
19074         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19075         and argument_count is 0 in which case we have a match.
19076         (Binary::ResolveOperator): More null checking and miscellaneous coding
19077         style cleanup.
19078
19079 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19080
19081         * rootcontext.cs (IsNameSpace): Compare against null.
19082
19083         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19084
19085         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19086         and Unary::Operator.
19087
19088         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19089         accordingly.
19090
19091         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19092         we have overloaded operators.
19093         (Binary::ResolveOperator): Implement the part which does the operator overload
19094         resolution.
19095
19096         * class.cs (Operator::Emit): Implement.
19097         (TypeContainer::Emit): Emit the operators we have too.
19098
19099         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19100         the case when we have a user-defined operator.
19101
19102 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19103
19104         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19105
19106 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19107
19108         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19109         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19110         (Constructor::Emit): Implement.
19111         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19112         if we have no work to do. 
19113         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19114         Emit method.
19115
19116         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19117         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19118
19119         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19120         of parent.parent.
19121
19122 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19123
19124         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19125         in the source.
19126         (Tree::RecordNamespace): Method to do what the name says ;-)
19127         (Tree::Namespaces): Property to get at the namespaces hashtable.
19128
19129         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19130         keep track.
19131
19132         * rootcontext.cs (IsNamespace): Fixed it :-)
19133
19134 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19135
19136         * class.cs (TypeContainer::FindMembers): Add support for
19137         constructors. 
19138         (MethodCore): New class that encapsulates both the shared aspects
19139         of a Constructor and a Method.  
19140         (Method, Constructor): Factored pieces into MethodCore.
19141
19142         * driver.cs: Added --fatal which makes errors throw exceptions.
19143         Load System assembly as well as part of the standard library.
19144
19145         * report.cs: Allow throwing exceptions on errors for debugging.
19146
19147         * modifiers.cs: Do not use `parent', instead use the real type
19148         container to evaluate permission settings.
19149
19150         * class.cs: Put Ravi's patch back in.  He is right, and we will
19151         have to cope with the
19152
19153 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19154
19155         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19156         FamORAssem, not FamANDAssem.
19157
19158 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19159
19160         * driver.cs: Added --parse option that only parses its input files
19161         and terminates.
19162
19163         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19164         incorrect.  IsTopLevel is not used to tell whether an object is
19165         root_types or not (that can be achieved by testing this ==
19166         root_types).  But to see if this is a top-level *class* (not
19167         necessarly our "toplevel" container). 
19168
19169 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19170
19171         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19172         parent instead of a direct call to GetType.
19173
19174 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19175
19176         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19177         Modifiers.TypeAttr. This should just be a call to that method.
19178
19179         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19180         object so that we can determine if we are top-level or not.
19181
19182         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19183         TypeContainer too.
19184
19185         * enum.cs (Enum::Define): Ditto.
19186
19187         * modifiers.cs (FieldAttr): Re-write.
19188
19189         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19190         (TypeContainer::HaveStaticConstructor): New property to provide access
19191         to precisely that info.
19192
19193         * modifiers.cs (MethodAttr): Re-write.
19194         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19195
19196         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19197         of top-level types as claimed.
19198
19199 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19200
19201         * expression.cs (MemberLookup): Fruitless attempt to lookup
19202         constructors.  Maybe I need to emit default constructors?  That
19203         might be it (currently .NET emits this for me automatically).
19204         (Invocation::OverloadResolve): Cope with Arguments == null.
19205         (Invocation::EmitArguments): new function, shared by the new
19206         constructor and us.
19207         (Invocation::Emit): Handle static and instance methods.  Emit
19208         proper call instruction for virtual or non-virtual invocations.
19209         (New::Emit): Implement.
19210         (New::Resolve): Implement.
19211         (MemberAccess:Resolve): Implement.
19212         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19213         to track instances.
19214         (FieldExpr::Resolve): Set type.
19215
19216         * support.cs: Handle empty arguments.
19217                 
19218         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19219         SimpleLookup): Auxiliary routines to help parse a qualifier
19220         identifier.  
19221
19222         Update qualifier_identifier rule.
19223
19224         * codegen.cs: Removed debugging messages.
19225
19226         * class.cs: Make this a global thing, this acts just as a "key" to
19227         objects that we might have around.
19228
19229         (Populate): Only initialize method_builders_to_methods once.
19230
19231         * expression.cs (PropertyExpr): Initialize type from the
19232         PropertyType. 
19233
19234         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19235         Resolve pattern.  Attempt to implicitly convert value to boolean.
19236         Emit code.
19237
19238         * expression.cs: Set the type for the int32/int32 argument case.
19239         (Binary::ResolveOperator): Set the return type to boolean for
19240         comparission operators
19241
19242         * typemanager.cs: Remove debugging print code.
19243
19244         (Invocation::Resolve): resolve type.
19245
19246         * class.cs: Allocate a MemberInfo of the correct size, as the code
19247         elsewhere depends on the test to reflect the correct contents.
19248
19249         (Method::) Keep track of parameters, due to System.Reflection holes
19250
19251         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19252         mapping here.
19253
19254         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19255         of the exact size and return that.
19256
19257         (Class::LookupMethodByBuilder): New function that maps
19258         MethodBuilders to its methods.  Required to locate the information
19259         on methods because System.Reflection bit us again.
19260
19261         * support.cs: New file, contains an interface ParameterData and
19262         two implementations: ReflectionParameters and InternalParameters
19263         used to access Parameter information.  We will need to grow this
19264         as required.
19265
19266         * expression.cs (Invocation::GetParameterData): implement a cache
19267         and a wrapper around the ParameterData creation for methods. 
19268         (Invocation::OverloadResolve): Use new code.
19269
19270 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19271
19272         * class.cs (TypeContainer::EmitField): Remove and move into 
19273         (Field::Define): here and modify accordingly.
19274         (Field.FieldBuilder): New member.
19275         (TypeContainer::Populate): Update accordingly.
19276         (TypeContainer::FindMembers): Implement.
19277
19278 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19279
19280         * statement.cs: (VariableInfo::VariableType): New field to be
19281         initialized with the full type once it is resolved. 
19282
19283 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19284
19285         * parameter.cs (GetParameterInfo): Use a type cache to compute
19286         things only once, and to reuse this information
19287
19288         * expression.cs (LocalVariableReference::Emit): Implement.
19289         (OpcodeCast::Emit): fix.
19290
19291         (ParameterReference::Resolve): Implement.
19292         (ParameterReference::Emit): Implement.
19293
19294         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19295         that are expressions need to stay as Expressions.
19296
19297         * typemanager.cs (CSharpName): Returns the C# name of a type if
19298         possible. 
19299
19300         * expression.cs (Expression::ConvertImplicit): New function that
19301         implements implicit type conversions.
19302
19303         (Expression::ImplicitReferenceConversion): Implements implicit
19304         reference conversions.
19305
19306         (EmptyCast): New type for transparent casts.
19307
19308         (OpcodeCast): New type for casts of types that are performed with
19309         a sequence of bytecodes.
19310
19311         (BoxedCast): New type used for casting value types into reference
19312         types.  Emits a box opcode.
19313
19314         (Binary::DoNumericPromotions): Implements numeric promotions of
19315         and computation of the Binary::Type.
19316
19317         (Binary::EmitBranchable): Optimization.
19318
19319         (Binary::Emit): Implement code emission for expressions.
19320
19321         * typemanager.cs (TypeManager): Added two new core types: sbyte
19322         and byte.
19323
19324 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19325
19326         * class.cs (TypeContainer::FindMembers): Method which does exactly
19327         what Type.FindMembers does, only we don't have to use reflection. No
19328         implementation yet.
19329
19330         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19331         typecontainer objects as we need to get at them.
19332         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19333
19334         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19335         typecontainer object.
19336
19337         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19338         of just a Report object.
19339
19340 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19341
19342         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19343         "remove_"
19344         (TypeContainer::Populate): Now define the delegates of the type too.
19345         (TypeContainer.Delegates): Property to access the list of delegates defined
19346         in the type.
19347
19348         * delegates.cs (Delegate::Define): Implement partially.
19349
19350         * modifiers.cs (TypeAttr): Handle more flags.
19351
19352 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19353
19354         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19355         and not <=
19356         (Operator::Define): Re-write logic to get types by using the LookupType method
19357         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19358         (Indexer::Define): Ditto.
19359         (Event::Define): Ditto.
19360         (Property::Define): Ditto.
19361
19362 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19363
19364         * class.cs (TypeContainer::Populate): Now define operators too. 
19365         (TypeContainer.Operators): New property to access the list of operators
19366         in a type.
19367         (Operator.OperatorMethodBuilder): New member to hold the method builder
19368         for the operator we are defining.
19369         (Operator::Define): Implement.
19370
19371 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19372
19373         * class.cs (Event::Define): Make the prefixes of the accessor methods
19374         addOn_ and removeOn_ 
19375
19376         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19377         of the location being passed in too. Ideally, this should go later since all
19378         error reporting should be done through the Report object.
19379
19380         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19381         (Populate): Iterate thru the indexers we have and define them too.
19382         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19383         for the get and set accessors.
19384         (Indexer::Define): Implement.
19385
19386 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19387
19388         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19389         my previous implementation, did not work.
19390
19391         * typemanager.cs: Add a couple of missing types (the longs).
19392
19393         * literal.cs: Use TypeManager.bool_type instead of getting it.
19394
19395         * expression.cs (EventExpr): New kind of expressions.
19396         (Expressio::ExprClassFromMemberInfo): finish
19397
19398 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19399
19400         * assign.cs: Emit stores to static fields differently.
19401
19402 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19403
19404         * Merge in changes and adjust code to tackle conflicts. Backed out my
19405         code in Assign::Resolve ;-) 
19406
19407 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19408
19409         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19410         instead Report.Error and also pass in the location.
19411         (CSharpParser::Lexer): New readonly property to return the reference
19412         to the Tokenizer object.
19413         (declare_local_variables): Use Report.Error with location instead of plain 
19414         old error.
19415         (CheckDef): Ditto.
19416
19417         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19418         (Operator.CheckBinaryOperator): Ditto.
19419
19420         * cs-parser.jay (operator_declarator): Update accordingly.
19421
19422         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19423         (CheckBinaryOperator): Same here.
19424
19425         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19426         on the name without any prefixes of namespace names etc. This is because we
19427         already might have something already fully qualified like 
19428         'System.Console.WriteLine'
19429
19430         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19431
19432 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19433
19434         * cs-tokenizer.cs (location): Return a string which also contains
19435         the file name.
19436
19437         * expression.cs (ElementAccess): New class for expressions of the
19438         type 'element access.'
19439         (BaseAccess): New class for expressions of the type 'base access.'
19440         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19441         respectively.
19442
19443         * cs-parser.jay (element_access): Implement action.
19444         (base_access): Implement actions.
19445         (checked_expression, unchecked_expression): Implement.
19446
19447         * cs-parser.jay (local_variable_type): Correct and implement.
19448         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19449
19450         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19451
19452         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19453         name and the specifiers.
19454
19455         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19456
19457         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19458         making them all public ;-)
19459
19460         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19461         class anyways.
19462
19463 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19464
19465         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19466         PropertyExprs.
19467         (FieldExpr, PropertyExprs): New resolved expressions.
19468         (SimpleName::MemberStaticCheck): Perform static checks for access
19469         to non-static fields on static methods. Maybe this should be
19470         generalized for MemberAccesses. 
19471         (SimpleName::ResolveSimpleName): More work on simple name
19472         resolution. 
19473
19474         * cs-parser.jay (primary_expression/qualified_identifier): track
19475         the parameter index.
19476
19477         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19478         (EmitContext::EmitBoolExpression): Chain to expression generation
19479         instead of temporary hack.
19480         (::EmitStatementExpression): Put generic expression code generation.
19481
19482         * assign.cs (Assign::Emit): Implement variable assignments to
19483         local variables, parameters and fields.
19484
19485 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19486
19487         * statement.cs (Block::GetVariableInfo): New method, returns the
19488         VariableInfo for a variable name in a block.
19489         (Block::GetVariableType): Implement in terms of GetVariableInfo
19490
19491         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19492         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19493
19494 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19495
19496         * cs-parser.jay (operator_declaration): Continue on my quest : update
19497         to take attributes argument.
19498         (event_declaration): Ditto.
19499         (enum_declaration): Ditto.
19500         (indexer_declaration): Ditto.
19501
19502         * class.cs (Operator::Operator): Update constructor accordingly.
19503         (Event::Event): Ditto.
19504
19505         * delegate.cs (Delegate::Delegate): Same here.
19506
19507         * enum.cs (Enum::Enum): Same here.
19508
19509 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19510
19511         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19512
19513         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19514
19515         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19516         being passed around as an arraylist.
19517         (Attributes::AddAttribute): Method to add attribute sections.
19518
19519         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19520         (struct_declaration): Update accordingly.
19521         (constant_declaration): Update.
19522         (field_declaration): Update.
19523         (method_header): Update.
19524         (fixed_parameter): Update.
19525         (parameter_array): Ditto.
19526         (property_declaration): Ditto.
19527         (destructor_declaration): Ditto.
19528
19529         * class.cs (Struct::Struct): Update constructors accordingly.
19530         (Class::Class): Ditto.
19531         (Field::Field): Ditto.
19532         (Method::Method): Ditto.
19533         (Property::Property): Ditto.
19534         (TypeContainer::OptAttribute): update property's return type.
19535
19536         * interface.cs (Interface.opt_attributes): New member.
19537         (Interface::Interface): Update to take the extra Attributes argument.
19538
19539         * parameter.cs (Parameter::Parameter): Ditto.
19540
19541         * constant.cs (Constant::Constant): Ditto.
19542
19543         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19544         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19545         the attributes as a parameter.
19546         (InterfaceProperty): Update constructor call.
19547         (InterfaceEvent): Ditto.
19548         (InterfaceMethod): Ditto.
19549         (InterfaceIndexer): Ditto.
19550
19551         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19552         pass the attributes too.
19553         (interface_event_declaration): Ditto.
19554         (interface_property_declaration): Ditto.
19555         (interface_method_declaration): Ditto.
19556         (interface_declaration): Ditto.
19557
19558 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19559
19560         * class.cs (Method::Define): Track the "static Main" definition to
19561         create an entry point. 
19562
19563         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19564         EntryPoint if we find it. 
19565
19566         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19567         (EmitContext::ig): Make this variable public.
19568
19569         * driver.cs: Make the default output file be the first file name
19570         with the .exe extension.  
19571
19572         Detect empty compilations
19573
19574         Handle various kinds of output targets.  Handle --target and
19575         rename -t to --dumper.
19576
19577         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19578         methods inherited from Expression return now an Expression.  This
19579         will is used during the tree rewriting as we resolve them during
19580         semantic analysis.
19581
19582         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19583         the spec.  Missing entirely is the information about
19584         accessability of elements of it.
19585
19586         (Expression::ExprClassFromMemberInfo): New constructor for
19587         Expressions that creates a fully initialized Expression based on
19588         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19589         a Type.
19590
19591         (Invocation::Resolve): Begin implementing resolution of invocations.
19592
19593         * literal.cs (StringLiteral):  Implement Emit.
19594
19595 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19596
19597         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19598         member.
19599
19600 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19601
19602         * cs-parser.jay (attribute_arguments): Implement actions.
19603         (attribute): Fix bug in production. Implement action.
19604         (attribute_list): Implement.
19605         (attribute_target): Implement.
19606         (attribute_target_specifier, opt_target_specifier): Implement
19607         (CheckAttributeTarget): New method to check if the attribute target
19608         is valid.
19609         (attribute_section): Implement.
19610         (opt_attributes): Implement.
19611
19612         * attribute.cs : New file to handle attributes.
19613         (Attribute): Class to hold attribute info.
19614
19615         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19616         (attribute_section): Modify production to use 2 different rules to 
19617         achieve the same thing. 1 s/r conflict down !
19618         Clean out commented, useless, non-reducing dimension_separator rules.
19619
19620         * class.cs (TypeContainer.attributes): New member to hold list
19621         of attributes for a type.
19622         (Struct::Struct): Modify to take one more argument, the attribute list.
19623         (Class::Class): Ditto.
19624         (Field::Field): Ditto.
19625         (Method::Method): Ditto.
19626         (Property::Property): Ditto.
19627
19628         * cs-parser.jay (struct_declaration): Update constructor call to
19629         pass in the attributes too.
19630         (class_declaration): Ditto.
19631         (constant_declaration): Ditto.
19632         (field_declaration): Ditto.
19633         (method_header): Ditto.
19634         (fixed_parameter): Ditto.
19635         (parameter_array): Ditto.
19636         (property_declaration): Ditto.
19637
19638         * constant.cs (Constant::Constant): Update constructor similarly.
19639         Use System.Collections.
19640
19641         * parameter.cs (Parameter::Parameter): Update as above.
19642
19643 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19644
19645         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19646         (TypeContainer.delegates): New member to hold list of delegates.
19647
19648         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19649         this time as I seem to be on crack ;-)
19650
19651 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19652
19653         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19654         tell whether an identifier represents a namespace.
19655
19656         * expression.cs (NamespaceExpr): A namespace expression, used only
19657         temporarly during expression resolution.
19658         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19659         utility functions to resolve names on expressions.
19660
19661 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19662
19663         * codegen.cs: Add hook for StatementExpressions. 
19664
19665         * class.cs: Fix inverted test for static flag in methods.
19666
19667 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19668
19669         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19670         to make it coincide with MS' number.
19671         (Operator::CheckBinaryOperator): Ditto.
19672
19673         * ../errors/errors.txt : Remove error numbers added earlier.
19674
19675         * ../errors/cs1019.cs : Test case for error # 1019
19676
19677         * ../errros/cs1020.cs : Test case for error # 1020
19678
19679         * cs-parser.jay : Clean out commented cruft.
19680         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19681         used anywhere - non-reducing rule.
19682         (namespace_declarations): Non-reducing rule - comment out.
19683
19684         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19685         with TypeContainer::AddEnum.
19686
19687         * delegate.cs : New file for delegate handling classes.
19688         (Delegate): Class for declaring delegates.
19689
19690         * makefile : Update.
19691
19692         * cs-parser.jay (delegate_declaration): Implement.
19693
19694 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19695
19696         * class.cs (Event::Define): Implement.
19697         (Event.EventBuilder): New member.
19698
19699         * class.cs (TypeContainer::Populate): Update to define all enums and events
19700         we have.
19701         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19702         readonly fields for all these cases ?
19703
19704 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19705
19706         * class.cs (Property): Revamp to use the convention of making fields readonly.
19707         Accordingly modify code elsewhere.
19708
19709         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19710         the Define method of the Property class.
19711
19712         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19713         trivial bug.
19714         (TypeContainer::Populate): Update to define all the properties we have. Also
19715         define all enumerations.
19716
19717         * enum.cs (Define): Implement.
19718
19719 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19720
19721         * cs-parser.jay (overloadable_operator): The semantic value is an
19722         enum of the Operator class.
19723         (operator_declarator): Implement actions.
19724         (operator_declaration): Implement.
19725
19726         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19727         validity of definitions.
19728         (Operator::CheckBinaryOperator): Static method to check for binary operators
19729         (TypeContainer::AddOperator): New method to add an operator to a type.
19730
19731         * cs-parser.jay (indexer_declaration): Added line to actually call the
19732         AddIndexer method so it gets added ;-)
19733
19734         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19735         already taken care of by the MS compiler ?  
19736
19737 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19738
19739         * class.cs (Operator): New class for operator declarations.
19740         (Operator::OpType): Enum for the various operators.
19741
19742 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19743
19744         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19745         ostensibly handle this in semantic analysis.
19746
19747         * cs-parser.jay (general_catch_clause): Comment out
19748         (specific_catch_clauses, specific_catch_clause): Ditto.
19749         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19750         (catch_args, opt_catch_args): New productions.
19751         (catch_clause): Rewrite to use the new productions above
19752         (catch_clauses): Modify accordingly.
19753         (opt_catch_clauses): New production to use in try_statement
19754         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19755         and re-write the code in the actions to extract the specific and
19756         general catch clauses by being a little smart ;-)
19757
19758         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19759         Hooray, try and catch statements parse fine !
19760
19761 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19762
19763         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19764         string from the hashtable of variables.
19765
19766         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19767         I end up making that mistake ;-)
19768         (catch_clauses): Fixed gross error which made Key and Value of the 
19769         DictionaryEntry the same : $1 !!
19770
19771 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19772
19773         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19774
19775         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19776         when the add and remove accessors are specified. 
19777
19778 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19779
19780         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19781         information about indexer_declarator.
19782         (indexer_declarator): Implement actions.
19783         (parsing_indexer): New local boolean used to keep track of whether
19784         we are parsing indexers or properties. This is necessary because 
19785         implicit_parameters come into picture even for the get accessor in the 
19786         case of an indexer.
19787         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19788
19789         * class.cs (Indexer): New class for indexer declarations.
19790         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19791         (TypeContainer::indexers): New member to hold list of indexers for the
19792         type.
19793
19794 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19795
19796         * cs-parser.jay (add_accessor_declaration): Implement action.
19797         (remove_accessor_declaration): Implement action.
19798         (event_accessors_declaration): Implement
19799         (variable_declarators): swap statements for first rule - trivial.
19800
19801         * class.cs (Event): New class to hold information about event
19802         declarations.
19803         (TypeContainer::AddEvent): New method to add an event to a type
19804         (TypeContainer::events): New member to hold list of events.
19805
19806         * cs-parser.jay (event_declaration): Implement actions.
19807
19808 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19809
19810         * cs-parser.jay (dim_separators): Implement. Make it a string
19811         concatenating all the commas together, just as they appear.
19812         (opt_dim_separators): Modify accordingly
19813         (rank_specifiers): Update accordingly. Basically do the same
19814         thing - instead, collect the brackets here.
19815         (opt_rank_sepcifiers): Modify accordingly.
19816         (array_type): Modify to actually return the complete type string
19817         instead of ignoring the rank_specifiers.
19818         (expression_list): Implement to collect the expressions
19819         (variable_initializer): Implement. We make it a list of expressions
19820         essentially so that we can handle the array_initializer case neatly too.
19821         (variable_initializer_list): Implement.
19822         (array_initializer): Make it a list of variable_initializers
19823         (opt_array_initializer): Modify accordingly.
19824
19825         * expression.cs (New::NType): Add enumeration to help us
19826         keep track of whether we have an object/delegate creation
19827         or an array creation.
19828         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19829         members to hold data about array creation.
19830         (New:New): Modify to update NewType
19831         (New:New): New Overloaded contructor for the array creation
19832         case.
19833
19834         * cs-parser.jay (array_creation_expression): Implement to call
19835         the overloaded New constructor.
19836
19837 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19838
19839         * class.cs (TypeContainer::Constructors): Return member
19840         constructors instead of returning null.
19841
19842 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19843
19844         * typemanager.cs (InitCoreTypes): Initialize the various core
19845         types after we have populated the type manager with the user
19846         defined types (this distinction will be important later while
19847         compiling corlib.dll)
19848
19849         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19850         on Expression Classification.  Now all expressions have a method
19851         `Resolve' and a method `Emit'.
19852
19853         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19854         generation from working.     Also add some temporary debugging
19855         code. 
19856
19857 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19858
19859         * codegen.cs: Lots of code generation pieces.  This is only the
19860         beginning, will continue tomorrow with more touches of polish.  We
19861         handle the fundamentals of if, while, do, for, return.  Others are
19862         trickier and I need to start working on invocations soon.
19863
19864         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19865         s.InitStatement. 
19866
19867         * codegen.cs (EmitContext): New struct, used during code
19868         emission to keep a context.   Most of the code generation will be
19869         here. 
19870
19871         * cs-parser.jay: Add embedded blocks to the list of statements of
19872         this block.  So code generation proceeds in a top down fashion.
19873
19874 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19875
19876         * statement.cs: Add support for multiple child blocks.
19877
19878 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19879
19880         * codegen.cs (EmitCode): New function, will emit the code for a
19881         Block of code given a TypeContainer and its ILGenerator. 
19882
19883         * statement.cs (Block): Standard public readonly optimization.
19884         (Block::Block constructors): Link children. 
19885         (Block::Child): Child Linker.
19886         (Block::EmitVariables): Emits IL variable declarations.
19887
19888         * class.cs: Drop support for MethodGroups here, delay until
19889         Semantic Analysis.
19890         (Method::): Applied the same simplification that I did before, and
19891         move from Properties to public readonly fields.
19892         (Method::ParameterTypes): Returns the parameter types for the
19893         function, and implements a cache that will be useful later when I
19894         do error checking and the semantic analysis on the methods is
19895         performed.
19896         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19897         and made a method, optional argument tells whether this is a class
19898         or a structure to apply the `has-this' bit.
19899         (Method::GetCallingConvention): Implement, returns the calling
19900         convention. 
19901         (Method::Define): Defines the type, a second pass is performed
19902         later to populate the methods.
19903
19904         (Constructor::ParameterTypes): implement a cache similar to the
19905         one on Method::ParameterTypes, useful later when we do semantic
19906         analysis. 
19907
19908         (TypeContainer::EmitMethod):  New method.  Emits methods.
19909
19910         * expression.cs: Removed MethodGroup class from here.
19911
19912         * parameter.cs (Parameters::GetCallingConvention): new method.
19913
19914 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19915
19916         * class.cs (TypeContainer::Populate): Drop RootContext from the
19917         argument. 
19918
19919         (Constructor::CallingConvention): Returns the calling convention.
19920         (Constructor::ParameterTypes): Returns the constructor parameter
19921         types. 
19922
19923         (TypeContainer::AddConstructor): Keep track of default constructor
19924         and the default static constructor.
19925
19926         (Constructor::) Another class that starts using `public readonly'
19927         instead of properties. 
19928
19929         (Constructor::IsDefault): Whether this is a default constructor. 
19930
19931         (Field::) use readonly public fields instead of properties also.
19932
19933         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19934         track of static constructors;  If none is used, turn on
19935         BeforeFieldInit in the TypeAttributes. 
19936
19937         * cs-parser.jay (opt_argument_list): now the return can be null
19938         for the cases where there are no arguments. 
19939
19940         (constructor_declarator): If there is no implicit `base' or
19941         `this', then invoke the default parent constructor. 
19942
19943         * modifiers.cs (MethodAttr): New static function maps a set of
19944         modifiers flags into a MethodAttributes enum
19945         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19946         MethodAttr, TypeAttr to represent the various mappings where the
19947         modifiers are used.
19948         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19949
19950 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19951
19952         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19953         method arguments.
19954
19955         * interface.cs (PopulateIndexer): Implemented the code generator
19956         for interface indexers.
19957
19958 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19959
19960         * interface.cs (InterfaceMemberBase): Now we track the new status
19961         here.  
19962
19963         (PopulateProperty): Implement property population.  Woohoo!  Got
19964         Methods and Properties going today. 
19965
19966         Removed all the properties for interfaces, and replaced them with
19967         `public readonly' fields. 
19968
19969 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19970
19971         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19972         initialize their hashtables/arraylists only when they are needed
19973         instead of doing this always.
19974
19975         * parameter.cs: Handle refs and out parameters.
19976
19977         * cs-parser.jay: Use an ArrayList to construct the arguments
19978         instead of the ParameterCollection, and then cast that to a
19979         Parameter[] array.
19980
19981         * parameter.cs: Drop the use of ParameterCollection and use
19982         instead arrays of Parameters.
19983
19984         (GetParameterInfo): Use the Type, not the Name when resolving
19985         types. 
19986
19987 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19988
19989         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19990         and instead use public readonly fields.
19991
19992         * class.cs: Put back walking code for type containers.
19993
19994 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19995
19996         * class.cs (MakeConstant): Code to define constants.
19997
19998         * rootcontext.cs (LookupType): New function.  Used to locate types 
19999
20000
20001 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20002
20003         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20004         this System.Reflection code is.  Kudos to Microsoft
20005
20006         * typemanager.cs: Implement a type cache and avoid loading all
20007         types at boot time.  Wrap in LookupType the internals.  This made
20008         the compiler so much faster.  Wow.  I rule!
20009
20010         * driver.cs: Make sure we always load mscorlib first (for
20011         debugging purposes, nothing really important).
20012
20013         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20014         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20015
20016         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20017         on namespaces that have been imported using the `using' keyword.
20018
20019         * class.cs (TypeContainer::TypeAttr): Virtualize.
20020         (Class::TypeAttr): Return attributes suitable for this bad boy.
20021         (Struct::TypeAttr): ditto.
20022         Handle nested classes.
20023         (TypeContainer::) Remove all the type visiting code, it is now
20024         replaced with the rootcontext.cs code
20025
20026         * rootcontext.cs (GetClassBases): Added support for structs. 
20027
20028 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20029
20030         * interface.cs, statement.cs, class.cs, parameter.cs,
20031         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20032         Drop use of TypeRefs, and use strings instead.
20033
20034 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20035
20036         * rootcontext.cs: 
20037
20038         * class.cs (Struct::Struct): set the SEALED flags after
20039         checking the modifiers.
20040         (TypeContainer::TypeAttr): new property, returns the
20041         TypeAttributes for a class.  
20042
20043         * cs-parser.jay (type_list): Oops, list production was creating a
20044         new list of base types.
20045
20046         * rootcontext.cs (StdLib): New property.
20047         (GetInterfaceTypeByName): returns an interface by type name, and
20048         encapsulates error handling here.
20049         (GetInterfaces): simplified.
20050         (ResolveTree): Encapsulated all the tree resolution here.
20051         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20052         types. 
20053
20054         * driver.cs: Add support for --nostdlib, to avoid loading the
20055         default assemblies.
20056         (Main): Do not put tree resolution here. 
20057
20058         * rootcontext.cs: Beginning of the class resolution.
20059
20060 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20061
20062         * rootcontext.cs: Provide better error reporting. 
20063
20064         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20065
20066         * rootcontext.cs (CreateInterface): Handle the case where there
20067         are no parent interfaces.
20068
20069         (CloseTypes): Routine to flush types at the end.
20070         (CreateInterface): Track types.
20071         (GetInterfaces): Returns an array of Types from the list of
20072         defined interfaces.
20073
20074         * typemanager.c (AddUserType): Mechanism to track user types (puts
20075         the type on the global type hash, and allows us to close it at the
20076         end). 
20077
20078 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20079
20080         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20081         RecordInterface instead.
20082
20083         * cs-parser.jay: Updated to reflect changes above.
20084
20085         * decl.cs (Definition): Keep track of the TypeBuilder type that
20086         represents this type here.  Not sure we will use it in the long
20087         run, but wont hurt for now.
20088
20089         * driver.cs: Smaller changes to accomodate the new code.
20090
20091         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20092         when done. 
20093
20094         * rootcontext.cs (CreateInterface):  New method, used to create
20095         the System.TypeBuilder type for interfaces.
20096         (ResolveInterfaces): new entry point to resolve the interface
20097         hierarchy. 
20098         (CodeGen): Property, used to keep track of the code generator.
20099
20100 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20101
20102         * cs-parser.jay: Add a second production for delegate_declaration
20103         with `VOID'.
20104
20105         (enum_body): Put an opt_comma here instead of putting it on
20106         enum_body or enum_member_declarations so we can handle trailing
20107         commas on enumeration members.  Gets rid of a shift/reduce.
20108
20109         (type_list): Need a COMMA in the middle.
20110
20111         (indexer_declaration): Tell tokenizer to recognize get/set
20112
20113         * Remove old targets.
20114
20115         * Re-add the parser target.
20116
20117 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20118
20119         * cs-parser.jay: Add precendence rules for a number of operators
20120         ot reduce the number of shift/reduce conflicts in the grammar.
20121
20122 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20123
20124         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20125         and put it here.
20126
20127         Get rid of old crufty code.
20128
20129         * rootcontext.cs: Use this to keep track of the parsed
20130         representation and the defined types available to the program. 
20131
20132         * gen-treedump.cs: adjust for new convention.
20133
20134         * type.cs: Split out the type manager, and the assembly builder
20135         from here. 
20136
20137         * typemanager.cs: the type manager will live here now.
20138
20139         * cil-codegen.cs: And the code generator here. 
20140
20141 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20142
20143         * makefile: Fixed up for easy making.
20144
20145 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20146
20147         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20148         the 
20149
20150         (unary_expression): Expand pre_increment_expression and
20151         post_decrement_expression to reduce a shift/reduce.
20152
20153 2001-07-11  Simon Cozens
20154
20155         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20156
20157         Improve allow_keyword_as_indent name.
20158
20159 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20160
20161         * Adjustments for Beta2. 
20162
20163 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20164
20165         * decl.cs: Added `Define' abstract method.
20166         (InTransit): new property, used to catch recursive definitions. 
20167
20168         * interface.cs: Implement `Define'. 
20169
20170         * modifiers.cs: Map Modifiers.constants to
20171         System.Reflection.TypeAttribute flags.
20172
20173         * class.cs: Keep track of types and user-defined types.
20174         (BuilderInit): New method for creating an assembly
20175         (ResolveType): New function to launch the resolution process, only
20176         used by interfaces for now.
20177
20178         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20179         that are inserted into the name space. 
20180
20181 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20182
20183         * ARGH.  I have screwed up my tree so many times due to the use of
20184         rsync rather than using CVS.  Going to fix this at once. 
20185
20186         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20187         load types.
20188
20189 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20190
20191         * Experiment successful: Use System.Type rather that our own
20192         version of Type.  
20193
20194 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20195
20196         * cs-parser.jay: Removed nsAliases from here.
20197
20198         Use new namespaces, handle `using XXX;' 
20199
20200         * namespace.cs: Reimplemented namespace handling, use a recursive
20201         definition of the class.  Now we can keep track of using clauses
20202         and catch invalid using clauses.
20203
20204 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20205
20206         * gen-treedump.cs: Adapted for all the renaming.
20207
20208         * expression.cs (Expression): this class now has a Type property
20209         which returns an expression Type.
20210
20211         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20212         `Type', as this has a different meaning now in the base
20213
20214 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20215
20216         * interface.cs, class.cs: Removed from all the sources the
20217         references to signature computation, as we can not do method
20218         signature computation during the parsing time, as we are not
20219         trying to solve at that point distinguishing:
20220
20221         class X {
20222                 void a (Blah x) {}
20223                 void a (NS.Blah x) {}
20224         }
20225
20226         Which depending on the context might be valid or not, as we do not
20227         know if Blah is the same thing as NS.Blah at that point.
20228
20229         * Redid everything so the code uses TypeRefs now instead of
20230         Types.  TypeRefs are just temporary type placeholders, that need
20231         to be resolved.  They initially have a pointer to a string and the
20232         current scope in which they are used.  This is used later by the
20233         compiler to resolve the reference to an actual Type. 
20234
20235         * DeclSpace is no longer a CIR.Type, and neither are
20236         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20237         are all DeclSpaces, but no Types. 
20238
20239         * type.cs (TypeRefManager): This implements the TypeRef manager,
20240         which keeps track of all the types that need to be resolved after
20241         the parsing has finished. 
20242
20243 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20244
20245         * ARGH.  We are going to have to store `foreach' as a class rather
20246         than resolving it, as we need to verify error 1579 after name
20247         resolution.   *OR* we could keep a flag that says `This request to
20248         IEnumerator comes from a foreach statement' which we can then use
20249         to generate the error.
20250
20251 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20252
20253         * class.cs (TypeContainer.AddMethod): we now add methods to the
20254         MethodGroup instead of the method hashtable.  
20255
20256         * expression.cs: Add MethodGroup abstraction, which gets us one
20257         step closer to the specification in the way we handle method
20258         declarations.  
20259
20260         * cs-parser.jay (primary_expression): qualified_identifier now
20261         tried to match up an identifier to a local variable reference or
20262         to a parameter reference.
20263
20264         current_local_parameters is now a parser global variable that
20265         points to the current parameters for the block, used during name
20266         lookup.
20267
20268         (property_declaration): Now creates an implicit `value' argument to
20269         the set accessor.
20270
20271 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20272
20273         * parameter.cs: Do not use `param' arguments as part of the
20274         signature, per the spec.
20275
20276 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20277
20278         * decl.cs: Base class for classes, structs and interfaces.  This
20279         is the "Declaration Space" 
20280
20281         * cs-parser.jay: Use CheckDef for checking declaration errors
20282         instead of having one on each function.
20283
20284         * class.cs: Factor out some code for handling error handling in
20285         accordance to the "Declarations" section in the "Basic Concepts"
20286         chapter in the ECMA C# spec.
20287
20288         * interface.cs: Make all interface member classes derive from
20289         InterfaceMemberBase.
20290
20291 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20292
20293         * Many things: all interfaces are parsed and generated in
20294         gen-treedump.  Support for member variables, constructors,
20295         destructors, properties, constants is there.
20296
20297         Beginning of the IL backend, but very little done, just there for
20298         testing purposes. 
20299
20300 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20301
20302         * cs-parser.jay: Fix labeled statement.
20303
20304         * cs-tokenizer.cs (escape): Escape " and ' always.
20305         ref_line, ref_name: keep track of the line/filename as instructed
20306         by #line by the compiler.
20307         Parse #line.
20308
20309 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20310
20311         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20312         to match the values in System.CodeDOM.
20313
20314         Divid renamed to Divide.
20315
20316         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20317         statements. 
20318         (Statements.set): remove.
20319
20320         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20321         statements. 
20322
20323         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20324         falseStatements always have valid values. 
20325
20326         * cs-parser.jay: Use System.CodeDOM now.
20327