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