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