2002-08-13 Martin Baulig <martin@gnome.org>
[mono.git] / mcs / mcs / ChangeLog
1 2002-08-13  Martin Baulig  <martin@gnome.org>
2
3         In addition to a nice code cleanup, this gives us a performance
4         increase of about 1.4% on GNU/Linux - not much, but it's already
5         half a second for the self-hosting MCS compilation.
6
7         * typemanager.cs (IMemberFinder): New interface.  It is used by
8         TypeManager.FindMembers to call FindMembers on a TypeContainer,
9         Enum, Delegate or Interface.
10         (TypeManager.finder_to_member_finder): New PtrHashtable.
11         (TypeManager.finder_to_container): Removed.
12         (TypeManager.finder_to_delegate): Removed.
13         (TypeManager.finder_to_interface): Removed.
14         (TypeManager.finder_to_enum): Removed.
15
16         * interface.cs (Interface): Implement IMemberFinder.
17
18         * delegate.cs (Delegate): Implement IMemberFinder.
19
20         * enum.cs (Enum): Implement IMemberFinder.
21
22         * class.cs (TypeContainer): Implement IMemberFinder.
23
24 2002-08-12  Martin Baulig  <martin@gnome.org>
25
26         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
27
28 2002-08-12  Martin Baulig  <martin@gnome.org>
29
30         * ecore.cs (ITypeExpression): New interface for expressions which
31         resolve to a type.
32         (TypeExpression): Renamed to TypeLookupExpression.
33         (Expression.DoResolve): If we're doing a types-only lookup, the
34         expression must implement the ITypeExpression interface and we
35         call DoResolveType() on it.
36         (SimpleName): Implement the new ITypeExpression interface.
37         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
38         hack, the situation that we're only looking up types can't happen
39         anymore when this method is called.  Moved the type lookup code to
40         DoResolveType() and call it.
41         (SimpleName.DoResolveType): This ITypeExpression interface method
42         is now doing the types-only lookup.
43         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
44         (ResolveFlags): Added MaskExprClass.
45
46         * expression.cs (MemberAccess): Implement the ITypeExpression
47         interface.
48         (MemberAccess.DoResolve): Added support for a types-only lookup
49         when we're called via ITypeExpression.DoResolveType().
50         (ComposedCast): Implement the ITypeExpression interface.
51
52         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
53         Expression.Resolve() with ResolveFlags.Type instead.
54
55 2002-08-12  Martin Baulig  <martin@gnome.org>
56
57         * interface.cs (Interface.Define): Apply attributes.
58
59         * attribute.cs (Attribute.ApplyAttributes): Added support for
60         interface attributes.
61
62 2002-08-11  Martin Baulig  <martin@gnome.org>
63
64         * statement.cs (Block.Emit): Only check the "this" variable if we
65         do not always throw an exception.
66
67         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
68         whether the property has a set accessor.
69
70 2002-08-11  Martin Baulig  <martin@gnome.org>
71
72         Added control flow analysis support for structs.
73
74         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
75         with control flow analysis turned off.
76         (IVariable): New interface.
77         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
78         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
79         (FieldExpr.DoResolve): Resolve the instance expression with flow
80         analysis turned off and do the definite assignment check after the
81         resolving when we know what the expression will resolve to.
82
83         * expression.cs (LocalVariableReference, ParameterReference):
84         Implement the new IVariable interface, only call the flow analysis
85         code if ec.DoFlowAnalysis is true.
86         (This): Added constructor which takes a Block argument.  Implement
87         the new IVariable interface.
88         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
89         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
90         This does the definite assignment checks for struct members.
91
92         * class.cs (Constructor.Emit): If this is a non-static `struct'
93         constructor which doesn't have any initializer, call
94         Block.AddThisVariable() to tell the flow analysis code that all
95         struct elements must be initialized before control returns from
96         the constructor.
97
98         * statement.cs (MyStructInfo): New public class.
99         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
100         argument to this indexer.  If non-zero, check an individual struct
101         member, not the whole struct.
102         (FlowBranching.CheckOutParameters): Check struct members.
103         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
104         overloaded versions of these methods which take an additional
105         `int field_idx' argument to check struct members.
106         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
107         overloaded versions of these methods which take an additional
108         `string field_name' argument to check struct member.s
109         (VariableInfo): Implement the IVariable interface.
110         (VariableInfo.StructInfo): New public property.  Returns the
111         MyStructInfo instance of the variable if it's a struct or null.
112         (Block.AddThisVariable): New public method.  This is called from
113         Constructor.Emit() for non-static `struct' constructor which do
114         not have any initializer.  It creates a special variable for the
115         "this" instance variable which will be checked by the flow
116         analysis code to ensure that all of the struct's fields are
117         initialized before control returns from the constructor.
118         (UsageVector): Added support for struct members.  If a
119         variable/parameter is a struct with N members, we reserve a slot
120         in the usage vector for each member.  A struct is considered fully
121         initialized if either the struct itself (slot 0) or all its
122         members are initialized.
123
124 2002-08-08  Martin Baulig  <martin@gnome.org>
125
126         * driver.cs (Driver.MainDriver): Only report an error CS5001
127         if there were no compilation errors.
128
129         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
130         `UnsafeContext' property to determine whether the parent is in
131         unsafe context rather than checking the parent's ModFlags:
132         classes nested in an unsafe class are unsafe as well.
133
134 2002-08-08  Martin Baulig  <martin@gnome.org>
135
136         * statement.cs (UsageVector.MergeChildren): Distinguish between
137         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
138         we return.  Added test17() and test18() to test-154.cs.
139
140 2002-08-08  Martin Baulig  <martin@gnome.org>
141
142         * typemanager.cs (TypeManager.FilterWithClosure): If we have
143         Family access, make sure the invoking type isn't a subclass of the
144         queried type (that'd be a CS1540).
145
146         * ecore.cs (Expression.MemberLookup): Added overloaded version of
147         this method which takes an additional `Type invocation_type'.
148
149         * expression.cs (BaseAccess.DoResolve): Use the base type as
150         invocation and query type.
151         (MemberAccess.DoResolve): If the lookup failed and we're about to
152         report a CS0122, try a lookup with the ec.ContainerType - if this
153         succeeds, we must report a CS1540.
154
155 2002-08-08  Martin Baulig  <martin@gnome.org>
156
157         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
158         (MethodGroupExpr): Implement the IMemberExpr interface.
159
160         * expression (MemberAccess.ResolveMemberAccess): No need to have
161         any special code for MethodGroupExprs anymore, they're now
162         IMemberExprs.   
163
164 2002-08-08  Martin Baulig  <martin@gnome.org>
165
166         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
167         Family, FamANDAssem and FamORAssem permissions.
168         (TypeManager.IsSubclassOrNestedChildOf): New public method.
169
170 2002-08-08  Martin Baulig  <martin@gnome.org>
171
172         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
173         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
174         or loop block.
175
176 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
177
178         * driver.cs: implemented /resource option to embed managed resources.
179
180 2002-08-07  Martin Baulig  <martin@gnome.org>
181
182         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
183         (FieldBase.HasFieldInitializer): New public property.
184         (FieldBase.GetInitializerExpression): New public method.  Resolves and
185         returns the field initializer and makes sure it is only resolved once.
186         (TypeContainer.EmitFieldInitializers): Call
187         FieldBase.GetInitializerExpression to get the initializer, this ensures
188         that it isn't resolved multiple times.
189
190         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
191         the resolving process (SimpleName/MemberLookup) that we're currently
192         emitting a field initializer (which must not access any instance members,
193         this is an error CS0236).
194
195         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
196         argument, if the `IsFieldInitializer' flag is set, we must report and
197         error CS0236 and not an error CS0120.   
198
199 2002-08-07  Martin Baulig  <martin@gnome.org>
200
201         * ecore.cs (IMemberExpr): New public interface.
202         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
203         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
204         if the expression is an IMemberExpr.
205
206         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
207         to be null, implicitly default to `this' if we're non-static in
208         this case.  Simplified the code a lot by using the new IMemberExpr
209         interface.  Also fixed bug #28176 here.
210
211 2002-08-06  Martin Baulig  <martin@gnome.org>
212
213         * cs-parser.jay (SimpleLookup): Removed.  We need to create
214         ParameterReferences during semantic analysis so that we can do a
215         type-only search when resolving Cast, TypeOf and SizeOf.
216         (block): Pass the `current_local_parameters' to the Block's
217         constructor.
218
219         * class.cs (ConstructorInitializer): Added `Parameters parameters'
220         argument to the constructor.
221         (ConstructorInitializer.Resolve): Create a temporary implicit
222         block with the parameters.
223
224         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
225         references here if we aren't doing a type-only search.
226
227         * statement.cs (Block): Added constructor which takes a
228         `Parameters parameters' argument.
229         (Block.Parameters): New public property.
230
231         * support.cs (InternalParameters.Parameters): Renamed `parameters'
232         to `Parameters' and made it public readonly.
233
234 2002-08-06  Martin Baulig  <martin@gnome.org>
235
236         * ecore.cs (Expression.Warning): Made this public as well.
237
238         * report.cs (Report.Debug): Print the contents of collections.
239
240 2002-08-06  Martin Baulig  <martin@gnome.org>
241
242         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
243         used to tell Resolve() which kinds of expressions it may return.
244         (Expression.Resolve): Added overloaded version of this method which
245         takes a `ResolveFlags flags' argument.  This can be used to tell
246         Resolve() which kinds of expressions it may return.  Reports a
247         CS0118 on error.
248         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
249         ResolveFlags.SimpleName.
250         (Expression.Error118): Added overloaded version of this method which
251         takes a `ResolveFlags flags' argument.  It uses the flags to determine
252         which kinds of expressions are allowed.
253
254         * expression.cs (Argument.ResolveMethodGroup): New public method.
255         Resolves an argument, but allows a MethodGroup to be returned.
256         This is used when invoking a delegate.
257
258         * TODO: Updated a bit.
259
260 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
261
262         Fixed compilation with csc.
263
264         * ecore.cs: Expression.Error made public. Is this correct? Should
265         Warning be made public too?
266
267         * expression.cs: use ea.Location instead of ea.loc.
268         [FIXME:  Filed as bug #28607: MCS must report these errors.]
269
270 2002-08-06  Martin Baulig  <martin@gnome.org>
271
272         * ecore.cs (Expression.loc): Moved the location here instead of
273         duplicating it in all derived classes.
274         (Expression.Location): New public property.
275         (Expression.Error, Expression.Warning): Made them non-static and
276         removed the location argument.
277         (Expression.Warning): Added overloaded version which takes an
278         `int level' argument.
279         (Expression.Error118): Make this non-static and removed the
280         expression and location arguments.
281         (TypeExpr): Added location argument to the constructor.
282
283         * expression.cs (StaticCallExpr): Added location argument to
284         the constructor.
285         (Indirection, PointerArithmetic): Likewise.
286         (CheckedExpr, UnCheckedExpr): Likewise.
287         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
288         (StringPtr): Likewise.
289
290
291 2002-08-05  Martin Baulig  <martin@gnome.org>
292
293         * expression.cs (BaseAccess.DoResolve): Actually report errors.
294
295         * assign.cs (Assign.DoResolve): Check whether the source
296         expression is a value or variable.
297
298         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
299         while resolving the corresponding blocks.
300
301         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
302         an error, don't silently return null.
303
304         * statement.cs (Block.AddVariable): Do the error reporting here
305         and distinguish between CS0128 and CS0136.
306         (Block.DoResolve): Report all unused labels (warning CS0164).
307         (LabeledStatement): Pass the location to the constructor.
308         (LabeledStatement.HasBeenReferenced): New property.
309         (LabeledStatement.Resolve): Set it to true here.
310
311         * statement.cs (Return.Emit): Return success even after reporting
312         a type mismatch error (CS0126 or CS0127), this is what csc does and
313         it avoids confusing the users with any consecutive errors.
314
315 2002-08-05  Martin Baulig  <martin@gnome.org>
316
317         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
318
319         * const.cs (Const.LookupConstantValue): Catch circular definitions.
320
321         * expression.cs (MemberAccess.DoResolve): Silently return if an
322         error has already been reported.
323
324         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
325         error has already been reported.
326
327 2002-08-05  Martin Baulig  <martin@gnome.org>
328
329         * statement.cs (UsageVector): Only initialize the `parameters'
330         vector if we actually have any "out" parameters.
331
332 2002-08-05  Martin Baulig  <martin@gnome.org>
333
334         * expression.cs (Binary.ResolveOperator): When combining delegates,
335         they must have the same type.
336
337 2002-08-05  Martin Baulig  <martin@gnome.org>
338
339         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
340         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
341         work with the ms runtime and we also don't need it: if we're a
342         PropertyBuilder and not in the `indexer_arguments' hash, then we
343         are a property and not an indexer.
344
345         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
346         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
347         since the latter one doesn't work with the ms runtime.
348
349 2002-08-03  Martin Baulig  <martin@gnome.org>
350
351         Fixed bugs #27998 and #22735.
352
353         * class.cs (Method.IsOperator): New public field.
354         (Method.CheckBase): Report CS0111 if there's already a method
355         with the same parameters in the current class.  Report CS0508 when
356         attempting to change the return type of an inherited method.
357         (MethodData.Emit): Report CS0179 if a method doesn't have a body
358         and it's not marked abstract or extern.
359         (PropertyBase): New abstract base class for Property and Indexer.
360         (PropertyBase.CheckBase): Moved here from Property and made it work
361         for indexers.
362         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
363         the same so we can reuse it there.
364         (Property, Indexer): Derive from PropertyBase.
365         (MethodSignature.inheritable_property_signature_filter): New delegate
366         to find properties and indexers.
367
368         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
369         argument and improved error reporting.
370
371         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
372         EmptyReadOnlyParameters and made it a property.
373
374         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
375         version of this method which takes a `PropertyInfo indexer'.
376         (TypeManager.RegisterIndexer): New method.
377
378         * class.cs: Added myself as author of this file :-)
379
380 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
381
382         * class.cs: fixed compilation on windoze.
383
384 2002-08-03  Martin Baulig  <martin@gnome.org>
385
386         * interface.cs (Interface.GetInterfaceBases): Check whether all
387         base interfaces are at least as accessible than the current one.
388
389         * class.cs (TypeContainer.GetClassBases): Check whether base types
390         are at least as accessible than the current type.
391         (TypeContainer.AsAccessible): Implemented and made non-static.
392         (MemberBase.CheckParameters): Report errors if the accessibility
393         checks fail.
394
395         * delegate.cs (Delegate.Delegate): The default visibility is
396         internal for top-level types and private for nested types.
397         (Delegate.Define): Report errors if the accessibility checks fail.
398
399         * enum.cs (Enum.Enum): The default visibility is internal for
400         top-level types and private for nested types.
401         (Enum.DefineType): Compute the correct visibility.
402
403         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
404         function which takes a `bool is_toplevel' instead of a TypeContainer.
405
406         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
407         builtin type.
408
409 2002-08-02  Martin Baulig  <martin@gnome.org>
410
411         * expression.cs (LocalVariableReferenc): Added constructor which
412         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
413         (LocalVariableReference.IsReadOnly): New property.
414         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
415         variable is readonly, use our own readonly flag to do this; you can
416         use the new constructor to get a writable reference to a read-only
417         variable.
418
419         * cs-parser.jay (foreach_statement, using_statement): Get a writable
420         reference to the local variable.
421
422 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
423
424         * rootcontext.cs (ResolveCore): Also include System.Exception
425
426         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
427         we reach an EmptyStatement.
428
429         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
430         is also fine.
431
432         * expression.cs (Binary.ResolveOperator): Check error result in
433         two places.
434
435         use brtrue/brfalse directly and avoid compares to null.
436
437 2002-08-02  Martin Baulig  <martin@gnome.org>
438
439         * class.cs (TypeContainer.Define): Define all nested interfaces here.
440         Fixes bug #28407, added test-155.cs.
441
442 2002-08-01  Martin Baulig  <martin@gnome.org>
443
444         * class.cs (Event.EmitDefaultMethod): Make this work with static
445         events.  Fixes #28311, added verify-3.cs.
446
447 2002-08-01  Martin Baulig  <martin@gnome.org>
448
449         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
450         `is_disposable' fields.
451         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
452         `hm.is_disposable' if we're using the collection pattern.
453         (Foreach.EmitCollectionForeach): Use the correct type for the
454         enumerator's local variable, only emit the try/finally block if
455         necessary (fixes #27713).
456
457 2002-08-01  Martin Baulig  <martin@gnome.org>
458
459         * ecore.cs (Expression.report118): Renamed to Error118 and made
460         it public static.
461
462         * statement.cs (Throw.Resolve): Check whether the expression is of
463         the correct type (CS0118) and whether the type derives from
464         System.Exception (CS0155).
465         (Catch.Resolve): New method.  Do the type lookup here and check
466         whether it derives from System.Exception (CS0155).
467         (Catch.CatchType, Catch.IsGeneral): New public properties.
468
469         * typemanager.cs (TypeManager.exception_type): Added.
470
471 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
472
473         * driver.cs: Updated About function.
474
475 2002-07-31  Martin Baulig  <martin@gnome.org>
476
477         Implemented Control Flow Analysis.
478
479         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
480         (EmitContext.CurrentBranching): Added.
481         (EmitContext.StartFlowBranching): Added.
482         (EmitContext.EndFlowBranching): Added.
483         (EmitContext.KillFlowBranching): Added.
484         (EmitContext.IsVariableAssigned): Added.
485         (EmitContext.SetVariableAssigned): Added.
486         (EmitContext.IsParameterAssigned): Added.
487         (EmitContext.SetParameterAssigned): Added.
488         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
489         Added control flow analysis stuff here.
490
491         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
492         resolve the expression as lvalue.
493         (LocalVariableReference.DoResolve): Check whether the variable has
494         already been assigned.
495         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
496         the parameter as assigned here.
497         (ParameterReference.DoResolve): Check whether the parameter has already
498         been assigned.
499         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
500         expression as lvalue.
501
502         * statement.cs (FlowBranching): New class for the flow analysis code.
503         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
504         (LabeledStatement.IsDefined): New public property.
505         (LabeledStatement.AddUsageVector): New public method to tell flow
506         analyis that the label may be reached via a forward jump.
507         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
508         flow analysis.
509         (VariableInfo.Number): New public field.  This is used by flow analysis
510         to number all locals of a block.
511         (Block.CountVariables): New public property.  This is the number of
512         local variables in this block (including the locals from all parent
513         blocks).
514         (Block.EmitMeta): Number all the variables.
515
516         * statement.cs: Added flow analysis support to all classes.
517
518 2002-07-31  Martin Baulig  <martin@gnome.org>
519
520         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
521         To get debugging messages, compile mcs with /define:MCS_DEBUG and
522         then use this argument.
523
524         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
525
526         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
527         use this to specify /define options.
528
529 2002-07-29  Martin Baulig  <martin@gnome.org>
530
531         * statement.cs (Fixed): Moved all code that does variable lookups
532         and resolvings from Emit to Resolve.
533
534         * statement.cs (For): Moved all code that does variable lookups
535         and resolvings from Emit to Resolve.
536
537         * statement.cs (Using): Moved all code that does variable lookups
538         and resolvings from Emit to Resolve.
539
540 2002-07-29  Martin Baulig  <martin@gnome.org>
541
542         * attribute.cs (Attribute.Resolve): Explicitly catch a
543         System.NullReferenceException when creating the
544         CustromAttributeBuilder and report a different warning message.
545
546 2002-07-29  Martin Baulig  <martin@gnome.org>
547
548         * support.cs (ParameterData.ParameterName): Added method to
549         get the name of a parameter.
550
551         * typemanager.cs (TypeManager.IsValueType): New public method.
552
553 2002-07-29  Martin Baulig  <martin@gnome.org>
554
555         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
556         is a flag which specifies that it's either ref or out.
557         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
558         the out parameter to `out Parameter.Modifier mod', also set the
559         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
560
561         * support.cs (InternalParameters.ParameterModifier): Distinguish
562         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
563         Parameter.Modifier.ISBYREF flag if it's either ref or out.
564
565         * expression.cs (Argument.GetParameterModifier): Distinguish
566         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
567         Parameter.Modifier.ISBYREF flag if it's either ref or out.
568
569 2002-07-29  Martin Baulig  <martin@gnome.org>
570
571         * expression.cs (ParameterReference.ParameterReference): Added
572         `Location loc' argument to the constructor.
573
574         * cs-parser.jay: Pass location to ParameterReference.
575
576 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
577
578         * statement.cs (Try): Initialize the location.
579
580         * cs-parser.jay: pass location to Try.
581
582         * expression.cs (Unary.Reduce): Change the prototype to return
583         whether a constant fold could be performed or not.  The result is
584         returned in an out parameters.  In the case of Indirection and
585         AddressOf, we want to perform the full tests.
586
587 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
588
589         * statement.cs (Statement.Emit): Flag dead code.
590
591 2002-07-27  Andrew Birkett  <andy@nobugs.org>
592
593         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
594
595 2002-07-27  Martin Baulig  <martin@gnome.org>
596
597         * class.cs (MethodData.Define): Put back call to
598         TypeManager.AddMethod(), accidentally commented this out.
599
600         * report.cs (Debug): New public method to print debugging information,
601         this is `[Conditional ("DEBUG")]'.
602
603 2002-07-26  Martin Baulig  <martin@gnome.org>
604
605         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
606         (switch_statement): Push the current_block to the switch_stack and
607         pop it again when we're done with the switch.
608         (switch_section): The new block is a child of the current_block.
609         Fixes bug #24007, added test-152.cs.
610
611 2002-07-27  Martin Baulig  <martin@gnome.org>
612
613         * expression.cs (Invocation.EmitArguments): When calling a varargs
614         function with only its fixed arguments, we need to pass an empty
615         array.
616
617 2002-07-27  Martin Baulig  <martin@gnome.org>
618
619         Mono 0.13 has been released.
620
621 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
622
623         * driver.cs: Rename --resource to --linkres, because that is what
624         we do currently, we dont support --resource yet.
625
626         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
627
628 2002-07-25  Martin Baulig  <martin@gnome.org>
629
630         * class.cs (MethodData): New public class.  This is a `method builder'
631         class for a method or one accessor of a Property/Indexer/Event.
632         (MethodData.GetMethodFlags): Moved here from MemberBase.
633         (MethodData.ApplyAttributes): Likewise.
634         (MethodData.ApplyObsoleteAttribute): Likewise.
635         (MethodData.ApplyConditionalAttribute): Likewise.
636         (MethodData.ApplyDllImportAttribute): Likewise.
637         (MethodData.CheckAbstractAndExternal): Likewise.
638         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
639         (MethodData.Emit): Formerly known as Method.Emit().
640         (MemberBase): Moved everything which was specific to a single
641         accessor/method to MethodData.
642         (Method): Create a new MethodData and call Define() and Emit() on it.
643         (Property, Indexer, Event): Create a new MethodData objects for each
644         accessor and call Define() and Emit() on them.
645
646 2002-07-25  Martin Baulig  <martin@gnome.org>
647
648         Made MethodCore derive from MemberBase to reuse the code from there.
649         MemberBase now also checks for attributes.
650
651         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
652         (MemberBase.GetMethodFlags): Moved here from class Method and marked
653         as virtual.
654         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
655         `CallingConventions cc' and `Attributes opt_attrs' arguments.
656         (MemberBase.ApplyAttributes): New virtual method; applies the
657         attributes to a method or accessor.
658         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
659         (MemberBase.ApplyConditionalAttribute): Likewise.
660         (MemberBase.ApplyDllImportAttribute): Likewise.
661         (MemberBase.CheckAbstractAndExternal): Likewise.
662         (MethodCore.ParameterTypes): This is now a property instead of a
663         method, it's initialized from DoDefineParameters().
664         (MethodCore.ParameterInfo): Removed the set accessor.
665         (MethodCore.DoDefineParameters): New protected virtual method to
666         initialize ParameterTypes and ParameterInfo.
667         (Method.GetReturnType): We can now simply return the MemberType.
668         (Method.GetMethodFlags): Override the MemberBase version and add
669         the conditional flags.
670         (Method.CheckBase): Moved some code from Define() here, call
671         DoDefineParameters() here.
672         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
673         here to avoid some larger code duplication.
674         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
675         ensure that abstract and external accessors don't declare a body.
676
677         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
678         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
679         lookup in the attribute's parent classes, so we need to abort as soon
680         as we found the first match.
681         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
682         the attribute has no arguments.
683
684         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
685         of a Method.
686
687 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
688
689         * cs-parser.jay: reverted previous patch.
690
691 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
692
693         * cs-parser.jay: fixed bug #22119.
694
695 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
696
697         * attribute.cs: fixed compilation. The error was:
698         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
699         be assigned to before control leaves the current method."
700         [FIXME:  Filed as bug #28186: MCS must report this error.]
701
702 2002-07-25  Martin Baulig  <martin@gnome.org>
703
704         * attribute.cs (Attribute.Conditional_GetConditionName): New static
705         method to pull the condition name ouf of a Conditional attribute.
706         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
707         the obsolete message and error flag out of an Obsolete attribute.
708
709         * class.cs (Method.GetMethodFlags): New public method to get the
710         TypeManager.MethodFlags for this method.
711         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
712         private methods.
713         (Method.Define): Get and apply the Obsolete and Conditional attributes;
714         if we're overriding a virtual function, set the new private variable
715         `parent_method'; call the new TypeManager.AddMethod().
716
717         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
718         the MethodBuilder and the Method in a PtrHashtable.
719         (TypeManager.builder_to_method): Added for this purpose.
720         (TypeManager.MethodFlags): Added IsObsoleteError.
721         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
722         Obsolete and Conditional arguments in MethodBuilders.  If we discover
723         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
724         the message from the attribute.
725
726 2002-07-24  Martin Baulig  <martin@gnome.org>
727
728         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
729         preprocessor directives, ensure that the argument to #define/#undef is
730         exactly one identifier and that it's actually an identifier.
731
732         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
733         did not work ....
734
735 2002-07-24  Martin Baulig  <martin@gnome.org>
736
737         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
738         initialize it to TypeManager.object_type in the constructor.
739         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
740         of the `hm.get_current' method if we're using the collection pattern.
741         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
742         for the explicit conversion to make it work when we're using the collection
743         pattern and the `Current' property has a different return type than `object'.
744         Fixes #27713.
745
746 2002-07-24  Martin Baulig  <martin@gnome.org>
747
748         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
749         does not match, but don't report any errors.  This method is called in
750         order for all methods in a MethodGroupExpr until a matching method is
751         found, so we don't want to bail out if the first method doesn't match.
752         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
753         matches, report the 123.  Fixes #28070.
754
755 2002-07-24  Martin Baulig  <martin@gnome.org>
756
757         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
758         TypeManager.TypeToCoreType() to the top of the method so the
759         following equality checks will work.  Fixes #28107.
760
761 2002-07-24  Martin Baulig  <martin@gnome.org>
762
763         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
764         operand is of type uint, and the other operand is of type sbyte,
765         short or int, the operands are converted to type long." -
766         Actually do what this comment already told us.  Fixes bug #28106,
767         added test-150.cs.
768
769 2002-07-24  Martin Baulig  <martin@gnome.org>
770
771         * class.cs (MethodBase): New abstract class.  This is now a base
772         class for Property, Indexer and Event to avoid some code duplication
773         in their Define() and DefineMethods() methods.
774         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
775         generic methods for Define() and DefineMethods().
776         (FieldBase): Derive from MemberBase, not MemberCore.
777         (Property): Derive from MemberBase, not MemberCore.
778         (Property.DefineMethod): Moved all the code from this method to the
779         new MethodBase.DefineAccessor(), just call it with appropriate
780         argumetnts.
781         (Property.Define): Call the new Property.DoDefine(), this does some
782         sanity checks and we don't need to duplicate the code everywhere.
783         (Event): Derive from MemberBase, not MemberCore.
784         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
785         accessors, this will also make them work with interface events.
786         (Indexer): Derive from MemberBase, not MemberCore.
787         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
788         (Indexer.Define): Use the new MethodBase functions.
789
790         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
791         argument to the constructor.
792         (Interface.FindMembers): Added support for interface events.
793         (Interface.PopluateEvent): Implemented.
794
795         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
796
797 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
798
799         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
800         but this is required to check for a method name being the same as
801         the containing class.  
802
803         Handle this now.
804
805 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
806
807         * interface.cs: initialize variable.
808
809 2002-07-23  Martin Baulig  <martin@gnome.org>
810
811         Implemented the IndexerName attribute in interfaces.
812
813         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
814         name if this is an explicit interface implementation.
815         (Indexer.InterfaceIndexerName): New public variable.  If we're
816         implementing an interface indexer, this is the IndexerName in that
817         interface.  Otherwise, it's the IndexerName.
818         (Indexer.DefineMethod): If we're implementing interface indexer,
819         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
820         and Pending.ImplementIndexer methods.
821         (Indexer.Define): Also define the PropertyBuilder if we're
822         implementing an interface indexer and this is neither an explicit
823         interface implementation nor do the IndexerName match the one in
824         the interface.
825
826         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
827         If a method is defined here, then we always need to create a proxy
828         for it.  This is used when implementing interface indexers.
829         (Pending.IsInterfaceIndexer): New public method.
830         (Pending.ImplementIndexer): New public method.
831         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
832         This is used when implementing interface indexers to define a proxy
833         if necessary.
834         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
835         define a proxy if necessary.
836
837         * interface.cs (Interface.IndexerName): New public variable.
838         (Interface.PopulateIndexer): Set the IndexerName.
839         (Interface.DefineIndexers): New private method.  Populate all the
840         indexers and make sure their IndexerNames match.
841
842         * typemanager.cs (IndexerPropertyName): Added support for interface
843         indexers.
844
845 2002-07-22  Martin Baulig  <martin@gnome.org>
846
847         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
848         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
849         ret if HasReturnLabel.
850         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
851         variables.
852
853         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
854         and set the ec.LoopBeginTryCatchLevel.
855         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
856         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
857         the current ec.TryCatchLevel, the branch goes out of an exception
858         block.  In this case, we need to use Leave and not Br.
859
860 2002-07-22  Martin Baulig  <martin@gnome.org>
861
862         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
863         block unless the block does not always return or it is contained in
864         another try { ... } catch { ... } block.  Fixes bug #26506.
865         Added verify-1.cs to the test suite.
866
867 2002-07-22  Martin Baulig  <martin@gnome.org>
868
869         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
870         then we do not always return.  Fixes bug #24985.
871
872 2002-07-22  Martin Baulig  <martin@gnome.org>
873
874         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
875         lookup on a per-class level; ie. walk up the class hierarchy until we
876         found at least one applicable method, then choose the best among them.
877         Fixes bug #24463 and test-29.cs.
878
879 2002-07-22  Martin Baulig  <martin@gnome.org>
880
881         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
882         return types of the methods.  The return type is not part of the
883         signature and we must not check it to make the `new' modifier work.
884         Fixes bug #27999, also added test-147.cs.
885         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
886
887         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
888         on the method's return type.
889
890 2002-07-21  Martin Baulig  <martin@gnome.org>
891
892         * assign.cs: Make this work if the rightmost source is a constant and
893         we need to do an implicit type conversion.  Also adding a few more tests
894         to test-38.cs which should have caught this.
895
896         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
897         target in the makefile for this.  The makefile.gnu is primarily intended
898         for end-users who don't want to debug the compiler.
899
900 2002-07-21  Martin Baulig  <martin@gnome.org>
901
902         * assign.cs: Improved the Assign class so it can now handle embedded
903         assignments (X = Y = Z = something).  As a side-effect this'll now also
904         consume less local variables.  test-38.cs now passes with MCS, added
905         a few new test cases to that test.
906
907 2002-07-20  Martin Baulig  <martin@gnome.org>
908
909         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
910         instructions.  Fixes bug #27977, also added test-146.cs.
911
912 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
913
914         * cs-tokenizer.cs: fixed getHex ().
915
916 2002-07-19  Martin Baulig  <martin@gnome.org>
917
918         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
919         not Type.GetType() to lookup the array type.  This is needed when
920         we're constructing an array of a user-defined type.
921         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
922         single-dimensional arrays, but also for single-dimensial arrays of
923         type decimal.
924
925 2002-07-19  Martin Baulig  <martin@gnome.org>
926
927         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
928         this function is called, it's not allowed to share LocalBuilders
929         among ILGenerators.
930
931 2002-07-19  Martin Baulig  <martin@gnome.org>
932
933         * expression.cs (Argument.Resolve): Report an error 118 when trying
934         to pass a type as argument.
935
936 2002-07-18  Martin Baulig  <martin@gnome.org>
937
938         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
939         Conv_R_Un for the signed `long' type.
940
941 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
942
943         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
944         `expr' for the temporary result, as that will fail if we do
945         multiple resolves on the same expression.
946
947 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
948
949         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
950         ec.TypeContainer for looking up aliases. 
951
952         * class.cs (TypeContainer): Remove LookupAlias from here.
953
954         * decl.cs (DeclSpace); Move here.
955
956 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
957
958         * class.cs (FindMembers): Only call filter if the constructor
959         bulider is not null.
960
961         Also handle delegates in `NestedTypes' now.  Now we will perform
962         type lookups using the standard resolution process.  This also
963         fixes a bug.
964
965         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
966         This uses Expressions (the limited kind that can be parsed by the
967         tree) instead of strings.
968
969         * expression.cs (ComposedCast.ToString): Implement, used to flag
970         errors since now we have to render expressions.
971
972         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
973         FormArrayType. 
974
975         * ecore.cs (SimpleName.ToString): ditto.
976
977         * cs-parser.jay: Instead of using strings to assemble types, use
978         Expressions to assemble the type (using SimpleName, ComposedCast,
979         MemberAccess).  This should fix the type lookups in declarations,
980         because we were using a different code path for this.
981
982         * statement.cs (Block.Resolve): Continue processing statements
983         even when there is an error.
984
985 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
986
987         * class.cs (Event.Define): Also remove the `remove' method from
988         the list of pending items.
989
990         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
991         generate more compact code. 
992
993 2002-07-17  Martin Baulig  <martin@gnome.org>
994
995         * const.cs (Const.LookupConstantValue): Add support for constant
996         `unchecked' and `checked' expressions.
997         Also adding test case test-140.cs for this.
998
999 2002-07-17  Martin Baulig  <martin@gnome.org>
1000
1001         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
1002         check whether mi.ReturnType implements the IEnumerator interface; the
1003         `==' and the IsAssignableFrom() will fail in this situation.
1004
1005 2002-07-16  Ravi Pratap  <ravi@ximian.com>
1006
1007         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
1008         here too.
1009
1010 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1011
1012         * expression.cs: fixed bug #27811.
1013
1014 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
1015
1016         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
1017         Molaro: when we are a ref, the value already contains a pointer
1018         value, do not take the address of it.
1019
1020 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1021         * removed mb-parser.jay and mb-tokenizer.cs
1022
1023 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
1024
1025         * expression.cs: check against the building corlib void type.
1026
1027 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
1028
1029         * ecore.cs: fix for valuetype static readonly fields: when 
1030         initializing them, we need their address, not the address of a copy.
1031
1032 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
1033
1034         * typemanager.cs: register also enum_type in corlib.
1035
1036 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
1037
1038         * class.cs: allow calling this (but not base) initializers in structs.
1039
1040 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
1041
1042         * ecore.cs: make sure we compare against the building base types
1043         in GetTypeSize ().
1044
1045 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
1046
1047         * typemanager.cs: fix TypeToCoreType() to handle void and object
1048         (corlib gets no more typerefs after this change).
1049
1050 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
1051
1052         * expression.cs (ArrayCreation.EmitArrayArguments): use
1053         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
1054
1055         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
1056         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
1057         array indexes, the runtime actually forbids them.
1058
1059         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
1060         for array arguments here.
1061
1062         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
1063         instead of the default for ValueTypes.
1064
1065         (New.DoEmit): Use IsValueType instead of
1066         IsSubclassOf (value_type)
1067         (New.DoResolve): ditto.
1068         (Invocation.EmitCall): ditto.
1069
1070         * assign.cs (Assign): ditto.
1071
1072         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
1073         Statements *are* currently doing part of their resolution during
1074         Emit.  
1075
1076         Expressions do always resolve during resolve, but statements are
1077         only required to propagate resolution to their children.
1078
1079 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
1080
1081         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
1082
1083         (LoadAssembly): Do not add the dll if it is already specified
1084         
1085         (MainDriver): Add the System directory to the link path at the end,
1086         after all the other -L arguments. 
1087
1088         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
1089         wrong opcode for loading bytes and bools (ldelem.i1 instead of
1090         ldelem.u1) and using the opposite for sbytes.
1091
1092         This fixes Digger, and we can finally run it.
1093
1094         * driver.cs (UnixParseOption): Move the option parsing here.  
1095         (CSCParseOption): Implement CSC-like parsing of options.
1096
1097         We now support both modes of operation, the old Unix way, and the
1098         new CSC-like way.  This should help those who wanted to make cross
1099         platform makefiles.
1100
1101         The only thing broken is that /r:, /reference: and /lib: are not
1102         implemented, because I want to make those have the same semantics
1103         as the CSC compiler has, and kill once and for all the confussion
1104         around this.   Will be doing this tomorrow.
1105
1106         * statement.cs (Unsafe.Resolve): The state is checked during
1107         resolve, not emit, so we have to set the flags for IsUnsfe here.
1108
1109 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
1110
1111         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
1112         not catch the Error_ObjectRefRequired in SimpleName (as it is
1113         possible to have a class/instance variable name that later gets
1114         deambiguated), we have to check this here.      
1115
1116 2002-07-10  Ravi Pratap  <ravi@ximian.com>
1117
1118         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
1119         make static and put into Expression.
1120
1121         (Event.Define): Register the private field of the event with the 
1122         TypeManager so that GetFieldFromEvent can get at it.
1123
1124         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
1125         keep track of the private field associated with an event which
1126         has no accessors.
1127
1128         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
1129         private field.
1130
1131         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
1132         
1133 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
1134
1135         * expression.cs (Binary.EmitBranchable): this routine emits the
1136         Binary expression in a branchable context.  This basically means:
1137         we need to branch somewhere, not just get the value on the stack.
1138
1139         This works together with Statement.EmitBoolExpression.
1140
1141         * statement.cs (Statement.EmitBoolExpression): Use
1142         EmitBranchable. 
1143
1144 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
1145
1146         * statement.cs (For): Reduce the number of jumps in loops.
1147
1148         (For): Implement loop inversion for the For statement.
1149
1150         (Break): We can be breaking out of a Try/Catch controlled section
1151         (foreach might have an implicit try/catch clause), so we need to
1152         use Leave instead of Br.
1153
1154         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
1155         now).  If the instace expression supports IMemoryLocation, we use
1156         the AddressOf method from the IMemoryLocation to extract the
1157         address instead of emitting the instance.
1158
1159         This showed up with `This', as we were emitting the instance
1160         always (Emit) instead of the Address of This.  Particularly
1161         interesting when This is a value type, as we dont want the Emit
1162         effect (which was to load the object).
1163         
1164 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
1165
1166         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
1167
1168         * statement.cs (Checked): Set the CheckedState during the resolve
1169         process too, as the ConvCast operations track the checked state on
1170         the resolve process, and not emit.
1171
1172         * cs-parser.jay (namespace_member_declaration): Flag that we have
1173         found a declaration when we do.  This is used to flag error 1529
1174
1175         * driver.cs: Report ok when we display the help only.
1176
1177 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
1178
1179         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
1180
1181 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
1182
1183         * cs-tokenizer.cs (define): We also have to track locally the
1184         defines.  AllDefines is just used for the Conditional Attribute,
1185         but we also need the local defines for the current source code. 
1186
1187 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
1188
1189         * statement.cs (While, For, Do): These loops can exit through a
1190         Break statement, use this information to tell whether the
1191         statement is the last piece of code.
1192
1193         (Break): Flag that we break.
1194
1195         * codegen.cs (EmitContexts): New `Breaks' state variable.
1196
1197 2002-07-03  Martin Baulig  <martin@gnome.org>
1198
1199         * class.cs (TypeContainer.MethodModifiersValid): Allow override
1200         modifiers in method declarations in structs.  Otherwise, you won't
1201         be able to override things like Object.Equals().
1202
1203 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
1204
1205         * class.cs (Method, Property, Indexer): Do not allow the public
1206         modifier to be used in explicit interface implementations.
1207
1208         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
1209         override modifiers in method declarations in structs
1210
1211 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
1212
1213         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
1214         integer or real overflow, report an error
1215
1216 2002-07-02  Martin Baulig  <martin@gnome.org>
1217
1218         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
1219         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
1220         to tell the runtime about our newly created System.Object and
1221         System.ValueType types.
1222
1223 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
1224
1225         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
1226         struct instead of Ldarg/Starg.
1227
1228 2002-07-02  Martin Baulig  <martin@gnome.org>
1229
1230         * expression.cs (Indirection.Indirection): Call
1231         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
1232
1233 2002-07-02  Martin Baulig  <martin@gnome.org>
1234
1235         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
1236         ValueType, call TypeManager.TypeToCoreType() on it.
1237         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
1238         the OpCodes.Newarr argument.
1239
1240 2002-07-02  Martin Baulig  <martin@gnome.org>
1241
1242         * expression.cs (Invocation.EmitCall): When compiling corlib,
1243         replace all calls to the system's System.Array type to calls to
1244         the newly created one.
1245
1246         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
1247         System.Array methods.
1248         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
1249         from the system's System.Array type which must be replaced.
1250
1251 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
1252
1253         * typemanager.cs: load unverifiable_code_ctor so we can build
1254         corlib using the correct type. Avoid using GetTypeCode() with
1255         TypeBuilders.
1256         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
1257         TypeManager.object_type to allow building corlib.
1258
1259 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
1260
1261         * ecore.cs: handle System.Enum separately in LoadFromPtr().
1262
1263 2002-07-01  Martin Baulig  <martin@gnome.org>
1264
1265         * class.cs: Make the last change actually work, we need to check
1266         whether `ifaces != null' to avoid a crash.
1267
1268 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
1269
1270         * class.cs: when we build structs without fields that implement
1271         interfaces, we need to add the interfaces separately, since there is
1272         no API to both set the size and add the interfaces at type creation
1273         time.
1274
1275 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
1276
1277         * expression.cs: the dimension arguments to the array constructors
1278         need to be converted if they are a long.
1279
1280 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
1281
1282         * class.cs: don't emit ldarg.0 if there is no parent constructor
1283         (fixes showstopper for corlib).
1284
1285 2002-06-29  Martin Baulig  <martin@gnome.org>
1286
1287         MCS now compiles corlib on GNU/Linux :-)
1288
1289         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
1290         ie. check for MethodImplOptions.InternalCall.
1291
1292         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
1293         and TypeManager.attribute_type are null, so we must explicitly check
1294         whether parent is not null to find out whether it's an attribute type.
1295         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
1296         and SetBuilder, not only if the property is neither abstract nor external.
1297         This is necessary to set the MethodImplOptions on the accessor methods.
1298         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
1299         SetBuilder, see Property.Emit().
1300
1301         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
1302         populate "System.Object", "System.ValueType" and "System.Attribute" since
1303         they've already been populated from BootCorlib_PopulateCoreTypes().
1304
1305 2002-06-29  Martin Baulig  <martin@gnome.org>
1306
1307         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
1308         is the NullLiteral, we also need to make sure that target_type is not
1309         an enum type.   
1310
1311 2002-06-29  Martin Baulig  <martin@gnome.org>
1312
1313         * rootcontext.cs (RootContext.ResolveCore): We must initialize
1314         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
1315         before calling BootstrapCorlib_ResolveDelegate ().
1316
1317 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1318
1319         * statement.cs: fixed build-breaker. All tests passed ok.
1320
1321 2002-06-27  Martin Baulig  <martin@gnome.org>
1322
1323         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
1324         for System.Decimal when compiling corlib.
1325
1326 2002-06-27  Martin Baulig  <martin@gnome.org>
1327
1328         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
1329         switch blocks which contain nothing but a default clause.
1330
1331 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
1332
1333        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
1334
1335 2002-06-27  Martin Baulig  <martin@gnome.org>
1336
1337         * ecore.cs (PropertyExpr.PropertyExpr): Call
1338         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
1339
1340         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
1341         is already a TypeBuilder.
1342
1343 2002-06-27  Martin Baulig  <martin@gnome.org>
1344
1345         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
1346         `target_type == TypeManager.array_type', not IsAssignableFrom() in
1347         the "from an array-type to System.Array" case.  This makes it work
1348         when compiling corlib.
1349
1350 2002-06-27  Martin Baulig  <martin@gnome.org>
1351
1352         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
1353         non-static PropertyExpr, set its InstanceExpression.  This makes
1354         the `ICollection.Count' property work in System/Array.cs.
1355
1356 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
1357
1358         * driver.cs: Made error handling more consistent.  Errors now
1359         tracked by Report class, so many methods which used to return int
1360         now return void.  Main() now prints success/failure and 
1361         errors/warnings message.
1362
1363         Renamed '--probe' compiler argument to '--expect-error'.  Removed
1364         the magic number return values (123 and 124).  Now, if the
1365         expected error occurs, the compiler exits with success (exit value
1366         0).  If the compilation completes without seeing that particular
1367         error, the compiler exits with failure (exit value 1).  The
1368         makefile in mcs/errors has been changed to handle the new behaviour.
1369
1370         * report.cs: Made 'expected error' number a property and renamed
1371         it from 'Probe' to 'ExpectedError'.
1372
1373         * genericparser.cs: Removed error handling support, since it is
1374         now all done by Report class.
1375
1376         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
1377         class, so parse() no longer returns an int.
1378
1379         * namespace.cs: Use Report.Error instead of GenericParser.error
1380
1381 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
1382
1383         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
1384         TypeContainer.AddOperator): At the front of the list put the
1385         explicit implementations, so they get resolved/defined first. 
1386
1387 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
1388
1389         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
1390         interface type is implemented by this TypeContainer.  Used during
1391         explicit interface implementation.
1392
1393         (Property.Define, Indexer.Define, Method.Define): Validate that
1394         the given interface in the explicit implementation is one of the
1395         base classes for the containing type.
1396
1397         Also if we are explicitly implementing an interface, but there is
1398         no match in the pending implementation table, report an error.
1399
1400         (Property.Define): Only define the property if we are
1401         not explicitly implementing a property from an interface.  Use the
1402         correct name also for those properties (the same CSC uses,
1403         although that is really not needed).
1404         
1405         (Property.Emit): Do not emit attributes for explicitly implemented
1406         properties, as there is no TypeBuilder.
1407
1408         (Indexer.Emit): ditto.
1409
1410         Hiding then means that we do not really *implement* a pending
1411         implementation, which makes code fail.
1412
1413 2002-06-22  Martin Baulig  <martin@gnome.org>
1414
1415         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
1416         the return value of Object.GetType().  [FIXME: we need to do this whenever
1417         we get a type back from the reflection library].
1418
1419 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
1420
1421         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
1422
1423 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
1424
1425         * attribute.cs: Return null if we can not look up the type.
1426
1427         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
1428         the interface types found.
1429
1430         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
1431         interface types found.
1432
1433         * typemanager.cs (GetInterfaces): Make this routine returns alll
1434         the interfaces and work around the lame differences between
1435         System.Type and System.Reflection.Emit.TypeBuilder in the results
1436         result for GetInterfaces.
1437         
1438         (ExpandInterfaces): Given an array of interface types, expand and
1439         eliminate repeated ocurrences of an interface.  This expands in
1440         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
1441         be IA, IB, IC.
1442         
1443 2002-06-21  Martin Baulig  <martin@gnome.org>
1444
1445         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
1446         on System.Enum.
1447
1448 2002-06-21  Martin Baulig  <martin@gnome.org>
1449
1450         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
1451         and called with one of the core types, return the corresponding typebuilder for
1452         that type.
1453
1454         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
1455         element type.
1456
1457 2002-06-21  Martin Baulig  <martin@gnome.org>
1458
1459         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
1460         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
1461         (Expression.ConvertReferenceExplicit): Likewise.
1462
1463         * expression.cs (ElementAccess.DoResolve): Likewise.
1464         (ElementAccess.DoResolveLValue): Likewise.
1465
1466 2002-06-10  Martin Baulig  <martin@gnome.org>
1467
1468         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
1469         add the "value" parameter to the parameter list.
1470
1471         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
1472         to our caller.
1473
1474 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
1475
1476         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
1477         the argument to an int, uint, long or ulong, per the spec.  Also
1478         catch negative constants in array creation.
1479
1480 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
1481
1482         * class.cs: do not allow the same interface to appear twice in
1483         the definition list.
1484
1485 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
1486
1487         * ecore.cs: don't use ldlen with System.Array.
1488
1489 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
1490
1491         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
1492
1493 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
1494
1495         * modifiers.cs: produce correct field attributes for protected
1496         internal. Easy fix so miguel can work on ther harder stuff:-)
1497
1498 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
1499
1500         * pending.cs: New file.  Move the code from class.cs here.
1501         Support clearning the pending flag for all methods (when not doing
1502         explicit interface implementation).
1503
1504 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
1505
1506         * rootcontext.cs: added a couple more types needed to bootstrap.
1507
1508 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
1509
1510         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
1511         constructor in the type, instead of any constructor in the type
1512         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
1513         a bug in the Mono runtime when applying the params attribute). 
1514
1515 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
1516         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
1517
1518 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
1519
1520         * expression.cs (Unary.ResolveOperator): Use TypeManager
1521         to resolve the type.
1522         
1523 2002-06-13  Ravi Pratap  <ravi@ximian.com>
1524
1525         * cs-parser.jay (enum_member_declaration): Pass in the attributes
1526         attached.
1527
1528         * enum.cs (AddEnumMember): Add support to store the attributes associated 
1529         with each member too.
1530
1531         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
1532         field builders too - this takes care of the enum member case.
1533
1534 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
1535
1536         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
1537         address-of operator on both value types and pointers.
1538         
1539 2002-06-10  Martin Baulig  <martin@gnome.org>
1540
1541         * interface.cs (Interface.PopulateIndexer): Add the indexer's
1542         PropertyBuilder to the `property_builders' list.
1543
1544         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
1545         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
1546         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
1547         find any indexers which are inherited from an interface.
1548
1549 2002-06-09  Martin Baulig  <martin@gnome.org>
1550
1551         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
1552         the same type as the constant if necessary.  There's also a test-130.cs
1553         for this.
1554
1555         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
1556
1557         * typemanager.cs (TypeManager.ChangeType): Previously known as
1558         Enum.ChangeEnumType().
1559
1560 2002-06-09  Martin Baulig  <martin@gnome.org>
1561
1562         * expression.cs (Cast.TryReduce): Added support for consts.
1563
1564 2002-06-08  Ravi Pratap  <ravi@ximian.com>
1565
1566         * class.cs (Accessor): Hold attributes information so we can pass
1567         it along.
1568
1569         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
1570         Modify to pass in attributes attached to the methods.
1571
1572         (add_accessor_declaration, remove_accessor_declaration): Ditto.
1573
1574         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
1575         to handle the Accessor kind :-)
1576
1577         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
1578         
1579 2002-06-08  Martin Baulig  <martin@gnome.org>
1580
1581         * expression.cs (Unary.TryReduceNegative): Added support for
1582         ULongConstants.
1583
1584 2002-06-08  Martin Baulig  <martin@gnome.org>
1585
1586         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
1587         name can't be found in the `defined_names' - the caller will do a
1588         MemberLookup in this case and thus find methods in System.Enum
1589         such as Enum.IsDefined().
1590
1591 2002-06-08  Martin Baulig  <martin@gnome.org>
1592
1593         * enum.cs (Enum.ChangeEnumType): This is a custom version of
1594         Convert.ChangeType() which works with TypeBuilder created types.
1595         (Enum.LookupEnumValue, Enum.Define): Use it here.
1596
1597         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
1598         `TypeBuilder.BaseType != null' check.
1599         (TypeContainer.FindMembers): Only lookup parent members if we
1600         actually have a parent.
1601         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
1602         (ConstructorInitializer.Resolve): Likewise.
1603
1604         * interface.cs (Interface.FindMembers): Added
1605         `TypeBuilder.BaseType != null' check.
1606
1607         * rootcontext.cs (RootContext.ResolveCore): Added
1608         "System.Runtime.CompilerServices.IndexerNameAttribute" to
1609         classes_second_stage.
1610
1611         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
1612         debug_type and trace_type when compiling with --nostdlib.       
1613
1614 2002-06-07  Martin Baulig  <martin@gnome.org>
1615
1616         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
1617         (AddField): Set it to true when adding a non-static field.
1618         (DefineType): Use `have_nonstatic_fields' to find out whether we
1619         have non-static fields, not `Fields != null'.
1620
1621 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
1622
1623         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
1624         dereferencing a null on the static-field code path)
1625
1626 2002-05-30  Martin Baulig  <martin@gnome.org>
1627
1628         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
1629         to take command line arguments.  Use reflection to call the new
1630         custom `Initialize' function on the symbol writer and pass it the
1631         command line arguments.
1632
1633         * driver.cs (--debug-args): New command line argument to pass command
1634         line arguments to the symbol writer.
1635
1636 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
1637
1638         * assign.cs (DoResolve): Forgot to do the implicit conversion to
1639         the target type for indexers and properties.  Thanks to Joe for
1640         catching this.
1641
1642 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
1643
1644         * typemanager.cs (MethodFlags): returns the method flags
1645         (Obsolete/ShouldIgnore) that control warning emission and whether
1646         the invocation should be made, or ignored. 
1647
1648         * expression.cs (Invocation.Emit): Remove previous hack, we should
1649         not do this on matching a base type, we should do this based on an attribute
1650
1651         Only emit calls to System.Diagnostics.Debug and
1652         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
1653         on the command line.
1654
1655         * rootcontext.cs: Global settings for tracing and debugging.
1656
1657         * cs-tokenizer.cs (define): New utility function to track
1658         defines.   Set the global settings for TRACE and DEBUG if found.
1659
1660 2002-05-25  Ravi Pratap  <ravi@ximian.com>
1661
1662         * interface.cs (Populate*): Pass in the TypeContainer as well as
1663         the DeclSpace as parameters so that we can create EmitContexts and
1664         then use that to apply attributes etc.
1665
1666         (PopulateMethod, PopulateEvent, PopulateProperty)
1667         (PopulateIndexer): Apply attributes everywhere.
1668
1669         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
1670         etc.
1671
1672         (ApplyAttributes): Update accordingly.
1673
1674         We now apply interface attributes for all members too.
1675
1676 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
1677
1678         * class.cs (Indexer.Define); Correctly check if we are explicit
1679         implementation (instead of checking the Name for a ".", we
1680         directly look up if the InterfaceType was specified).
1681
1682         Delay the creation of the PropertyBuilder.
1683
1684         Only create the PropertyBuilder if we are not an explicit
1685         interface implementation.   This means that explicit interface
1686         implementation members do not participate in regular function
1687         lookups, and hence fixes another major ambiguity problem in
1688         overload resolution (that was the visible effect).
1689
1690         (DefineMethod): Return whether we are doing an interface
1691         implementation. 
1692         
1693         * typemanager.cs: Temporary hack until we get attributes in
1694         interfaces (Ravi is working on that) and we get IndexerName
1695         support in interfaces.
1696
1697         * interface.cs: Register the indexers as properties.
1698
1699         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
1700         warning, I have verified that this is a bug in the .NET runtime
1701         (JavaScript suffers of the same problem).
1702
1703         * typemanager.cs (MemberLookup): When looking up members for
1704         interfaces, the parent of an interface is the implicit
1705         System.Object (so we succeed in searches of Object methods in an
1706         interface method invocation.  Example:  IEnumerable x;  x.ToString
1707         ()) 
1708
1709 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
1710
1711         * class.cs (Event): Events should also register if they do
1712         implement the methods that an interface requires.
1713
1714         * typemanager.cs (MemberLookup); use the new GetInterfaces
1715         method. 
1716
1717         (GetInterfaces): The code used to lookup interfaces for a type is
1718         used in more than one place, factor it here. 
1719
1720         * driver.cs: Track the errors at the bottom of the file, we kept
1721         on going.
1722
1723         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
1724         instance if the method we are calling is static!
1725
1726 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
1727
1728         * attribute.cs (ApplyAttributes): Make this function filter out
1729         the IndexerName attribute (as that attribute in reality is never
1730         applied) and return the string constant for the IndexerName
1731         attribute. 
1732
1733         * class.cs (TypeContainer.Emit): Validate that all the indexers
1734         have the same IndexerName attribute, and if so, set the
1735         DefaultName attribute on the class. 
1736
1737         * typemanager.cs: The return value might contain other stuff (not
1738         only methods).  For instance, consider a method with an "Item"
1739         property and an Item method.
1740
1741         * class.cs: If there is a problem with the parameter types,
1742         return. 
1743
1744 2002-05-24  Ravi Pratap  <ravi@ximian.com>
1745
1746         * ecore.cs (ImplicitConversionExists): Wrapper function which also
1747         looks at user defined conversion after making a call to 
1748         StandardConversionExists - we need this for overload resolution.
1749
1750         * expression.cs : Update accordingly the various method calls.
1751
1752         This fixes 2 bugs filed against implicit user defined conversions 
1753
1754 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
1755
1756         * statement.cs: Track the result of the assignment.
1757
1758 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
1759
1760         * expression.cs (MemberAccess): Improved error reporting for
1761         inaccessible members.
1762
1763 2002-05-22  Martin Baulig  <martin@gnome.org>
1764
1765         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
1766         itself with debugging support.
1767
1768 2002-05-22  Martin Baulig  <martin@gnome.org>
1769
1770         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
1771         Removed, this isn't needed anymore.
1772
1773 2002-05-20  Martin Baulig  <martin@gnome.org>
1774
1775         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
1776         be underlying type for an enum.
1777
1778 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
1779
1780         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
1781         that splits out the loading of just the core types.
1782
1783         * rootcontext.cs (ResolveCore): Split the struct resolution in
1784         two, so we can load the enumeration underlying types before any
1785         enums are used.
1786
1787         * expression.cs (Is): Bandaid until we fix properly Switch (see
1788         bug #24985 for details).
1789
1790         * typemanager.cs (ImplementsInterface): The hashtable will contain
1791         a null if there are no interfaces implemented.
1792
1793 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
1794
1795         * cs-parser.jay (indexer_declarator): It is fine to have array
1796         parameters
1797
1798 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
1799
1800         * typemanager.cs: (RegisterBuilder): New function used to register
1801         TypeBuilders that implement interfaces.  Since
1802         TypeBuilder.GetInterfaces (as usual) does not work with lame
1803         Reflection.Emit. 
1804         (AddUserType): register interfaces.
1805
1806         (ImplementsInterface): Use the builder_to_ifaces hash if we are
1807         dealing with TypeBuilder.  Also, arrays are showing up as
1808         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
1809         methods can not be invoked on them!
1810
1811         * ecore.cs (ExplicitReferenceConversionExists): Made public.
1812         (ImplicitReferenceConversionExists): Split out from
1813         StandardConversionExists. 
1814
1815         * expression.cs (As): We were only implementing one of the three
1816         cases for the as operator.  We now implement them all.
1817         (Is): Implement the various other cases for Is as well.
1818
1819         * typemanager.cs (CACHE): New define used to control if we want or
1820         not the FindMembers cache.  Seems to have a negative impact on
1821         performance currently
1822
1823         (MemberLookup): Nested types have full acess to
1824         enclosing type members
1825
1826         Remove code that coped with instance/static returns for events, we
1827         now catch this in RealFindMembers.
1828
1829         (RealFindMembers): only perform static lookup if the instance
1830         lookup did not return a type or an event.  
1831
1832 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
1833
1834         * assign.cs (CompoundAssign): We pass more semantic information
1835         now to Compound Assignments than we did before: now we have all
1836         the information at hand, and now we resolve the target *before* we
1837         do the expression expansion, which allows the "CacheValue" method
1838         to have the effect we intended (before, a [x] += 1 would generate
1839         two differen ArrayAccess expressions from the ElementAccess,
1840         during the resolution process).
1841
1842         (CompoundAssign.DoResolve): Resolve target and original_source here.
1843
1844 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
1845
1846         * expression.cs (ArrayAccess): dropped debugging information. 
1847
1848         * typemanager.cs: Small bug fix: I was always returning i_members,
1849         instead of one of i_members or s_members (depending on which had
1850         the content).
1851
1852         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
1853         method is invoked before any code generation takes place, and it
1854         is a mechanism to inform that the expression will be invoked more
1855         than once, and that the method should use temporary values to
1856         avoid having side effects
1857
1858         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
1859         
1860         * ecore.cs (Expression.CacheTemporaries): Provide empty default
1861         implementation.
1862
1863         * expression.cs (Indirection, ArrayAccess): Add support for
1864         CacheTemporaries in these two bad boys. 
1865
1866         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
1867         ldobj or ldind_ref.  
1868         (StoreFromPtr): Handle stobj as well.
1869
1870         * expression.cs (UnaryMutator): Share more code.
1871         
1872         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
1873         down: I was not tracking the Filter function as well, which
1874         was affecting the results of the cache.
1875
1876 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
1877
1878         * attribute.cs: Remove the hack to handle the CharSet property on
1879         StructLayouts. 
1880
1881 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
1882
1883         * attribute.cs (DoResolve): More uglyness, we now only try to
1884         resolve the attribute partially, to extract the CharSet
1885         information (only if we are a StructLayout attribute).  Otherwise 
1886
1887         (GetExtraTypeInfo): Add some code to conditionally kill in the
1888         future this.   I am more and more convinced that the .NET
1889         framework has special code to handle the attribute setting on
1890         certain elements.
1891
1892         * expression.cs (IsParamsMethodApplicable): Revert my previous
1893         foreach change here, it was wrong.
1894
1895 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
1896
1897         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
1898         (pp_expr): do not abort on unknown input, just return.
1899         (eval): abort if there are pending chars.
1900
1901         * attribute.cs (Attribute.Resolve): Positional parameters are
1902         optional.  Deal with that case.
1903
1904         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
1905         the Ansi/Unicode/Auto information for the type.
1906
1907         (TypeContainer.DefineType): instantiate the EmitContext here, as
1908         we will be using it during the type definition (to resolve
1909         attributes) and during the emit phase.
1910
1911         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
1912         to pull type information out of the attributes
1913
1914         (Attribute.Resolve): track the constructor builder, and allow for
1915         multiple invocations (structs and classes will use this).
1916
1917         * ecore.cs (MemberLookupFinal): new version with all the
1918         parameters customizable.
1919
1920         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
1921         constructors.  Return if the result value is null (as the error
1922         would have been flagged already by MemberLookupFinal)
1923
1924         Do not allow instances of abstract classes or interfaces to be
1925         created.
1926         
1927         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
1928         We have to compare the assembly property here when dealing with
1929         FamANDAssem and Assembly access modifiers, because we might be
1930         creating an assembly from *modules* (that means that we are not
1931         getting TypeBuilders for types defined in other modules that are
1932         part of this assembly).
1933
1934         (Method.Emit): If the method is marked abstract and has a body,
1935         emit an error. 
1936
1937         (TypeContainer.DefineMembers): If both the defined member and the
1938         parent name match are methods, then do not emit any warnings: let
1939         the Method.Define routine take care of flagging warnings.  But if
1940         there is a mismatch (method overrides something else, or method is
1941         overriwritten by something, then emit warning).
1942
1943         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
1944         set to null, this means `do not check for the return type on the
1945         signature'. 
1946
1947         (Method.Define): set the return type for the method signature to
1948         null, so that we get methods with the same name and parameters and
1949         different return types.  This is used to flag warning 114 (you are
1950         hiding a method, and you probably want to use the new/override
1951         keywords instead).
1952
1953         * typemanager.cs (MemberLookup): Implemented proper access
1954         control, closing a long standing set of bug reports.  The problem
1955         was that the Framework only has two bits: Public and NonPublic,
1956         and NonPublic includes private and protected methods, but we need
1957         to enforce the FamANDAssem, FamOrAssem and Family. 
1958
1959 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
1960
1961         * statement.cs (GotoCase): Return true: Ammounts to giving up
1962         knowledge on whether we return or not, and letting the other case
1963         be responsible for it.
1964
1965 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
1966
1967         * driver.cs: Do not load directories for each file processed, only
1968         do it if there is a pattern.
1969
1970         * ecore.cs: Report readonly assigns here as well, as we might have
1971         been resolved only by MemberAccess.
1972
1973         (SimpleName.SimpleNameResolve): Also be useful for LValue
1974         resolution.   We need this to propagate assign to local readonly variables
1975
1976         * typemanager.cs: Use a ptrhashtable for the criteria, because we
1977         do not want to reuse potential criteria memory.
1978
1979         * class.cs (MyEventBuilder): Set reflected_type;
1980
1981         * ecore.cs (Constantify): Added support for constifying bools.
1982
1983         (RootContext.LookupType): Added a cache for values looked up in
1984         the declaration space.
1985
1986         * typemanager.cs (FindMembers): Now is a front-end to
1987         RealFindMembers, and provides a two-level hashtable-based cache to
1988         the request.  
1989
1990         15% performance improvement: from 22.5 to 19.2 seconds.
1991
1992         * expression.cs (IsParamsMethodApplicable): use foreach.
1993         (Invocation.DoResolve): ditto.
1994         (New.DoResolve): ditto.
1995         (ArrayCreation.DoResolve): ditto.
1996
1997         * ecore.cs (FindMostEncompassingType): use foreach.
1998
1999         * delegate.cs (NewDelegate.DoResolve): Use foreach
2000
2001         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
2002         (RemoveMethods): use foreach.
2003
2004         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
2005         nested foreach statements instead of for, and also break out of
2006         the inner loop once a match is found.
2007         
2008         (Invocation.OverloadResolve): Use foreach, simplify the code. 
2009
2010 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
2011
2012         * cfold.cs (BinaryFold): During an enumeration evaluation context,
2013         we actually unwrap the expression to allow for extra information
2014         to be extracted. 
2015
2016         * expression.cs: Use Shr_Un on unsigned operations. 
2017
2018 2002-05-08  Ravi Pratap  <ravi@ximian.com>
2019
2020         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
2021         applicable operators was not being considered correctly. This closes
2022         the bug Miguel reported.
2023
2024 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
2025
2026         * attribute.cs: check that the type derives from System.Attribute
2027         and report the correct error in that case (moved the duplicate code to
2028         its own method, too).
2029
2030 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
2031
2032         * attribute.cs: lookup attribute type name as the spec says: first the
2033         bare attribute name and then name + "Attribute" (nant compiles with
2034         mcs after this fix).
2035
2036 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
2037
2038         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
2039         Because of the way we parse things, we should try to see if a
2040         UIntConstant can fit in an integer.
2041
2042 2002-05-07  Ravi Pratap  <ravi@ximian.com>
2043
2044         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
2045         when we are in an explicit context.
2046
2047         (ConvertReferenceExplicit): When converting from Iface type S to Class
2048         T make sure the rules are implemented as an OR.
2049
2050         * parameter.cs (ParameterType): Make it a property for now although the
2051         purpose really isn't anything immediate.
2052         
2053         * expression.cs (Is*Applicable): Do better checking on the parameter type
2054         of a ref/out parameter. The ones from the system assemblies are already 
2055         marked with the correct type so we don't need to do any correction.
2056
2057         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
2058         the object type is standard too so include that.
2059
2060 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
2061
2062         * ecore.cs (StandardConversionExists): Augment with missing code:
2063         deal with IntConstant, LongConstants and Enumerations.
2064
2065         * assign.cs: Report the error, instead of failing silently
2066
2067         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
2068         typecontainer that they are declared, because the
2069         typecontainer/namespace will have the list of using clauses that
2070         need to be applied.
2071
2072         Assembly Attributes were escaping the normal registration
2073         mechanism. 
2074
2075         (EmitCode): Apply attributes within an EmitContext that represents
2076         the container they were declared on.
2077         
2078         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
2079
2080 2002-05-06  Ravi Pratap  <ravi@ximian.com>
2081
2082         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
2083         Revamp completely - make much cleaner as we now operate only
2084         on a set of Types.
2085
2086         (FindMostSpecificSource, FindMostSpecificTarget): New methods
2087         to implement the logic detailed in the spec more correctly.
2088
2089         (UserDefinedConversion): Update accordingly.
2090
2091 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
2092
2093         * statement.cs: Return flow analysis information up.
2094
2095         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
2096         and the default.
2097
2098         (token): Do not consume an extra character before calling
2099         decimal_digits.
2100
2101 2002-05-06  Piers Haken <piersh@friskit.com>
2102
2103         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
2104
2105 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
2106
2107         * class.cs (Constructor.Emit): Set the IsStatic flag in the
2108         EmitContext during the instance constructor initializer
2109         resolution, to stop access to instance variables.
2110
2111         This is mandated by the spec, last paragraph of the `constructor
2112         initializers' section. 
2113
2114 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
2115
2116         * cs-parser.jay, class.cs (Accessor): new class used to represent
2117         an accessor (get or set).  In the past we used `null' to represent
2118         a missing accessor.  But this is ambiguous because there was no
2119         way to tell in abstract indexers/properties if one of them was
2120         specified.
2121
2122         Now there is a way of addressing that.
2123
2124         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
2125         instead of FindMembers.
2126
2127         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
2128         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
2129
2130         * attribute.cs: Treat indexers and properties as the same in terms
2131         of applying attributes
2132
2133         * ecore.cs (FindMostEncompassedType): Use statically initialized
2134         EmptyExpressions()s like we do elsewhere to avoid creating useless
2135         objects (and we take this out of the tight loop).
2136
2137         (GetConversionOperators): Move the code to extract the actual
2138         operators to a separate routine to clean things up.
2139
2140 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
2141
2142         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
2143         events are always registered FieldBuilders.
2144         
2145         * class.cs (FieldBase): New class shared by Fields 
2146
2147         * delegate.cs: If we are a toplevel delegate, use our full name.
2148         If we are a nested delegate, then only use our tail name.
2149
2150 2002-05-02  Ravi Pratap  <ravi@ximian.com>
2151
2152         * expression.cs (IsApplicable): Ensure that we add the "&" to
2153         ref/out types before comparing it with the type of the argument.
2154
2155         (IsParamsMethodApplicable): Ditto.
2156
2157         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
2158         silly me ;-)
2159
2160         * delegate.cs : Handle the case when we have more than one applicable
2161         method. Flag an error only when we finish checking all.
2162
2163 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
2164
2165         * expression.cs: Add support for boolean static initializers.
2166
2167 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
2168
2169         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
2170
2171         * parameter.cs (ComputeParameterTypes,
2172         ComputeAndDefineParameterTypes): Better error handling: now we
2173         clear the `types' cache if we fail during any of the type lookups.
2174         We also return the status code correctly to our caller
2175
2176         * delegate.cs: If we fail to define a delegate, abort the extra
2177         steps. 
2178
2179         * expression.cs (Binary.ResolveOperator): for
2180         operator==(object,object) and operator !=(object, object) we also
2181         have to verify that there is an implicit conversion from one to
2182         the other.
2183
2184         (ArrayAccess.DoResolve): Array Access can operate on
2185         non-variables. 
2186
2187 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
2188
2189         * assign.cs (CompoundAssign): A new class used as a "flag" that
2190         the assignment actually is happening as part of a compound
2191         assignment operator.
2192
2193         During compound assignment, a few new rules exist to enable things
2194         like:
2195
2196         byte b |= 1 + 2
2197
2198         From the spec:
2199         
2200         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
2201         to the type of x) if y is implicitly convertible to the type of x,
2202         and the operator is a builtin operator and the return type of the
2203         operator is explicitly convertible to the type of x. 
2204
2205         * rootcontext.cs: Reset warning level to 2.  4 catches various
2206         "interesting" features in mcs, we must clean this up at some
2207         point, but currently am trying to kill other bugs ;-)
2208
2209         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
2210         in container classes as well.  
2211
2212         * expression.cs (Binary.ResolveOperator): Handle string case
2213         before anything else (as operator overloading does emit an error
2214         before doing anything else).
2215
2216         This code could go away when we move to a table driven model, but
2217         i could not come up with a good plan last night.
2218         
2219 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
2220
2221         * typemanager.cs (CSharpName): reimplementation using regex.
2222         * class.cs: added null check for fields in Emit
2223         * rootcontext.cs: set warninglevel to 4
2224
2225 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
2226
2227         * typemanager.cs (CSharpName): reimplemented with Lupus
2228         suggestion.
2229
2230 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
2231
2232         * statement.cs (If): correclty implement Resolve, because we were
2233         not catching sem errors in there.  The same process is needed
2234         everywhere else. 
2235         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
2236         
2237
2238         (Statement.Warning_DeadCodeFound): Factorize code.
2239         (While): Report dead code here too.
2240
2241         (Statement): Added Resolve virtual method to allow
2242         for resolution split from the emit code.
2243
2244 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
2245
2246         * statement.cs (EmitBoolExpression): No longer try to resolve the
2247         expression here.    
2248         (MakeBoolean): New utility function that resolve, implicitly
2249         converts to boolean and tags the expression. 
2250         
2251
2252         (If, Do): Implement dead code elimination.
2253         (While): Implement loop inversion
2254
2255         (Do, While, For, If): Resolve the expression prior to calling our
2256         code generation.
2257
2258 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
2259
2260         * class.cs:
2261           - added method Report28 (warning: program has more than one entry point)
2262           - added method IsEntryPoint, implements paragraph 10.1 of the spec
2263           - modified method Method.Define, the part at the end of the method
2264
2265         * rootcontext.cs: added static public Location EntryPointLocation;
2266           
2267         * ../errors/cs0028.cs : Add test case for the above warning.              
2268
2269         * typemanager.cs:
2270           - modified method CSharpName to allow arrays of primitive type to
2271             be printed nicely (e.g. instead of System.Int32[][] it now prints
2272             int[][])
2273           - added method CSharpSignature: returns the signature of a method
2274             in string format to be used in reporting errors, warnings, etc.
2275
2276         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
2277         with String.Empty.
2278         
2279 2002-04-26  Ravi Pratap  <ravi@ximian.com>
2280
2281         * delegate.cs (Define): Fix extremely silly bug where I was
2282         setting the type of the 'object' parameter of the BeginInvoke
2283         method to System.IAsyncResult instead of System.Object ;-)
2284
2285 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
2286
2287         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
2288         here. 
2289
2290         (Constructor.Emit): return if we fail to initialize the
2291         constructor.  Another door closed!  
2292
2293         * expression.cs (New.DoResolve): Improve error message (from -6 to
2294         1501).  Use DeclaredOnly lookup to find the exact constructor.
2295
2296         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
2297         loop.  This is useful.
2298
2299         * cs-parser.jay: Adjust the default parameters so that destructors
2300         have the proper signature.
2301
2302 2002-04-26  Martin Baulig  <martin@gnome.org>
2303
2304         * driver.cs (LoadAssembly): If `assembly' contains any characters
2305         which are only valid in path names and not in assembly names
2306         (currently slash, backslash and point), use Assembly.LoadFrom ()
2307         instead of Assembly.Load () on the `assembly' (before iteration
2308         over the link_paths).
2309
2310 2002-04-26  Martin Baulig  <martin@gnome.org>
2311
2312         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
2313
2314 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
2315
2316         * class.cs (Property): use the new typemanager.MemberLookup
2317
2318         (TypeContainer.MemberLookup): Implement using the
2319         TypeManager.MemberLookup now. 
2320         
2321         * typemanager.cs: Make MemberLookup a function of the TypeManager,
2322         and return MemberInfos, so that these can be used without an
2323         EmitContext (what we had before).
2324
2325 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
2326
2327         * expression.cs: Fix the case where the argument to params if the
2328         type of the params.  I omitted handling this before.   Fixed
2329
2330 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
2331
2332         * driver.cs: Call BootCorlib_PopulateCoreType
2333
2334         * class.cs (Property.CheckBase): Check for properties only, not
2335         for all members. 
2336
2337         * interface.cs: Temporary hack: try/catch around the
2338         CustomAttributeBuilder, because I am getting an exception that I
2339         do not understand.
2340
2341         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
2342         types whose definitions are required to be there (attributes are
2343         defined before standard types).
2344
2345         Compute definitions as we boot the various types, as they are used
2346         immediately (value_type class will need object_type, but if we do
2347         not initialize object_type, we will pass a null, which will let
2348         the runtime pick the System.Object from the existing corlib, which
2349         is not what we want).
2350
2351 2002-04-22  Patrik Torstensson <totte@labs2.com>
2352
2353         * cs-tokenizer.cs: fixed a number of trim() issues.
2354
2355 2002-04-22  Ravi Pratap  <ravi@ximian.com>
2356
2357         * expression.cs (Argument.Type): Ensure that we return the correct
2358         type when we have out or ref parameters [in which case we 
2359         append a "&"].
2360         
2361 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
2362
2363         * class.cs (Property, Indexer): Allow extern modifier in there. 
2364
2365         * typemanager.cs (InitBaseTypes): Initializes object_type and
2366         value_type, since those will be used early on during the bootstrap
2367         process to compile corlib.
2368
2369         (InitCoreTypes): Move code from here to InitBaseTypes.
2370
2371 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
2372
2373         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
2374         single-dimension arrays as using the ldlen opcode.  
2375
2376         Daniel Lewis discovered this optimization.  
2377
2378         * typemanager.cs: Add signature for System.Array::get_Length
2379
2380 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2381
2382         * statement.cs: report the error when the foreach does not apply to an
2383         array nor a collection.
2384
2385 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
2386
2387         * expression.cs: Add implicit conversions to the operator ~.
2388
2389         * constant.cs (DecimalConstant.Emit): Emit decimal value.
2390
2391         * typemanager.cs: Locate the decimal constructor.
2392
2393 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2394
2395         * attribute.cs: use the new property of TypeOf.
2396         * expression.cs: added 'get' property around typearg.
2397
2398         These changes fix a build breaker reported by NickD. Is this the
2399         correct way to fix?  If not, please, revert my changes and make it
2400         work :-).
2401
2402 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
2403
2404         * attribute.cs: Add support for typeof in attribute invocations.
2405         I am not sure that this is right though.
2406
2407 2002-04-14  Duncan Mak  <duncan@ximian.com>
2408
2409         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
2410         Binary.Operator.Division case.
2411
2412 2002-04-13  Ravi Pratap  <ravi@ximian.com>
2413
2414         * class.cs (DefineType): Ensure that we do a proper check on
2415         attribute types and also register it with the TypeManager.
2416
2417         (TypeContainer.Targets): The default for attribute types is
2418         AttributeTargets.All.
2419         
2420         * attribute.cs (ApplyAttributes): Registering the attribute type
2421         is done elsewhere, not when we discover we have a Usage attribute.
2422
2423 2002-04-12  Ravi Pratap  <ravi@ximian.com>
2424
2425         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
2426         and get rid of is_delegate parameter.
2427
2428         * everywhere : update.
2429         
2430 2002-04-12  Ravi Pratap  <ravi@ximian.com>
2431
2432         * cs-parser.jay (compilation_unit): Revamp completely to use
2433         some new ideas that I got from Rhys' grammar to solve the problems
2434         with assembly level attributes.
2435
2436         (outer_declaration): New grammar production.
2437
2438         (attribute_sections): Add.
2439
2440         (opt_attributes): Base on attribute_sections
2441
2442         (namespace_declaration): Allow opt_attributes to tackle the case
2443         when we have assembly level attributes - we are clever in this
2444         regard now ;-)
2445
2446         * attribute.cs (ApplyAttributes): Do not worry about assembly 
2447         attributes in the non-global context.
2448
2449         * rootcontext.cs (AddGlobalAttributes): Go back to using this
2450         instead of SetGlobalAttributes.
2451
2452         * class.cs, rootcontext.cs : Ensure we define and generate 
2453         attribute types before anything else.
2454
2455         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
2456         and flag the new error -20 for the case when the attribute type
2457         does not have valid targets specified. csc does not catch this.
2458
2459         * ../errors/errors.txt : update for error # -20
2460
2461 2002-04-11  Ravi Pratap  <ravi@ximian.com>
2462
2463         * support.cs (InternalParameters.ParameterModifier): Do some null
2464         checking and return sane values.
2465
2466         * class.cs (Method.Define): If we are a PInvoke method, ensure
2467         that we are static and extern. Report error # 601
2468
2469         * ../errors/cs0601.cs : Add test case for the above error.
2470
2471 2002-04-07  Ravi Pratap  <ravi@ximian.com>
2472
2473         * rootcontext.cs (attribute_types): We need to keep type of
2474         all attribute types separately and emit code for them first.
2475
2476         (RegisterAttribute) : Implement.
2477
2478         * class.cs (DefineType): Check if the current Type is a custom
2479         attribute type and register it accordingly.
2480
2481         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
2482         adding the first attribute twice and rename to
2483
2484         (SetGlobalAttributes): this.
2485
2486         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
2487         lookups.
2488
2489         * attribute.cs (ApplyAttributes): Take an additional argument telling us
2490         if we are processing global arguments. Hmm, I am unsure of this.
2491
2492 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2493
2494         * expression.cs: added static array of strings to avoid calling
2495         Enum.ToString () for Operator in Binary. Significant recover of
2496         performance.
2497
2498 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
2499
2500         * class.cs (FindMembers): Allow the Builders of the various
2501         members to be null.  If they are skip them.  This only happens
2502         during the PInvoke declaration.
2503
2504 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
2505
2506         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
2507         failure, so we do not keep going afterwards.
2508
2509         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
2510         wanted to pass `false' as the `is_delegate' argument.  If this is
2511         the case, why not use delegate_type == null to mean `is_delegate =
2512         false' and anything else as is_delegate = true.
2513
2514 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
2515
2516         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
2517         code for the section, not the beginning of the tests.
2518
2519 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
2520
2521         * cfold.cs: Handle operator + (Enum x, Underlying x) 
2522
2523         * expression.cs (Binary): same.  Warn about errors where we have
2524         Enum/Enum in operator + as well.
2525
2526 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
2527
2528         * statement.cs:
2529                 - added support for switch(bool)
2530                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
2531                 - add TableSwitchEmit() to handle table-based switch statements
2532
2533 2002-04-05  Ravi Pratap  <ravi@ximian.com>
2534
2535         * expression.cs (Invocation.OverloadResolve): Factor out code which
2536         does parameter compatibility checking with arguments so that we can 
2537         re-use the code even from Delegate.VerifyApplicability
2538
2539         (VerifyArgumentsCompat): Move above code here.
2540
2541         * delegate.cs (VerifyApplicability): Get rid of duplicate code
2542         and instead make a call to the above method.
2543
2544 2002-03-31  Ravi Pratap  <ravi@ximian.com>
2545
2546         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
2547         We use it to keep track of classes which are attribute types.
2548
2549 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
2550
2551         * delegate.cs (Delegate.Define): Correctly define the types in the
2552         presence of fixed and array parameters.
2553
2554         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
2555         doing FindMembers.
2556
2557         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
2558         include NonPublic after the first iteration.
2559
2560         * class.cs (Indexer.CheckBase): Only check if both parents are
2561         non-null. 
2562         
2563         * cs-parser.jay (accessor_body): If empty, set to null.
2564
2565         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
2566         same code path here to resolve constants names that we did have in
2567         MemberAccess.DoResolve.  There is too much code duplicated here.
2568
2569 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
2570
2571         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
2572
2573         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
2574         to MakeUnionSet.
2575
2576         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
2577         tokens, numbers and strings.
2578
2579         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
2580         parenthesis.
2581
2582         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
2583         asyncronous parameters and the regular parameters.  
2584
2585         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
2586         specify the target directory.
2587
2588         * expression.cs: (This.DoResolve): Simplify
2589         (As.Emit): Optimize, do not generate IsInst if the expression is
2590         always of the given type.
2591
2592         (Is.DoResolve): Bug fix, we were reporting both always/never for
2593         the is expression.
2594
2595         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
2596         creating too many unnecessary arrays.
2597
2598 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
2599
2600         * class.cs (EmitFieldInitializer): Use Assign expression to assign
2601         fields instead of rolling our own initializer.   Takes care of all
2602         implicit conversions, and drops unnecessary static checks/argument.
2603
2604 2002-03-31  Dick Porter  <dick@ximian.com>
2605
2606         * driver.cs: use the GetDirectories() return values properly, and
2607         use "/" as path separator.
2608
2609 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
2610
2611         * expression.cs (Unary): Optimize - - expr into expr.
2612         (Binary): Optimize a + (-b) into a -b.
2613
2614         * codegen.cs (CodeGen): Made all methods static.
2615
2616 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
2617
2618         * rootcontext.cs: 
2619
2620         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
2621         TypeBuilder property.
2622
2623         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
2624         instead. 
2625
2626         * tree.cs: Removed the various RecordXXXX, and replaced with a
2627         single RecordDecl.  Removed all the accessor methods, and just
2628         left a single access point Type 
2629
2630         * enum.cs: Rename DefineEnum to DefineType.
2631
2632         * decl.cs: New abstract method `DefineType' used to unify the
2633         Defines for Enumerations, Interfaces, TypeContainers and
2634         Delegates.
2635
2636         (FindType): Moved LookupInterfaceOrClass here.  Moved the
2637         LookupBaseClasses method that used to live in class.cs and
2638         interface.cs here, and renamed to FindType.
2639         
2640         * delegate.cs: Implement DefineType.  Take advantage of the
2641         refactored pattern for locating the parent builder without taking
2642         the parent_builder argument (which we know does not work if we are
2643         nested, and triggering a toplevel definition).
2644
2645 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
2646
2647         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
2648         accessibility of a member has changed during override and report
2649         an error if so.
2650
2651         * class.cs (Method.Define, Property.Define): Only complain on
2652         overrides if the method is private, any other accessibility is
2653         fine (and since we just checked the permission is the same, we are
2654         good to go).
2655
2656         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
2657         and elif are processed always.  The other pre-processing
2658         directives are only processed if we are "taking" the path
2659
2660 2002-03-29  Martin Baulig  <martin@gnome.org>
2661
2662         * class.cs (Method.Emit): Only emit symbolic debugging info if the
2663         current location is not Null.
2664
2665         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
2666         a separate method so we can profile it.
2667
2668         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
2669         `span.Seconds' are just seconds, but no minutes or hours.
2670         (MainDriver): Profile the CodeGen.SaveSymbols calls.
2671
2672 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
2673
2674         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
2675         Remove the gratuitous set of Final:
2676
2677                                 // If an interface implementation, then we can set Final.
2678                                 if (((flags & MethodAttributes.Abstract) == 0) &&
2679                                     implementing.DeclaringType.IsInterface)
2680                                         flags |= MethodAttributes.Final;
2681
2682         I do not know what I was smoking when I used that.
2683         
2684
2685         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
2686         step into fixing the name resolution issues for delegates and
2687         unifying the toplevel name resolution.
2688
2689 2002-03-28  Martin Baulig  <martin@gnome.org>
2690
2691         * class.cs (Method.Emit): If we have a symbol writer, call its
2692         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
2693         tell it about the current method.
2694
2695         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
2696         writer that we're going to emit the first byte of IL code for a new
2697         statement (a new source line).
2698         (EmitContext.EmitTopBlock): If we have a symbol writer, call
2699         EmitContext.Mark() before emitting any code.
2700
2701         * location.cs (SymbolDocument): Return null when we're Null.
2702
2703         * statement.cs (Statement): Moved the `Location loc' variable here.
2704         (Statement.EmitBoolExpression): If we have a symbol writer, call
2705         ec.Mark() before emitting any code to tell it that we're at the
2706         beginning of a new statement.
2707         (StatementExpression): Added `Location' argument to the constructor.
2708         (Block): Added public readonly variable `StartLocation' and public
2709         variable `EndLocation'.  The latter is to be set using SetEndLocation().
2710         (Block): Added constructor which takes a start and end location.
2711         (Block.SetEndLocation): New method. This sets the end location.
2712         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
2713         local variables we create.
2714         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
2715         each statement and do also mark the begin and end of the block.
2716
2717         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
2718         tell it the current lexer.Location, use Location.Null for the end of the
2719         block.
2720         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
2721         current block, set its end location using SetEndLocation().
2722         (statement_expression): StatementExpression constructor now takes the
2723         lexer.Location as additional argument.
2724         (for_statement, declare_local_variables): Likewise.
2725         (declare_local_variables): When creating a new implicit block, use the
2726         new Block constructor and pass it the lexer.Location.
2727
2728 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
2729
2730         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
2731         members also on the parent interfaces recursively.
2732
2733 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
2734
2735         * report.cs: Use new formats, since Gonzalo finished the missing
2736         bits. 
2737
2738         * expression.cs (Binary.ResolveOperator): added missing operator|
2739         operator& and operator^ for bool/bool.
2740
2741         * cs-parser.jay: CheckDef now takes a Location argument that is
2742         used to report errors more precisly (instead of reporting the end
2743         of a definition, we try to track something which is a lot closer
2744         to the source of the problem).
2745
2746         * cs-tokenizer.cs: Track global token use, so we can properly flag
2747         the use of #define/#undef after the first token has been seen.
2748
2749         Also, rename the reportXXXX to Error_DescriptiveName
2750
2751         * decl.cs (DeclSpace.IsTopLevel): Move property here from
2752         TypeContainer, so that Enum and Interface can use this too.
2753
2754         * class.cs (TypeContainer.LookupInterfaceOrClass,
2755         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
2756         `builder' argument.  Typically this was used to pass the parent
2757         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
2758         the definition).  
2759
2760         The problem is that a nested class could trigger the definition of
2761         a toplevel class, and the builder would be obviously wrong in that
2762         case. 
2763
2764         So we drop this argument, and we compute dynamically the
2765         TypeBuilder/ModuleBuilder (the correct information was available
2766         to us anyways from DeclSpace.Parent)
2767
2768         * interface.cs (Interface.DefineInterface): Drop builder
2769         parameter cleanup like class.cs
2770
2771         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
2772         like class.cs
2773
2774         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
2775         values. 
2776
2777         (Try.Emit): Propagate the returns value from the statement.
2778
2779         (Return.Emit): Even if we are leavning 
2780
2781         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
2782
2783         * modifiers.cs: Fix the computation of MethodAttributes flags.
2784
2785 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
2786
2787         * driver.cs: allow compilation of files that start with '/'.
2788         Add a default case when checking the argument of --target.
2789
2790 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
2791
2792         * interface.cs: Implement the same search algorithm for types in
2793         the interface code.
2794
2795         * delegate.cs: Do not allow multiple definition.
2796
2797         * Recovered ChangeLog that got accidentally amputated
2798
2799         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
2800
2801         * rootcontext.cs: Load manually enum to allow core classes to
2802         contain enumerations.
2803
2804         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
2805         Update to new static methods in TypeManager.
2806
2807         * typemanager.cs (GetMethod, GetConstructor): Use our
2808         implementation of FindMembers to find the members, since during
2809         corlib compilation, the types are TypeBuilders and GetMethod and
2810         GetConstructor do not work.
2811
2812         Make all methods in TypeManager static.
2813
2814         (InitCodeHelpers): Split the functionality from
2815         the InitCodeTypes function.
2816
2817         * driver.cs: Call InitCodeHelpers after we have populated the
2818         types. 
2819
2820         * cs-parser.jay (delegate_declaration): we did not used to compute
2821         the delegate name correctly for void delegates.
2822
2823 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
2824
2825         * rootcontext.cs (RootContext): Init the interface_resolve_order
2826         and type_container_resolve_order always.
2827
2828         (ResolveCore, BootstrapCorlib_ResolveClass,
2829         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
2830         compiler when compiling with --nostdlib
2831
2832         * class.cs (TypeContainer.DefineType): Check that our parent is
2833         not null.  This test is most important when we are bootstraping
2834         the core types.
2835
2836         * codegen.cs: Split out the symbol writing code.
2837
2838 2002-03-25  Martin Baulig  <martin@gnome.org>
2839
2840         * driver.cs (-g): Made -g an alias for --debug.
2841
2842 2002-03-24  Martin Baulig  <martin@gnome.org>
2843
2844         * codegen.cs (SymbolWriter): New public variable. Returns the
2845         current symbol writer.
2846         (CodeGen): Added `bool want_debugging_support' argument to the
2847          constructor. If true, tell the ModuleBuild that we want debugging
2848         support and ask it for the ISymbolWriter.
2849         (Save): If we have a symbol writer, call it's Close() method after
2850         saving the assembly.
2851
2852         * driver.c (--debug): New command line argument to create a
2853         debugger information file.
2854
2855         * location.cs (SymbolDocument): New public property. Returns an
2856         ISymbolDocumentWriter object for the current source file or null
2857         if we don't have a symbol writer.
2858
2859 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
2860
2861         * driver.cs (LoadAssembly): Correctly return when all the paths
2862         have been tried and not before.
2863
2864         * statement.cs (Switch.Emit): return the actual coverage for this
2865         statement (returns/not-returns)
2866
2867         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
2868         switch of the statement if we are the last switch section.  That
2869         kills two problems: try/catch problems (we used to emit an empty
2870         nop at the end) and switch statements where all branches would
2871         return. 
2872
2873 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
2874
2875         * driver.cs: Add default assemblies (the equivalent to the
2876         Microsoft CSC.RSP file)
2877
2878         * cs-tokenizer.cs: When updating `cols and setting it to zero,
2879         also update tokens_seen and set it to false.
2880
2881         * driver.cs: Implement --recurse for Mike.
2882
2883         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
2884         correctly splitting out the paths.
2885
2886 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
2887
2888         * interface.cs (Interface.PopulateProperty): Instead of using
2889         `parent' as the declaration space for the set parameters, use
2890         `this' 
2891
2892         * support.cs (InternalParameters): InternalParameters constructor
2893         takes a DeclSpace instead of a TypeContainer.
2894
2895         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
2896         types are being initialized, load the address of it before calling
2897         the function.  
2898
2899         (New): Provide a mechanism to disable the generation of local
2900         value type temporaries when the caller will be providing us with
2901         an address to store it.
2902
2903         (ArrayCreation.EmitDynamicInitializers): Use it.
2904
2905 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
2906
2907         * expression.cs (Invocation.EmitArguments): Only probe for array
2908         property if there is more than one argument.  Sorry about that.
2909
2910         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
2911         empty param arrays.
2912         
2913         * class.cs (Method.LabelParameters): Fix incorrect code path that
2914         prevented the `ParamArrayAttribute' from being applied to the
2915         params attribute.
2916
2917 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
2918
2919         * support.cs (ReflectionParameters): Correctly compute whether the
2920         last argument is a params array.  Fixes the problem with
2921         string.Split ('a')
2922
2923         * typemanager.cs: Make the assemblies array always be non-null
2924         (empty, but non-null)
2925
2926         * tree.cs (RecordDecl): New function that abstracts the recording
2927         of names.  This reports error 101, and provides a pointer to the
2928         previous declaration.  Fixes a crash in the compiler.
2929
2930         * cs-parser.jay (constructor_declaration): Update to new grammar,
2931         and provide a constructor_body that can be empty.
2932
2933 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
2934
2935         * driver.cs: Add support for --resources.
2936
2937         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
2938         Make all types for the various array helper methods be integer.
2939
2940         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
2941         CheckState to ConvCast.
2942
2943         (ConvCast): Now it takes a `checked' state argument, to avoid
2944         depending on the emit context for the conversion, and just using
2945         the resolve time setting.
2946
2947         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
2948         instead of Invocation.EmitArguments.  We do not emit the original
2949         arguments, instead we emit those which have been converted to
2950         unsigned int expressions.
2951
2952         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
2953
2954         * codegen.cs: ditto.
2955
2956         * expression.cs (LocalVariableReference): Drop the use of the
2957         Store function that depended on the variable index.
2958
2959         * statement.cs (VariableInfo): Drop the `Idx' property from this
2960         class, as this is not taking into account the indexes for
2961         temporaries tat we generate during the execution, getting the
2962         indexes wrong.
2963
2964         * class.cs: First emit class initializers, then call the parent
2965         constructor. 
2966
2967         * expression.cs (Binary): Fix opcode emision.
2968         (UnaryMutator.EmitCode): Support checked code generation
2969
2970         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
2971         matches for events for both the Static and Instance scans,
2972         pointing to the same element.   Fix that.
2973
2974 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
2975
2976         * rootcontext.cs (ResolveTree): Always set the
2977         interface_resolve_order, because nested interfaces will be calling
2978         into us.
2979
2980         * class.cs (GetInterfaceOrClass): Track the same resolution
2981         process used by TypeManager.LookupType.  This fixes the nested
2982         type lookups in class declarations (separate path from
2983         LookupType). 
2984
2985         (TypeContainer.DefineType): Also define nested interfaces.
2986         (TypeContainer.RegisterOrder): New public function used to
2987         register the order in which child interfaces need to be closed.
2988
2989         Nested interfaces need to be closed after their parents have been
2990         created. 
2991         
2992         * interface.cs (InterfaceAttr): Put all the logic for computing
2993         the interface attribute here. 
2994
2995         (DefineInterface): Register our interface order with the
2996         RootContext or with the TypeContainer depending on the case.
2997
2998 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
2999
3000         * cs-parser.jay: rework foreach statement to work with the new
3001         changes to the policy on SimpleNames.
3002         
3003         * report.cs: support Stacktrace on warnings as well.
3004
3005         * makefile: drop --unsafe and /unsafe from the compile.
3006
3007 2002-03-13  Ravi Pratap  <ravi@ximian.com>
3008
3009         * ecore.cs (StandardConversionExists): Modify to take an Expression
3010         as the first parameter. Ensure we do null -> reference type conversion
3011         checking.
3012
3013         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
3014         temporary Expression objects.
3015
3016 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
3017
3018         * interface.cs: workaround bug in method overloading resolution
3019         (there is already a bugzilla bug for it).
3020
3021 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
3022
3023         We could also solve this problem by having a separate path for
3024         performing type lookups, instead of DoResolve, we could have a
3025         ResolveType entry point, and only participating pieces of the
3026         production (simplename, deref, array) would implement this. 
3027         
3028         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
3029         signal SimpleName to only resolve type names and not attempt to
3030         resolve anything else.
3031
3032         * expression.cs (Cast): Set the flag.
3033
3034         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
3035
3036         * class.cs: Only report 108 if there is no `new' modifier.
3037
3038         * cs-parser.jay: rework foreach statement to work with the new
3039         changes to the policy on SimpleNames.
3040         
3041         * report.cs: support Stacktrace on warnings as well.
3042
3043         * makefile: drop --unsafe and /unsafe from the compile.
3044
3045 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
3046
3047         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
3048         lookups here, instead of doing that at parse time.  This means
3049         that our grammar will not introduce `LocalVariableReferences' as
3050         expressions at this point.  That solves the problem of code like
3051         this:
3052
3053         class X {
3054            static void Main ()
3055            { int X = 1;
3056             { X x = null }}}
3057
3058         This is only half the fix.  The full fix requires parameters to
3059         also be handled in this way.
3060
3061         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
3062         makes the use more obvious of the DeclSpace.  The
3063         ec.TypeContainer.TypeBuilder is now only used to pull the
3064         TypeBuilder for it.
3065
3066         My theory is that I can get rid of the TypeBuilder completely from
3067         the EmitContext, and have typecasts where it is used (from
3068         DeclSpace to where it matters).  
3069
3070         The only pending problem is that the code that implements Aliases
3071         is on TypeContainer, and probably should go in DeclSpace.
3072
3073         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
3074         lookups here, instead of doing that at parse time.  This means
3075         that our grammar will not introduce `LocalVariableReferences' as
3076         expressions at this point.  That solves the problem of code like
3077         this:
3078
3079         class X {
3080            static void Main ()
3081            { int X = 1;
3082             { X x = null }}}
3083
3084         This is only half the fix.  The full fix requires parameters to
3085         also be handled in this way.
3086
3087         * class.cs (Property.DefineMethod): When implementing an interface
3088         method, set newslot, when implementing an abstract method, do not
3089         set the flag (before we tried never setting it, or always setting
3090         it, which is the difference).
3091         (Indexer.DefineMethod): same.
3092         (Method.DefineMethod): same.
3093
3094         * ecore.cs: Only set the status used flag if we get back a Field.
3095
3096         * attribute.cs: Temporary hack, so Paolo can keep working.
3097
3098 2002-03-08  Ravi Pratap  <ravi@ximian.com>
3099
3100         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
3101         the unmanaged type in the case we have a MarshalAs attribute.
3102
3103         (Resolve): Handle the case when we are parsing the special MarshalAs
3104         attribute [we need to store the unmanaged type to use later]
3105         
3106         * typemanager.cs (marshal_as_attr_type): Built in type for the 
3107         MarshalAs Attribute.
3108
3109         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
3110         on parameters and accordingly set the marshalling info.
3111         
3112 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
3113
3114         * class.cs: Optimizing slightly by removing redundant code after
3115         we switched to the `NoTypes' return value.
3116         (Property.DefineMethod): use NoTypes here too.
3117
3118         This fixes the bug I introduced in my last batch of changes.
3119
3120 2002-03-05  Ravi Pratap  <ravi@ximian.com>
3121
3122         * tree.cs (RecordEnum): Add. We now keep track of enums too.
3123
3124         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
3125         Enums since those are types too. 
3126
3127         * cs-parser.jay (enum_declaration): Record enums as we parse them.
3128         
3129         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
3130         thanks to a call during the lookup process.
3131
3132 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
3133
3134         * statement.cs (Foreach): Lots of work to accomodate a particular
3135         kind of foreach statement that I had not kept in mind.  It is
3136         possible to have foreachs on classes that provide a GetEnumerator
3137         method that return objects that implement the "pattern" for using
3138         a foreach, there is no need to support GetEnumerator
3139         specifically. 
3140
3141         This is needed to compile nant.
3142
3143         * decl.cs: Only report 114 if the member is not `Finalize' and if
3144         the warning level is at least 2.
3145
3146         * class.cs: Moved the compare function from Method to
3147         MethodSignature. 
3148
3149         (MethodSignature.InheritableMemberSignatureCompare): Add new
3150         filter function that is used to extract inheritable methods from a
3151         class. 
3152
3153         (Method.Define): Use the new `inheritable_method_signature_filter'
3154         delegate
3155
3156         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
3157         command. 
3158
3159 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
3160
3161         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
3162
3163         * cs-parser.jay: Add opt_semicolon to the interface declaration.
3164
3165         * expression.cs: Pass location information to
3166         ConvertImplicitStandard. 
3167
3168         * class.cs: Added debugging code to track return values from
3169         interfaces. 
3170
3171 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
3172
3173         * expression.cs (Is.DoResolve): If either side of the `is' is an
3174         interface, do not flag the warning.
3175
3176         * ecore.cs (ImplicitReferenceConversion): We need a separate test
3177         for interfaces
3178
3179         * report.cs: Allow for --fatal to be used with --probe.
3180         
3181         * typemanager.cs (NoTypes): Move the definition for the empty Type
3182         array here. 
3183
3184         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
3185         properties. 
3186         (TypeContainer.DefineProxy): New function used to proxy to parent
3187         implementations when implementing interfaces.
3188         (TypeContainer.ParentImplements): used to lookup if our parent
3189         implements a public function that is required by an interface.
3190         (TypeContainer.VerifyPendingMethods): Hook this up.
3191
3192         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
3193         `modules' and `assemblies' arraylists into arrays.  We only grow
3194         these are the very early start up of the program, so this improves
3195         the speedof LookupType (nicely measured).
3196
3197         * expression.cs (MakeByteBlob): Replaced unsafe code with
3198         BitConverter, as suggested by Paolo.
3199
3200         * cfold.cs (ConstantFold.Binary): Special case: perform constant
3201         folding of string concatenation, but if either side is a string,
3202         and the other is not, then return null, and let the runtime use
3203         the concatenation on the string plus the object (using
3204         `Object.ToString'). 
3205
3206 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
3207
3208         Constant Folding has been implemented now.
3209         
3210         * expression.cs (Unary.Reduce): Do not throw an exception, catch
3211         the error instead on types that are not supported in one's
3212         complement. 
3213
3214         * constant.cs (Constant and all children): New set of functions to
3215         perform implict and explicit conversions.
3216         
3217         * ecore.cs (EnumConstant): Implement the new functions to perform
3218         conversion by proxying to the child expression.
3219
3220         * codegen.cs: (ConstantCheckState): Constant evaluation has its
3221         own separate setting that can not be turned off from the command
3222         line using --unchecked or --checked and is only controlled using
3223         the checked/unchecked statements and expressions.  This setting is
3224         used by the constant folder to flag errors.
3225
3226         * expression.cs (CheckedExpr, UncheckedExpr): Set the
3227         ConstantCheckState as well.   
3228
3229         During Resolve, they also have to flag the state, because the
3230         constant folder runs completely in the Resolve phase.
3231
3232         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
3233         well.
3234
3235 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
3236
3237         * cfold.cs: New file, this file contains the constant folder.
3238         
3239         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
3240         argument to track whether we are using the resulting address to
3241         load or store a value and provide better error messages. 
3242
3243         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
3244         new AddressOf arguments.
3245
3246         * statement.cs (Foreach.EmitCollectionForeach): Update
3247
3248         * expression.cs (Argument.Emit): Call AddressOf with proper
3249         arguments to track usage.
3250
3251         (New.DoEmit): Call AddressOf with new arguments.
3252
3253         (Unary.Emit): Adjust AddressOf call.
3254
3255 2002-03-01  Ravi Pratap  <ravi@ximian.com>
3256
3257         * cs-parser.jay (member_access): Change the case for pre-defined types
3258         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
3259         this suggestion.
3260
3261         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
3262         a method body.
3263
3264         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
3265         essentially like methods and apply attributes like MethodImplOptions to them too.
3266
3267         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
3268         not being null.
3269
3270         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
3271         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
3272         is the DeclSpace.
3273
3274         * Update code everywhere accordingly.
3275
3276         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
3277
3278         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
3279
3280 2002-02-28  Ravi Pratap  <ravi@ximian.com>
3281
3282         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
3283         try performing lookups against those instead of jumping straight into using
3284         the 'using' clauses.
3285
3286         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
3287
3288         (LookupType): Perform lookups in implicit parents too.
3289
3290         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
3291         sequence as RootContext.LookupType. 
3292
3293         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
3294         the various cases of namespace lookups into this method.
3295
3296 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
3297
3298         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
3299         in positional arguments)
3300
3301         * class.cs (Operator): Update the AllowedModifiers to contain
3302         extern. 
3303
3304         * cs-parser.jay: Update operator declaration to allow for the
3305         operator body to be empty.
3306
3307         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
3308         values. 
3309
3310 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
3311
3312         * class.cs (Method.Emit): Label parameters.
3313
3314         * driver.cs: Return 1 or 0 as the program exit code.
3315
3316 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
3317
3318         * expression.cs: Special case the `null' object when trying to
3319         auto-compute the type, as anything can be explicitly converted to
3320         that. 
3321
3322         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
3323         spotting this Paolo.
3324
3325         (Expression.ImplicitNumericConversion): Perform comparissions of
3326         the type using the underlying type in the case of an enumeration
3327         rather than using the enumeration type for the compare.
3328
3329         Cope with the underlying == type case, which is not possible to
3330         catch before. 
3331
3332         (Expression.ConvertNumericExplicit): Perform comparissions of
3333         the type using the underlying type in the case of an enumeration
3334         rather than using the enumeration type for the compare.
3335
3336         * driver.cs: If the user does not supply an extension, assume .exe
3337
3338         * cs-parser.jay (if_statement): Rewrote so that we can track the
3339         location for the if statement.
3340
3341         * expression.cs (Binary.ConstantFold): Only concat strings when
3342         the operation is "+", not everything ;-)
3343
3344         * statement.cs (Statement.EmitBoolExpression): Take a location
3345         argument. 
3346         (If, While, Do): Track location.
3347
3348         * expression.cs (Binary.ResolveOperator): In the object + string
3349         case, I was missing a call to ConvertImplicit
3350
3351 2002-02-25  Ravi Pratap  <ravi@ximian.com>
3352
3353         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
3354         Location arguments. Ensure we use RootContext.LookupType to do our work
3355         and not try to do a direct Type.GetType and ModuleBuilder.GetType
3356
3357         * interface.cs (PopulateMethod): Handle the type of the parameter being
3358         null gracefully.
3359
3360         * expression.cs (Invocation.BetterFunction): Handle the case when we 
3361         have a params method with no fixed arguments and a call is made with no
3362         arguments.
3363
3364 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
3365
3366         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
3367         the verbatim-string-literal
3368
3369         * support.cs (InternalParameters.ParameterModifier): handle null
3370         fixed parameters.
3371         (InternalParameters.ParameterType): ditto.
3372
3373         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
3374         duplicating the name of the variable parameter.
3375         (GetParameterByName): Fix bug where we were not looking up array
3376         paramters if they were the only present (thanks Paolo!).
3377         (GetParameterInfo): We only have an empty set of types if both
3378         fixed and array are set to null.
3379         (GetParameterInfo-idx): Handle FixedParameter == null
3380
3381         * cs-parser.jay: Handle the case where there is no catch
3382         statements (missing null test).
3383
3384 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
3385
3386         * driver.cs (MainDriver): Be conservative on our command line
3387         handling.
3388
3389         Catch DirectoryNotFoundException when calling GetFiles.
3390         
3391         (SplitPathAndPattern): Used to split the input specification into
3392         a path and a pattern that we can feed to Directory.GetFiles.
3393
3394 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
3395
3396         * statement.cs (Fixed): Implement the last case of the Fixed
3397         statement (string handling).
3398
3399         * expression.cs (StringPtr): New class used to return a char * to
3400         a string;  Used by the Fixed statement.
3401
3402         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
3403
3404         * expression.cs (Binary.ResolveOperator): Remove redundant
3405         MemberLookup pn parent type.
3406         Optimize union call, we do not need a union if the types are the same.
3407         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
3408         type.
3409
3410         Specialize the use of MemberLookup everywhere, instead of using
3411         the default settings. 
3412
3413         (StackAlloc): Implement stackalloc keyword.
3414
3415         * cs-parser.jay: Add rule to parse stackalloc.
3416         
3417         * driver.cs: Handle /h, /help, /?
3418
3419         * expression.cs (MakeByteBlob): Removed the hacks we had in place
3420         before we supported unsafe code.
3421         
3422         * makefile: add --unsafe to the self compilation of mcs.
3423
3424 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
3425
3426         * expression.cs (PointerArithmetic): New class that is used to
3427         perform pointer arithmetic.
3428         (Binary.Resolve): Handle pointer arithmetic
3429         Handle pointer comparission.
3430         (ArrayPtr): Utility expression class that is used to take the
3431         address of an array.
3432
3433         (ElementAccess): Implement array access for pointers
3434         
3435         * statement.cs (Fixed): Implement fixed statement for arrays, we
3436         are missing one more case before we are done.
3437
3438         * expression.cs (Indirection): Implement EmitAssign and set the
3439         ExprClass to Variable.  This allows pointer dereferences to be
3440         treated as variables, and to have values assigned to them.
3441         
3442         * ecore.cs (Expression.StoreFromPtr): New utility function to
3443         store values dereferencing.
3444
3445 2002-02-20  Ravi Pratap  <ravi@ximian.com>
3446
3447         * expression.cs (Binary.ResolveOperator): Ensure that we are
3448         not trying to operate on a void type - this fixes the reported
3449         bug.
3450
3451         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
3452         the parent implementation is sealed.
3453
3454         * ../errors/cs0239.cs : Add.
3455
3456         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
3457
3458         * typemanager.cs (unverifiable_code_type): Corresponds to 
3459         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
3460         which have unsafe code in them.
3461
3462         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
3463         unsafe context.
3464
3465 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
3466
3467         * cs-tokenizer.cs: Add support for @"litreal strings"
3468
3469         Make tokenizer accept pre-processor directives
3470         on any column (remove the old C-like limitation). 
3471
3472         * rootcontext.cs (EmitCode): Emit any global attributes.
3473         (AddGlobalAttributes): Used to keep track of assembly attributes. 
3474
3475         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
3476
3477         * cs-parser.jay: Add support for global attributes.  
3478
3479 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
3480
3481         * expression.cs (Indirection): New helper class.  Unary will
3482         create Indirection classes to be able to implement the
3483         IMemoryLocation interface on it.
3484
3485 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
3486
3487         * cs-parser.jay (fixed_statement): reference the right statement.
3488
3489         * statement.cs (Fixed.Emit): Finish implementing the fixed
3490         statement for the &x case.
3491
3492 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
3493
3494         * class.cs (Property.Define, Method.Define): Remove newslot when
3495         `implementing'.  
3496
3497         * modifiers.cs: My use of NewSlot when `Abstract' was set was
3498         wrong.  NewSlot should only be used if the `new' keyword is present.
3499
3500         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
3501         locating our system dir.  Sorry about this.
3502
3503 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
3504
3505         * driver.cs (GetSystemDir): Compute correctly the location of our
3506         system assemblies.  I was using the compiler directory instead of
3507         the library directory.
3508
3509 2002-02-13  Ravi Pratap  <ravi@ximian.com>
3510
3511         * expression.cs (BetterFunction): Put back in what Miguel commented out
3512         since it is the correct fix. The problem is elsewhere ;-)
3513
3514         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
3515         parameters of the parms method are themselves compatible or not !
3516
3517         (StandardConversionExists): Fix very dangerous bug where we were forgetting
3518         to check that a class implements an interface before saying that an implicit
3519         conversion was allowed. Use ImplementsInterface to do the checking.
3520
3521 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
3522
3523         * class.cs (Method.Define): Track whether we are an explicit
3524         implementation or not.  And only call DefineMethodOverride if we
3525         are an explicit implementation.
3526
3527         (Property.DefineMethod): Ditto.
3528
3529 2002-02-11  Ravi Pratap  <ravi@ximian.com>
3530
3531         * expression.cs (BetterFunction): Catch hideous bug which was
3532          preventing us from detecting ambiguous calls due to implicit casts i.e
3533         cs0121.
3534
3535 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
3536
3537         * support.cs (Pair): Remove un-needed method.  I figured why I was
3538         getting the error in cs-parser.jay, the variable in a foreach loop
3539         is readonly, and the compiler does not really treat this as a variable.
3540
3541         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
3542         instead of EQUALS in grammar.  
3543
3544         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
3545
3546         * expression.cs (Unary.DoResolve): Check whether the argument is
3547         managed or not.
3548
3549 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
3550
3551         * support.cs: Api for Pair to set a value.  Despite the fact that
3552         the variables are public the MS C# compiler refuses to compile
3553         code that accesses the field if the variable is part of a foreach
3554         statement. 
3555
3556         * statement.cs (Fixed): Begin implementation of the fixed
3557         statement.
3558
3559         (Block.AddVariable): Return the VariableInfo on success and null
3560         on failure instead of true/false. 
3561
3562         * cs-parser.jay (foreach): Catch errors on variables already
3563         defined (we were ignoring this value before) and properly unwind
3564         the block hierarchy
3565
3566         (fixed_statement): grammar for the fixed statement.
3567
3568 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
3569
3570         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
3571         pointer types to be incretemented.
3572
3573         (SizeOf): Implement.
3574
3575         * cs-parser.jay (pointer_member_access): Implement
3576         expr->IDENTIFIER production.
3577
3578         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
3579         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
3580         on safe contexts.
3581
3582         (Unary): Implement indirection.
3583
3584         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
3585         use in non-unsafe context).
3586
3587         (SimpleName.DoResolve): Check for pointers in field access on safe
3588         contexts. 
3589
3590         (Expression.LoadFromPtr): Factor the load-indirect code in this
3591         function.  This was duplicated in UnboxCast and ParameterReference
3592
3593 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
3594
3595         * expression.cs (ComposedCast): report an error if a pointer cast
3596         is used in a safe region.
3597
3598         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
3599         pointer type casts in unsafe context.
3600
3601         * codegen.cs (EmitContext): Set up IsUnsafe.
3602
3603         * cs-parser.jay (non_expression_type): Add productions for pointer
3604         casts. 
3605
3606         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
3607         code.  We should not use force into static mode if the method is
3608         not virtual.  Fixes bug in MIS
3609
3610         * statement.cs (Do.Emit, While.Emit, For.Emit,
3611         Statement.EmitBoolExpression): Add support to Do and While to
3612         propagate infinite loop as `I do return' semantics.
3613
3614         Improve the For case to also test for boolean constants.
3615
3616         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
3617         to the list of attributes we can add.
3618
3619         Remove `EmitContext' argument.
3620
3621         * class.cs (Method.Define): Apply parameter attributes.
3622         (Constructor.Define): Apply parameter attributes.
3623         (MethodCore.LabelParameters): Move here the core of labeling
3624         parameters. 
3625
3626         * support.cs (ReflectionParameters.ParameterModifier,
3627         InternalParameters.ParameterModifier): Use IsByRef on the type and
3628         only return the OUT bit for these parameters instead of in/out/ref
3629         flags.
3630
3631         This is because I miss-understood things.  The ParameterInfo.IsIn
3632         and IsOut represent whether the parameter has the [In] and [Out]
3633         attributes set.  
3634
3635 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
3636
3637         * ecore.cs (FieldExpr.Emit): Release temporaries.
3638
3639         * assign.cs (LocalTemporary.Release): new function.
3640
3641         * codegen.cs (EmitContext.GetTemporaryStorage,
3642         EmitContext.FreeTemporaryStorage): Rework the way we deal with
3643         temporary storage.  Now we can "put back" localbuilders when we
3644         are done with them
3645
3646 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
3647
3648         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
3649         need to make a copy of the variable to generate verifiable code.
3650
3651 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
3652
3653         * driver.cs: Compute dynamically the system directory.
3654
3655         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
3656         Slower, but more generally useful.  Used by the abstract
3657         registering implementation. 
3658
3659         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
3660         the rules for the special rule on Type/instances.  First check if
3661         we have the same name, and if so, try that special static path
3662         rather than the instance path.
3663         
3664 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
3665
3666         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
3667         for, while and if.
3668
3669         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
3670         Enum, ValueType, Delegate or Array for non-corlib compiles.
3671
3672         * cs-tokenizer.cs: Catch long identifiers (645)
3673
3674         * typemanager.cs (IndexerPropetyName): Ravi never tested this
3675         piece of code.
3676
3677         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
3678         fix, we were returning too early, so we were not registering
3679         pending methods from abstract classes.
3680
3681         Do not register pending methods if the class is abstract.
3682
3683         * expression.cs (Conditional.DoResolve): Report circular implicit
3684         conversions when we neecd to compute it for conditional
3685         expressions. 
3686
3687         (Is.DoResolve): If the expression is always of the provided type,
3688         flag warning 183.  If the expression can not ever be of the
3689         provided type flag warning 184.
3690
3691         * class.cs: Catch 169 as well.
3692
3693         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
3694         read. 
3695
3696 2002-01-18  Nick Drochak  <ndrochak@gol.com>
3697
3698         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
3699
3700 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
3701
3702         * interface.cs: (PopulateMethod): Check for pointers being defined
3703         only if the unsafe context is active.
3704         (PopulateProperty): ditto.
3705         (PopulateIndexer): ditto.
3706
3707         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
3708         specified.  If pointers are present, make sure that they are
3709         present in an unsafe context.
3710         (Constructor, Constructor.Define): ditto.
3711         (Field, Field.Define): ditto.
3712         (Property, Property.Define): ditto.
3713         (Event, Event.Define): ditto.
3714
3715         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
3716         hashtable if there are classes or structs defined.
3717
3718         * expression.cs (LocalVariableReference.DoResolve): Simplify this
3719         code, as the constant resolution moved.
3720
3721         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
3722         the metadata, so we can flag error 133. 
3723
3724         * decl.cs (MemberCore.UnsafeOK): New function to test that a
3725         pointer is being declared in an unsafe context.
3726
3727 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
3728
3729         * modifiers.cs (Modifiers.Check): Require a Location argument.
3730         Report error 227 for Unsafe use.
3731
3732         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
3733
3734         * statement.cs (For.Emit): If the test is null, then report that
3735         we do `return', as we wont reach anything afterwards.
3736
3737         (Switch.SwitchGoverningType): Track the expression that matched
3738         the conversion.
3739
3740         * driver.cs: Allow negative numbers as an error code to flag.
3741
3742         * cs-parser.jay: Handle 1551.
3743
3744         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
3745
3746 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
3747
3748         * cs-parser.jay: Report 1518 (type declaration can only contain
3749         class, struct, interface, enum or delegate)
3750
3751         (switch_label): Report 1523 (keywords `case' or `default' must
3752         preced code)
3753
3754         (opt_switch_sections): Report 1522 (empty switch)
3755
3756         * driver.cs: Report 1515 (response file specified multiple times)
3757         Report 1516 (Source file specified multiple times).
3758
3759         * expression.cs (Argument.Resolve): Signal 1510
3760
3761         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
3762         access not allowed in static code)
3763
3764 2002-01-11  Ravi Pratap  <ravi@ximian.com>
3765
3766         * typemanager.cs (IsPointerType): Utility method which we are going
3767         to need a lot.
3768
3769         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
3770         the object type, so we take care of that.
3771
3772         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
3773         
3774         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
3775         added to non-params parameters :-)
3776
3777         * typemanager.cs (CSharpName): Include 'void' type too. 
3778
3779         (void_ptr_type): Include in the set of core types.
3780
3781         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
3782         duplicating code.
3783
3784         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
3785         an unsafe context.
3786
3787         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
3788         completely forgotten about it.
3789
3790 2002-01-10  Ravi Pratap  <ravi@ximian.com>
3791
3792         * cs-parser.jay (pointer_type): Add. This begins our implementation
3793         of parsing rules for unsafe code.
3794
3795         (unsafe_statement): Implement.
3796
3797         (embedded_statement): Modify to include the above.
3798
3799         * statement.cs (Unsafe): Implement new class for unsafe blocks.
3800
3801         * codegen.cs (EmitContext.InUnsafe): Add. This determines
3802         if the current context is an unsafe one.
3803
3804         * cs-parser.jay (local_variable_pointer_type): Since local variable types
3805         are handled differently, we need separate rules for them.
3806
3807         (local_variable_declaration): Update to use local_variable_pointer_type
3808         to allow variable declarations of unmanaged pointer types.
3809
3810         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
3811         in unsafe contexts.
3812
3813         * ../errors/cs0214.cs : Add.
3814
3815 2002-01-16  Nick Drochak  <ndrochak@gol.com>
3816
3817         * makefile: remove 'response' file when cleaning.
3818
3819 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
3820
3821         * cs-parser.jay: Report 1524.
3822
3823 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
3824
3825         * typemanager.cs (RegisterMethod): drop checking if we have
3826         registered this from here
3827
3828 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
3829
3830         * class.cs (Method.EmitDestructor): Implement calling our base
3831         destructor. 
3832
3833         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
3834         value of InFinally.
3835
3836         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
3837         this routine and will wrap the call in a try/catch block.  Deal
3838         with the case.
3839
3840 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
3841
3842         * ecore.cs (Expression.MemberLookup): instead of taking a
3843         parameter `same_type' that was used to tell whether we could
3844         access private members we compute our containing type from the
3845         EmitContext.
3846
3847         (FieldExpr): Added partial support for volatile fields.  This does
3848         not work for volatile fields exposed from assemblies, as I can not
3849         figure out how to extract the modreq from it.
3850
3851         Updated all the source files to use this.
3852
3853         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
3854         because it is referenced by MemberLookup very often. 
3855
3856 2002-01-09  Ravi Pratap  <ravi@ximian.com>
3857
3858         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
3859         TypeBuilder.GetCustomAttributes to retrieve what we need.
3860
3861         Get rid of redundant default_member_attr_type as this is the same as
3862         default_member_type which already exists.
3863
3864         * interface.cs, attribute.cs : Update accordingly.
3865         
3866 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
3867
3868         * typemanager.cs: Enable IndexerPropertyName again.  It does not
3869         work for TYpeBuilders though.  Ravi, can you please fix this?
3870
3871         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
3872
3873         * expression.cs (Argument.Emit): Handle the case of ref objects
3874         being passed to ref functions;  
3875
3876         (ParameterReference.EmitLoad): Loads the content of the pointer
3877         without dereferencing.
3878
3879 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
3880
3881         * cs-tokenizer.cs: Implemented the pre-processing expressions.
3882
3883 2002-01-08  Ravi Pratap  <ravi@ximian.com>
3884
3885         * class.cs (Indexer.DefineMethod): Incorporate the interface
3886         type in the name of the method if we are doing explicit interface
3887         implementation.
3888
3889         * expression.cs (ConversionExists): Remove as it is completely obsolete.
3890
3891         (BetterConversion): Fix extremely trivial bug where we were referring to
3892         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
3893         again !
3894
3895         * ../errors/bug16.cs : Add although we have fixed it.
3896
3897 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
3898
3899         * expression.cs (BaseIndexer): Begin implementation.
3900
3901         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
3902
3903         * cs-parser.jay (indexer_declarator): Use qualified_identifier
3904         production directly to remove a shift/reduce, and implement
3905         explicit interface implementation.
3906
3907         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
3908         after a floating point suffix.
3909
3910         * expression.cs (DoNumericPromotions): Improved the conversion for
3911         uint/uint.  If we have a constant, we avoid doing a typecast to a
3912         larger type.
3913
3914         * class.cs (Indexer): Implement explicit interface implementation
3915         for indexers.
3916         
3917 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
3918
3919         * class.cs: make the default instance constructor public and hidebysig.
3920
3921 2001-01-03  Ravi Pratap  <ravi@ximian.com>
3922
3923         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
3924         so we can call it from elsewhere.
3925
3926         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
3927         we emit it internally if the class has a defined indexer; otherwise the user
3928         emits it by decorating the class definition with the DefaultMemberAttribute.
3929
3930         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
3931         attribute is not used on a type which defines an indexer.
3932
3933         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
3934         character when we skip whitespace.
3935
3936         * ../errors/cs0646.cs : Add.
3937
3938 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
3939
3940         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
3941         again. 
3942
3943         * makefile: Add practical target `mcs3.exe' which builds the third
3944         generation compiler. 
3945
3946         * expression.cs (New): Fix structures constructor calling.
3947
3948         * class.cs (Property, Method, Indexer): Emit Final flag on the
3949         method if we are an interface implementation and we are not
3950         abstract. 
3951
3952         * ecore.cs (PropertyExpr): New public field `IsBase', tells
3953         whether this property is referencing a `base' method.
3954
3955         * expression.cs (Invocation.EmitCall): take an extra argument:
3956         is_base, this is used to determine whether the `call' or
3957         `callvirt' opcode should be used.
3958
3959         
3960         * delegate.cs: update EmitCall.
3961
3962         * class.cs (Method.Define): Set NewSlot for the cases where we are
3963         not implementing an interface method.
3964
3965         (Property.Define): ditto.
3966
3967 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
3968
3969         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
3970         'r'.  Allows mcs to parse itself fully.
3971
3972 2002-01-02  Ravi Pratap  <ravi@ximian.com>
3973
3974         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
3975         of the number of initializers that require the InitializeArray method.
3976
3977         (CheckIndices): Store the Expression in all cases - not the plain value. Also
3978         update the above field where necessary.
3979
3980         (MakeByteBlob): Update accordingly.
3981
3982         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
3983         greater than 2.
3984
3985         (EmitDynamicInitializers): Update in accordance with the new optimization.
3986
3987         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
3988         same OpCode applies.
3989
3990         * cs-parser.jay : Fix some glaring errors I introduced.
3991
3992 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
3993
3994         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
3995         so that we can check for name clashes there too.
3996
3997         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
3998         for interface indexers.
3999
4000         * interfaces.cs (Define): Emit the default member attribute.
4001
4002         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
4003         variable was being referred to while setting the value ;-)
4004
4005 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
4006
4007         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
4008         byte-by-byte information when we know the data is zero.
4009
4010         Make the block always a multiple of 4, because
4011         DefineInitializedData has a bug.
4012
4013         * assign.cs: Fix, we should assign from the temporary, not from
4014         the source. 
4015
4016         * expression.cs (MakeByteBlob): Fix my incorrect code.
4017
4018 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
4019
4020         * typemanager.cs (EnumToUnderlying): This function is used to get
4021         the underlying type from an enumeration, because it does not
4022         always work. 
4023
4024         * constant.cs: Use the I4_S form for values between -128 and 127.
4025
4026         * statement.cs (Block.LookupLabel): Looks up a label.
4027         (Block): Drop support for labeled blocks.
4028
4029         (LabeledStatement): New kind of statement that represents a label
4030         only.
4031
4032         (Goto): Finally implement this bad boy.
4033         
4034         * cs-parser.jay: Update to reflect new mechanism to implement
4035         labels.
4036
4037 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
4038
4039         * codegen.cs (EmitContext.This): a codegen property that keeps the
4040         a single instance of this instead of creating many different this
4041         instances. 
4042
4043         * delegate.cs (Delegate.DoResolve): Update to use the property;
4044
4045         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
4046
4047         * expression.cs (BaseAccess.DoResolve): Ditto.
4048
4049 2001-12-29  Ravi Pratap  <ravi@ximian.com>
4050
4051         * typemanager.cs (methodimpl_attr_type): Add to hold the type
4052         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
4053
4054         (InitCoreTypes): Update accordingly.
4055
4056         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
4057         so we can quickly store the state.
4058
4059         (ApplyAttributes): Set the correct implementation flags
4060         for InternalCall methods.
4061
4062 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
4063
4064         * expression.cs (EmitCall): if a method is not virtual, then do
4065         not use callvirt on it.
4066
4067         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
4068         user defined stuff) requires the use of stobj, which takes an
4069         address on the stack instead of an array and an index.  So emit
4070         the Ldelema operation for it.
4071
4072         (EmitStoreOpcode): Use stobj for valuetypes.
4073
4074         (UnaryMutator.EmitCode): Use the right 1 value depending on
4075         whether we are dealing with int64/uint64, float or doubles.
4076
4077         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
4078         constructors that I implemented last night.
4079
4080         (Constructor.IsDefault): Fix to work properly for static
4081         constructors.
4082
4083         * cs-parser.jay (CheckDef): report method signature errors.
4084         Update error number 103 to be 132.
4085
4086         * decl.cs: New AdditionResult enumeration value: MethodExists.
4087         Although we do this check for methods later on in the semantic
4088         analysis, catching repeated default constructors is so easy that
4089         we catch these here. 
4090         
4091         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
4092         promotions code.
4093
4094         (ParameterReference.EmitAssign, Emit): handle
4095         bools as bytes.
4096
4097         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
4098         (ArrayAccess.EmitStoreOpcode): ditto.
4099
4100         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
4101
4102         * expression.cs (MakeByteBlob): Complete all the missing types
4103         (uint, short, ushort, byte, sbyte)
4104
4105         * class.cs: Only init instance field initializers on instance
4106         constructors. 
4107
4108         Rename `constructors' to instance_constructors. 
4109
4110         (TypeContainer.AddConstructor): Only add constructors to the list
4111         if it is not static.
4112
4113         Make sure that we handle default_static_constructor independently
4114         everywhere where we handle instance_constructors
4115
4116 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
4117
4118         * class.cs: Do not lookup or create a base initializer for a
4119         static constructor.
4120
4121         (ConstructorInitializer.Resolve): use the proper type to lookup
4122         for constructors.
4123
4124         * cs-parser.jay: Report error 1585 (modifiers between type and name).
4125
4126         * enum.cs, interface.cs: Remove CloseType, this is taken care by
4127         in DeclSpace. 
4128
4129         * decl.cs: CloseType is now an virtual method, the default
4130         implementation just closes this type.
4131         
4132 2001-12-28  Ravi Pratap  <ravi@ximian.com>
4133
4134         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
4135         to PreserveSig by default. Also emit HideBySig on such methods.
4136
4137         Basically, set the defaults to standard values.
4138
4139         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
4140         argument, if candidate is better, it can't be worse than the best !
4141
4142         (Invocation): Re-write bits to differentiate between methods being
4143         applicable in their expanded form and their normal form - for params
4144         methods of course.
4145
4146         Get rid of use_standard everywhere as only standard conversions are allowed
4147         in overload resolution. 
4148
4149         More spec conformance.
4150         
4151 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
4152
4153         * driver.cs: Add --timestamp, to see where the compiler spends
4154         most of its time.
4155
4156         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
4157         `this' in static code.
4158
4159         (SimpleName.DoResolve): Implement in terms of a helper function
4160         that allows static-references to be passed upstream to
4161         MemberAccess.
4162
4163         (Expression.ResolveWithSimpleName): Resolve specially simple
4164         names when called by MemberAccess to implement the special
4165         semantics. 
4166
4167         (Expression.ImplicitReferenceConversion): Handle conversions from
4168         Null to reference types before others, as Null's type is
4169         System.Object. 
4170
4171         * expression.cs (Invocation.EmitCall): Handle the special case of
4172         calling methods declared on a reference type from a ValueType
4173         (Base classes System.Object and System.Enum)
4174
4175         (MemberAccess.Resolve): Only perform lookups on Enumerations if
4176         the left hand side is a TypeExpr, not on every enumeration. 
4177
4178         (Binary.Resolve): If types are reference types, then do a cast to
4179         object on operators != and == of both arguments.
4180         
4181         * typemanager.cs (FindMembers): Extract instance and static
4182         members if requested.
4183
4184         * interface.cs (PopulateProperty): Use void_type instead of null
4185         as the return type for the setter method.
4186
4187         (PopulateIndexer): ditto.
4188
4189 2001-12-27  Ravi Pratap  <ravi@ximian.com>
4190
4191         * support.cs (ReflectionParameters): Fix minor bug where we
4192         were examining the wrong parameter for the ParamArray attribute.
4193
4194         Cope with requests for the type of the parameter at position
4195         greater than the params parameter's. We now return the element
4196         type of the params array as that makes more sense.
4197
4198         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
4199         accordingly as we no longer have to extract the element type
4200         ourselves.
4201
4202         (Invocation.OverloadResolve): Update.
4203
4204 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
4205
4206         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
4207         against IEnumerator, test whether the return value is a descendant
4208         of the IEnumerator interface.
4209
4210         * class.cs (Indexer.Define): Use an auxiliary method to implement
4211         the other bits of the method definition.  Begin support for
4212         explicit interface implementation.
4213
4214         (Property.DefineMethod): Use TypeManager.void_type instead of null
4215         for an empty return value.
4216
4217 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
4218
4219         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
4220         dealing with a FieldExpr which is composed of a FieldBuilder, in
4221         the code path we did extract the constant, but we should have
4222         obtained the underlying value to be able to cast it (otherwise we
4223         end up in an infinite loop, this is what Ravi was running into).
4224
4225         (ArrayCreation.UpdateIndices): Arrays might be empty.
4226
4227         (MemberAccess.ResolveMemberAccess): Add support for section
4228         14.5.4.1 that deals with the special case of E.I when E is a type
4229         and something else, that I can be a reference to a static member.
4230
4231         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
4232         handle a particular array type to create byte blobs, it is just
4233         something we dont generate byteblobs for.
4234
4235         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
4236         arguments. 
4237
4238         * location.cs (Push): remove the key from the hashtable that we
4239         are about to add.   This happens for empty files.
4240
4241         * driver.cs: Dispose files after we have parsed them.
4242
4243         (tokenize): new function that only runs the tokenizer on its
4244         input, for speed testing.
4245
4246 2001-12-26  Ravi Pratap  <ravi@ximian.com>
4247
4248         * class.cs (Event.Define): Define the private field only if there
4249         are no accessors defined.
4250
4251         * expression.cs (ResolveMemberAccess): If there is no associated
4252         field with the event, that means we have an event defined with its
4253         own accessors and we should flag error cs0070 since transforming
4254         ourselves into a field is not valid in that case.
4255
4256         * ecore.cs (SimpleName.DoResolve): Same as above.
4257
4258         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
4259         and charset to sane values.
4260
4261 2001-12-25  Ravi Pratap  <ravi@ximian.com>
4262
4263         * assign.cs (DoResolve): Perform check on events only if they 
4264         are being accessed outside the declaring type.
4265
4266         * cs-parser.jay (event_declarations): Update rules to correctly
4267         set the type of the implicit parameter etc.
4268
4269         (add_accessor, remove_accessor): Set current local parameters.
4270
4271         * expression.cs (Binary): For delegate addition and subtraction,
4272         cast the return value from the method into the appropriate delegate
4273         type.
4274
4275 2001-12-24  Ravi Pratap  <ravi@ximian.com>
4276
4277         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
4278         of these as the workaround is unnecessary.
4279
4280         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
4281         delegate data - none of that is needed at all.
4282
4283         Re-write bits to extract the instance expression and the delegate method
4284         correctly.
4285
4286         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
4287         on delegates too.
4288
4289         * attribute.cs (ApplyAttributes): New method to take care of common tasks
4290         of attaching attributes instead of duplicating code everywhere.
4291
4292         * everywhere : Update code to do attribute emission using the above method.
4293
4294 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
4295
4296         * expression.cs (IsParamsMethodApplicable): if there are not
4297         parameters, return immediately.
4298
4299         * ecore.cs: The 0 literal can be implicity converted to an enum
4300         type. 
4301
4302         (SimpleName.DoResolve): First lookup the type, then lookup the
4303         members. 
4304
4305         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
4306         want to get its address.  If the InstanceExpression is not
4307         addressable, store the result in a temporary variable, then get
4308         the address of it.
4309
4310         * codegen.cs: Only display 219 errors on warning level or above. 
4311
4312         * expression.cs (ArrayAccess): Make it implement the
4313         IMemoryLocation interface.
4314
4315         (Binary.DoResolve): handle the operator == (object a, object b)
4316         and operator != (object a, object b) without incurring into a
4317         BoxedCast (because 5 != o should never be performed).
4318
4319         Handle binary enumerator operators.
4320
4321         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
4322         value type, otherwise use Ldelem_ref.
4323
4324         Use precomputed names;
4325
4326         (AddressOf): Implement address of
4327
4328         * cs-parser.jay (labeled_statement): Fix recursive block
4329         addition by reworking the production.
4330
4331         * expression.cs (New.DoEmit): New has a special case:
4332                 
4333                  If we are dealing with a ValueType, we have a few
4334                  situations to deal with:
4335                 
4336                     * The target of New is a ValueType variable, that is
4337                       easy, we just pass this as the variable reference
4338                 
4339                     * The target of New is being passed as an argument,
4340                       to a boxing operation or a function that takes a
4341                       ValueType.
4342                 
4343                       In this case, we need to create a temporary variable
4344                       that is the argument of New.
4345
4346
4347 2001-12-23  Ravi Pratap  <ravi@ximian.com>
4348
4349         * rootcontext.cs (LookupType): Check that current_type is not null before
4350         going about looking at nested types.
4351
4352         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
4353         not implement the IAssignMethod interface any more.
4354
4355         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
4356         where we tranform them into FieldExprs if they are being resolved from within
4357         the declaring type.
4358
4359         * ecore.cs (SimpleName.DoResolve): Do the same here.
4360
4361         * assign.cs (DoResolve, Emit): Clean up code considerably. 
4362
4363         * ../errors/bug10.cs : Add.
4364
4365         * ../errors/cs0070.cs : Add.
4366
4367         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
4368
4369         * assign.cs : Get rid of EventIsLocal everywhere.
4370         
4371 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
4372
4373         * ecore.cs (ConvertIntLiteral): finished the implementation.
4374
4375         * statement.cs (SwitchLabel): Convert the value we are using as a
4376         key before looking up the table.
4377
4378 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
4379
4380         * codegen.cs (EmitTopBlock): Require a Location argument now.
4381
4382         * cs-parser.jay (constructor_declarator): We need to setup
4383         current_local_parameters before we parse the
4384         opt_constructor_initializer, to allow the variables to be bound
4385         to the constructor arguments.
4386
4387         * rootcontext.cs (LookupType): First lookup nested classes in our
4388         class and our parents before we go looking outside our class.
4389
4390         * expression.cs (ConstantFold): Extract/debox the values at the
4391         beginnning. 
4392
4393         * rootcontext.cs (EmitCode): Resolve the constants first before we
4394         resolve the types.  This is not really needed, but it helps debugging.
4395
4396         * statement.cs: report location.
4397         
4398         * cs-parser.jay: pass location to throw statement.
4399
4400         * driver.cs: Small bug fix.
4401
4402         * report.cs: Updated format to be 4-zero filled digits.
4403
4404 2001-12-22  Ravi Pratap  <ravi@ximian.com>
4405
4406         * expression.cs (CheckIndices): Fix minor bug where the wrong
4407         variable was being referred to ;-)
4408
4409         (DoEmit): Do not call EmitStaticInitializers when the 
4410         underlying type is System.Object.
4411
4412 2001-12-21  Ravi Pratap  <ravi@ximian.com>
4413
4414         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
4415         and do the usual workaround for SRE.
4416
4417         * class.cs (MyEventBuilder.EventType): New member to get at the type
4418         of the event, quickly.
4419
4420         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
4421
4422         * assign.cs (Assign.DoResolve): Handle the case when the target
4423         is an EventExpr and perform the necessary checks.
4424
4425         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
4426         interface.
4427
4428         (SimpleName.MemberStaticCheck): Include check for EventExpr.
4429
4430         (EventExpr): Set the type in the constructor itself since we 
4431         are meant to be born fully resolved.
4432
4433         (EventExpr.Define): Revert code I wrote earlier.
4434                 
4435         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
4436         instance expression is null. The instance expression is a This in that case
4437         or a null, depending on whether it is a static method or not.
4438
4439         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
4440         refers to more than one method.
4441
4442         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
4443         and accordingly flag errors.
4444
4445 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
4446
4447         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
4448
4449 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
4450
4451         * location.cs (ToString): Provide useful rutine.
4452
4453 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
4454
4455         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
4456         objects, return the actual integral boxed.
4457
4458         * statement.cs (SwitchLabel): define an ILLabel for each
4459         SwitchLabel. 
4460         
4461         (Switch.CheckSwitch): If the value is a Literal, extract
4462         the underlying literal.
4463         
4464         Also in the unused hashtable we had, add the SwitchLabel so we can
4465         quickly look this value up.
4466
4467         * constant.cs: Implement a bunch of new constants.  Rewrite
4468         Literal based on this.  Made changes everywhere to adapt to this.
4469         
4470         * expression.cs (Expression.MakeByteBlob): Optimize routine by
4471         dereferencing array only once, and also copes with enumrations.
4472
4473         bytes are two bytes wide, not one.
4474
4475         (Cast): Perform constant conversions.
4476         
4477         * ecore.cs (TryImplicitIntConversion): Return literals instead of
4478         wrappers to the literals here.
4479
4480         * expression.cs (DoNumericPromotions): long literals can converted
4481         to ulong implicity (this is taken care of elsewhere, but I was
4482         missing this spot).
4483
4484         * ecore.cs (Expression.Literalize): Make the return type Literal,
4485         to improve type checking.
4486
4487         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
4488
4489 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
4490
4491         * literal.cs: Revert code from ravi that checked the bounds.  The
4492         bounds are sane by the definition of the type itself. 
4493
4494         * typemanager.cs: Fix implementation of ImplementsInterface.  We
4495         need to actually look up in our parent hierarchy for interfaces
4496         implemented. 
4497
4498         * const.cs: Use the underlying type for enumerations
4499
4500         * delegate.cs: Compute the basename for the delegate creation,
4501         that should fix the delegate test case, and restore the correct
4502         Type Lookup semantics in rootcontext
4503
4504         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
4505         referencing a nested type with the Reflection API is using the "+"
4506         sign. 
4507
4508         * cs-parser.jay: Do not require EOF token at the end.
4509
4510 2001-12-20  Ravi Pratap  <ravi@ximian.com>
4511
4512         * rootcontext.cs (LookupType): Concatenate type names with
4513         a '.' instead of a '+' The test suite passes again.
4514
4515         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
4516         field of the enumeration.
4517
4518         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
4519         the case when the member is an EventExpr.
4520
4521         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
4522         static has an associated instance expression.
4523
4524         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
4525
4526         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
4527
4528         * class.cs (Event.Define): Register event and perform appropriate checks
4529         for error #111.
4530
4531         We define the Add and Remove methods even if the use provides none because
4532         in that case, we provide default implementations ourselves.
4533
4534         Define a private field of the type of the event. This is done by the CSC compiler
4535         and we should be doing it too ;-)
4536
4537         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
4538         More methods we use in code we generate.
4539
4540         (multicast_delegate_type, delegate_type): Two separate types since the distinction
4541         is important.
4542
4543         (InitCoreTypes): Update accordingly for the above.
4544
4545         * class.cs (Event.Emit): Generate code for default accessors that we provide
4546
4547         (EmitDefaultMethod): Do the job in the above.
4548
4549         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
4550         appropriate place.
4551
4552 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
4553
4554         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
4555         builders even if we were missing one.
4556
4557         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
4558         pass the Basename as our class name instead of the Name.  The
4559         basename will be correctly composed for us.
4560
4561         * parameter.cs (Paramters): Now takes a Location argument.
4562
4563         * decl.cs (DeclSpace.LookupType): Removed convenience function and
4564         make all the code call directly LookupType in RootContext and take
4565         this chance to pass the Location information everywhere.
4566
4567         * Everywhere: pass Location information.
4568
4569 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
4570
4571         * class.cs (Constructor.Define): Updated way of detecting the
4572         length of the parameters.
4573
4574         (TypeContainer.DefineType): Use basename as the type name for
4575         nested types.
4576
4577         (TypeContainer.Define): Do not recursively define types here, as
4578         definition is taken care in order by the RootContext.
4579
4580         * tree.cs: Keep track of namespaces in a per-file basis.
4581
4582         * parameter.cs (Parameter.ComputeSignature): Update to use
4583         DeclSpace. 
4584
4585         (Parameters.GetSignature): ditto.
4586
4587         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
4588         instead of a TypeContainer.
4589
4590         (Interface.SemanticAnalysis): Use `this' instead of our parent to
4591         resolve names.  Because we need to be resolve in our context, not
4592         our parents.
4593         
4594         * driver.cs: Implement response files.
4595
4596         * class.cs (TypeContainer.DefineType): If we are defined, do not
4597         redefine ourselves.
4598         
4599         (Event.Emit): Emit the code for add/remove handlers.
4600         (Event.Define): Save the MethodBuilders for add/remove.
4601
4602         * typemanager.cs: Use pair here too.
4603
4604         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
4605         DictionaryEntry requires the first argument to be non-null.  
4606         
4607         (enum_declaration): Compute full name for registering the
4608         enumeration.
4609         
4610         (delegate_declaration): Instead of using
4611         formal_parameter_list, use opt_formal_parameter_list as the list
4612         can be empty.
4613
4614         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
4615         (EventParsing): New property that controls whether `add' and
4616         `remove' are returned as tokens or identifiers (for events);
4617
4618 2001-12-19  Ravi Pratap  <ravi@ximian.com>
4619
4620         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
4621         use MyEventBuilder only and let it wrap the real builder for us.
4622
4623         (MyEventBuilder): Revamp constructor etc.
4624
4625         Implement all operations that we perform on EventBuilder in precisely the same
4626         way here too.
4627
4628         (FindMembers): Update to use the EventBuilder member.
4629
4630         (Event.Emit): Update accordingly.
4631
4632 2001-12-18  Ravi Pratap  <ravi@ximian.com>
4633
4634         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
4635         by calling the appropriate methods.
4636
4637         (GetCustomAttributes): Make stubs as they cannot possibly do anything
4638         useful.
4639
4640         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
4641
4642 2001-12-17  Ravi Pratap  <ravi@ximian.com>
4643
4644         * delegate.cs (Delegate.Populate): Check that the return type
4645         and various parameters types are indeed accessible.
4646
4647         * class.cs (Constructor.Define): Same here.
4648
4649         (Field.Define): Ditto.
4650
4651         (Event.Define): Ditto.
4652
4653         (Operator.Define): Check that the underlying Method defined itself
4654         correctly - so it's MethodBuilder should not be null.
4655
4656         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
4657         expression happens to be null.
4658
4659         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
4660         members but as of now we don't seem to be able to do anything really useful with it.
4661
4662         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
4663         not the EventBuilder.
4664
4665 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
4666
4667         * cs-tokenizer.cs: Add support for defines.
4668         Add support for #if, #elif, #else, #endif
4669         
4670         (eval_var): evaluates a variable.
4671         (eval): stubbed for evaluating functions.
4672
4673         * cs-parser.jay: Pass the defines information
4674
4675         * driver.cs: Add --define command line option.
4676
4677         * decl.cs: Move MemberCore here.
4678
4679         Make it the base class for DeclSpace.  This allows us to catch and
4680         report 108 and 109 for everything now.
4681
4682         * class.cs (TypeContainer.Define): Extract all the members
4683         before populating and emit the warning 108 (new keyword required
4684         to override) instead of having each member implement this.
4685
4686         (MemberCore.Define): New abstract method, we will be using this in
4687         the warning reporting engine in Populate.
4688         
4689         (Operator.Define): Adjust to new MemberCore protocol. 
4690
4691         * const.cs (Const): This does not derive from Expression, it is a
4692         temporary object we use to create fields, it is a MemberCore. 
4693
4694         * class.cs (Method.Define): Allow the entry point to be in a
4695         specific class.
4696
4697         * driver.cs: Rewrite the argument handler to clean it up a bit.
4698
4699         * rootcontext.cs: Made it just an auxiliary namespace feature by
4700         making everything static.
4701
4702         * driver.cs: Adapt code to use RootContext type name instead of
4703         instance variable.
4704
4705         * delegate.cs: Remove RootContext argument.
4706
4707         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
4708         argument. 
4709
4710         * class.cs (Event.Define): The lookup can fail.
4711         
4712         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
4713
4714         * expression.cs: Resolve the this instance before invoking the code.
4715
4716 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
4717
4718         * cs-parser.jay: Add a production in element_access that allows
4719         the thing to become a "type" reference.  This way we can parse
4720         things like "(string [])" as a type.
4721
4722         Note that this still does not handle the more complex rules of
4723         casts. 
4724         
4725
4726         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
4727
4728         * ecore.cs: (CopyNewMethods): new utility function used to
4729         assemble the list of methods from running FindMembers.
4730
4731         (MemberLookup): Rework FindMembers so that 
4732
4733 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
4734
4735         * class.cs (TypeContainer): Remove Delegates who fail to be
4736         defined.
4737
4738         * delegate.cs (Populate): Verify that we dont get null return
4739         values.   TODO: Check for AsAccessible.
4740
4741         * cs-parser.jay: Use basename to emit error 574 (destructor should
4742         have the same name as container class), not the full name.
4743
4744         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
4745         possible representation.  
4746
4747         Also implements integer type suffixes U and L.
4748
4749 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
4750
4751         * expression.cs (ArrayCreation.DoResolve): We need to do the
4752         argument resolution *always*.
4753
4754         * decl.cs: Make this hold the namespace.  Hold the root context as
4755         well.
4756         (LookupType): Move here.
4757
4758         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
4759
4760         * location.cs (Row, Name): Fixed the code, it was always returning
4761         references to the first file.
4762
4763         * interface.cs: Register properties defined through interfaces.
4764
4765         * driver.cs: Add support for globbing on the command line
4766
4767         * class.cs (Field): Make it derive from MemberCore as well.
4768         (Event): ditto.
4769
4770 2001-12-15  Ravi Pratap  <ravi@ximian.com>
4771
4772         * class.cs (Event::Define): Check that the type of the event is a delegate
4773         type else flag error #66.
4774
4775         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
4776         same.
4777
4778         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
4779         values of EntryPoint, CharSet etc etc.
4780
4781         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
4782
4783         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
4784         be null and we should ignore this. I am not sure if this is really clean. Apparently,
4785         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
4786         which needs this to do its work.
4787
4788         * ../errors/cs0066.cs : Add.
4789
4790 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
4791
4792         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
4793         helper functions.
4794
4795         * class.cs: (MethodSignature.MethodSignature): Removed hack that
4796         clears out the parameters field.
4797         (MemberSignatureCompare): Cleanup
4798
4799         (MemberCore): New base class used to share code between MethodCore
4800         and Property.
4801
4802         (RegisterRequiredImplementations) BindingFlags.Public requires
4803         either BindingFlags.Instace or Static.  Use instance here.
4804
4805         (Property): Refactored code to cope better with the full spec.
4806
4807         * parameter.cs (GetParameterInfo): Return an empty array instead
4808         of null on error.
4809
4810         * class.cs (Property): Abstract or extern properties have no bodies.
4811
4812         * parameter.cs (GetParameterInfo): return a zero-sized array.
4813
4814         * class.cs (TypeContainer.MethodModifiersValid): Move all the
4815         method modifier validation to the typecontainer so we can reuse
4816         this on properties.
4817
4818         (MethodCore.ParameterTypes): return an empty sized array of types.
4819
4820         (Property.Define): Test property modifier validity.
4821
4822         Add tests for sealed/override too.
4823
4824         (Method.Emit): abstract or extern methods have no bodies.
4825
4826 2001-12-14  Ravi Pratap  <ravi@ximian.com>
4827
4828         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
4829         thing.
4830
4831         (Method::Define, ::Emit): Modify accordingly.
4832
4833         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
4834
4835         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
4836
4837         * makefile: Pass in /unsafe.
4838
4839 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
4840
4841         * class.cs (MakeKey): Kill routine.
4842         
4843         * class.cs (TypeContainer.Define): Correctly define explicit
4844         method implementations (they require the full interface name plus
4845         the method name).
4846
4847         * typemanager.cs: Deply the PtrHashtable here and stop using the
4848         lame keys.  Things work so much better.
4849
4850         This of course broke everyone who depended on `RegisterMethod' to
4851         do the `test for existance' test.  This has to be done elsewhere.
4852
4853         * support.cs (PtrHashtable): A hashtable that avoid comparing with
4854         the object stupid Equals method (because, that like fails all over
4855         the place).  We still do not use it.
4856
4857         * class.cs (TypeContainer.SetRequiredInterface,
4858         TypeContainer.RequireMethods): Killed these two routines and moved
4859         all the functionality to RegisterRequiredImplementations.
4860
4861         (TypeContainer.RegisterRequiredImplementations): This routine now
4862         registers all the implementations required in an array for the
4863         interfaces and abstract methods.  We use an array of structures
4864         which can be computed ahead of time to reduce memory usage and we
4865         also assume that lookups are cheap as most classes will not
4866         implement too many interfaces.
4867
4868         We also avoid creating too many MethodSignatures.
4869
4870         (TypeContainer.IsInterfaceMethod): Update and optionally does not
4871         clear the "pending" bit if we find that there are problems with
4872         the declaration.
4873
4874         (TypeContainer.VerifyPendingMethods): Update to report errors of
4875         methods that look like implementations but are not.
4876
4877         (TypeContainer.Define): Add support for explicit interface method
4878         implementation. 
4879         
4880 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
4881
4882         * typemanager.cs: Keep track of the parameters here instead of
4883         being a feature of the TypeContainer.
4884
4885         * class.cs: Drop the registration of parameters here, as
4886         InterfaceMethods are also interface declarations.
4887
4888         * delegate.cs: Register methods with the TypeManager not only with
4889         the TypeContainer.  This code was buggy.
4890
4891         * interface.cs: Full registation here.
4892
4893 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
4894
4895         * expression.cs: Remove reducer for binary expressions, it can not
4896         be done this way.
4897
4898         * const.cs: Put here the code that used to go into constant.cs
4899
4900         * constant.cs: Put here the code for constants, this is a new base
4901         class for Literals.
4902
4903         * literal.cs: Make Literal derive from Constant.
4904
4905 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
4906
4907         * statement.cs (Return.Emit): Report error 157 if the user
4908         attempts to return from a finally block.
4909
4910         (Return.Emit): Instead of emitting a return, jump to the end of
4911         the function.
4912
4913         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
4914         LocalBuilder to store the result of the function.  ReturnLabel is
4915         the target where we jump.
4916         
4917
4918 2001-12-09  Radek Doulik  <rodo@ximian.com>
4919
4920         * cs-parser.jay: remember alias in current namespace
4921
4922         * ecore.cs (SimpleName::DoResolve): use aliases for types or
4923         namespaces
4924
4925         * class.cs (LookupAlias): lookup alias in my_namespace
4926
4927         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
4928         aliases hashtable
4929         (LookupAlias): lookup alias in this and if needed in parent
4930         namespaces
4931
4932 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
4933
4934         * support.cs: 
4935
4936         * rootcontext.cs: (ModuleBuilder) Made static, first step into
4937         making things static.  I need this to avoid passing the
4938         TypeContainer when calling ParameterType.
4939
4940         * support.cs (InternalParameters.ParameterType): Remove ugly hack
4941         that did string manipulation to compute the type and then call
4942         GetType.  Use Parameter.ParameterType instead.
4943
4944         * cs-tokenizer.cs: Consume the suffix for floating values.
4945
4946         * expression.cs (ParameterReference): figure out whether this is a
4947         reference parameter or not.  Kill an extra variable by computing
4948         the arg_idx during emission.
4949
4950         * parameter.cs (Parameters.GetParameterInfo): New overloaded
4951         function that returns whether a parameter is an out/ref value or not.
4952
4953         (Parameter.ParameterType): The type of the parameter (base,
4954         without ref/out applied).
4955         
4956         (Parameter.Resolve): Perform resolution here.
4957         (Parameter.ExternalType): The full type (with ref/out applied).
4958
4959         * statement.cs (Using.Emit, Using.EmitExpression): Implement
4960         support for expressions on the using statement.
4961
4962 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
4963
4964         * statement.cs (Using.EmitLocalVariableDecls): Split the
4965         localvariable handling of the using statement.
4966
4967         (Block.EmitMeta): Keep track of variable count across blocks.  We
4968         were reusing slots on separate branches of blocks.
4969
4970         (Try.Emit): Emit the general code block, we were not emitting it. 
4971
4972         Check the type of the declaration to be an IDisposable or
4973         something that can be implicity converted to it. 
4974
4975         Emit conversions if required.
4976
4977         * ecore.cs (EmptyExpression): New utility class.
4978         (Expression.ImplicitConversionExists): New utility function.
4979
4980 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
4981
4982         * statement.cs (Using): Implement.
4983
4984         * expression.cs (LocalVariableReference): Support read only variables.
4985
4986         * statement.cs: Remove the explicit emit for the Leave opcode.
4987         (VariableInfo): Add a readonly field.
4988
4989 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
4990
4991         * ecore.cs (ConvCast): new class used to encapsulate the various
4992         explicit integer conversions that works in both checked and
4993         unchecked contexts.
4994
4995         (Expression.ConvertNumericExplicit): Use new ConvCast class to
4996         properly generate the overflow opcodes.
4997
4998 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
4999
5000         * statement.cs: The correct type for the EmptyExpression is the
5001         element_type, not the variable type.  Ravi pointed this out.
5002
5003 2001-12-04  Ravi Pratap  <ravi@ximian.com>
5004
5005         * class.cs (Method::Define): Handle PInvoke methods specially
5006         by using DefinePInvokeMethod instead of the usual one.
5007
5008         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
5009         above to do the task of extracting information and defining the method.
5010         
5011 2001-12-04  Ravi Pratap  <ravi@ximian.com>
5012
5013         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
5014         of the condition for string type.
5015
5016         (Emit): Move that here. 
5017
5018         (ArrayCreation::CheckIndices): Keep string literals in their expression
5019         form.
5020
5021         (EmitDynamicInitializers): Handle strings appropriately.
5022
5023 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
5024
5025         * codegen.cs (EmitContext): Replace multiple variables with a
5026         single pointer to the current Switch statement.
5027
5028         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
5029         EmitContext.
5030
5031 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
5032
5033         * statement.cs 
5034
5035         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
5036         default'.
5037         
5038         (Foreach.Emit): Foreach on arrays was not setting
5039         up the loop variables (for break/continue).
5040
5041         (GotoCase): Semi-implented.
5042         
5043 2001-12-03  Ravi Pratap  <ravi@ximian.com>
5044
5045         * attribute.cs (CheckAttribute): Handle system attributes by using
5046         Attribute.GetAttributes to examine information we need.
5047
5048         (GetValidPlaces): Same here.
5049
5050         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
5051
5052         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
5053
5054         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
5055
5056         (Method::Define): Set appropriate flags if we have a DllImport attribute.
5057
5058         (Method::Emit): Handle the case when we are a PInvoke method.
5059
5060 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
5061
5062         * expression.cs: Use ResolveWithSimpleName on compound names.
5063
5064 2001-12-02  Ravi Pratap  <ravi@ximian.com>
5065
5066         * constant.cs (EmitConstant): Make sure we resolve the associated expression
5067         before trying to reduce it.
5068
5069         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
5070
5071         * constant.cs (LookupConstantValue): Implement.
5072
5073         (EmitConstant): Use the above in emitting the constant.
5074
5075         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
5076         that are user-defined by doing a LookupConstantValue on them.
5077
5078         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
5079         too, like above.
5080
5081 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
5082
5083         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
5084
5085         (BaseAccess.DoResolve): Implement.
5086
5087         (MemberAccess.DoResolve): Split this routine into a
5088         ResolveMemberAccess routine that can be used independently
5089
5090 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
5091
5092         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
5093         As that share bits of the implementation.  Is returns a boolean,
5094         while As returns the Type that is being probed.
5095
5096 2001-12-01  Ravi Pratap  <ravi@ximian.com>
5097
5098         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
5099         instead of a Literal - much easier.
5100
5101         (EnumInTransit): Remove - utterly useless :-)
5102
5103         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
5104
5105         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
5106
5107         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
5108         chain when we have no associated expression.
5109
5110 2001-11-30  Ravi Pratap  <ravi@ximian.com>
5111
5112         * constant.cs (Define): Use Location while reporting the errror.
5113
5114         Also emit a warning when 'new' is used and there is no inherited
5115         member to hide.
5116
5117         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
5118         populated.
5119
5120         (LookupEnumValue): Implement to lookup an enum member's value and define it
5121         if necessary.
5122
5123         (Populate): Re-write accordingly to use the above routine.
5124
5125 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
5126
5127         * expression.cs (This): Fix prototype for DoResolveLValue to
5128         override the base class DoResolveLValue.
5129
5130         * cs-parser.cs: Report errors cs574 and cs575 (destructor
5131         declarations) 
5132
5133         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
5134         (we need to load the address of the field here).  This fixes
5135         test-22. 
5136         
5137         (FieldExpr.DoResolveLValue): Call the DoResolve
5138         function to initialize the Instance expression.
5139         
5140         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
5141         correctly the GetEnumerator operation on a value type.
5142
5143         * cs-parser.jay: Add more simple parsing error catches.
5144
5145         * statement.cs (Switch): Add support for string switches.
5146         Handle null specially.
5147
5148         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
5149
5150 2001-11-28  Ravi Pratap  <ravi@ximian.com>
5151
5152         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
5153
5154         (declare_local_constant): New helper function.
5155
5156         * statement.cs (AddConstant): Keep a separate record of constants
5157
5158         (IsConstant): Implement to determine if a variable is a constant.
5159
5160         (GetConstantExpression): Implement.
5161
5162         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
5163
5164         * statement.cs (IsVariableDefined): Re-write.
5165
5166 2001-11-27  Ravi Pratap  <ravi@ximian.com>
5167
5168         * class.cs (TypeContainer::FindMembers): Look for constants
5169         in the case when we are looking for MemberTypes.Field
5170
5171         * expression.cs (MemberAccess::DoResolve): Check that in the
5172         case we are a FieldExpr and a Literal, we are not being accessed
5173         by an instance reference.
5174
5175         * cs-parser.jay (local_constant_declaration): Implement.
5176
5177         (declaration_statement): Implement for constant declarations.
5178
5179 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
5180
5181         * statement.cs (Switch): Catch double defaults.
5182
5183         (Switch): More work on the switch() statement
5184         implementation.  It works for integral values now, need to finish
5185         string support.
5186
5187
5188 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
5189
5190         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
5191         integer literals into other integer literals.  To be used by
5192         switch. 
5193
5194 2001-11-24  Ravi Pratap  <ravi@ximian.com>
5195
5196         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
5197         some memory.
5198
5199         (EmitDynamicInitializers): Cope with the above since we extract data
5200         directly from ArrayData now.
5201
5202         (ExpectInitializers): Keep track of whether initializers are mandatory
5203         or not.
5204
5205         (Bounds): Make it a hashtable to prevent the same dimension being 
5206         recorded for every element in that dimension.
5207
5208         (EmitDynamicInitializers): Fix bug which prevented the Set array method
5209         from being found.
5210
5211         Also fix bug which was causing the indices to be emitted in the reverse
5212         order.
5213
5214 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
5215
5216         * expression.cs (ArrayCreation): Implement the bits that Ravi left
5217         unfinished.  They do not work, because the underlying code is
5218         sloppy.
5219
5220 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
5221
5222         * cs-parser.jay: Remove bogus fixme.
5223
5224         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
5225         on Switch statement.
5226         
5227 2001-11-23  Ravi Pratap  <ravi@ximian.com>
5228
5229         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
5230         the same. 
5231         
5232         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
5233         parameter. Apparently, any expression is allowed. 
5234
5235         (ValidateInitializers): Update accordingly.
5236
5237         (CheckIndices): Fix some tricky bugs thanks to recursion.
5238
5239         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
5240         I was being completely brain-dead.
5241
5242         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
5243         and re-write acordingly.
5244
5245         (DelegateInvocation): Re-write accordingly.
5246
5247         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
5248
5249         (MakeByteBlob): Handle types more correctly.
5250
5251         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
5252         initialization from expressions but it is incomplete because I am a complete
5253         Dodo :-|
5254
5255 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
5256
5257         * statement.cs (If.Emit): Fix a bug that generated incorrect code
5258         on If.  Basically, we have to return `true' (ie, we do return to
5259         our caller) only if both branches of the if return.
5260
5261         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
5262         short-circuit operators, handle them as short circuit operators. 
5263
5264         (Cast.DoResolve): Resolve type.
5265         (Cast.Cast): Take an expression as the target type.
5266
5267         * cs-parser.jay (cast_expression): Remove old hack that only
5268         allowed a limited set of types to be handled.  Now we take a
5269         unary_expression and we resolve to a type during semantic
5270         analysis.
5271
5272         Use the grammar productions from Rhys to handle casts (this is
5273         not complete like Rhys syntax yet, we fail to handle that corner
5274         case that C# has regarding (-x), but we will get there.
5275         
5276 2001-11-22  Ravi Pratap  <ravi@ximian.com>
5277
5278         * class.cs (EmitFieldInitializer): Take care of the case when we have a
5279         field which is an array type.
5280
5281         * cs-parser.jay (declare_local_variables): Support array initialization too.
5282
5283         * typemanager.cs (MakeKey): Implement.
5284
5285         (everywhere): Use the above appropriately.
5286
5287         * cs-parser.jay (for_statement): Update for array initialization while
5288         declaring variables.
5289
5290         * ecore.cs : The error message was correct, it's the variable's names that
5291         were misleading ;-) Make the code more readable.
5292
5293         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
5294         the correct type etc.
5295
5296         (ConvertExplicit): Handle Enum types by examining the underlying type.
5297
5298 2001-11-21  Ravi Pratap  <ravi@ximian.com>
5299
5300         * parameter.cs (GetCallingConvention): Always return
5301         CallingConventions.Standard for now.
5302
5303 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
5304
5305         * expression.cs (Binary.ResolveOperator): Update the values of `l'
5306         and `r' after calling DoNumericPromotions.
5307
5308         * ecore.cs: Fix error message (the types were in the wrong order).
5309
5310         * statement.cs (Foreach.ProbeCollectionType): Need to pass
5311         BindingFlags.Instance as well 
5312
5313         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
5314         implicit int literal conversion in an empty cast so that we
5315         propagate the right type upstream.
5316
5317         (UnboxCast): new class used to unbox value types.
5318         (Expression.ConvertExplicit): Add explicit type conversions done
5319         by unboxing.
5320
5321         (Expression.ImplicitNumericConversion): Oops, forgot to test for
5322         the target type before applying the implicit LongLiterals to ULong
5323         literal cast.
5324
5325 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
5326
5327         * cs-parser.jay (for_statement): Reworked the way For works: now
5328         we declare manually any variables that are introduced in
5329         for_initializer to solve the problem of having out-of-band code
5330         emition (that is what got for broken).
5331
5332         (declaration_statement): Perform the actual variable declaration
5333         that used to be done in local_variable_declaration here.
5334
5335         (local_variable_declaration): Do not declare anything, just pass
5336         the information on a DictionaryEntry
5337
5338 2001-11-20  Ravi Pratap  <ravi@ximian.com>
5339
5340         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
5341         re-write of the logic to now make it recursive.
5342
5343         (UpdateIndices): Re-write accordingly.
5344
5345         Store element data in a separate ArrayData list in the above methods.
5346
5347         (MakeByteBlob): Implement to dump the array data into a byte array.
5348
5349 2001-11-19  Ravi Pratap  <ravi@ximian.com>
5350
5351         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
5352         into CheckIndices.
5353
5354         * constant.cs (Define): Implement.
5355
5356         (EmitConstant): Re-write fully.
5357
5358         Pass in location info.
5359
5360         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
5361         respectively.
5362
5363         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
5364         DictionaryEntry since we need location info too.
5365
5366         (constant_declaration): Update accordingly.
5367
5368         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
5369         code into another method : UpdateIndices.
5370
5371 2001-11-18  Ravi Pratap  <ravi@ximian.com>
5372
5373         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
5374         some type checking etc.
5375
5376 2001-11-17  Ravi Pratap  <ravi@ximian.com>
5377
5378         * expression.cs (ArrayCreation::ValidateInitializers): Implement
5379         bits to provide dimension info if the user skips doing that.
5380
5381         Update second constructor to store the rank correctly.
5382
5383 2001-11-16  Ravi Pratap  <ravi@ximian.com>
5384
5385         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
5386         and try to implement.
5387
5388         * ../errors/cs0150.cs : Add.
5389
5390         * ../errors/cs0178.cs : Add.
5391
5392 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
5393
5394         * statement.cs: Implement foreach on multi-dimensional arrays. 
5395
5396         * parameter.cs (Parameters.GetParameterByName): Also lookup the
5397         name of the params argument.
5398
5399         * expression.cs: Use EmitStoreOpcode to get the right opcode while
5400         initializing the array.
5401
5402         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
5403         we can use this elsewhere.
5404
5405         * statement.cs: Finish implementation of foreach for single
5406         dimension arrays.
5407
5408         * cs-parser.jay: Use an out-of-band stack to pass information
5409         around, I wonder why I need this.
5410
5411         foreach_block: Make the new foreach_block the current_block.
5412
5413         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
5414         function used to return a static Parameters structure.  Used for
5415         empty parameters, as those are created very frequently.
5416
5417         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
5418
5419 2001-11-15  Ravi Pratap  <ravi@ximian.com>
5420
5421         * interface.cs : Default modifier is private, not public. The
5422         make verify test passes again.
5423
5424 2001-11-15  Ravi Pratap  <ravi@ximian.com>
5425
5426         * support.cs (ReflectionParameters): Fix logic to determine
5427         whether the last parameter is a params one. Test 9 passes again.
5428
5429         * delegate.cs (Populate): Register the builders we define with
5430         RegisterParameterForBuilder. Test 19 passes again.
5431
5432         * cs-parser.jay (property_declaration): Reference $6 instead
5433         of $$ to get at the location.
5434
5435         (indexer_declaration): Similar stuff.
5436
5437         (attribute): Ditto.
5438
5439         * class.cs (Property): Register parameters for the Get and Set methods
5440         if they exist. Test 23 passes again.
5441
5442         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
5443         call to EmitArguments as we are sure there aren't any params arguments. 
5444         Test 32 passes again.
5445
5446         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
5447         IndexOutOfRangeException. 
5448
5449         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
5450         Test 33 now passes again.
5451         
5452 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
5453
5454         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
5455         broke a bunch of things.  Will have to come up with a better way
5456         of tracking locations.
5457
5458         * statement.cs: Implemented foreach for single dimension arrays.
5459
5460 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
5461
5462         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
5463         an error.  This removes the lookup from the critical path.
5464
5465         * cs-parser.jay: Removed use of temporary_loc, which is completely
5466         broken. 
5467
5468 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
5469
5470         * support.cs (ReflectionParameters.ParameterModifier): Report
5471         whether the argument is a PARAMS argument or not.
5472
5473         * class.cs: Set the attribute `ParamArrayAttribute' on the
5474         parameter argument.
5475
5476         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
5477         and cons_param_array_attribute (ConstructorInfo for
5478         ParamArrayAttribute)., 
5479
5480         * codegen.cs: Emit the return using the `Return' statement, that
5481         way we can report the error correctly for missing return values. 
5482
5483         * class.cs (Method.Emit): Clean up.
5484
5485         * expression.cs (Argument.Resolve): Take another argument: the
5486         location where this argument is used.  Notice that this is not
5487         part of the "Argument" class as to reduce the size of the
5488         structure (we know the approximate location anyways).
5489
5490         Test if the argument is a variable-reference, if not, then
5491         complain with a 206.
5492
5493         (Argument.Emit): Emit addresses of variables.
5494
5495         (Argument.FullDesc): Simplify.
5496
5497         (Invocation.DoResolve): Update for Argument.Resolve.
5498
5499         (ElementAccess.DoResolve): ditto.
5500
5501         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
5502         method should be virtual, as this method is always virtual.
5503
5504         (NewDelegate.DoResolve): Update for Argument.Resolve.
5505
5506         * class.cs (ConstructorInitializer.DoResolve): ditto.
5507         
5508         * attribute.cs (Attribute.Resolve): ditto.
5509
5510 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
5511
5512         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
5513
5514         * expression.cs (ParameterReference): Drop IStackStorage and implement
5515         IAssignMethod instead. 
5516
5517         (LocalVariableReference): ditto.
5518         
5519         * ecore.cs (FieldExpr): Drop IStackStorage and implement
5520         IAssignMethod instead. 
5521
5522 2001-11-13  Miguel de Icaza <miguel@ximian.com>
5523
5524         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
5525         enumerations that are used in heavily used structures derive from
5526         byte in a laughable and pathetic attempt to reduce memory usage.
5527         This is the kind of pre-optimzations that you should not do at
5528         home without adult supervision.
5529
5530         * expression.cs (UnaryMutator): New class, used to handle ++ and
5531         -- separatedly from the other unary operators.  Cleans up the
5532         code, and kills the ExpressionStatement dependency in Unary.
5533
5534         (Unary): Removed `method' and `Arguments' from this class, making
5535         it smaller, and moving it all to SimpleCall, so I can reuse this
5536         code in other locations and avoid creating a lot of transient data
5537         strucutres when not required.
5538
5539         * cs-parser.jay: Adjust for new changes.
5540
5541 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
5542
5543         * enum.cs (Enum.Populate): If there is a failure during
5544         definition, return
5545
5546         * cs-parser.jay (opt_enum_base): we used to catch type errors
5547         here, but this is really incorrect.  The type error should be
5548         catched during semantic analysis.
5549
5550 2001-12-11  Ravi Pratap  <ravi@ximian.com>
5551
5552         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
5553         current_local_parameters as expected since I, in my stupidity, had forgotten
5554         to do this :-)
5555
5556         * attribute.cs (GetValidPlaces): Fix stupid bug.
5557
5558         * class.cs (Method::Emit): Perform check on applicability of attributes.
5559
5560         (Constructor::Emit): Ditto.
5561
5562         (Field::Emit): Ditto.
5563
5564         (Field.Location): Store location information.
5565
5566         (Property, Event, Indexer, Operator): Ditto.
5567
5568         * cs-parser.jay (field_declaration): Pass in location for each field.
5569
5570         * ../errors/cs0592.cs : Add.
5571
5572 2001-11-12  Ravi Pratap  <ravi@ximian.com>
5573
5574         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
5575
5576         (InitCoreTypes): Update accordingly.
5577
5578         (RegisterAttrType, LookupAttr): Implement.
5579
5580         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
5581         info about the same.
5582
5583         (Resolve): Update to populate the above as necessary.
5584
5585         (Error592): Helper.
5586
5587         (GetValidPlaces): Helper to the above.
5588
5589         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
5590
5591         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
5592
5593 2001-11-12  Ravi Pratap  <ravi@ximian.com>
5594
5595         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
5596
5597         * ../errors/cs0617.cs : Add.
5598
5599 2001-11-11  Ravi Pratap  <ravi@ximian.com>
5600
5601         * enum.cs (Emit): Rename to Populate to be more consistent with what
5602         we expect it to do and when exactly it is called.
5603
5604         * class.cs, rootcontext.cs : Update accordingly.
5605
5606         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
5607         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
5608
5609         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
5610
5611         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
5612         of a fieldinfo using the above, when dealing with a FieldBuilder.
5613
5614 2001-11-10  Ravi Pratap  <ravi@ximian.com>
5615
5616         * ../errors/cs0031.cs : Add.
5617
5618         * ../errors/cs1008.cs : Add.
5619
5620         * ../errrors/cs0543.cs : Add.
5621
5622         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
5623         enum type.
5624
5625         (FindMembers): Implement.
5626
5627         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
5628         enums and delegates too.
5629
5630         (enum_types): Rename to builder_to_enum.
5631
5632         (delegate_types): Rename to builder_to_delegate.
5633
5634         * delegate.cs (FindMembers): Implement.
5635
5636 2001-11-09  Ravi Pratap  <ravi@ximian.com>
5637
5638         * typemanager.cs (IsEnumType): Implement.
5639
5640         * enum.cs (Emit): Re-write parts to account for the underlying type
5641         better and perform checking etc.
5642
5643         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
5644         of the underlying type.
5645
5646         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
5647         value
5648
5649         * enum.cs (error31): Helper to report error #31.
5650
5651         * cs-parser.jay (enum_declaration): Store location of each member too.
5652
5653         * enum.cs (member_to_location): New hashtable. 
5654
5655         (AddEnumMember): Update location hashtable.
5656
5657         (Emit): Use the location of each member while reporting errors.
5658
5659 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
5660
5661         * cs-parser.jay: A for_initializer if is a
5662         local_variable_declaration really ammount to have an implicit
5663         block with the variable declaration and no initializer for for.
5664
5665         * statement.cs (For.Emit): Cope with null initializers.
5666
5667         This fixes the infinite loop on for initializers.
5668
5669 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
5670
5671         * enum.cs: More cleanup.
5672
5673         * ecore.cs: Remove dead code.
5674
5675         * class.cs (Property.Emit): More simplification.
5676         (Event.Emit): ditto.
5677
5678         Reworked to have less levels of indentation.
5679         
5680 2001-11-08  Ravi Pratap  <ravi@ximian.com>
5681
5682         * class.cs (Property): Emit attributes.
5683
5684         (Field): Ditto.
5685         
5686         (Event): Ditto.
5687
5688         (Indexer): Ditto.
5689
5690         (Operator): Ditto.
5691
5692         * enum.cs (Emit): Ditto.
5693
5694         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
5695         Enums too.
5696
5697         * class.cs (Field, Event, etc.): Move attribute generation into the
5698         Emit method everywhere.
5699
5700         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
5701         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
5702         as we had no way of defining nested enums !
5703
5704         * rootcontext.cs : Adjust code accordingly.
5705
5706         * typemanager.cs (AddEnumType): To keep track of enum types separately.
5707
5708 2001-11-07  Ravi Pratap  <ravi@ximian.com>
5709
5710         * expression.cs (EvalConstantExpression): Move into ecore.cs
5711         
5712         * enum.cs (Enum): Rename some members and make them public and readonly
5713         according to our convention.
5714
5715         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
5716         nothing else.
5717
5718         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
5719
5720         (Enum::Emit): Write a simple version for now which doesn't try to compute
5721         expressions. I shall modify this to be more robust in just a while.
5722
5723         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
5724
5725         (TypeContainer::CloseType): Create the Enum types too.
5726
5727         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
5728
5729         * expression.cs (EvalConstantExpression): Get rid of completely.
5730
5731         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
5732         user-defined values and other cases.
5733
5734         (IsValidEnumLiteral): Helper function.
5735
5736         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
5737         out there in the case we had a literal FieldExpr.
5738
5739         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
5740
5741         (Literalize): Revamp a bit to take two arguments.
5742         
5743         (EnumLiteral): New class which derives from Literal to wrap enum literals.
5744         
5745 2001-11-06  Ravi Pratap  <ravi@ximian.com>
5746
5747         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
5748
5749         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
5750
5751         (Resolve): Use the above to ensure we have proper initializers.
5752
5753 2001-11-05  Ravi Pratap  <ravi@ximian.com>
5754
5755         * expression.cs (Expression::EvalConstantExpression): New method to 
5756         evaluate constant expressions.
5757
5758         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
5759
5760 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
5761
5762         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
5763         in an array.
5764
5765         (Binary.ResolveOperator): Handle operator != (object a, object b)
5766         and operator == (object a, object b);
5767
5768         (Binary.DoNumericPromotions): Indicate whether the numeric
5769         promotion was possible.
5770
5771         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
5772         Implement.  
5773
5774         Made the ArrayAccess implement interface IAssignMethod instead of
5775         IStackStore as the order in which arguments are passed reflects
5776         this.
5777
5778         * assign.cs: Instead of using expr.ExprClass to select the way of
5779         assinging, probe for the IStackStore/IAssignMethod interfaces.
5780
5781         * typemanager.cs: Load InitializeArray definition.
5782
5783         * rootcontext.cs (RootContext.MakeStaticData): Used to define
5784         static data that can be used to initialize arrays. 
5785
5786 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
5787
5788         * expression.cs: Handle operator== and operator!= for booleans.
5789
5790         (Conditioal.Reduce): Implement reducer for the ?: operator.
5791
5792         (Conditional.Resolve): Implement dead code elimination.
5793
5794         (Binary.Resolve): Catch string literals and return a new
5795         concatenated string.
5796
5797         (Unary.Reduce): Implement reduction of unary expressions.
5798
5799         * ecore.cs: Split out the expression core handling here.
5800
5801         (Expression.Reduce): New method used to perform constant folding
5802         and CSE.  This is needed to support constant-expressions. 
5803         
5804         * statement.cs (Statement.EmitBoolExpression): Pass true and false
5805         targets, and optimize for !x.
5806
5807 2001-11-04  Ravi Pratap  <ravi@ximian.com>
5808
5809         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
5810         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
5811         set custom atttributes.
5812
5813         * literal.cs (Literal::GetValue): New abstract method to return the actual
5814         value of the literal, cast as an object.
5815
5816         (*Literal): Implement GetValue method.
5817
5818         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
5819         expressions to the arraylist but objects of type Argument.
5820
5821         * class.cs (TypeContainer::Emit): Emit our attributes too.
5822
5823         (Method::Emit, Constructor::Emit): Ditto.
5824
5825         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
5826         to be ignoring earlier.
5827
5828 2001-11-03  Ravi Pratap  <ravi@ximian.com>
5829
5830         * attribute.cs (AttributeSection::Define): Implement to do the business
5831         of constructing a CustomAttributeBuilder.
5832
5833         (Attribute): New trivial class. Increases readability of code.  
5834
5835         * cs-parser.jay : Update accordingly.
5836
5837         (positional_argument_list, named_argument_list, named_argument): New rules
5838
5839         (attribute_arguments): Use the above so that we are more correct.
5840         
5841 2001-11-02  Ravi Pratap  <ravi@ximian.com>
5842         
5843         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
5844         to perform all checks for a method with a params parameter.
5845
5846         (Invocation::OverloadResolve): Update to use the above method and therefore
5847         cope correctly with params method invocations.
5848
5849         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
5850         params too.
5851
5852         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
5853         constructors in our parent too because we can't afford to miss out on 
5854         protected ones ;-)
5855
5856         * attribute.cs (AttributeSection): New name for the class Attribute
5857
5858         Other trivial changes to improve readability.
5859
5860         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
5861         use the new class names.
5862         
5863 2001-11-01  Ravi Pratap  <ravi@ximian.com>
5864
5865         * class.cs (Method::Define): Complete definition for params types too
5866
5867         (Indexer::Define): Ditto.
5868
5869         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
5870         Cope everywhere with a request for info about the array parameter.
5871
5872 2001-11-01  Ravi Pratap  <ravi@ximian.com>
5873
5874         * tree.cs (RecordNamespace): Fix up to check for the correct key.
5875
5876         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
5877         local_variable_type to extract the string corresponding to the type.
5878
5879         (local_variable_type): Fixup the action to use the new helper method.
5880
5881         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
5882         go.
5883
5884         * expression.cs : Clean out code which uses the above.
5885
5886 2001-10-31  Ravi Pratap  <ravi@ximian.com>
5887         
5888         * typemanager.cs (RegisterMethod): Check if we already have an existing key
5889         and bale out if necessary by returning a false.
5890
5891         (RegisterProperty): Ditto.
5892
5893         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
5894         and print out appropriate error messages.
5895
5896         * interface.cs (everywhere): Ditto.
5897
5898         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
5899         location to constructor.
5900
5901         * class.cs (Property, Event, Indexer): Update accordingly.
5902
5903         * ../errors/cs111.cs : Added.
5904
5905         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
5906         of a method, as laid down by the spec.
5907
5908         (Invocation::OverloadResolve): Use the above method.
5909
5910 2001-10-31  Ravi Pratap  <ravi@ximian.com>
5911
5912         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
5913         now take a TypeContainer and a Parameters object.
5914
5915         (ParameterData): Modify return type of ParameterModifier method to be 
5916         Parameter.Modifier and not a string.
5917
5918         (ReflectionParameters, InternalParameters): Update accordingly.
5919
5920         * expression.cs (Argument::GetParameterModifier): Same here.
5921
5922         * support.cs (InternalParameters::ParameterType): Find a better way of determining
5923         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
5924         symbol in it at all so maybe this is only for now.
5925
5926 2001-10-30  Ravi Pratap  <ravi@ximian.com>
5927
5928         * support.cs (InternalParameters): Constructor now takes an extra argument 
5929         which is the actual Parameters class.
5930
5931         (ParameterDesc): Update to provide info on ref/out modifiers.
5932
5933         * class.cs (everywhere): Update call to InternalParameters to pass in
5934         the second argument too.
5935
5936         * support.cs (ParameterData): Add ParameterModifier, which is a method 
5937         to return the modifier info [ref/out etc]
5938
5939         (InternalParameters, ReflectionParameters): Implement the above.
5940
5941         * expression.cs (Argument::ParameterModifier): Similar function to return
5942         info about the argument's modifiers.
5943
5944         (Invocation::OverloadResolve): Update to take into account matching modifiers 
5945         too.
5946
5947         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
5948         a new SetFormalParameters object which we pass to InternalParameters.
5949
5950 2001-10-30  Ravi Pratap  <ravi@ximian.com>
5951
5952         * expression.cs (NewArray): Merge into the ArrayCreation class.
5953
5954 2001-10-29  Ravi Pratap  <ravi@ximian.com>
5955
5956         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
5957         NewUserdefinedArray into one as there wasn't much of a use in having
5958         two separate ones.
5959
5960         * expression.cs (Argument): Change field's name to ArgType from Type.
5961
5962         (Type): New readonly property which returns the proper type, taking into 
5963         account ref/out modifiers.
5964
5965         (everywhere): Adjust code accordingly for the above.
5966
5967         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
5968         whether we are emitting for a ref or out parameter.
5969
5970         * expression.cs (Argument::Emit): Use the above field to set the state.
5971
5972         (LocalVariableReference::Emit): Update to honour the flag and emit the
5973         right stuff.
5974
5975         * parameter.cs (Attributes): Set the correct flags for ref parameters.
5976
5977         * expression.cs (Argument::FullDesc): New function to provide a full desc.
5978
5979         * support.cs (ParameterData): Add method ParameterDesc to the interface.
5980
5981         (ReflectionParameters, InternalParameters): Implement the above method.
5982
5983         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
5984         reporting errors.
5985
5986         (Invocation::FullMethodDesc): Ditto. 
5987
5988 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
5989
5990         * cs-parser.jay: Add extra production for the second form of array
5991         creation. 
5992
5993         * expression.cs (ArrayCreation): Update to reflect the above
5994         change. 
5995
5996         * Small changes to prepare for Array initialization.
5997
5998 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
5999
6000         * typemanager.cs (ImplementsInterface): interface might be null;
6001         Deal with this problem;
6002
6003         Also, we do store negative hits on the cache (null values), so use
6004         this instead of calling t.GetInterfaces on the type everytime.
6005
6006 2001-10-28  Ravi Pratap  <ravi@ximian.com>
6007
6008         * typemanager.cs (IsBuiltinType): New method to help determine the same.
6009
6010         * expression.cs (New::DoResolve): Get rid of array creation code and instead
6011         split functionality out into different classes.
6012
6013         (New::FormArrayType): Move into NewBuiltinArray.
6014
6015         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
6016         quite useless.
6017
6018         (NewBuiltinArray): New class to handle creation of built-in arrays.
6019
6020         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
6021         account creation of one-dimensional arrays.
6022
6023         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
6024
6025         (NewUserdefinedArray::DoResolve): Implement.
6026
6027         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
6028
6029         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
6030         we maintain inside the TypeManager. This is necessary to perform lookups on the
6031         module builder.
6032
6033         (LookupType): Update to perform GetType on the module builders too.     
6034
6035         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
6036
6037         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
6038
6039 2001-10-23  Ravi Pratap  <ravi@ximian.com>
6040
6041         * expression.cs (New::DoResolve): Implement guts of array creation.
6042
6043         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
6044         
6045 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
6046
6047         * expression.cs: Fix bug I introduced lsat night that broke
6048         Delegates. 
6049
6050         (Expression.Resolve): Report a 246 error (can not resolve name)
6051         if we find a SimpleName in the stream.
6052         
6053         (Expression.ResolveLValue): Ditto.
6054         
6055         (Expression.ResolveWithSimpleName): This function is a variant of
6056         ResolveName, this one allows SimpleNames to be returned without a
6057         warning.  The only consumer of SimpleNames is MemberAccess
6058
6059 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
6060
6061         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
6062         might arrive here.  I have my doubts that this is correct.
6063
6064         * statement.cs (Lock): Implement lock statement.
6065
6066         * cs-parser.jay: Small fixes to support `lock' and `using'
6067
6068         * cs-tokenizer.cs: Remove extra space
6069
6070         * driver.cs: New flag --checked, allows to turn on integer math
6071         checking. 
6072
6073         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
6074         Threading.Monitor.Exit 
6075         
6076 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
6077
6078         * expression.cs (IndexerAccess::DoResolveLValue): Set the
6079         Expression Class to be IndexerAccess.
6080
6081         Notice that Indexer::DoResolve sets the eclass to Value.
6082
6083 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
6084
6085         * class.cs (TypeContainer::Emit): Emit code for indexers.
6086
6087         * assign.cs (IAssignMethod): New interface implemented by Indexers
6088         and Properties for handling assignment.
6089
6090         (Assign::Emit): Simplify and reuse code. 
6091         
6092         * expression.cs (IndexerAccess, PropertyExpr): Implement
6093         IAssignMethod, clean up old code. 
6094
6095 2001-10-22  Ravi Pratap  <ravi@ximian.com>
6096
6097         * typemanager.cs (ImplementsInterface): New method to determine if a type
6098         implements a given interface. Provides a nice cache too.
6099
6100         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
6101         method.
6102
6103         (ConvertReferenceExplicit): Ditto.
6104
6105         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
6106         various methods, with correct names etc.
6107
6108         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
6109         Operator.UnaryNegation.
6110
6111         * cs-parser.jay (operator_declarator): Be a little clever in the case where
6112         we have a unary plus or minus operator.
6113
6114         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
6115         UnaryMinus.
6116
6117         * everywhere : update accordingly.
6118
6119         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
6120         respectively.
6121
6122         * class.cs (Method::Define): For the case where we are implementing a method
6123         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
6124         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
6125         
6126 2001-10-21  Ravi Pratap  <ravi@ximian.com>
6127
6128         * interface.cs (FindMembers): Implement to work around S.R.E
6129         lameness.
6130
6131         * typemanager.cs (IsInterfaceType): Implement.
6132
6133         (FindMembers): Update to handle interface types too.
6134
6135         * expression.cs (ImplicitReferenceConversion): Re-write bits which
6136         use IsAssignableFrom as that is not correct - it doesn't work.
6137
6138         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
6139         and accordingly override EmitStatement.
6140
6141         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
6142         using the correct logic :-)
6143
6144 2001-10-19  Ravi Pratap  <ravi@ximian.com>
6145
6146         * ../errors/cs-11.cs : Add to demonstrate error -11 
6147
6148 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
6149
6150         * assign.cs (Assign::Resolve): Resolve right hand side first, and
6151         then pass this as a hint to ResolveLValue.
6152         
6153         * expression.cs (FieldExpr): Add Location information
6154
6155         (FieldExpr::LValueResolve): Report assignment to readonly
6156         variable. 
6157         
6158         (Expression::ExprClassFromMemberInfo): Pass location information.
6159
6160         (Expression::ResolveLValue): Add new method that resolves an
6161         LValue. 
6162
6163         (Expression::DoResolveLValue): Default invocation calls
6164         DoResolve. 
6165
6166         (Indexers): New class used to keep track of indexers in a given
6167         Type. 
6168
6169         (IStackStore): Renamed from LValue, as it did not really describe
6170         what this did.  Also ResolveLValue is gone from this interface and
6171         now is part of Expression.
6172
6173         (ElementAccess): Depending on the element access type
6174         
6175         * typemanager.cs: Add `indexer_name_type' as a Core type
6176         (System.Runtime.CompilerServices.IndexerNameAttribute)
6177
6178         * statement.cs (Goto): Take a location.
6179         
6180 2001-10-18  Ravi Pratap  <ravi@ximian.com>
6181
6182         * delegate.cs (Delegate::VerifyDelegate): New method to verify
6183         if two delegates are compatible.
6184
6185         (NewDelegate::DoResolve): Update to take care of the case when
6186         we instantiate a delegate from another delegate.
6187
6188         * typemanager.cs (FindMembers): Don't even try to look up members
6189         of Delegate types for now.
6190
6191 2001-10-18  Ravi Pratap  <ravi@ximian.com>
6192
6193         * delegate.cs (NewDelegate): New class to take care of delegate
6194         instantiation.
6195
6196         * expression.cs (New): Split the delegate related code out into 
6197         the NewDelegate class.
6198
6199         * delegate.cs (DelegateInvocation): New class to handle delegate 
6200         invocation.
6201
6202         * expression.cs (Invocation): Split out delegate related code into
6203         the DelegateInvocation class.
6204
6205 2001-10-17  Ravi Pratap  <ravi@ximian.com>
6206
6207         * expression.cs (New::DoResolve): Implement delegate creation fully
6208         and according to the spec.
6209
6210         (New::DoEmit): Update to handle delegates differently.
6211
6212         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
6213         because of which we were printing out arguments in reverse order !
6214
6215         * delegate.cs (VerifyMethod): Implement to check if the given method
6216         matches the delegate.
6217
6218         (FullDelegateDesc): Implement.
6219
6220         (VerifyApplicability): Implement.
6221
6222         * expression.cs (Invocation::DoResolve): Update to accordingly handle
6223         delegate invocations too.
6224
6225         (Invocation::Emit): Ditto.
6226
6227         * ../errors/cs1593.cs : Added.
6228
6229         * ../errors/cs1594.cs : Added.
6230
6231         * delegate.cs (InstanceExpression, TargetMethod): New properties.
6232
6233 2001-10-16  Ravi Pratap  <ravi@ximian.com>
6234
6235         * typemanager.cs (intptr_type): Core type for System.IntPtr
6236
6237         (InitCoreTypes): Update for the same.
6238
6239         (iasyncresult_type, asynccallback_type): Ditto.
6240
6241         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
6242         correct.
6243
6244         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
6245         too.
6246
6247         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
6248         the builders for the 4 members of a delegate type :-)
6249
6250         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
6251         type.
6252
6253         * expression.cs (New::DoResolve): Implement guts for delegate creation.
6254
6255         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
6256
6257 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
6258
6259         * statement.cs (Break::Emit): Implement.   
6260         (Continue::Emit): Implement.
6261
6262         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
6263         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
6264         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
6265         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
6266         end loop
6267         
6268         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
6269         properties that track the label for the current loop (begin of the
6270         loop and end of the loop).
6271
6272 2001-10-15  Ravi Pratap  <ravi@ximian.com>
6273
6274         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
6275         use of emitting anything at all.
6276
6277         * class.cs, rootcontext.cs : Get rid of calls to the same.
6278
6279         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
6280
6281         (Populate): Define the constructor correctly and set the implementation
6282         attributes.
6283
6284         * typemanager.cs (delegate_types): New hashtable to hold delegates that
6285         have been defined.
6286
6287         (AddDelegateType): Implement.
6288
6289         (IsDelegateType): Implement helper method.
6290
6291         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
6292
6293         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
6294         and accordingly handle it.
6295
6296         * delegate.cs (Populate): Take TypeContainer argument.
6297         Implement bits to define the Invoke method. However, I still haven't figured out
6298         how to take care of the native int bit :-(
6299
6300         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
6301         Qualify the name of the delegate, not its return type !
6302
6303         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
6304         conversion.
6305
6306         (StandardConversionExists): Checking for array types turns out to be recursive.
6307
6308         (ConvertReferenceExplicit): Implement array conversion.
6309
6310         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
6311         
6312 2001-10-12  Ravi Pratap  <ravi@ximian.com>
6313
6314         * cs-parser.jay (delegate_declaration): Store the fully qualified
6315         name as it is a type declaration.
6316
6317         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
6318         readonly.
6319
6320         (DefineDelegate): Renamed from Define. Does the same thing essentially,
6321         as TypeContainer::DefineType.
6322
6323         (Populate): Method in which all the definition of the various methods (Invoke)
6324         etc is done.
6325
6326         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
6327         see.
6328         
6329         (CloseDelegate): Finally creates the delegate.
6330
6331         * class.cs (TypeContainer::DefineType): Update to define delegates.
6332         (Populate, Emit and CloseType): Do the same thing here too.
6333
6334         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
6335         delegates in all these operations.
6336
6337 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
6338
6339         * expression.cs: LocalTemporary: a new expression used to
6340         reference a temporary that has been created.
6341
6342         * assign.cs: Handle PropertyAccess back here, so that we can
6343         provide the proper semantic access to properties.
6344
6345         * expression.cs (Expression::ConvertReferenceExplicit): Implement
6346         a few more explicit conversions. 
6347
6348         * modifiers.cs: `NEW' modifier maps to HideBySig.
6349
6350         * expression.cs (PropertyExpr): Make this into an
6351         ExpressionStatement, and support the EmitStatement code path. 
6352
6353         Perform get/set error checking, clean up the interface.
6354
6355         * assign.cs: recognize PropertyExprs as targets, and if so, turn
6356         them into toplevel access objects.
6357
6358 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
6359
6360         * expression.cs: PropertyExpr::PropertyExpr: use work around the
6361         SRE.
6362
6363         * typemanager.cs: Keep track here of our PropertyBuilders again to
6364         work around lameness in SRE.
6365
6366 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
6367
6368         * expression.cs (LValue::LValueResolve): New method in the
6369         interface, used to perform a second resolution pass for LValues. 
6370         
6371         (This::DoResolve): Catch the use of this in static methods.
6372
6373         (This::LValueResolve): Implement.
6374
6375         (This::Store): Remove warning, assigning to `this' in structures
6376         is 
6377
6378         (Invocation::Emit): Deal with invocation of
6379         methods on value types.  We need to pass the address to structure
6380         methods rather than the object itself.  (The equivalent code to
6381         emit "this" for structures leaves the entire structure on the
6382         stack instead of a pointer to it). 
6383
6384         (ParameterReference::DoResolve): Compute the real index for the
6385         argument based on whether the method takes or not a `this' pointer
6386         (ie, the method is static).
6387
6388         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
6389         value types returned from functions when we need to invoke a
6390         method on the sturcture.
6391         
6392
6393 2001-10-11  Ravi Pratap  <ravi@ximian.com>
6394
6395         * class.cs (TypeContainer::DefineType): Method to actually do the business of
6396         defining the type in the Modulebuilder or Typebuilder. This is to take
6397         care of nested types which need to be defined on the TypeBuilder using
6398         DefineNestedMethod.
6399
6400         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
6401         methods in RootContext, only ported to be part of TypeContainer.
6402
6403         (TypeContainer::GetInterfaceOrClass): Ditto.
6404
6405         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
6406
6407         * interface.cs (Interface::DefineInterface): New method. Does exactly
6408         what RootContext.CreateInterface did earlier, only it takes care of nested types 
6409         too.
6410
6411         (Interface::GetInterfaces): Move from RootContext here and port.
6412
6413         (Interface::GetInterfaceByName): Same here.
6414
6415         * rootcontext.cs (ResolveTree): Re-write.
6416
6417         (PopulateTypes): Re-write.
6418
6419         * class.cs (TypeContainer::Populate): Populate nested types too.
6420         (TypeContainer::Emit): Emit nested members too.
6421
6422         * typemanager.cs (AddUserType): Do not make use of the FullName property,
6423         instead just use the name argument passed in as it is already fully
6424         qualified.
6425
6426         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
6427         to TypeContainer mapping to see if a type is user-defined.
6428
6429         * class.cs (TypeContainer::CloseType): Implement. 
6430
6431         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
6432         the default constructor.
6433         
6434         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
6435         twice.
6436
6437         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
6438
6439         * interface.cs (CloseType): Create the type here.
6440         
6441         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
6442         the hierarchy.
6443
6444         Remove all the methods which are now in TypeContainer.
6445
6446 2001-10-10  Ravi Pratap  <ravi@ximian.com>
6447
6448         * delegate.cs (Define): Re-write bits to define the delegate
6449         correctly.
6450
6451 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
6452
6453         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
6454
6455         * expression.cs (ImplicitReferenceConversion): handle null as well
6456         as a source to convert to any reference type.
6457
6458         * statement.cs (Return): Perform any implicit conversions to
6459         expected return type.  
6460
6461         Validate use of return statement.  
6462
6463         * codegen.cs (EmitContext): Pass the expected return type here.
6464
6465         * class.cs (Method, Constructor, Property): Pass expected return
6466         type to EmitContext.
6467
6468 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
6469
6470         * expression.cs: Make DoResolve take an EmitContext instead of a
6471         TypeContainer.
6472
6473         Replaced `l' and `location' for `loc', for consistency.
6474         
6475         (Error, Warning): Remove unneeded Tc argument.
6476
6477         * assign.cs, literal.cs, constant.cs: Update to new calling
6478         convention. 
6479         
6480         * codegen.cs: EmitContext now contains a flag indicating whether
6481         code is being generated in a static method or not.
6482
6483         * cs-parser.jay: DecomposeQI, new function that replaces the old
6484         QualifiedIdentifier.  Now we always decompose the assembled
6485         strings from qualified_identifier productions into a group of
6486         memberaccesses.
6487
6488 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
6489
6490         * rootcontext.cs: Deal with field-less struct types correctly now
6491         by passing the size option to Define Type.
6492
6493         * class.cs: Removed hack that created one static field. 
6494
6495 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
6496
6497         * statement.cs: Moved most of the code generation here. 
6498
6499 2001-10-09  Ravi Pratap  <ravi@ximian.com>
6500
6501         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
6502         seem very right.
6503
6504         (ElementAccess): Remove useless bits for now - keep checks as the spec
6505         says.
6506
6507 2001-10-08  Ravi Pratap  <ravi@ximian.com>
6508
6509         * expression.cs (ElementAccess::DoResolve): Remove my crap code
6510         and start performing checks according to the spec.
6511
6512 2001-10-07  Ravi Pratap  <ravi@ximian.com>
6513
6514         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
6515         rank_specifiers instead.
6516
6517         (rank_specifiers): Change the order in which the rank specifiers are stored
6518
6519         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
6520
6521         * expression.cs (ElementAccess): Implement the LValue interface too.
6522         
6523 2001-10-06  Ravi Pratap  <ravi@ximian.com>
6524         
6525         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
6526         except that user defined conversions are not included.
6527
6528         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
6529         perform the conversion of the return type, if necessary.
6530
6531         (New::DoResolve): Check whether we are creating an array or an object
6532         and accordingly do the needful.
6533
6534         (New::Emit): Same here.
6535
6536         (New::DoResolve): Implement guts of array creation.
6537
6538         (New::FormLookupType): Helper function.
6539
6540 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
6541
6542         * codegen.cs: Removed most of the code generation here, and move the
6543         corresponding code generation bits to the statement classes. 
6544
6545         Added support for try/catch/finalize and throw.
6546         
6547         * cs-parser.jay: Added support for try/catch/finalize.
6548
6549         * class.cs: Catch static methods having the flags override,
6550         virtual or abstract.
6551
6552         * expression.cs (UserCast): This user cast was not really doing
6553         what it was supposed to do.  Which is to be born in fully resolved
6554         state.  Parts of the resolution were being performed at Emit time! 
6555
6556         Fixed this code.
6557
6558 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
6559
6560         * expression.cs: Implicity convert the result from UserCast.
6561
6562 2001-10-05  Ravi Pratap  <ravi@ximian.com>
6563
6564         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
6565         prevented it from working correctly. 
6566
6567         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
6568         merely ConvertImplicit.
6569
6570 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
6571
6572         * typemanager.cs: Make the LookupTypeContainer function static,
6573         and not per-instance.  
6574
6575         * class.cs: Make static FindMembers (the one that takes a Type
6576         argument). 
6577
6578         * codegen.cs: Add EmitForeach here.
6579
6580         * cs-parser.jay: Make foreach a toplevel object instead of the
6581         inline expansion, as we need to perform semantic analysis on it. 
6582
6583 2001-10-05  Ravi Pratap  <ravi@ximian.com>
6584
6585         * expression.cs (Expression::ImplicitUserConversion): Rename to
6586         UserDefinedConversion.
6587
6588         (Expression::UserDefinedConversion): Take an extra argument specifying 
6589         whether we look for explicit user conversions too.
6590
6591         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
6592
6593         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
6594
6595         (ExplicitUserConversion): Make it a call to UserDefinedConversion
6596         with the appropriate arguments.
6597
6598         * cs-parser.jay (cast_expression): Record location too.
6599
6600         * expression.cs (Cast): Record location info.
6601
6602         (Expression::ConvertExplicit): Take location argument.
6603
6604         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
6605         to determine if we are doing explicit conversions.
6606
6607         (UserCast::Emit): Update accordingly.
6608
6609         (Expression::ConvertExplicit): Report an error if everything fails.
6610
6611         * ../errors/cs0030.cs : Add.
6612
6613 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
6614
6615         * modifiers.cs: If the ABSTRACT keyword is present, also set the
6616         virtual and newslot bits. 
6617
6618         * class.cs (TypeContainer::RegisterRequiredImplementations):
6619         Record methods we need.
6620
6621         (TypeContainer::MakeKey): Helper function to make keys for
6622         MethodBases, since the Methodbase key is useless.
6623
6624         (TypeContainer::Populate): Call RegisterRequiredImplementations
6625         before defining the methods.   
6626
6627         Create a mapping for method_builders_to_methods ahead of time
6628         instead of inside a tight loop.
6629
6630         (::RequireMethods):  Accept an object as the data to set into the
6631         hashtable so we can report interface vs abstract method mismatch.
6632
6633 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
6634
6635         * report.cs: Make all of it static.
6636
6637         * rootcontext.cs: Drop object_type and value_type computations, as
6638         we have those in the TypeManager anyways.
6639
6640         Drop report instance variable too, now it is a global.
6641
6642         * driver.cs: Use try/catch on command line handling.
6643
6644         Add --probe option to debug the error reporting system with a test
6645         suite. 
6646
6647         * report.cs: Add support for exiting program when a probe
6648         condition is reached.
6649
6650 2001-10-03  Ravi Pratap  <ravi@ximian.com>
6651
6652         * expression.cs (Binary::DoNumericPromotions): Fix the case when
6653         we do a forcible conversion regardless of type, to check if 
6654         ForceConversion returns a null.
6655
6656         (Binary::error19): Use location to report error.
6657
6658         (Unary::error23): Use location here too.
6659
6660         * ../errors/cs0019.cs : Check in.
6661
6662         * ../errors/cs0023.cs : Check in.
6663
6664         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
6665         case of a non-null MethodInfo object with a length of 0 !
6666
6667         (Binary::ResolveOperator): Flag error if overload resolution fails to find
6668         an applicable member - according to the spec :-)
6669         Also fix logic to find members in base types.
6670
6671         (Unary::ResolveOperator): Same here.
6672
6673         (Unary::report23): Change name to error23 and make first argument a TypeContainer
6674         as I was getting thoroughly confused between this and error19 :-)
6675         
6676         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
6677         (::FindMostEncompassedType): Implement.
6678         (::FindMostEncompassingType): Implement.
6679         (::StandardConversionExists): Implement.
6680
6681         (UserImplicitCast): Re-vamp. We now need info about most specific
6682         source and target types so that we can do the necessary conversions.
6683
6684         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
6685         mathematical union with no duplicates.
6686
6687 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
6688
6689         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
6690         in order from base classes to child classes, so that we can in
6691         child classes look up in our parent for method names and
6692         attributes (required for handling abstract, virtual, new, override
6693         constructs: we need to instrospect our base class, and if we dont
6694         populate the classes in order, the introspection might be
6695         incorrect.  For example, a method could query its parent before
6696         the parent has any methods and would determine that the parent has
6697         no abstract methods (while it could have had them)).
6698
6699         (RootContext::CreateType): Record the order in which we define the
6700         classes.
6701
6702 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
6703
6704         * class.cs (TypeContainer::Populate): Also method definitions can
6705         fail now, keep track of this.
6706
6707         (TypeContainer::FindMembers): Implement support for
6708         DeclaredOnly/noDeclaredOnly flag.
6709
6710         (Constructor::Emit) Return the ConstructorBuilder.
6711
6712         (Method::Emit) Return the MethodBuilder. 
6713         Check for abstract or virtual methods to be public.
6714
6715         * rootcontext.cs (RootContext::CreateType): Register all the
6716         abstract methods required for the class to be complete and the
6717         interface methods that must be implemented. 
6718
6719         * cs-parser.jay: Report error 501 (method requires body if it is
6720         not marked abstract or extern).
6721
6722         * expression.cs (TypeOf::Emit): Implement.
6723
6724         * typemanager.cs: runtime_handle_type, new global type.
6725
6726         * class.cs (Property::Emit): Generate code for properties.
6727
6728 2001-10-02  Ravi Pratap  <ravi@ximian.com>
6729
6730         * expression.cs (Unary::ResolveOperator): Find operators on base type
6731         too - we now conform exactly to the spec.
6732
6733         (Binary::ResolveOperator): Same here.
6734
6735         * class.cs (Operator::Define): Fix minor quirk in the tests.
6736
6737         * ../errors/cs0215.cs : Added.
6738
6739         * ../errors/cs0556.cs : Added.
6740
6741         * ../errors/cs0555.cs : Added.
6742
6743 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
6744
6745         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
6746         single integer which is really efficient
6747
6748 2001-10-01  Ravi Pratap  <ravi@ximian.com>
6749
6750         *  expression.cs (Expression::ImplicitUserConversion): Use location
6751         even in the case when we are examining True operators.
6752  
6753         * class.cs (Operator::Define): Perform extensive checks to conform
6754         with the rules for operator overloading in the spec.
6755
6756         * expression.cs (Expression::ImplicitReferenceConversion): Implement
6757         some of the other conversions mentioned in the spec.
6758
6759         * typemanager.cs (array_type): New static member for the System.Array built-in
6760         type.
6761
6762         (cloneable_interface): For System.ICloneable interface.
6763
6764         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
6765         we start resolving the tree and populating types.
6766
6767         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
6768  
6769 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
6770
6771         * expression.cs (Expression::ExprClassFromMemberInfo,
6772         Expression::Literalize): Create literal expressions from
6773         FieldInfos which are literals.
6774
6775         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
6776         type casts, because they were wrong.  The test suite in tests
6777         caught these ones.
6778
6779         (ImplicitNumericConversion): ushort to ulong requires a widening
6780         cast. 
6781
6782         Int32 constant to long requires widening cast as well.
6783
6784         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
6785         for integers because the type on the stack is not i4.
6786
6787 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
6788
6789         * expression.cs (report118): require location argument. 
6790
6791         * parameter.cs: Do not dereference potential null value.
6792
6793         * class.cs: Catch methods that lack the `new' keyword when
6794         overriding a name.  Report warnings when `new' is used without
6795         anything being there to override.
6796
6797         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
6798
6799         * class.cs: Only add constructor to hashtable if it is non-null
6800         (as now constructors can fail on define).
6801
6802         (TypeManager, Class, Struct): Take location arguments.
6803
6804         Catch field instance initialization in structs as errors.
6805
6806         accepting_filter: a new filter for FindMembers that is static so
6807         that we dont create an instance per invocation.
6808
6809         (Constructor::Define): Catch errors where a struct constructor is
6810         parameterless 
6811
6812         * cs-parser.jay: Pass location information for various new
6813         constructs. 
6814         
6815         * delegate.cs (Delegate): take a location argument.
6816
6817         * driver.cs: Do not call EmitCode if there were problesm in the
6818         Definition of the types, as many Builders wont be there. 
6819
6820         * decl.cs (Decl::Decl): Require a location argument.
6821
6822         * cs-tokenizer.cs: Handle properly hex constants that can not fit
6823         into integers, and find the most appropiate integer for it.
6824
6825         * literal.cs: Implement ULongLiteral.
6826
6827         * rootcontext.cs: Provide better information about the location of
6828         failure when CreateType fails.
6829         
6830 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
6831
6832         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
6833         as well.
6834
6835         * expression.cs (Binary::CheckShiftArguments): Add missing type
6836         computation.
6837         (Binary::ResolveOperator): Add type to the logical and and logical
6838         or, Bitwise And/Or and Exclusive Or code paths, it was missing
6839         before.
6840
6841         (Binary::DoNumericPromotions): In the case where either argument
6842         is ulong (and most signed types combined with ulong cause an
6843         error) perform implicit integer constant conversions as well.
6844
6845 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
6846
6847         * expression.cs (UserImplicitCast): Method should always be
6848         non-null. 
6849         (Invocation::BetterConversion): Simplified test for IntLiteral.
6850
6851         (Expression::ImplicitNumericConversion): Split this routine out.
6852         Put the code that performs implicit constant integer conversions
6853         here. 
6854
6855         (Expression::Resolve): Become a wrapper around DoResolve so we can
6856         check eclass and type being set after resolve.
6857
6858         (Invocation::Badness): Remove this dead function
6859
6860         (Binary::ResolveOperator): Do not compute the expensive argumnets
6861         unless we have a union for it.
6862
6863         (Probe::Emit): Is needs to do an isinst and then
6864         compare against null.
6865
6866         (::CanConvert): Added Location argument.  If the Location argument
6867         is null (Location.Null), then we do not report errors.  This is
6868         used by the `probe' mechanism of the Explicit conversion.  We do
6869         not want to generate an error for something that the user
6870         explicitly requested to be casted.  But the pipeline for an
6871         explicit cast first tests for potential implicit casts.
6872
6873         So for now, if the Location is null, it means `Probe only' to
6874         avoid adding another argument.   Might have to revise this
6875         strategy later.
6876
6877         (ClassCast): New class used to type cast objects into arbitrary
6878         classes (used in Explicit Reference Conversions).
6879
6880         Implement `as' as well.
6881
6882         Reverted all the patches from Ravi below: they were broken:
6883
6884                 * The use of `level' as a mechanism to stop recursive
6885                   invocations is wrong.  That was there just to catch the
6886                   bug with a strack trace but not as a way of addressing
6887                   the problem.
6888
6889                   To fix the problem we have to *understand* what is going
6890                   on and the interactions and come up with a plan, not
6891                   just get things going.
6892
6893                 * The use of the type conversion cache that I proposed
6894                   last night had an open topic: How does this work across
6895                   protection domains.  A user defined conversion might not
6896                   be public in the location where we are applying the
6897                   conversion, a different conversion might be selected
6898                   (ie, private A->B (better) but public B->A (worse),
6899                   inside A, A->B applies, but outside it, B->A will
6900                   apply).
6901
6902                 * On top of that (ie, even if the above is solved),
6903                   conversions in a cache need to be abstract.  Ie, `To
6904                   convert from an Int to a Short use an OpcodeCast', not
6905                   `To convert from an Int to a Short use the OpcodeCast on
6906                   the variable 5' (which is what this patch was doing).
6907         
6908 2001-09-28  Ravi Pratap  <ravi@ximian.com>
6909
6910         * expression.cs (Invocation::ConversionExists): Re-write to use
6911         the conversion cache
6912         
6913         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
6914         cache all conversions done, not just user-defined ones.
6915
6916         (Invocation::BetterConversion): The real culprit. Use ConversionExists
6917         to determine if a conversion exists instead of acutually trying to 
6918         perform the conversion. It's faster too.
6919
6920         (Expression::ConvertExplicit): Modify to use ConversionExists to check
6921         and only then attempt the implicit conversion.
6922
6923 2001-09-28  Ravi Pratap  <ravi@ximian.com>
6924
6925         * expression.cs (ConvertImplicit): Use a cache for conversions
6926         already found. Check level of recursion and bail out if necessary.
6927         
6928 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
6929
6930         * typemanager.cs (string_concat_string_string, string_concat_object_object):
6931         Export standard methods that we expect for string operations.
6932         
6933         * statement.cs (Block::UsageWarning): Track usage of variables and
6934         report the errors for not used variables.
6935
6936         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
6937         operator. 
6938
6939 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
6940
6941         * codegen.cs: remove unnneded code 
6942
6943         * expression.cs: Removed BuiltinTypeAccess class
6944
6945         Fix the order in which implicit conversions are
6946         done.  
6947
6948         The previous fixed dropped support for boxed conversions (adding a
6949         test to the test suite now)
6950
6951         (UserImplicitCast::CanConvert): Remove test for source being null,
6952         that code is broken.  We should not feed a null to begin with, if
6953         we do, then we should track the bug where the problem originates
6954         and not try to cover it up here.
6955
6956         Return a resolved expression of type UserImplicitCast on success
6957         rather than true/false.  Ravi: this is what I was talking about,
6958         the pattern is to use a static method as a "constructor" for
6959         objects. 
6960
6961         Also, do not create arguments until the very last minute,
6962         otherwise we always create the arguments even for lookups that
6963         will never be performed. 
6964
6965         (UserImplicitCast::Resolve): Eliminate, objects of type
6966         UserImplicitCast are born in a fully resolved state. 
6967         
6968         * typemanager.cs (InitCoreTypes): Init also value_type
6969         (System.ValueType). 
6970
6971         * expression.cs (Cast::Resolve): First resolve the child expression.
6972
6973         (LValue): Add new method AddressOf to be used by
6974         the `&' operator.  
6975
6976         Change the argument of Store to take an EmitContext instead of an
6977         ILGenerator, because things like FieldExpr need to be able to call
6978         their children expression to generate the instance code. 
6979
6980         (Expression::Error, Expression::Warning): Sugar functions for
6981         reporting errors.
6982
6983         (Expression::MemberLookup): Accept a TypeContainer instead of a
6984         Report as the first argument.
6985
6986         (Expression::ResolvePrimary): Killed.  I still want to improve
6987         this as currently the code is just not right.
6988
6989         (Expression::ResolveMemberAccess): Simplify, but it is still
6990         wrong. 
6991
6992         (Unary::Resolve): Catch errors in AddressOf operators.
6993
6994         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
6995         index to a byte for the short-version, or the compiler will choose
6996         the wrong Emit call, which generates the wrong data.
6997
6998         (ParameterReference::Emit, ::Store): same.
6999
7000         (FieldExpr::AddressOf): Implement.
7001         
7002         * typemanager.cs: TypeManager: made public variable instead of
7003         property.
7004         
7005         * driver.cs: document --fatal.
7006
7007         * report.cs (ErrorMessage, WarningMessage): new names for the old
7008         Error and Warning classes.
7009
7010         * cs-parser.jay (member_access): Turn built-in access to types
7011         into a normal simplename
7012
7013 2001-09-27  Ravi Pratap  <ravi@ximian.com>
7014
7015         * expression.cs (Invocation::BetterConversion): Fix to cope
7016         with q being null, since this was introducing a bug.
7017
7018         * expression.cs (ConvertImplicit): Do built-in conversions first.
7019
7020 2001-09-27  Ravi Pratap  <ravi@ximian.com>
7021
7022         * expression.cs (UserImplicitCast::Resolve): Fix bug.
7023
7024 2001-09-27  Ravi Pratap  <ravi@ximian.com>
7025
7026         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
7027         I had introduced long ago (what's new ?).
7028
7029         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
7030         the work of all the checking. 
7031         (ConvertImplicit): Call CanConvert and only then create object if necessary.
7032         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
7033
7034         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
7035         that is the right way. 
7036
7037         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
7038         overloading resolution. Use everywhere instead of cutting and pasting code.
7039
7040         (Binary::ResolveOperator): Use MakeUnionSet.
7041
7042         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
7043         we have to convert to bool types. Not complete yet.
7044         
7045 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
7046
7047         * typemanager.cs (TypeManager::CSharpName): support ushort.
7048
7049         * expression.cs (Expression::TryImplicitIntConversion): Attempts
7050         to provide an expression that performsn an implicit constant int
7051         conversion (section 6.1.6).
7052         (Expression::ConvertImplicitRequired): Reworked to include
7053         implicit constant expression conversions.
7054
7055         (Expression::ConvertNumericExplicit): Finished.
7056
7057         (Invocation::Emit): If InstanceExpression is null, then it means
7058         that we perform a call on this.
7059         
7060 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
7061
7062         * expression.cs (Unary::Emit): Remove some dead code.
7063         (Probe): Implement Resolve and Emit for `is'.
7064         (Expression::ConvertImplicitRequired): Attempt to do constant
7065         expression conversions here.  Maybe should be moved to
7066         ConvertImplicit, but I am not sure.
7067         (Expression::ImplicitLongConstantConversionPossible,
7068         Expression::ImplicitIntConstantConversionPossible): New functions
7069         that tell whether is it possible to apply an implicit constant
7070         expression conversion.
7071
7072         (ConvertNumericExplicit): Started work on explicit numeric
7073         conversions.
7074
7075         * cs-parser.jay: Update operator constants.
7076
7077         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
7078         (Parameters::GetSignature): Hook up VerifyArgs here.
7079         (Parameters::VerifyArgs): Verifies that no two arguments have the
7080         same name. 
7081
7082         * class.cs (Operator): Update the operator names to reflect the
7083         ones that the spec expects (as we are just stringizing the
7084         operator names).
7085         
7086         * expression.cs (Unary::ResolveOperator): Fix bug: Use
7087         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
7088         previous usage did only work for our methods.
7089         (Expression::ConvertImplicit): Handle decimal implicit numeric
7090         conversions as well.
7091         (Expression::InternalTypeConstructor): Used to invoke constructors
7092         on internal types for default promotions.
7093
7094         (Unary::Emit): Implement special handling for the pre/post
7095         increment/decrement for overloaded operators, as they need to have
7096         the same semantics as the other operators.
7097
7098         (Binary::ResolveOperator): ditto.
7099         (Invocation::ConversionExists): ditto.
7100         (UserImplicitCast::Resolve): ditto.
7101         
7102 2001-09-26  Ravi Pratap  <ravi@ximian.com>
7103
7104         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
7105         operator, return after emitting body. Regression tests pass again !
7106
7107         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
7108         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
7109         (Invocation::OverloadResolve): Ditto.
7110         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
7111
7112         * everywhere : update calls to the above methods accordingly.
7113
7114 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
7115
7116         * assign.cs (Assign): Make it inherit from ExpressionStatement.
7117
7118         * expression.cs (ExpressionStatement): New base class used for
7119         expressions that can appear in statements, so that we can provide
7120         an alternate path to generate expression that do not leave a value
7121         on the stack.
7122
7123         (Expression::Emit, and all the derivatives): We no longer return
7124         whether a value is left on the stack or not.  Every expression
7125         after being emitted leaves a single value on the stack.
7126
7127         * codegen.cs (EmitContext::EmitStatementExpression): Use the
7128         facilties of ExpressionStatement if possible.
7129
7130         * cs-parser.jay: Update statement_expression.
7131
7132 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
7133
7134         * driver.cs: Change the wording of message
7135
7136 2001-09-25  Ravi Pratap  <ravi@ximian.com>
7137
7138         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
7139         the type of the expression to the return type of the method if
7140         we have an overloaded operator match ! The regression tests pass again !
7141         (Unary::ResolveOperator): Ditto.
7142
7143         * expression.cs (Invocation::ConversionExists): Correct the member lookup
7144         to find "op_Implicit", not "implicit" ;-)
7145         (UserImplicitCast): New class to take care of user-defined implicit conversions.
7146         (ConvertImplicit, ForceConversion): Take TypeContainer argument
7147
7148         * everywhere : Correct calls to the above accordingly.
7149
7150         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
7151         (ConvertImplicit): Do user-defined conversion if it exists.
7152
7153 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
7154
7155         * assign.cs: track location.
7156         (Resolve): Use implicit conversions on assignment.
7157
7158         * literal.cs: Oops.  Not good, Emit of short access values should
7159         pass (Bytes) or the wrong argument will be selected.
7160
7161         * expression.cs (Unary::Emit): Emit code for -expr.
7162         
7163         (Unary::ResolveOperator): Handle `Substract' for non-constants
7164         (substract from zero from the non-constants).
7165         Deal with Doubles as well. 
7166         
7167         (Expression::ConvertImplicitRequired): New routine that reports an
7168         error if no implicit conversion exists. 
7169
7170         (Invocation::OverloadResolve): Store the converted implicit
7171         expressions if we make them
7172         
7173 2001-09-24  Ravi Pratap  <ravi@ximian.com>
7174
7175         * class.cs (ConstructorInitializer): Take a Location argument.
7176         (ConstructorBaseInitializer): Same here.
7177         (ConstructorThisInitializer): Same here.
7178
7179         * cs-parser.jay : Update all calls accordingly.
7180
7181         * expression.cs (Unary, Binary, New): Take location argument.
7182         Update accordingly everywhere.
7183
7184         * cs-parser.jay : Update all calls to the above to take a location
7185         argument.
7186
7187         * class.cs : Ditto.
7188
7189 2001-09-24  Ravi Pratap  <ravi@ximian.com>
7190
7191         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
7192         (Invocation::BetterConversion): Same here
7193         (Invocation::ConversionExists): Ditto.
7194
7195         (Invocation::ConversionExists): Implement.
7196
7197 2001-09-22  Ravi Pratap  <ravi@ximian.com>
7198
7199         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
7200         Also take an additional TypeContainer argument.
7201
7202         * All over : Pass in TypeContainer as argument to OverloadResolve.
7203
7204         * typemanager.cs (CSharpName): Update to check for the string type and return
7205         that too.
7206
7207         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
7208         a given method.
7209         
7210 2001-09-21  Ravi Pratap  <ravi@ximian.com>
7211
7212         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
7213         (Invocation::BetterFunction): Implement.
7214         (Invocation::BetterConversion): Implement.
7215         (Invocation::ConversionExists): Skeleton, no implementation yet.
7216
7217         Okay, things work fine !
7218
7219 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
7220
7221         * typemanager.cs: declare and load enum_type, delegate_type and
7222         void_type. 
7223
7224         * expression.cs (Expression::Emit): Now emit returns a value that
7225         tells whether a value is left on the stack or not.  This strategy
7226         might be reveted tomorrow with a mechanism that would address
7227         multiple assignments.
7228         (Expression::report118): Utility routine to report mismatches on
7229         the ExprClass.
7230
7231         (Unary::Report23): Report impossible type/operator combination
7232         utility function.
7233
7234         (Unary::IsIncrementableNumber): Whether the type can be
7235         incremented or decremented with add.
7236         (Unary::ResolveOperator): Also allow enumerations to be bitwise
7237         complemented. 
7238         (Unary::ResolveOperator): Implement ++, !, ~,
7239
7240         (Invocation::Emit): Deal with new Emit convetion.
7241         
7242         * All Expression derivatives: Updated their Emit method to return
7243         whether they leave values on the stack or not.
7244         
7245         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
7246         stack for expressions that are statements. 
7247
7248 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
7249
7250         * expression.cs (LValue): New interface.  Must be implemented by
7251         LValue objects.
7252         (LocalVariableReference, ParameterReference, FieldExpr): Implement
7253         LValue interface.
7254         
7255         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
7256         interface for generating code, simplifies the code.
7257
7258 2001-09-20  Ravi Pratap  <ravi@ximian.com>
7259
7260         * expression.cs (everywhere): Comment out return statements in ::Resolve
7261         methods to avoid the warnings.
7262
7263 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
7264
7265         * driver.cs (parse): Report error 2001 if we can not open the
7266         source file.
7267
7268         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
7269         not resolve it.
7270
7271         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
7272         object. 
7273
7274         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
7275         otherwise nested blocks end up with the same index.
7276
7277         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
7278
7279         * expression.cs:  Instead of having FIXMEs in the Resolve
7280         functions, throw exceptions so it is obvious that we are facing a
7281         bug. 
7282
7283         * cs-parser.jay (invocation_expression): Pass Location information.
7284
7285         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
7286         Use a basename for those routines because .NET does not like paths
7287         on them. 
7288
7289         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
7290         already defined.
7291
7292 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
7293
7294         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
7295         are loading the correct data types (throws an exception if not).
7296         (TypeManager::InitCoreTypes): Use CoreLookupType
7297
7298         * expression.cs (Unary::ResolveOperator): return the child
7299         expression for expressions which are just +expr.
7300         (Unary::ResolveOperator): Return negative literals for -LITERAL
7301         expressions (otherwise they are Unary {Literal}).
7302         (Invocation::Badness): Take into account `Implicit constant
7303         expression conversions'.
7304
7305         * literal.cs (LongLiteral): Implement long literal class.
7306         (IntLiteral): export the `Value' of the intliteral. 
7307
7308 2001-09-19  Ravi Pratap  <ravi@ximian.com>
7309
7310         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
7311
7312         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
7313         instead of 'Operator'
7314
7315         * expression.cs (Binary::ResolveOperator): Update accordingly.
7316         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
7317         and 'Minus'
7318
7319         * cs-parser.jay (unary_expression): Update to use the new names.
7320
7321         * gen-treedump.cs (GetUnary): Same here.
7322
7323         * expression.cs (Unary::Resolve): Implement.
7324         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
7325         operators are found instead of making noise ;-)
7326         (Unary::ResolveOperator): New method to do precisely the same thing which
7327         Binary::ResolveOperator does for Binary expressions.
7328         (Unary.method, .Arguments): Add.
7329         (Unary::OperName): Implement.   
7330         (Unary::ForceConversion): Copy and Paste !
7331
7332         * class.cs (Operator::Define): Fix a small bug for the case when we have 
7333         a unary operator.
7334
7335         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
7336         for the inbuilt operators. Only overloading works for now ;-)
7337
7338 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
7339
7340         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
7341         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
7342
7343         * expression.cs (This::Emit): Implement. 
7344         (This::Resolve): Implement.
7345         (TypeOf:Resolve): Implement.
7346         (Expression::ResolveSimpleName): Add an implicit this to instance
7347         field references. 
7348         (MemberAccess::Resolve): Deal with Parameters and Fields. 
7349         Bind instance variable to Field expressions.
7350         (FieldExpr::Instance): New field used to track the expression that
7351         represents the object instance.
7352         (FieldExpr::Resolve): Track potential errors from MemberLookup not
7353         binding 
7354         (FieldExpr::Emit): Implement.
7355
7356         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
7357         the last instruction contains a return opcode to avoid generating
7358         the last `ret' instruction (this generates correct code, and it is
7359         nice to pass the peverify output).
7360
7361         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
7362         initializer for static and instance variables.
7363         (Constructor::Emit): Allow initializer to be null in the case of
7364         static constructors.  Only emit initializer for instance
7365         constructors. 
7366
7367         (TypeContainer::FindMembers): Return a null array if there are no
7368         matches.
7369
7370         Also fix the code for the MemberTypes.Method branch, as it was not
7371         scanning that for operators (or tried to access null variables before).
7372
7373         * assign.cs (Assign::Emit): Handle instance and static fields. 
7374
7375         * TODO: Updated.
7376
7377         * driver.cs: Stop compilation if there are parse errors.
7378
7379         * cs-parser.jay (constructor_declaration): Provide default base
7380         initializer for non-static constructors.
7381         (constructor_declarator): Do not provide a default base
7382         initializers if none was specified.
7383         Catch the fact that constructors should not have parameters.
7384
7385         * class.cs: Do not emit parent class initializers for static
7386         constructors, that should be flagged as an error.
7387
7388 2001-09-18  Ravi Pratap  <ravi@ximian.com>
7389
7390         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
7391         Move back code into TypeContainer::Populate.
7392
7393 2001-09-18  Ravi Pratap  <ravi@ximian.com>
7394
7395         * class.cs (TypeContainer::AddConstructor): Fix the check to
7396         compare against Name, not Basename. 
7397         (Operator::OpType): Change Plus and Minus to Add and Subtract.
7398
7399         * cs-parser.jay : Update accordingly.
7400
7401         * class.cs (TypeContainer::FindMembers): For the case where we are searching
7402         for methods, don't forget to look into the operators too.
7403         (RegisterMethodBuilder): Helper method to take care of this for
7404         methods, constructors and operators.
7405         (Operator::Define): Completely revamp.
7406         (Operator.OperatorMethod, MethodName): New fields.
7407         (TypeContainer::Populate): Move the registering of builders into
7408         RegisterMethodBuilder.
7409         (Operator::Emit): Re-write.
7410
7411         * expression.cs (Binary::Emit): Comment out code path to emit method
7412         invocation stuff for the case when we have a user defined operator. I am
7413         just not able to get it right !
7414         
7415 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
7416
7417         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
7418         argument. 
7419
7420         (Expression::MemberLookup): Provide a version that allows to
7421         specify the MemberTypes and BindingFlags. 
7422
7423         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
7424         so it was not fetching variable information from outer blocks.
7425
7426         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
7427         Beforefieldinit as it was buggy.
7428
7429         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
7430         that Ravi put here.  
7431
7432         * class.cs (Constructor::Emit): Only emit if block is not null.
7433         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
7434         deal with this by semantically definining it as if the user had
7435         done it.
7436
7437         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
7438         constructors as we now "emit" them at a higher level.
7439
7440         (TypeContainer::DefineDefaultConstructor): Used to define the
7441         default constructors if none was provided.
7442
7443         (ConstructorInitializer): Add methods Resolve and Emit. 
7444         
7445         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
7446
7447 2001-09-17  Ravi Pratap  <ravi@ximian.com>
7448
7449         * class.cs (TypeContainer::EmitDefaultConstructor): Register
7450         the default constructor builder with our hashtable for methodbuilders
7451         to methodcores.
7452
7453         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
7454         and argument_count is 0 in which case we have a match.
7455         (Binary::ResolveOperator): More null checking and miscellaneous coding
7456         style cleanup.
7457
7458 2001-09-17  Ravi Pratap  <ravi@ximian.com>
7459
7460         * rootcontext.cs (IsNameSpace): Compare against null.
7461
7462         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
7463
7464         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
7465         and Unary::Operator.
7466
7467         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
7468         accordingly.
7469
7470         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
7471         we have overloaded operators.
7472         (Binary::ResolveOperator): Implement the part which does the operator overload
7473         resolution.
7474
7475         * class.cs (Operator::Emit): Implement.
7476         (TypeContainer::Emit): Emit the operators we have too.
7477
7478         * expression.cs (Binary::Emit): Update to emit the appropriate code for
7479         the case when we have a user-defined operator.
7480         
7481 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
7482
7483         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
7484
7485 2001-09-16  Ravi Pratap  <ravi@ximian.com>
7486
7487         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
7488         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
7489         (Constructor::Emit): Implement.
7490         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
7491         if we have no work to do. 
7492         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
7493         Emit method.
7494
7495         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
7496         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
7497
7498         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
7499         of parent.parent.
7500
7501 2001-09-15  Ravi Pratap  <ravi@ximian.com>
7502
7503         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
7504         in the source.
7505         (Tree::RecordNamespace): Method to do what the name says ;-)
7506         (Tree::Namespaces): Property to get at the namespaces hashtable.
7507
7508         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
7509         keep track.
7510
7511         * rootcontext.cs (IsNamespace): Fixed it :-)
7512
7513 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
7514
7515         * class.cs (TypeContainer::FindMembers): Add support for
7516         constructors. 
7517         (MethodCore): New class that encapsulates both the shared aspects
7518         of a Constructor and a Method.  
7519         (Method, Constructor): Factored pieces into MethodCore.
7520
7521         * driver.cs: Added --fatal which makes errors throw exceptions.
7522         Load System assembly as well as part of the standard library.
7523
7524         * report.cs: Allow throwing exceptions on errors for debugging.
7525
7526         * modifiers.cs: Do not use `parent', instead use the real type
7527         container to evaluate permission settings.
7528
7529         * class.cs: Put Ravi's patch back in.  He is right, and we will
7530         have to cope with the
7531
7532 2001-09-14  Ravi Pratap  <ravi@ximian.com>
7533
7534         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
7535         FamORAssem, not FamANDAssem.
7536         
7537 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
7538
7539         * driver.cs: Added --parse option that only parses its input files
7540         and terminates.
7541
7542         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
7543         incorrect.  IsTopLevel is not used to tell whether an object is
7544         root_types or not (that can be achieved by testing this ==
7545         root_types).  But to see if this is a top-level *class* (not
7546         necessarly our "toplevel" container). 
7547
7548 2001-09-14  Ravi Pratap  <ravi@ximian.com>
7549
7550         * enum.cs (Enum::Define): Modify to call the Lookup method on the
7551         parent instead of a direct call to GetType.
7552
7553 2001-09-14  Ravi Pratap  <ravi@ximian.com>
7554
7555         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
7556         Modifiers.TypeAttr. This should just be a call to that method.
7557
7558         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
7559         object so that we can determine if we are top-level or not.
7560
7561         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
7562         TypeContainer too.
7563
7564         * enum.cs (Enum::Define): Ditto.
7565
7566         * modifiers.cs (FieldAttr): Re-write.
7567
7568         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
7569         (TypeContainer::HaveStaticConstructor): New property to provide access
7570         to precisely that info.
7571
7572         * modifiers.cs (MethodAttr): Re-write.
7573         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
7574
7575         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
7576         of top-level types as claimed.
7577         
7578 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
7579
7580         * expression.cs (MemberLookup): Fruitless attempt to lookup
7581         constructors.  Maybe I need to emit default constructors?  That
7582         might be it (currently .NET emits this for me automatically).
7583         (Invocation::OverloadResolve): Cope with Arguments == null.
7584         (Invocation::EmitArguments): new function, shared by the new
7585         constructor and us.
7586         (Invocation::Emit): Handle static and instance methods.  Emit
7587         proper call instruction for virtual or non-virtual invocations.
7588         (New::Emit): Implement.
7589         (New::Resolve): Implement.
7590         (MemberAccess:Resolve): Implement.
7591         (MethodGroupExpr::InstanceExpression): used conforming to the spec
7592         to track instances.
7593         (FieldExpr::Resolve): Set type.
7594
7595         * support.cs: Handle empty arguments.
7596                 
7597         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
7598         SimpleLookup): Auxiliary routines to help parse a qualifier
7599         identifier.  
7600
7601         Update qualifier_identifier rule.
7602
7603         * codegen.cs: Removed debugging messages.
7604
7605         * class.cs: Make this a global thing, this acts just as a "key" to
7606         objects that we might have around.
7607
7608         (Populate): Only initialize method_builders_to_methods once.
7609
7610         * expression.cs (PropertyExpr): Initialize type from the
7611         PropertyType. 
7612
7613         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
7614         Resolve pattern.  Attempt to implicitly convert value to boolean.
7615         Emit code.
7616
7617         * expression.cs: Set the type for the int32/int32 argument case.
7618         (Binary::ResolveOperator): Set the return type to boolean for
7619         comparission operators
7620
7621         * typemanager.cs: Remove debugging print code.
7622
7623         (Invocation::Resolve): resolve type.
7624
7625         * class.cs: Allocate a MemberInfo of the correct size, as the code
7626         elsewhere depends on the test to reflect the correct contents.
7627
7628         (Method::) Keep track of parameters, due to System.Reflection holes
7629
7630         (TypeContainer::Populate): Keep track of MethodBuilders to Method
7631         mapping here.
7632
7633         (TypeContainer::FindMembers): Use ArrayList and then copy an array
7634         of the exact size and return that.
7635
7636         (Class::LookupMethodByBuilder): New function that maps
7637         MethodBuilders to its methods.  Required to locate the information
7638         on methods because System.Reflection bit us again.
7639
7640         * support.cs: New file, contains an interface ParameterData and
7641         two implementations: ReflectionParameters and InternalParameters
7642         used to access Parameter information.  We will need to grow this
7643         as required.
7644
7645         * expression.cs (Invocation::GetParameterData): implement a cache
7646         and a wrapper around the ParameterData creation for methods. 
7647         (Invocation::OverloadResolve): Use new code.
7648
7649 2001-09-13  Ravi Pratap  <ravi@ximian.com>
7650
7651         * class.cs (TypeContainer::EmitField): Remove and move into 
7652         (Field::Define): here and modify accordingly.
7653         (Field.FieldBuilder): New member.
7654         (TypeContainer::Populate): Update accordingly.
7655         (TypeContainer::FindMembers): Implement.
7656
7657 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
7658
7659         * statement.cs: (VariableInfo::VariableType): New field to be
7660         initialized with the full type once it is resolved. 
7661
7662 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
7663
7664         * parameter.cs (GetParameterInfo): Use a type cache to compute
7665         things only once, and to reuse this information
7666
7667         * expression.cs (LocalVariableReference::Emit): Implement.
7668         (OpcodeCast::Emit): fix.
7669
7670         (ParameterReference::Resolve): Implement.
7671         (ParameterReference::Emit): Implement.
7672
7673         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
7674         that are expressions need to stay as Expressions.
7675
7676         * typemanager.cs (CSharpName): Returns the C# name of a type if
7677         possible. 
7678
7679         * expression.cs (Expression::ConvertImplicit): New function that
7680         implements implicit type conversions.
7681
7682         (Expression::ImplicitReferenceConversion): Implements implicit
7683         reference conversions.
7684
7685         (EmptyCast): New type for transparent casts.
7686
7687         (OpcodeCast): New type for casts of types that are performed with
7688         a sequence of bytecodes.
7689         
7690         (BoxedCast): New type used for casting value types into reference
7691         types.  Emits a box opcode.
7692
7693         (Binary::DoNumericPromotions): Implements numeric promotions of
7694         and computation of the Binary::Type.
7695
7696         (Binary::EmitBranchable): Optimization.
7697
7698         (Binary::Emit): Implement code emission for expressions.
7699         
7700         * typemanager.cs (TypeManager): Added two new core types: sbyte
7701         and byte.
7702
7703 2001-09-12  Ravi Pratap  <ravi@ximian.com>
7704
7705         * class.cs (TypeContainer::FindMembers): Method which does exactly
7706         what Type.FindMembers does, only we don't have to use reflection. No
7707         implementation yet.
7708
7709         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
7710         typecontainer objects as we need to get at them.
7711         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
7712
7713         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
7714         typecontainer object.
7715
7716         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
7717         of just a Report object.
7718
7719 2001-09-11  Ravi Pratap  <ravi@ximian.com>
7720
7721         * class.cs (Event::Define): Go back to using the prefixes "add_" and
7722         "remove_"
7723         (TypeContainer::Populate): Now define the delegates of the type too.
7724         (TypeContainer.Delegates): Property to access the list of delegates defined
7725         in the type.
7726
7727         * delegates.cs (Delegate::Define): Implement partially.
7728
7729         * modifiers.cs (TypeAttr): Handle more flags.
7730
7731 2001-09-11  Ravi Pratap  <ravi@ximian.com>
7732
7733         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
7734         and not <=
7735         (Operator::Define): Re-write logic to get types by using the LookupType method
7736         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
7737         (Indexer::Define): Ditto.
7738         (Event::Define): Ditto.
7739         (Property::Define): Ditto.
7740         
7741 2001-09-10  Ravi Pratap  <ravi@ximian.com>
7742
7743         * class.cs (TypeContainer::Populate): Now define operators too. 
7744         (TypeContainer.Operators): New property to access the list of operators
7745         in a type.
7746         (Operator.OperatorMethodBuilder): New member to hold the method builder
7747         for the operator we are defining.
7748         (Operator::Define): Implement.
7749
7750 2001-09-10  Ravi Pratap  <ravi@ximian.com>
7751
7752         * class.cs (Event::Define): Make the prefixes of the accessor methods
7753         addOn_ and removeOn_ 
7754
7755         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
7756         of the location being passed in too. Ideally, this should go later since all
7757         error reporting should be done through the Report object.
7758
7759         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
7760         (Populate): Iterate thru the indexers we have and define them too.
7761         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
7762         for the get and set accessors.
7763         (Indexer::Define): Implement.
7764         
7765 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
7766
7767         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
7768         my previous implementation, did not work.
7769
7770         * typemanager.cs: Add a couple of missing types (the longs).
7771
7772         * literal.cs: Use TypeManager.bool_type instead of getting it.
7773
7774         * expression.cs (EventExpr): New kind of expressions.
7775         (Expressio::ExprClassFromMemberInfo): finish
7776
7777 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
7778
7779         * assign.cs: Emit stores to static fields differently.
7780
7781 2001-09-08  Ravi Pratap  <ravi@ximian.com>
7782
7783         * Merge in changes and adjust code to tackle conflicts. Backed out my
7784         code in Assign::Resolve ;-) 
7785
7786 2001-09-08  Ravi Pratap  <ravi@ximian.com>
7787
7788         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
7789         instead Report.Error and also pass in the location.
7790         (CSharpParser::Lexer): New readonly property to return the reference
7791         to the Tokenizer object.
7792         (declare_local_variables): Use Report.Error with location instead of plain 
7793         old error.
7794         (CheckDef): Ditto.
7795
7796         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
7797         (Operator.CheckBinaryOperator): Ditto.
7798
7799         * cs-parser.jay (operator_declarator): Update accordingly.
7800
7801         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
7802         (CheckBinaryOperator): Same here.
7803
7804         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
7805         on the name without any prefixes of namespace names etc. This is because we
7806         already might have something already fully qualified like 
7807         'System.Console.WriteLine'
7808
7809         * assign.cs (Resolve): Begin implementation. Stuck ;-)
7810
7811 2001-09-07  Ravi Pratap  <ravi@ximian.com>
7812
7813         * cs-tokenizer.cs (location): Return a string which also contains
7814         the file name.
7815
7816         * expression.cs (ElementAccess): New class for expressions of the
7817         type 'element access.'
7818         (BaseAccess): New class for expressions of the type 'base access.'
7819         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
7820         respectively.
7821         
7822         * cs-parser.jay (element_access): Implement action.
7823         (base_access): Implement actions.
7824         (checked_expression, unchecked_expression): Implement.
7825
7826         * cs-parser.jay (local_variable_type): Correct and implement.
7827         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
7828
7829         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
7830
7831         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
7832         name and the specifiers.
7833
7834         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
7835         
7836         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
7837         making them all public ;-)
7838
7839         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
7840         class anyways.
7841         
7842 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
7843
7844         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
7845         PropertyExprs.
7846         (FieldExpr, PropertyExprs): New resolved expressions.
7847         (SimpleName::MemberStaticCheck): Perform static checks for access
7848         to non-static fields on static methods. Maybe this should be
7849         generalized for MemberAccesses. 
7850         (SimpleName::ResolveSimpleName): More work on simple name
7851         resolution. 
7852
7853         * cs-parser.jay (primary_expression/qualified_identifier): track
7854         the parameter index.
7855
7856         * codegen.cs (CodeGen::Save): Catch save exception, report error.
7857         (EmitContext::EmitBoolExpression): Chain to expression generation
7858         instead of temporary hack.
7859         (::EmitStatementExpression): Put generic expression code generation.
7860
7861         * assign.cs (Assign::Emit): Implement variable assignments to
7862         local variables, parameters and fields.
7863
7864 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
7865
7866         * statement.cs (Block::GetVariableInfo): New method, returns the
7867         VariableInfo for a variable name in a block.
7868         (Block::GetVariableType): Implement in terms of GetVariableInfo
7869
7870         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
7871         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
7872
7873 2001-09-06  Ravi Pratap  <ravi@ximian.com>
7874
7875         * cs-parser.jay (operator_declaration): Continue on my quest : update
7876         to take attributes argument.
7877         (event_declaration): Ditto.
7878         (enum_declaration): Ditto.
7879         (indexer_declaration): Ditto.
7880         
7881         * class.cs (Operator::Operator): Update constructor accordingly.
7882         (Event::Event): Ditto.
7883
7884         * delegate.cs (Delegate::Delegate): Same here.
7885
7886         * enum.cs (Enum::Enum): Same here.
7887         
7888 2001-09-05  Ravi Pratap  <ravi@ximian.com>
7889
7890         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
7891
7892         * ../tests/cs0658.cs : New file to demonstrate error 0658.
7893
7894         * attribute.cs (Attributes): New class to encapsulate all attributes which were
7895         being passed around as an arraylist.
7896         (Attributes::AddAttribute): Method to add attribute sections.
7897
7898         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
7899         (struct_declaration): Update accordingly.
7900         (constant_declaration): Update.
7901         (field_declaration): Update.
7902         (method_header): Update.
7903         (fixed_parameter): Update.
7904         (parameter_array): Ditto.
7905         (property_declaration): Ditto.
7906         (destructor_declaration): Ditto.
7907         
7908         * class.cs (Struct::Struct): Update constructors accordingly.
7909         (Class::Class): Ditto.
7910         (Field::Field): Ditto.
7911         (Method::Method): Ditto.
7912         (Property::Property): Ditto.
7913         (TypeContainer::OptAttribute): update property's return type.
7914         
7915         * interface.cs (Interface.opt_attributes): New member.
7916         (Interface::Interface): Update to take the extra Attributes argument.
7917
7918         * parameter.cs (Parameter::Parameter): Ditto.
7919
7920         * constant.cs (Constant::Constant): Ditto.
7921
7922         * interface.cs (InterfaceMemberBase): New OptAttributes field.
7923         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
7924         the attributes as a parameter.
7925         (InterfaceProperty): Update constructor call.
7926         (InterfaceEvent): Ditto.
7927         (InterfaceMethod): Ditto.
7928         (InterfaceIndexer): Ditto.
7929
7930         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
7931         pass the attributes too.
7932         (interface_event_declaration): Ditto.
7933         (interface_property_declaration): Ditto.
7934         (interface_method_declaration): Ditto.
7935         (interface_declaration): Ditto.
7936
7937 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
7938
7939         * class.cs (Method::Define): Track the "static Main" definition to
7940         create an entry point. 
7941
7942         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
7943         EntryPoint if we find it. 
7944
7945         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
7946         (EmitContext::ig): Make this variable public.
7947
7948         * driver.cs: Make the default output file be the first file name
7949         with the .exe extension.  
7950
7951         Detect empty compilations
7952
7953         Handle various kinds of output targets.  Handle --target and
7954         rename -t to --dumper.
7955
7956         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
7957         methods inherited from Expression return now an Expression.  This
7958         will is used during the tree rewriting as we resolve them during
7959         semantic analysis.
7960
7961         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
7962         the spec.  Missing entirely is the information about
7963         accessability of elements of it.
7964
7965         (Expression::ExprClassFromMemberInfo): New constructor for
7966         Expressions that creates a fully initialized Expression based on
7967         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
7968         a Type.
7969
7970         (Invocation::Resolve): Begin implementing resolution of invocations.
7971         
7972         * literal.cs (StringLiteral):  Implement Emit.
7973
7974 2001-09-05  Ravi Pratap  <ravi@ximian.com>
7975
7976         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
7977         member.
7978         
7979 2001-09-04  Ravi Pratap  <ravi@ximian.com>
7980
7981         * cs-parser.jay (attribute_arguments): Implement actions.
7982         (attribute): Fix bug in production. Implement action.
7983         (attribute_list): Implement.
7984         (attribute_target): Implement.
7985         (attribute_target_specifier, opt_target_specifier): Implement
7986         (CheckAttributeTarget): New method to check if the attribute target
7987         is valid.
7988         (attribute_section): Implement.
7989         (opt_attributes): Implement.
7990
7991         * attribute.cs : New file to handle attributes.
7992         (Attribute): Class to hold attribute info.
7993
7994         * cs-parser.jay (opt_attribute_target_specifier): Remove production
7995         (attribute_section): Modify production to use 2 different rules to 
7996         achieve the same thing. 1 s/r conflict down !
7997         Clean out commented, useless, non-reducing dimension_separator rules.
7998         
7999         * class.cs (TypeContainer.attributes): New member to hold list
8000         of attributes for a type.
8001         (Struct::Struct): Modify to take one more argument, the attribute list.
8002         (Class::Class): Ditto.
8003         (Field::Field): Ditto.
8004         (Method::Method): Ditto.
8005         (Property::Property): Ditto.
8006         
8007         * cs-parser.jay (struct_declaration): Update constructor call to
8008         pass in the attributes too.
8009         (class_declaration): Ditto.
8010         (constant_declaration): Ditto.
8011         (field_declaration): Ditto.
8012         (method_header): Ditto.
8013         (fixed_parameter): Ditto.
8014         (parameter_array): Ditto.
8015         (property_declaration): Ditto.
8016
8017         * constant.cs (Constant::Constant): Update constructor similarly.
8018         Use System.Collections.
8019
8020         * parameter.cs (Parameter::Parameter): Update as above.
8021
8022 2001-09-02  Ravi Pratap  <ravi@ximian.com>
8023
8024         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
8025         (TypeContainer.delegates): New member to hold list of delegates.
8026
8027         * cs-parser.jay (delegate_declaration): Implement the action correctly 
8028         this time as I seem to be on crack ;-)
8029
8030 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
8031
8032         * rootcontext.cs (RootContext::IsNamespace): new function, used to
8033         tell whether an identifier represents a namespace.
8034
8035         * expression.cs (NamespaceExpr): A namespace expression, used only
8036         temporarly during expression resolution.
8037         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
8038         utility functions to resolve names on expressions.
8039
8040 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
8041
8042         * codegen.cs: Add hook for StatementExpressions. 
8043
8044         * class.cs: Fix inverted test for static flag in methods.
8045
8046 2001-09-02  Ravi Pratap  <ravi@ximian.com>
8047
8048         * class.cs (Operator::CheckUnaryOperator): Correct error number used
8049         to make it coincide with MS' number.
8050         (Operator::CheckBinaryOperator): Ditto.
8051
8052         * ../errors/errors.txt : Remove error numbers added earlier.
8053
8054         * ../errors/cs1019.cs : Test case for error # 1019
8055
8056         * ../errros/cs1020.cs : Test case for error # 1020
8057
8058         * cs-parser.jay : Clean out commented cruft.
8059         (dimension_separators, dimension_separator): Comment out. Ostensibly not
8060         used anywhere - non-reducing rule.
8061         (namespace_declarations): Non-reducing rule - comment out.
8062
8063         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
8064         with TypeContainer::AddEnum.
8065
8066         * delegate.cs : New file for delegate handling classes.
8067         (Delegate): Class for declaring delegates.
8068
8069         * makefile : Update.
8070
8071         * cs-parser.jay (delegate_declaration): Implement.
8072
8073 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
8074
8075         * class.cs (Event::Define): Implement.
8076         (Event.EventBuilder): New member.
8077
8078         * class.cs (TypeContainer::Populate): Update to define all enums and events
8079         we have.
8080         (Events): New property for the events arraylist we hold. Shouldn't we move to using
8081         readonly fields for all these cases ?
8082
8083 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
8084
8085         * class.cs (Property): Revamp to use the convention of making fields readonly.
8086         Accordingly modify code elsewhere.
8087
8088         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
8089         the Define method of the Property class.
8090
8091         * class.cs : Clean up applied patch and update references to variables etc. Fix 
8092         trivial bug.
8093         (TypeContainer::Populate): Update to define all the properties we have. Also
8094         define all enumerations.
8095
8096         * enum.cs (Define): Implement.
8097         
8098 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
8099
8100         * cs-parser.jay (overloadable_operator): The semantic value is an
8101         enum of the Operator class.
8102         (operator_declarator): Implement actions.
8103         (operator_declaration): Implement.
8104
8105         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
8106         validity of definitions.
8107         (Operator::CheckBinaryOperator): Static method to check for binary operators
8108         (TypeContainer::AddOperator): New method to add an operator to a type.
8109
8110         * cs-parser.jay (indexer_declaration): Added line to actually call the
8111         AddIndexer method so it gets added ;-)
8112
8113         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
8114         already taken care of by the MS compiler ?  
8115
8116 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
8117
8118         * class.cs (Operator): New class for operator declarations.
8119         (Operator::OpType): Enum for the various operators.
8120
8121 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
8122
8123         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
8124         ostensibly handle this in semantic analysis.
8125
8126         * cs-parser.jay (general_catch_clause): Comment out
8127         (specific_catch_clauses, specific_catch_clause): Ditto.
8128         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
8129         (catch_args, opt_catch_args): New productions.
8130         (catch_clause): Rewrite to use the new productions above
8131         (catch_clauses): Modify accordingly.
8132         (opt_catch_clauses): New production to use in try_statement
8133         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
8134         and re-write the code in the actions to extract the specific and
8135         general catch clauses by being a little smart ;-)
8136
8137         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
8138         Hooray, try and catch statements parse fine !
8139         
8140 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
8141
8142         * statement.cs (Block::GetVariableType): Fix logic to extract the type
8143         string from the hashtable of variables.
8144
8145         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
8146         I end up making that mistake ;-)
8147         (catch_clauses): Fixed gross error which made Key and Value of the 
8148         DictionaryEntry the same : $1 !!
8149
8150 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
8151
8152         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
8153
8154         * cs-parser.jay (event_declaration): Correct to remove the semicolon
8155         when the add and remove accessors are specified. 
8156
8157 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
8158
8159         * cs-parser.jay (IndexerDeclaration): New helper class to hold
8160         information about indexer_declarator.
8161         (indexer_declarator): Implement actions.
8162         (parsing_indexer): New local boolean used to keep track of whether
8163         we are parsing indexers or properties. This is necessary because 
8164         implicit_parameters come into picture even for the get accessor in the 
8165         case of an indexer.
8166         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
8167
8168         * class.cs (Indexer): New class for indexer declarations.
8169         (TypeContainer::AddIndexer): New method to add an indexer to a type.
8170         (TypeContainer::indexers): New member to hold list of indexers for the
8171         type.
8172
8173 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
8174
8175         * cs-parser.jay (add_accessor_declaration): Implement action.
8176         (remove_accessor_declaration): Implement action.
8177         (event_accessors_declaration): Implement
8178         (variable_declarators): swap statements for first rule - trivial.
8179
8180         * class.cs (Event): New class to hold information about event
8181         declarations.
8182         (TypeContainer::AddEvent): New method to add an event to a type
8183         (TypeContainer::events): New member to hold list of events.
8184
8185         * cs-parser.jay (event_declaration): Implement actions.
8186
8187 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
8188
8189         * cs-parser.jay (dim_separators): Implement. Make it a string
8190         concatenating all the commas together, just as they appear.
8191         (opt_dim_separators): Modify accordingly
8192         (rank_specifiers): Update accordingly. Basically do the same
8193         thing - instead, collect the brackets here.
8194         (opt_rank_sepcifiers): Modify accordingly.
8195         (array_type): Modify to actually return the complete type string
8196         instead of ignoring the rank_specifiers.
8197         (expression_list): Implement to collect the expressions
8198         (variable_initializer): Implement. We make it a list of expressions
8199         essentially so that we can handle the array_initializer case neatly too.
8200         (variable_initializer_list): Implement.
8201         (array_initializer): Make it a list of variable_initializers
8202         (opt_array_initializer): Modify accordingly.
8203
8204         * expression.cs (New::NType): Add enumeration to help us
8205         keep track of whether we have an object/delegate creation
8206         or an array creation.
8207         (New:NewType, New::Rank, New::Indices, New::Initializers): New
8208         members to hold data about array creation.
8209         (New:New): Modify to update NewType
8210         (New:New): New Overloaded contructor for the array creation
8211         case.
8212
8213         * cs-parser.jay (array_creation_expression): Implement to call
8214         the overloaded New constructor.
8215         
8216 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
8217
8218         * class.cs (TypeContainer::Constructors): Return member
8219         constructors instead of returning null.
8220
8221 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
8222
8223         * typemanager.cs (InitCoreTypes): Initialize the various core
8224         types after we have populated the type manager with the user
8225         defined types (this distinction will be important later while
8226         compiling corlib.dll)
8227
8228         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
8229         on Expression Classification.  Now all expressions have a method
8230         `Resolve' and a method `Emit'.
8231
8232         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
8233         generation from working.     Also add some temporary debugging
8234         code. 
8235         
8236 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
8237
8238         * codegen.cs: Lots of code generation pieces.  This is only the
8239         beginning, will continue tomorrow with more touches of polish.  We
8240         handle the fundamentals of if, while, do, for, return.  Others are
8241         trickier and I need to start working on invocations soon.
8242         
8243         * gen-treedump.cs: Bug fix, use s.Increment here instead of
8244         s.InitStatement. 
8245
8246         * codegen.cs (EmitContext): New struct, used during code
8247         emission to keep a context.   Most of the code generation will be
8248         here. 
8249
8250         * cs-parser.jay: Add embedded blocks to the list of statements of
8251         this block.  So code generation proceeds in a top down fashion.
8252
8253 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
8254
8255         * statement.cs: Add support for multiple child blocks.
8256
8257 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
8258
8259         * codegen.cs (EmitCode): New function, will emit the code for a
8260         Block of code given a TypeContainer and its ILGenerator. 
8261
8262         * statement.cs (Block): Standard public readonly optimization.
8263         (Block::Block constructors): Link children. 
8264         (Block::Child): Child Linker.
8265         (Block::EmitVariables): Emits IL variable declarations.
8266
8267         * class.cs: Drop support for MethodGroups here, delay until
8268         Semantic Analysis.
8269         (Method::): Applied the same simplification that I did before, and
8270         move from Properties to public readonly fields.
8271         (Method::ParameterTypes): Returns the parameter types for the
8272         function, and implements a cache that will be useful later when I
8273         do error checking and the semantic analysis on the methods is
8274         performed.
8275         (Constructor::GetCallingConvention): Renamed from CallingConvetion
8276         and made a method, optional argument tells whether this is a class
8277         or a structure to apply the `has-this' bit.
8278         (Method::GetCallingConvention): Implement, returns the calling
8279         convention. 
8280         (Method::Define): Defines the type, a second pass is performed
8281         later to populate the methods.
8282
8283         (Constructor::ParameterTypes): implement a cache similar to the
8284         one on Method::ParameterTypes, useful later when we do semantic
8285         analysis. 
8286
8287         (TypeContainer::EmitMethod):  New method.  Emits methods.
8288
8289         * expression.cs: Removed MethodGroup class from here.
8290         
8291         * parameter.cs (Parameters::GetCallingConvention): new method.
8292
8293 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
8294
8295         * class.cs (TypeContainer::Populate): Drop RootContext from the
8296         argument. 
8297
8298         (Constructor::CallingConvention): Returns the calling convention.
8299         (Constructor::ParameterTypes): Returns the constructor parameter
8300         types. 
8301         
8302         (TypeContainer::AddConstructor): Keep track of default constructor
8303         and the default static constructor.
8304
8305         (Constructor::) Another class that starts using `public readonly'
8306         instead of properties. 
8307
8308         (Constructor::IsDefault): Whether this is a default constructor. 
8309
8310         (Field::) use readonly public fields instead of properties also.
8311
8312         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
8313         track of static constructors;  If none is used, turn on
8314         BeforeFieldInit in the TypeAttributes. 
8315
8316         * cs-parser.jay (opt_argument_list): now the return can be null
8317         for the cases where there are no arguments. 
8318
8319         (constructor_declarator): If there is no implicit `base' or
8320         `this', then invoke the default parent constructor. 
8321         
8322         * modifiers.cs (MethodAttr): New static function maps a set of
8323         modifiers flags into a MethodAttributes enum
8324         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
8325         MethodAttr, TypeAttr to represent the various mappings where the
8326         modifiers are used.
8327         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
8328
8329 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
8330
8331         * parameter.cs (GetParameterInfo): Fix bug where there would be no
8332         method arguments.
8333
8334         * interface.cs (PopulateIndexer): Implemented the code generator
8335         for interface indexers.
8336
8337 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
8338
8339         * interface.cs (InterfaceMemberBase): Now we track the new status
8340         here.  
8341
8342         (PopulateProperty): Implement property population.  Woohoo!  Got
8343         Methods and Properties going today. 
8344
8345         Removed all the properties for interfaces, and replaced them with
8346         `public readonly' fields. 
8347
8348 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
8349
8350         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
8351         initialize their hashtables/arraylists only when they are needed
8352         instead of doing this always.
8353
8354         * parameter.cs: Handle refs and out parameters.
8355
8356         * cs-parser.jay: Use an ArrayList to construct the arguments
8357         instead of the ParameterCollection, and then cast that to a
8358         Parameter[] array.
8359
8360         * parameter.cs: Drop the use of ParameterCollection and use
8361         instead arrays of Parameters.
8362
8363         (GetParameterInfo): Use the Type, not the Name when resolving
8364         types. 
8365
8366 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
8367
8368         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
8369         and instead use public readonly fields.
8370
8371         * class.cs: Put back walking code for type containers.
8372
8373 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
8374
8375         * class.cs (MakeConstant): Code to define constants.
8376
8377         * rootcontext.cs (LookupType): New function.  Used to locate types 
8378
8379         
8380 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
8381
8382         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
8383         this System.Reflection code is.  Kudos to Microsoft
8384         
8385         * typemanager.cs: Implement a type cache and avoid loading all
8386         types at boot time.  Wrap in LookupType the internals.  This made
8387         the compiler so much faster.  Wow.  I rule!
8388         
8389         * driver.cs: Make sure we always load mscorlib first (for
8390         debugging purposes, nothing really important).
8391
8392         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
8393         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
8394
8395         * rootcontext.cs: Lookup types on their namespace;  Lookup types
8396         on namespaces that have been imported using the `using' keyword.
8397
8398         * class.cs (TypeContainer::TypeAttr): Virtualize.
8399         (Class::TypeAttr): Return attributes suitable for this bad boy.
8400         (Struct::TypeAttr): ditto.
8401         Handle nested classes.
8402         (TypeContainer::) Remove all the type visiting code, it is now
8403         replaced with the rootcontext.cs code
8404
8405         * rootcontext.cs (GetClassBases): Added support for structs. 
8406
8407 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
8408
8409         * interface.cs, statement.cs, class.cs, parameter.cs,
8410         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
8411         Drop use of TypeRefs, and use strings instead.
8412
8413 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
8414
8415         * rootcontext.cs: 
8416
8417         * class.cs (Struct::Struct): set the SEALED flags after
8418         checking the modifiers.
8419         (TypeContainer::TypeAttr): new property, returns the
8420         TypeAttributes for a class.  
8421
8422         * cs-parser.jay (type_list): Oops, list production was creating a
8423         new list of base types.
8424
8425         * rootcontext.cs (StdLib): New property.
8426         (GetInterfaceTypeByName): returns an interface by type name, and
8427         encapsulates error handling here.
8428         (GetInterfaces): simplified.
8429         (ResolveTree): Encapsulated all the tree resolution here.
8430         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
8431         types. 
8432         
8433         * driver.cs: Add support for --nostdlib, to avoid loading the
8434         default assemblies.
8435         (Main): Do not put tree resolution here. 
8436
8437         * rootcontext.cs: Beginning of the class resolution.
8438
8439 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
8440
8441         * rootcontext.cs: Provide better error reporting. 
8442
8443         * cs-parser.jay (interface_base): set our $$ to be interfaces.
8444
8445         * rootcontext.cs (CreateInterface): Handle the case where there
8446         are no parent interfaces.
8447         
8448         (CloseTypes): Routine to flush types at the end.
8449         (CreateInterface): Track types.
8450         (GetInterfaces): Returns an array of Types from the list of
8451         defined interfaces.
8452
8453         * typemanager.c (AddUserType): Mechanism to track user types (puts
8454         the type on the global type hash, and allows us to close it at the
8455         end). 
8456         
8457 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
8458
8459         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
8460         RecordInterface instead.
8461
8462         * cs-parser.jay: Updated to reflect changes above.
8463
8464         * decl.cs (Definition): Keep track of the TypeBuilder type that
8465         represents this type here.  Not sure we will use it in the long
8466         run, but wont hurt for now.
8467
8468         * driver.cs: Smaller changes to accomodate the new code.
8469
8470         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
8471         when done. 
8472
8473         * rootcontext.cs (CreateInterface):  New method, used to create
8474         the System.TypeBuilder type for interfaces.
8475         (ResolveInterfaces): new entry point to resolve the interface
8476         hierarchy. 
8477         (CodeGen): Property, used to keep track of the code generator.
8478
8479 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
8480
8481         * cs-parser.jay: Add a second production for delegate_declaration
8482         with `VOID'.
8483
8484         (enum_body): Put an opt_comma here instead of putting it on
8485         enum_body or enum_member_declarations so we can handle trailing
8486         commas on enumeration members.  Gets rid of a shift/reduce.
8487         
8488         (type_list): Need a COMMA in the middle.
8489
8490         (indexer_declaration): Tell tokenizer to recognize get/set
8491
8492         * Remove old targets.
8493
8494         * Re-add the parser target.
8495
8496 2001-07-13  Simon Cozens <simon@simon-cozens.org>
8497
8498         * cs-parser.jay: Add precendence rules for a number of operators
8499         ot reduce the number of shift/reduce conflicts in the grammar.
8500         
8501 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
8502
8503         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
8504         and put it here.
8505
8506         Get rid of old crufty code.
8507
8508         * rootcontext.cs: Use this to keep track of the parsed
8509         representation and the defined types available to the program. 
8510
8511         * gen-treedump.cs: adjust for new convention.
8512
8513         * type.cs: Split out the type manager, and the assembly builder
8514         from here. 
8515
8516         * typemanager.cs: the type manager will live here now.
8517
8518         * cil-codegen.cs: And the code generator here. 
8519
8520 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
8521
8522         * makefile: Fixed up for easy making.
8523
8524 2001-07-13  Simon Cozens <simon@simon-cozens.org>
8525
8526         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
8527         the 
8528
8529         (unary_expression): Expand pre_increment_expression and
8530         post_decrement_expression to reduce a shift/reduce.
8531
8532 2001-07-11  Simon Cozens
8533
8534         * cs-tokenizer.cs: Hex numbers should begin with a 0.
8535
8536         Improve allow_keyword_as_indent name.
8537
8538 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
8539
8540         * Adjustments for Beta2. 
8541
8542 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
8543
8544         * decl.cs: Added `Define' abstract method.
8545         (InTransit): new property, used to catch recursive definitions. 
8546
8547         * interface.cs: Implement `Define'. 
8548
8549         * modifiers.cs: Map Modifiers.constants to
8550         System.Reflection.TypeAttribute flags.
8551
8552         * class.cs: Keep track of types and user-defined types.
8553         (BuilderInit): New method for creating an assembly
8554         (ResolveType): New function to launch the resolution process, only
8555         used by interfaces for now.
8556
8557         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
8558         that are inserted into the name space. 
8559
8560 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
8561
8562         * ARGH.  I have screwed up my tree so many times due to the use of
8563         rsync rather than using CVS.  Going to fix this at once. 
8564
8565         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
8566         load types.
8567
8568 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
8569
8570         * Experiment successful: Use System.Type rather that our own
8571         version of Type.  
8572
8573 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
8574
8575         * cs-parser.jay: Removed nsAliases from here.
8576
8577         Use new namespaces, handle `using XXX;' 
8578
8579         * namespace.cs: Reimplemented namespace handling, use a recursive
8580         definition of the class.  Now we can keep track of using clauses
8581         and catch invalid using clauses.
8582
8583 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
8584
8585         * gen-treedump.cs: Adapted for all the renaming.
8586
8587         * expression.cs (Expression): this class now has a Type property
8588         which returns an expression Type.
8589
8590         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
8591         `Type', as this has a different meaning now in the base
8592
8593 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
8594
8595         * interface.cs, class.cs: Removed from all the sources the
8596         references to signature computation, as we can not do method
8597         signature computation during the parsing time, as we are not
8598         trying to solve at that point distinguishing:
8599
8600         class X {
8601                 void a (Blah x) {}
8602                 void a (NS.Blah x) {}
8603         }
8604
8605         Which depending on the context might be valid or not, as we do not
8606         know if Blah is the same thing as NS.Blah at that point.
8607
8608         * Redid everything so the code uses TypeRefs now instead of
8609         Types.  TypeRefs are just temporary type placeholders, that need
8610         to be resolved.  They initially have a pointer to a string and the
8611         current scope in which they are used.  This is used later by the
8612         compiler to resolve the reference to an actual Type. 
8613
8614         * DeclSpace is no longer a CIR.Type, and neither are
8615         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
8616         are all DeclSpaces, but no Types. 
8617
8618         * type.cs (TypeRefManager): This implements the TypeRef manager,
8619         which keeps track of all the types that need to be resolved after
8620         the parsing has finished. 
8621
8622 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
8623
8624         * ARGH.  We are going to have to store `foreach' as a class rather
8625         than resolving it, as we need to verify error 1579 after name
8626         resolution.   *OR* we could keep a flag that says `This request to
8627         IEnumerator comes from a foreach statement' which we can then use
8628         to generate the error.
8629
8630 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
8631
8632         * class.cs (TypeContainer.AddMethod): we now add methods to the
8633         MethodGroup instead of the method hashtable.  
8634
8635         * expression.cs: Add MethodGroup abstraction, which gets us one
8636         step closer to the specification in the way we handle method
8637         declarations.  
8638
8639         * cs-parser.jay (primary_expression): qualified_identifier now
8640         tried to match up an identifier to a local variable reference or
8641         to a parameter reference.
8642
8643         current_local_parameters is now a parser global variable that
8644         points to the current parameters for the block, used during name
8645         lookup.
8646
8647         (property_declaration): Now creates an implicit `value' argument to
8648         the set accessor.
8649
8650 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
8651
8652         * parameter.cs: Do not use `param' arguments as part of the
8653         signature, per the spec.
8654
8655 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
8656
8657         * decl.cs: Base class for classes, structs and interfaces.  This
8658         is the "Declaration Space" 
8659
8660         * cs-parser.jay: Use CheckDef for checking declaration errors
8661         instead of having one on each function.
8662
8663         * class.cs: Factor out some code for handling error handling in
8664         accordance to the "Declarations" section in the "Basic Concepts"
8665         chapter in the ECMA C# spec.
8666
8667         * interface.cs: Make all interface member classes derive from
8668         InterfaceMemberBase.
8669
8670 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
8671
8672         * Many things: all interfaces are parsed and generated in
8673         gen-treedump.  Support for member variables, constructors,
8674         destructors, properties, constants is there.
8675
8676         Beginning of the IL backend, but very little done, just there for
8677         testing purposes. 
8678
8679 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
8680
8681         * cs-parser.jay: Fix labeled statement.
8682
8683         * cs-tokenizer.cs (escape): Escape " and ' always.
8684         ref_line, ref_name: keep track of the line/filename as instructed
8685         by #line by the compiler.
8686         Parse #line.
8687
8688 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
8689
8690         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
8691         to match the values in System.CodeDOM.
8692
8693         Divid renamed to Divide.
8694
8695         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
8696         statements. 
8697         (Statements.set): remove.
8698
8699         * System.CodeDOM/CodeCatchClause.cs: always have a valid
8700         statements. 
8701
8702         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
8703         falseStatements always have valid values. 
8704
8705         * cs-parser.jay: Use System.CodeDOM now.
8706