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