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