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