2004-01-17 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
2
3         * class.cs (MethodData.Emit): Instead of checking the name of the
4         method to determine if its a destructor, create a new derived
5         class from Method called Destructor, and test for that.  
6
7         * cs-parser.jay: Create a Destructor object instead of a Method.  
8
9         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10
11         Fixes: 52933
12         
13 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
14
15         * expression.cs (Binary.ResolveOperator): Perform an implicit
16         conversion from MethodGroups to their delegate types on the
17         Addition operation.
18
19         * delegate.cs: Introduce a new class DelegateCreation that is the
20         base class for `NewDelegate' and `ImplicitDelegateCreation',
21         factor some code in here.
22
23         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
24         conversion from MethodGroups to compatible delegate types. 
25
26         * ecore.cs (Expression.Resolve): Do not flag error 654
27         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
28         we allow conversions from MethodGroups to delegate types now.
29         
30         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
31         assignments in v2 either.
32
33 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
34
35         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
36         static read-only fields in ctors.
37
38         Applied patch from Benjamin Jemlich 
39
40         * expression.cs (UnaryMutator): Avoid leaking local variables. 
41         
42 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
43
44         * cs-tokenizer.cs (IsCastToken): Allow the various native types
45         here to return true, as they can be used like this:
46
47                 (XXX) int.MEMBER ()
48
49         Fixed 49836 and all the other dups
50         
51 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
52
53         * driver.cs: Implement /win32res and /win32icon.
54
55 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
56
57         * cs-parser.jay: Add a rule to improve error handling for the
58         common mistake of placing modifiers after the type.
59
60 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
61
62         * cs-parser.jay (interface_event_declaration): Catch
63         initialization of events on interfaces, and report cs0068
64
65         * cs-parser.jay (interface_event_declaration): Catch
66         initialization of events. 
67
68         * ecore.cs: Better report missing constructors.
69         
70         * expression.cs (Binary.ResolveOperator): My previous bug fix had
71         the error reporting done in the wrong place.  Fix.
72
73         * expression.cs (Binary.ResolveOperator): Catch the 
74         operator + (E x, E y) error earlier, and later allow for implicit
75         conversions in operator +/- (E e, U x) from U to the underlying
76         type of E.
77
78         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
79         52596, if the container class is abstract, the default constructor
80         is protected otherwise its public (before, we were always public).
81
82         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
83         fixed statement.
84
85         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
86         Jemlich that fixes bug #52597, MCS was generating invalid code for
87         idisposable structs.   Thanks to Ben for following up with this
88         bug as well.
89         
90 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
91
92         * driver.cs: Allow assemblies without code to be generated, fixes
93         52230.
94
95 2004-01-07  Nick Drochak <ndrochak@gol.com>
96
97         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
98
99 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
100
101         * cs-parser.jay: Add rules to improve error reporting if fields or
102         methods are declared at the namespace level (error 116)
103
104         * Add rules to catch event add/remove
105
106 2004-01-04  David Sheldon <dave-mono@earth.li>
107
108   * expression.cs: Added matching ")" to error message for 
109   CS0077
110
111 2004-01-03 Todd Berman <tberman@gentoo.org>
112         
113         * ecore.cs, attribute.cs:
114         Applying fix from #52429.
115
116 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
117
118         * ecore.cs, expression.cs, statement.cs:
119         Total rewrite of how we handle branching. We
120         now handle complex boolean expressions with fewer
121         jumps. As well if (x == 0) no longer emits a ceq.
122
123         if (x is Foo) is much faster now, because we generate
124         better code.
125
126         Overall, we get a pretty big improvement on our benchmark
127         tests. The code we generate is smaller and more readable.
128
129         I did a full two-stage bootstrap. The patch was reviewed
130         by Martin and Miguel.
131
132 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
133
134         * cs-parser.jay: Make primary_expression not take a QI.
135         we dont need this because the member_access rule covers
136         us here. So we replace the rule with just IDENTIFIER.
137
138         This has two good effects. First, we remove a s/r conflict.
139         Second, we allocate many fewer QualifiedIdentifier objects.
140
141 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
142
143         * attribute.cs: Handle MarshalAs attributes as pseudo, and
144         set the correct information via SRE. This prevents
145         hanging on the MS runtime. Fixes #29374.
146
147 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
148
149         * convert.cs: correctly handle conversions to value types
150         from Enum and ValueType as unboxing conversions.
151
152         Fixes bug #52569. Patch by Benjamin Jemlich.
153
154 2004-01-02  Ravi Pratap  <ravi@ximian.com>
155
156         * expression.cs (BetterConversion): Prefer int -> uint
157         over int -> ulong (csc's behaviour). This fixed bug #52046.
158
159 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
160
161         * decl.cs (MemberCache.FindMembers): now returns a
162         MemberInfo [].
163
164         * typemanager.cs: In general, go with with ^^.
165         (CopyNewMethods): take an IList.
166         (RealMemberLookup): Only allocate an arraylist
167         if we copy from two sets of methods.
168
169         This change basically does two things:
170         1) Fewer array lists allocated due to CopyNewMethods.
171         2) the explicit cast in MemberList costed ALOT.
172
173 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
174
175         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
176         a hashtable to avoid needless string allocations when an identifier is
177         used more than once (the common case).
178
179 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
180
181         * pending.cs: MS's TypeBuilder.GetInterfaces ()
182         is broken, it will not return anything. So, we
183         have to use the information we have in mcs to
184         do the task.
185
186         * typemanager.cs: Add a cache for GetInterfaces,
187         since this will now be used more often (due to ^^)
188
189         (GetExplicitInterfaces) New method that gets the
190         declared, not effective, interfaces on a type
191         builder (eg, if you have interface IFoo, interface
192         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
193         { IBar }.
194
195         This patch makes MCS able to bootstrap itself on
196         Windows again.
197
198 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
199
200         * expression.cs: Remove the Nop's that Miguel put
201         in by mistake.
202
203 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
204
205         * report.cs, codegen.cs: Give the real stack trace to
206         the error when an exception is thrown.
207
208 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
209
210         * decl.cs: only allocate hashtables for ifaces if 
211         it is an iface!
212
213 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
214
215         * expression.cs: fix the error from cs0121-2.cs
216         (a parent interface has two child interfaces that
217         have a function with the same name and 0 params
218         and the function is called through the parent).
219
220 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
221
222         * class.cs, rootcontext.cs, typmanager.cs: do not
223         leak pointers.
224
225 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
226
227         * codegen.cs: remove stack for the ec flow branching.
228         It is already a linked list, so no need.
229
230 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
231
232         * Makefile: Allow custom profiler here.
233
234 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
235
236         * typemanager.cs (LookupType):
237           - Use a static char [], because split takes
238             a param array for args, so it was allocating
239             every time.
240           - Do not store true in a hashtable, it boxes.
241
242 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
243
244         * flowanalysis.cs: bytify common enums.
245
246 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
247
248         * modifiers.cs: Add a new set of flags for the
249         flags allowed on explicit interface impls.
250         * cs-parser.jay: catch the use of modifiers in
251         interfaces correctly.
252         * class.cs: catch private void IFoo.Blah ().
253
254         All related to bug #50572.
255
256 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
257
258         * decl.cs: Rewrite the consistant accessability checking.
259         Accessability is not linear, it must be implemented in
260         a tableish way. Fixes #49704.
261
262 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
263
264         * expression.cs: Handle negation in a checked context.
265         We must use subtraction from zero. Fixes #38674.
266
267 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
268
269         * class.cs: Ignore static void main in DLLs.
270         * rootcontext.cs: Handle the target type here,
271         since we are have to access it from class.cs
272         * driver.cs: account for the above.
273
274 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
275
276         * report.cs: Give line numbers and files if available.
277
278 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
279
280         * driver.cs: Implement /addmodule.
281
282         * typemanager.cs:  Change 'modules' field so it now contains Modules not
283         ModuleBuilders.
284
285 2003-12-20  Martin Baulig  <martin@ximian.com>
286
287         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
288         (FieldBase.IsAssigned): Removed this field.
289         (FieldBase.SetAssigned): New public method.
290         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
291
292 2003-12-20  Martin Baulig  <martin@ximian.com>
293
294         * expression.cs (LocalVariableReference.DoResolve): Don't set
295         `vi.Used' if we're called from DoResolveLValue().
296
297         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
298         returns the usage vector it just merged into the current one -
299         pass this one to UsageWarning().
300         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
301         of the `EmitContext', don't call this recursively on our children.
302
303 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
304
305         * driver.cs: Implement /target:module.
306
307 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
308
309         * support.cs (CharArrayHashtable): New helper class.
310
311         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
312         char arrays, not strings, so we can avoid creating a string in
313         consume_identifier if the identifier is a keyword.
314
315 2003-12-16  Martin Baulig  <martin@ximian.com>
316
317         * statement.cs (LocalInfo.Assigned): Removed this property.
318         (LocalInfo.Flags): Removed `Assigned'.
319         (LocalInfo.IsAssigned): New public method; takes the EmitContext
320         and uses flow analysis.
321         (Block.UsageWarning): Made this method private.
322         (Block.Resolve): Call UsageWarning() if appropriate.
323
324         * expression.cs (LocalVariableReference.DoResolve): Always set
325         LocalInfo.Used here.
326
327 2003-12-13  Martin Baulig  <martin@ximian.com>
328
329         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
330         any value here; we're now using flow analysis to figure out
331         whether a statement/block returns a value.
332
333 2003-12-13  Martin Baulig  <martin@ximian.com>
334
335         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
336         working again.
337         (FlowBranching.MergeFinally): Don't call
338         `branching.CheckOutParameters()' here, this is called in
339         MergeTopBlock().
340         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
341         when adding the `finally' vector.       
342
343 2003-12-13  Martin Baulig  <martin@ximian.com>
344
345         * flowanalysis.cs
346         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
347         actually work and also fix #48962.
348
349 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
350
351         * decl.cs: Do not check System.Object for nested types,
352         since we know it does not have any. Big bang for buck:
353
354         BEFORE:
355            Run 1:   8.35 seconds
356            Run 2:   8.32 seconds
357            corlib:  17.99 seconds
358         AFTER:
359            Run 1:   8.17 seconds
360            Run 2:   8.17 seconds
361            corlib:  17.39 seconds
362
363 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
364
365         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
366         time we are returning 0 members, so we save alot here.
367
368 2003-12-11  Martin Baulig  <martin@ximian.com>
369
370         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
371         `MergeChild()', also just take the `FlowBranching' as argument;
372         call Merge() on it and return the result.
373         (FlowBranching.Merge): We don't need to do anything if we just
374         have one sibling.
375
376 2003-12-11  Martin Baulig  <martin@ximian.com>
377
378         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
379         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
380         Maurer for this idea.
381
382 2003-12-11  Martin Baulig  <martin@ximian.com>
383
384         * flowanalysis.cs (MergeResult): This class is now gone; we now
385         use the `UsageVector' for this.  The reason for this is that if a
386         branching just has one sibling, we don't need to "merge" them at
387         all - that's the next step to do.
388         (FlowBranching.Merge): We now return a `UsageVector' instead of a
389         `MergeResult'.
390
391 2003-12-11  Martin Baulig  <martin@ximian.com>
392
393         Reworked flow analyis and made it more precise and bug-free.  The
394         most important change is that we're now using a special `Reachability'
395         class instead of having "magic" meanings of `FlowReturns'.  I'll
396         do some more cleanups and optimizations and also add some more
397         documentation this week.
398
399         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
400         largely reworked this class.
401         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
402         the new `Reachability' class instead of having "magic" values here.
403         (FlowBranching): We're now using an instance of `Reachability'
404         instead of having separate `Returns', `Breaks' etc. fields.
405
406         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
407         based on flow analysis; ignore the return value of block.Emit ().
408
409 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
410
411         * driver.cs typemanager.cs: Find the mono extensions to corlib even
412         if they are private.
413
414 2003-12-09  Martin Baulig  <martin@ximian.com>
415
416         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
417         call them directly on the UsageVector.
418
419 2003-12-09  Martin Baulig  <martin@ximian.com>
420
421         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
422         Changed return type from `FlowReturns' to `Reachability'.
423
424 2003-12-09  Martin Baulig  <martin@ximian.com>
425
426         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
427         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
428         `Reachable' fields with a single `Reachability' one.
429
430 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
431
432         * class.cs (FindMembers): Remove foreach's.
433
434         Bootstrap times:
435         
436         BEFORE
437                 Run 1:   8.74 seconds
438                 Run 2:   8.71 seconds
439         
440         AFTER
441                 Run 1:   8.64 seconds
442                 Run 2:   8.58 seconds
443         
444
445 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
446
447         * cs-parser.jay:
448         * gen-treedump.cs:
449         * statement.cs:
450         This patch does a few things:
451                 1. EmptyStatement is now a singleton, so it is never reallocated.
452                 2. All blah is EmptyStatement constructs have been changed to
453                    blah == EmptyStatement.Value, which is much faster and valid
454                    now that EmptyStatement is a singleton.
455                 3. When resolving a block, rather than allocating a new array for
456                    the non-empty statements, empty statements are replaced with
457                    EmptyStatement.Value
458                 4. Some recursive functions have been made non-recursive.
459         Mainly the performance impact is from (3), however (1) and (2) are needed for
460         this to work. (4) does not make a big difference in normal situations, however
461         it makes the profile look saner.
462
463         Bootstrap times:
464
465         BEFORE
466         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
467         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
468         Total memory allocated: 56397 KB
469         
470         AFTER
471         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
472         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
473         Total memory allocated: 55666 KB
474
475 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
476
477         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
478         than the hashtable in a hashtable version
479
480         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
481         we always end up concating a string. This results in a huge perf
482         loss, because many strings have to be tracked by the GC. In this
483         patch, we first use a hashtable that works with two keys, so that
484         the strings do not need to be concat'ed.
485
486         Bootstrap times:
487         BEFORE
488                 Run 1:   8.74 seconds
489                 Run 2:   8.71 seconds
490         
491         AFTER
492                 Run 1:   8.65 seconds
493                 Run 2:   8.56 seconds
494         
495 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
496
497         * Makefile: Add a new target `do-time' that does a quick and simple
498         profile, leaving easy to parse output.
499
500 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
501
502         * codegen.cs (Init): Create the dynamic assembly with 
503         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
504
505 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
506
507         * support.cs: Make the PtrHashtable use only one
508         instance of its comparer.
509
510 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
511
512         * typemanager.cs: Fix lookup of GetNamespaces.
513
514 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
515
516         * expression.cs: Removed redundant line.
517
518         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
519         ArrayLists, use for loops with bounds.  
520
521         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
522         arraylist.
523
524         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
525         arraylists, use for loop with bounds.
526
527         The above three changes give us a 0.071 second performance
528         improvement out of 3.294 seconds down to 3.223.  On my machine
529         the above changes reduced the memory usage by 1,387 KB during
530         compiler bootstrap.
531
532         * cs-parser.jay (QualifiedIdentifier): New class used to represent
533         QualifiedIdentifiers.  Before we created a new string through
534         concatenation, and mostly later on, the result would be
535         manipulated by DecomposeQI through string manipulation.
536
537         This reduced the compiler memory usage for bootstrapping from
538         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
539         compile times in 0.05 seconds.
540
541 2003-11-28  Dick Porter  <dick@ximian.com>
542
543         * support.cs: Do string compares with the Invariant culture.
544
545         * rootcontext.cs: 
546         * gen-treedump.cs: 
547         * expression.cs: 
548         * driver.cs: 
549         * decl.cs: 
550         * codegen.cs: 
551         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
552         the comparison is done with the Invariant culture.
553
554 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
555
556         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
557         GetEnumerator method.
558
559         (ProbeCollectionType): Iterate starting at the most specific type
560         upwards looking for a GetEnumerator
561
562         * expression.cs: Shift count can be up to 31 for int/uint and 63
563         for long/ulong.
564
565 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
566
567         * statement.cs (Block.LookupLabel): Also look for the label on the
568         children blocks.  Use a hash table to keep track of visited
569         nodes. 
570
571         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
572         we actually did transform the other operand, otherwise fall back
573         to the common codepath that casts to long.
574
575         * cs-tokenizer.cs: Use the same code pattern as the int case.
576         Maybe I should do the parsing myself, and avoid depending on the
577         Parse routines to get this done.
578
579 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
580
581         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
582         which fixes bug 51347.  This time test it.
583         
584         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
585         attributes for example can not tell the difference between these.
586         The difference was only a syntax feature of the language. 
587
588         * attribute.cs: Apply attributes to delegates.
589
590         * delegate.cs: Call the apply attributes method.
591
592 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
593
594         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
595         comparing 0 vs Byte.MinValue, not the value
596
597         (ImplicitConversionRequired): When reporting a conversion error,
598         use error 31 to print out the constant error instead of the
599         simpler 29.
600
601         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
602         which fixes bug 51347.
603         
604 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
605
606         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
607         which fixes the -warnaserror command line option.
608         
609 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
610
611         * cfold.cs (DoNumericPromotions): During constant folding of
612         additions on UIntConstant, special case intconstants with
613         IntConstants like we do on the expression binary operator. 
614
615 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
616
617         * convert.cs (ImplicitReferenceConversion): We were missing a case
618         (System.Enum are not value types or class types, so we need to
619         classify them separatedly).
620
621         * driver.cs: We do not support error 2007.
622
623 2003-11-12 Jackson Harper <jackson@ximian.com>
624
625         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
626         system directory. Also use the full file name so users can
627         libraries names mscorlib-o-tron.dll in a non system dir.
628         
629 2003-11-10  Martin Baulig  <martin@ximian.com>
630
631         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
632         (TypeManager.InitCoreTypes): Initialize them here, but instead of
633         calling `ResolveType()' on them, directly assign their `Type'.
634
635 2003-11-08  Martin Baulig  <martin@ximian.com>
636
637         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
638         return value and the `out parent' parameter.
639         (TypeContainer.DefineType): Moved the CS0644 check into
640         GetClassBases().  Don't pass the interface types to the
641         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
642         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
643
644         * ecore.cs (TypeExpr.IsAttribute): New property.
645         (TypeExpr.GetInterfaces): New method.
646
647         * interface.cs (Interface.GetInterfaceTypeByName): Return a
648         TypeExpr instead of a Type.
649         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
650         (Interface.DefineType): Don't pass the interface types to the
651         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
652         them later and then call `TypeBulider.AddInterfaceImplementation()'.
653
654         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
655         instead of a `Type[]'.
656         (TypeManager.RegisterBuilder): Likewise.
657         (TypeManager.AddUserInterface): Likewise.
658         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
659         `Type[]' and also return a `TypeExpr[]'.
660         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
661
662 2003-11-08  Martin Baulig  <martin@ximian.com>
663
664         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
665         Expression.     
666
667 2003-11-08  Martin Baulig  <martin@ximian.com>
668
669         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
670         TypeManager.ResolveExpressionTypes().
671
672         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
673         instead of an Expression.
674         (TypeExpr): This is now an abstract base class for `TypeExpression'.
675         (TypeExpression): New public class; formerly known as `TypeExpr'.
676
677         * expression.cs (ComposedCast): Derive from TypeExpr.
678
679         * typemanager.cs (TypeManager.system_*_expr): These are now
680         TypExpr's instead of Expression's.
681         (TypeManager.ResolveExpressionTypes): New public static function;
682         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
683         of them.        
684
685 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
686
687         * expression.cs (New.DoResolve): Do not dereference value that
688         might be a null return.
689
690         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
691         sure that the constant value has the right type.  Fixes an
692         unreported bug, similar to 50425.
693
694         * const.cs (Const.LookupConstantValue): Call
695         ImplicitStandardConversionExists before doing a conversion to
696         avoid havng the TypeManager.ChangeType do conversions.
697
698         Reduced the number of casts used
699
700         (Const.ChangeType): New routine to enable reuse of the constant
701         type changing code from statement.
702
703         * typemanager.cs (ChangeType): Move common initialization to
704         static global variables.
705
706         Fixes #50425.
707
708         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
709         every value type to go through, even if it was void.  Fix that. 
710
711         * cs-tokenizer.cs: Use is_identifier_start_character on the start
712         character of the define, and the is_identifier_part_character for
713         the rest of the string.
714
715 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
716
717         * expression.cs (UnaryMutator.EmitCode): When I updated
718         LocalVariableReference.DoResolve, I overdid it, and dropped an
719         optimization done on local variable references.
720
721 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
722
723         * ecore.cs: Convert the return from Ldlen into an int.
724
725 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
726
727         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
728         the accessibility, this is a special case for toplevel non-public
729         classes (internal for instance).
730
731 2003-10-20  Nick Drochak <ndrochak@gol.com>
732
733         * ecore.cs: Fix typo and build.  Needed another right paren.
734
735 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
736
737         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
738         `internal' case regular and protected, but not allowing protected
739         to be evaluated later.  Bug 49840
740
741 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
742
743         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
744         to kb.Nlast, and not the kb.nFirst to isolate the switch
745         statement.
746
747         Extract the underlying type, so enumerations of long/ulong are
748         treated like long/ulong.
749
750 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
751
752         * expression.cs (New): Overload the meaning of RequestedType to
753         track the possible creation of the NewDelegate type, since
754         DoResolve is invoked more than once for new constructors on field
755         initialization.
756
757         See bugs: #48800 and #37014
758
759         * cs-parser.jay (declare_local_constants): Take an arraylist
760         instead of a single constant.
761
762         (local_constant_declaration): It should take a
763         constant_declarators, not a constant_declarator.  Fixes 49487
764
765         * convert.cs: Fix error report.
766
767 2003-10-13 Jackson Harper <jackson@ximian.com>
768
769         * typemanager.cs (TypeToCoreType): Add float and double this fixes
770         bug #49611
771         
772 2003-10-09  Martin Baulig  <martin@ximian.com>
773
774         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
775         to the .ctor.
776         (MethodCore.DoDefineParameters): Removed the TypeContainer
777         argument; use the DeclSpace which was passed to the .ctor instead.
778         (MethodCore.CheckParameter): Take a DeclSpace instead of a
779         TypeContainer; we only need a DeclSpace here.
780
781 2003-10-09  Martin Baulig  <martin@ximian.com>
782
783         * class.cs (MethodData): Added additional `DeclSpace ds' argument
784         to the .ctor.
785         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
786         EmitContext's .ctor.    
787
788 2003-10-09  Martin Baulig  <martin@ximian.com>
789
790         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
791         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
792         AsAccessible(), moved them as well.
793
794         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
795
796 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
797
798         * cs-parser.jay : Renamed yyName to yyNames related to jay.
799
800 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
801
802         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
803         generation for >=, as spotted by Paolo, bug 48679.  
804         Patch from David Waite.
805
806         * cs-tokenizer.cs: Add handling for #pragma.
807
808         * cs-parser.jay: Allow for both yield and yield return in the
809         syntax.  The anti-cobolization of C# fight will go on!
810
811         * class.cs (TypeBuilder.DefineType): Catch error condition here
812         (Parent.DefineType erroring out and returning null).
813
814         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
815         coping with enumerations variables, we were mistakenly processing
816         them as a regular value type instead of built-in types.  Fixes the
817         bug #48063
818
819         * typemanager.cs (IsBuiltinOrEnum): New method.
820
821 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
822
823         * cs-parser.jay: Upgrade: yield now needs the return clause.
824
825 2003-09-19  Martin Baulig  <martin@ximian.com>
826
827         * decl.cs (MemberCache.SetupCacheForInterface): Take a
828         `MemberCache parent' argument.  Normally, an interface doesn't
829         have a parent type except System.Object, but we use this in gmcs
830         for generic type parameters.
831
832 2003-09-18  Martin Baulig  <martin@ximian.com>
833
834         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
835         on `type.IsInterface'; don't check whether the type has a parent
836         to determine whether it's an interface.
837
838 2003-09-15  Martin Baulig  <martin@ximian.com>
839
840         * class.cs (TypeContainer.DefineType): Added an error flag to
841         avoid reporting duplicate CS0146's ("class definition is
842         circular.").
843
844         * driver.cs (Driver.MainDriver): Abort if
845         RootContext.ResolveTree() reported any errors.
846
847 2003-09-07  Martin Baulig  <martin@ximian.com>
848
849         * report.cs (Error, Warning): Added overloaded versions which take
850         a `params object[] args' and call String.Format().
851
852 2003-09-07  Martin Baulig  <martin@ximian.com>
853
854         * decl.cs (DeclSpace..ctor): Don't call
855         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
856         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
857         (DeclSpace.RecordDecl): New method.
858
859         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
860
861 2003-09-02  Ravi Pratap  <ravi@ximian.com>
862
863         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
864         value attributes to be applied to ParameterBuilders.
865
866         * class.cs (MethodCore.LabelParameters): Make static and more
867         generic so that it can be used from other places - like interface
868         methods, for instance.
869
870         * interface.cs (Interface.Emit): Call LabelParameters before
871         emitting attributes on the InterfaceMethod.
872
873 2003-08-26  Martin Baulig  <martin@ximian.com>
874
875         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
876         resolving aliases; fixes #47927.
877
878 2003-08-26  Martin Baulig  <martin@ximian.com>
879
880         * statement.cs (Using.DoResolve): This is internally emitting a
881         try/finally clause, so we need to set ec.NeedExplicitReturn if we
882         do not always return.  Fixes #47681.
883
884 2003-08-26  Martin Baulig  <martin@ximian.com>
885
886         * decl.cs (MemberCore): Moved WarningNotHiding(),
887         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
888         into MemberBase.
889         (AdditionResult): Make this nested in DeclSpace.
890         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
891         argument; call NamespaceEntry.Define() unless we're nested in a
892         class or struct.
893
894         * namespace.cs (Namespace.DefineName): New public function.  This
895         is called from DeclSpace's .ctor to add 
896         (Namespace.Lookup): Include DeclSpaces in the lookup.
897
898         * class.cs (Operator): Derive from MemberBase, not MemberCore.
899
900         * const.cs (Const): Derive from MemberBase, not MemberCore.     
901
902 2003-08-25  Martin Baulig  <martin@ximian.com>
903
904         * convert.cs (Convert.ExplicitReferenceConversion): When
905         converting from an interface type to a class, unbox if the target
906         type is a struct type.  Fixes #47822.
907
908 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
909
910         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
911         #47854.
912
913 2003-08-22  Martin Baulig  <martin@ximian.com>
914
915         * class.cs (TypeManager.DefineType): When defining a nested type,
916         call DefineType() on our parent; fixes #47801.
917
918 2003-08-22  Martin Baulig  <martin@ximian.com>
919
920         * class.cs (MethodData.Define): While checking if a method is an
921         interface implementation, improve the test a bit more to fix #47654.
922
923 2003-08-22  Martin Baulig  <martin@ximian.com>
924
925         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
926         correctly; fixes #47722.
927
928 2003-08-22  Martin Baulig  <martin@ximian.com>
929
930         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
931         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
932
933         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
934
935 2003-08-22  Martin Baulig  <martin@ximian.com>
936
937         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
938         can only be assigned in static constructors.  Fixes #47161.
939
940 2003-08-22  Martin Baulig  <martin@ximian.com>
941
942         Rewrote and improved the flow analysis code.
943
944         * flowbranching.cs (FlowBranching): Make this class abstract.
945         (FlowBranching.CreateBranching): New static function to create a
946         new flow branching.
947         (FlowBranchingBlock, FlowBranchingException): New classes.
948         (FlowBranching.UsageVector.Type): New public readonly field.
949         (FlowBranching.UsageVector.Breaks): Removed the setter.
950         (FlowBranching.UsageVector.Returns): Removed the setter.
951         (FlowBranching.UsageVector): Added Break(), Return(),
952         NeverReachable() and Throw() methods to modify the reachability.
953         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
954         done by FlowBranching.Merge().
955         (FlowBranching.UsageVector.MergeChild): New method; merges the
956         merge result into the current vector.
957         (FlowBranching.Merge): New abstract method to merge a branching.
958
959 2003-08-12  Martin Baulig  <martin@ximian.com>
960
961         * expression.cs (Indirection.CacheTemporaries): Create the
962         LocalTemporary with the pointer type, not its element type.
963
964 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
965
966         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
967         token was a keyword or not.
968
969         Add `error' options where an IDENTIFIER was expected;  Provide
970         CheckToken and CheckIdentifierToken convenience error reporting
971         functions. 
972
973         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
974
975         * decl.cs: Rename `NamespaceEntry Namespace' public field into
976         NameSpaceEntry NameSpaceEntry.
977
978         (LookupInterfaceOrClass): Avoid creating a full qualified name
979         from namespace and name: avoid doing lookups when we know the
980         namespace is non-existant.   Use new Tree.LookupByNamespace which
981         looks up DeclSpaces based on their namespace, name pair.
982
983         * driver.cs: Provide a new `parser verbose' to display the
984         exception thrown during parsing.  This is turned off by default
985         now, so the output of a failure from mcs is more graceful.
986
987         * namespace.cs: Track all the namespaces defined in a hashtable
988         for quick lookup.
989         
990         (IsNamespace): New method
991
992 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
993
994         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
995         we know that we need to concatenate (full typename can never be
996         null). 
997
998         * class.cs: ditto.
999
1000         * statement.cs: Use a bitfield;  Do not initialize to null things
1001         which are done by the constructor by default.
1002
1003         * cs-parser.jay: bug fix, parameter was 4, not 3.
1004
1005         * expression.cs: Just use the property;
1006
1007         * statement.cs: No need for GetVariableInfo method.
1008
1009 2003-08-08  Martin Baulig  <martin@ximian.com>
1010
1011         * flowanalysis.cs (FlowReturns): This is now nested in the
1012         `FlowBranching' class.
1013         (MyBitVector): Moved this here from statement.cs.
1014         (FlowBranching.SiblingType): New enum type.
1015         (FlowBranching.CreateSibling): Added `SiblingType' argument.
1016
1017 2003-08-07  Martin Baulig  <martin@ximian.com>
1018
1019         * flowanalysis.cs (FlowBranchingType): This is now nested in the
1020         `FlowBranching' class and called `BranchingType'.
1021
1022 2003-08-07  Martin Baulig  <martin@ximian.com>
1023
1024         * flowanalysis.cs: Moved all the control flow analysis code into
1025         its own file.
1026
1027 2003-08-07  Martin Baulig  <martin@ximian.com>
1028
1029         * assign.cs (Assign.DoResolve): `target' must either be an
1030         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
1031         #37319.
1032
1033 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
1034
1035         * expression.cs (BinaryMethod): This kind of expression is created by the
1036         Binary class if it determines that the operator has to be handled
1037         by a method.
1038
1039         (BinaryDelegate): This kind of expression is created if we are
1040         dealing with a + or - operator on delegates.
1041
1042         (Binary): remove method, argumetns, and DelegateOperator: when
1043         dealing with methods, 
1044         
1045         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
1046
1047         * statement.cs (Block): use bitfields for the three extra booleans
1048         we had in use.   Remove unused topblock parameter.
1049
1050         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
1051
1052         * assign.cs: Drop extra unneeded tests.
1053
1054 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
1055
1056         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
1057
1058         * statement.cs (Foreach): Use VariableStorage instead of
1059         LocalBuilders.   
1060
1061         * codegen.cs (VariableStorage): New class used by clients that
1062         require a variable stored: locals or fields for variables that
1063         need to live across yield.
1064
1065         Maybe provide a convenience api for EmitThis+EmitLoad?
1066
1067         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
1068         these bad boys.
1069
1070 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
1071
1072         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
1073         RemapParameterLValue): New methods that are used to turn a
1074         precomputed FieldInfo into an expression like this:
1075
1076                 instance.FieldInfo
1077
1078         The idea is to use this instead of making LocalVariableReference
1079         have more than one meaning.
1080
1081         * cs-parser.jay: Add error production to BASE.
1082
1083         * ecore.cs: Deal with TypeManager.GetField returning null, which
1084         is now a valid return value.
1085
1086         (FieldExprNoAddress): New expression for Fields whose address can
1087         not be taken.
1088
1089         * expression.cs (LocalVariableReference): During the resolve
1090         phases, create new expressions if we are in a remapping context.
1091         Remove code that dealt with remapping here.
1092
1093         (ParameterReference): same.
1094
1095         (ProxyInstance): New expression, like the `This' expression, but
1096         it is born fully resolved.  We know what we are doing, so remove
1097         the errors that are targeted to user-provided uses of `this'.
1098
1099         * statement.cs (Foreach): our variable is now stored as an
1100         Expression;  During resolution, follow the protocol, dont just
1101         assume it will return this.
1102         
1103 2003-08-06  Martin Baulig  <martin@ximian.com>
1104
1105         * support.cs (SeekableStreamReader.cs): New public class.
1106
1107         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
1108         SeekableStreamReader instead of the normal StreamReader.
1109
1110 2003-08-04  Martin Baulig  <martin@ximian.com>
1111
1112         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
1113         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
1114         deambiguate casts and delegate invocations.
1115         (parenthesized_expression): Use the new tokens to ensure this is
1116         not a cast of method invocation.
1117
1118         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
1119         when reading a `)' and Deambiguate_CloseParens () was previously
1120         called.
1121
1122         * expression.cs (ParenthesizedExpression): New class.  This is
1123         just used for the CS0075 test.
1124         (Binary.DoResolve): Check for CS0075.   
1125
1126 2003-07-29  Ravi Pratap  <ravi@ximian.com>
1127
1128         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
1129         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
1130         reference comparison.
1131
1132         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
1133         examine the ReturnType for equality - this is necessary in the
1134         cases of implicit and explicit operators whose signature also
1135         includes the return type.
1136
1137 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
1138
1139         * namespace.cs: Cache the result of the namespace computation,
1140         instead of computing it every time.
1141
1142 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
1143
1144         * decl.cs: Use a global arraylist that we reuse over invocations
1145         to avoid excesive memory consumption.  Reduces memory usage on an
1146         mcs compile by one meg (45 average).
1147
1148         * typemanager.cs (LookupTypeReflection): In .NET pointers are
1149         private, work around that.
1150
1151 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
1152
1153         * literal.cs (IntLiteral): Define Zero and One static literals. 
1154
1155         * cs-parser.jay (integer_literal): use static literals to reduce
1156         memory usage for the most used literals (0, 1 and -1).  211kb
1157         reduced in memory usage.
1158
1159         Replace all calls to `new ArrayList' with `new
1160         ArrayList(4)' which is a good average number for most allocations,
1161         and also requires only 16 bytes of memory for its buffer by
1162         default. 
1163
1164         This reduced MCS memory usage in seven megabytes for the RSS after
1165         bootstrapping.
1166
1167 2003-07-28  Ravi Pratap  <ravi@ximian.com>
1168
1169         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
1170         handle params methods the correct way by forming only one
1171         applicable set with params and normal methods in them. Earlier we
1172         were looking at params methods only if we found no normal methods
1173         which was not the correct thing to do.
1174
1175         (Invocation.BetterFunction): Take separate arguments indicating
1176         when candidate and the best method are params methods in their
1177         expanded form.
1178
1179         This fixes bugs #43367 and #46199.
1180
1181         * attribute.cs: Documentation updates.
1182
1183         (CheckAttribute): Rename to CheckAttributeTarget.
1184         (GetValidPlaces): Rename to GetValidTargets.
1185
1186         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
1187         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
1188
1189         Fixes bug #44468.
1190
1191 2003-07-28  Martin Baulig  <martin@ximian.com>
1192
1193         * class.cs (TypeContainer.DefineMembers): Use the base type's full
1194         name when looking up the base class of a nested class.  Fixes #46977.
1195
1196 2003-07-26  Martin Baulig  <martin@ximian.com>
1197
1198         * expression.cs (Indexers.Indexer): New nested struct; contains
1199         getter, setter and the indexer's type.
1200         (Indexers.Properties): This is now an ArrayList of
1201         Indexers.Indexer's.
1202         (IndexerAccess.DoResolveLValue): Correctly set the type if the
1203         indexer doesn't have any getters.
1204
1205         * assign.cs (Assign.DoResolve): Also do the implicit conversions
1206         for embedded property and indexer assignments.
1207
1208 2003-07-26  Martin Baulig  <martin@ximian.com>
1209
1210         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
1211         preprocessor directive is not the first non-whitespace character
1212         on a line.
1213
1214 2003-07-26  Martin Baulig  <martin@ximian.com>
1215
1216         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
1217         namespace parsing, follow the spec more closely.
1218
1219         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
1220         NamespaceEntry.Lookup().
1221
1222 2003-07-25  Martin Baulig  <martin@ximian.com>
1223
1224         * MethodCore.cs (OverridesSomething): New public field; it's set
1225         from TypeContainer.DefineMembers if this method overrides
1226         something (which doesn't need to be a method).  Fix #39462.
1227
1228 2003-07-25  Ravi Pratap  <ravi@ximian.com>
1229
1230         * typemanager.cs (GetMembers): Ensure that the list of members is
1231         reversed. This keeps things in sync.
1232
1233         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
1234         find an AttributeUsage attribute.
1235
1236         * expression.cs (Invocation.OverloadResolve): Perform the check
1237         which disallows Invoke to be directly called on a Delegate.
1238
1239         (Error_InvokeOnDelegate): Report error cs1533.
1240         
1241 2003-07-25  Martin Baulig  <martin@ximian.com>
1242
1243         * expression.cs (Indexers.GetIndexersForType): Only look in the
1244         interface hierarchy if the requested type is already an
1245         interface.  Fixes #46788 while keeping #46502 fixed.
1246
1247 2003-07-25  Martin Baulig  <martin@ximian.com>
1248
1249         * class.cs (TypeContainer.DefineMembers): Check whether all
1250         readonly fields have been assigned and report warning CS0649 if
1251         not.
1252
1253         * statement.cs (LocalInfo.IsFixed): Always return true if this is
1254         a valuetype.
1255
1256 2003-07-24  Ravi Pratap  <ravi@ximian.com>
1257
1258         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
1259         returned from GetMethods to make things consistent with the
1260         assumptions MCS makes about ordering of methods.
1261
1262         This should comprehensively fix bug #45127 and it does :-)
1263
1264         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
1265         ordering is actually reverse.
1266
1267         * Clean up some debug messages I left lying around.
1268
1269         * interface.cs (Populate*): Get rid of code which emits attributes
1270         since the stage in which we emit attributes is the 'Emit' stage,
1271         not the define stage.
1272
1273         (Emit): Move attribute emission for interface members here.
1274         
1275 2003-07-22  Ravi Pratap  <ravi@ximian.com>
1276
1277         * expression.cs (Invocation.OverloadResolve): Follow the spec more
1278         closely: we eliminate methods in base types when we have an
1279         applicable method in a top-level type.
1280
1281         Please see section 14.5.5.1 for an exact description of what goes
1282         on. 
1283
1284         This fixes bug #45127 and a host of other related to corlib compilation.
1285
1286         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
1287         array is the method corresponding to the top-level type (this is
1288         because of the changes made to icall.c) so we change this
1289         accordingly.
1290
1291         (MethodGroupExpr.Name): This too.
1292
1293         * typemanager.cs (GetElementType): New method which does the right
1294         thing when compiling corlib. 
1295
1296         * everywhere: Make use of the above in the relevant places.
1297
1298 2003-07-22  Martin Baulig  <martin@ximian.com>
1299
1300         * cs-parser.jay (invocation_expression): Moved
1301         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
1302         `cast_expression', but create a InvocationOrCast which later
1303         resolves to either an Invocation or a Cast.
1304
1305         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
1306         method; call this before EmitStatement() to make sure that this
1307         expression can be used as a statement.
1308
1309         * expression.cs (InvocationOrCast): New class; resolves to either
1310         an Invocation or a Cast.
1311
1312         * statement.cs (StatementExpression): Call ResolveStatement() on
1313         the ExpressionStatement before emitting it.
1314
1315 2003-07-21  Martin Baulig  <martin@ximian.com>
1316
1317         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
1318         `ref' and `out' attributes match; fixes #46220.
1319         (MemberAccess.ResolveMemberAccess): You can't reference a type
1320         through an expression; fixes #33180.
1321         (Indexers.GetIndexersForType): Don't return the indexers from
1322         interfaces the class implements; fixes #46502.
1323
1324 2003-07-21  Martin Baulig  <martin@ximian.com>
1325
1326         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
1327         CS0661 checks; fixes bug #30442.
1328
1329 2003-07-21  Martin Baulig  <martin@ximian.com>
1330
1331         * decl.cs (AdditionResult): Added `Error'.
1332
1333         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
1334
1335         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
1336         makes cs0031.cs actually work.
1337
1338 2003-07-20  Martin Baulig  <martin@ximian.com>
1339
1340         * namespace.cs: Fixed that bug which caused a crash when compiling
1341         the debugger's GUI.
1342
1343 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
1344
1345         * typemanager.cs (LookupTypeReflection): Never expose types which
1346         are NotPublic, NestedPrivate, NestedAssembly, or
1347         NestedFamANDAssem.  We used to return these, and later do a check
1348         that would report a meaningful error, but the problem is that we
1349         would not get the real match, if there was a name override.
1350
1351 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
1352
1353         * namespace.cs (Namespace, Name): Do not compute the namespace
1354         name dynamically, compute it in the constructor.  This reduced
1355         memory usage by 1697 KB.
1356
1357         * driver.cs: Use --pause to pause at the end.
1358
1359 2003-07-17  Peter Williams  <peter@newton.cx>
1360
1361         * Makefile: Change the name of the test target so that it doesn't
1362         conflict with the recursive test target.
1363
1364 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
1365
1366         * expression.cs (LocalVariableReference.Emit, EmitAssign,
1367         AddressOf): Do not use EmitThis, that was wrong, use the actual
1368         this pointer.
1369
1370 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
1371
1372         * class.cs (MethodData.Define): While checking if a method is an
1373         interface implementation, improve the test: If we are not public
1374         (use new test here: use the computed MethodAttributes directly,
1375         instead of the parsed modifier flags) check if the `implementing'
1376         method comes from an interface or not.
1377
1378         * pending.cs (VerifyPendingMethods): Slightly better error
1379         message.
1380
1381         * makefile: add test target that does the mcs bootstrap.
1382
1383 2003-07-16  Ravi Pratap  <ravi@ximian.com>
1384
1385         * interface.cs (Define): Do nothing here since there are no
1386         members to populate etc. Move the attribute emission out of here
1387         since this was just totally the wrong place to put it. Attribute
1388         application happens during the 'Emit' phase, not in the 'Define'
1389         phase.
1390
1391         (Emit): Add this method and move the attribute emission here
1392
1393         * rootcontext.cs (EmitCode): Call the Emit method on interface
1394         types too.
1395
1396 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
1397
1398         * expression.cs (OverloadResolve): Report error only if Location
1399         is not 'Null' which means that there was a probe going on.
1400
1401 2003-07-14  Martin Baulig  <martin@ximian.com>
1402
1403         * expression.cs (ConditionalLogicalOperator): New public class to
1404         implement user defined conditional logical operators.
1405         This is section 14.11.2 in the spec and bug #40505.
1406
1407 2003-07-14  Martin Baulig  <martin@ximian.com>
1408
1409         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
1410
1411 2003-07-14  Martin Baulig  <martin@ximian.com>
1412
1413         * codegen.cs (EmitContext.InFixedInitializer): New public field.
1414
1415         * ecore.cs (IVariable.VerifyFixed): New interface method.
1416
1417         * expression.cs (Unary.ResolveOperator): When resolving the `&'
1418         operator, check whether the variable is actually fixed.  Fixes bug
1419         #36055.  Set a variable definitely assigned when taking its
1420         address as required by the spec.
1421
1422         * statement.cs (LocalInfo.IsFixed): New field.
1423         (LocalInfo.MakePinned): Set `IsFixed' to true.
1424
1425 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
1426
1427         * attribute.cs (Attribute.Resolve): While doing a Member lookup
1428         for .ctors, ensure that we only ask for members declared in the
1429         attribute type (BindingFlags.DeclaredOnly).
1430
1431         Fixes bug #43632.
1432
1433         * expression.cs (Error_WrongNumArguments): Report error 1501
1434         correctly the way CSC does.
1435
1436 2003-07-13  Martin Baulig  <martin@ximian.com>
1437
1438         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
1439         lookup on the fully qualified name, to make things like "X.X" work
1440         where "X.X" is a fully qualified type name, but we also have a
1441         namespace "X" in the using list.  Fixes #41975.
1442
1443 2003-07-13  Martin Baulig  <martin@ximian.com>
1444
1445         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
1446         function. If we're a CompoundAssign, we need to create an embedded
1447         CompoundAssign, not an embedded Assign.
1448         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
1449         Fixes #45854.
1450
1451 2003-07-13  Martin Baulig  <martin@ximian.com>
1452
1453         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
1454         work to fix bug #46088.
1455
1456 2003-07-13  Ravi Pratap <ravi@ximian.com>
1457
1458         * class.cs (Operator.Emit): Do not emit attributes here - it is
1459         taken care of by the Method class that we delegate too. This takes
1460         care of bug #45876.
1461         
1462 2003-07-10  Martin Baulig  <martin@ximian.com>
1463
1464         * expression.cs (TypeOfVoid): New class.
1465         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
1466
1467 2003-07-10  Martin Baulig  <martin@ximian.com>
1468
1469         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
1470         bug #35957.
1471
1472 2003-07-10  Martin Baulig  <martin@ximian.com>
1473
1474         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
1475         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
1476
1477         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
1478
1479         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
1480
1481 2003-07-10  Martin Baulig  <martin@ximian.com>
1482
1483         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
1484         of decimal.  Fixes #42850.
1485
1486         NOTE: I also fixed the created byte blob, but this doesn't work on
1487         the MS runtime and csc never produces any byte blobs for decimal
1488         arrays.
1489
1490 2003-07-10  Martin Baulig  <martin@ximian.com>
1491
1492         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
1493         structs; fixes #32068.
1494         (Block.AddChildVariableNames): Fixed #44302.
1495
1496 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1497
1498         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
1499         
1500 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
1501
1502         * attribute.cs: And this test is onger needed.
1503
1504 2003-07-08  Martin Baulig  <martin@ximian.com>
1505
1506         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
1507         inaccessible types.  Fixes #36313.
1508
1509         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
1510
1511         * namespace.cs (NamespaceEntry): Create implicit entries for all
1512         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
1513         implicit entries for N1.N2 and N1.
1514
1515 2003-07-08  Martin Baulig  <martin@ximian.com>
1516
1517         Rewrote the handling of namespaces to fix a lot of the issues
1518         wrt. `using' aliases etc.
1519
1520         * namespace.cs (Namespace): Splitted this class into a
1521         per-assembly `Namespace' and a per-file `NamespaceEntry'.
1522
1523         * typemanager.cs (TypeManager.IsNamespace): Removed.
1524         (TypeManager.ComputeNamespaces): Only compute namespaces from
1525         loaded assemblies here, not the namespaces from the assembly we're
1526         currently compiling.
1527
1528 2003-07-08  Martin Baulig  <martin@ximian.com>
1529
1530         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
1531
1532 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
1533
1534         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
1535         already fixed it.  
1536
1537         I thought about the memory savings here, but LookupTypeReflection
1538         is used under already very constrained scenarios.  Compiling
1539         corlib or mcs only exposes one hit, so it would not really reduce
1540         any memory consumption.
1541
1542 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1543
1544         * typemanager.cs: fixes bug #45889 by only adding public types from
1545         other assemblies to the list of known types.
1546
1547 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
1548
1549         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
1550         on the type we resolved.
1551
1552 2003-07-05  Martin Baulig  <martin@ximian.com>
1553
1554         * pending.cs (PendingImplementation.ParentImplements): Don't
1555         create the proxy if the parent is abstract.
1556
1557         * class.cs (TypeContainer.DefineIndexers): Process explicit
1558         interface implementations first.  Fixes #37714.
1559
1560 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
1561
1562         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
1563         defined recursively;  but since we modify the input parameters
1564         (left is set to `this' temporarily), we reset this value if the
1565         left_is_explicit is false, which gives the original semantics to
1566         the code.  
1567
1568         * literal.cs (NullPointer): new class used to represent a null
1569         literal in a pointer context.
1570
1571         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
1572         type is a pointer, use a NullPointer object instead of a
1573         NullLiteral.   Closes 43687
1574
1575         (ExplicitConversion): Convert pointer values using
1576         the conv opcode to the proper type.
1577
1578         * ecore.cs (New): change ValueTypeVariable property into a method,
1579         that returns whether the valuetype is suitable for being used.
1580
1581         * expression.cs (Binary.DoNumericPromotions): Only return if we
1582         the int constant was a valid uint, and we can return both left and
1583         right as uints.  If not, we continue processing, to trigger the
1584         type conversion.  This fixes 39018.
1585
1586         * statement.cs (Block.EmitMeta): During constant resolution, set
1587         the CurrentBlock property on the emitcontext, so that we resolve
1588         constants propertly.
1589
1590 2003-07-02  Martin Baulig  <martin@ximian.com>
1591
1592         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
1593         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
1594
1595         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
1596         than emitting it here.
1597
1598         * statement.cs: Fixed some more flow analysis bugs.
1599
1600 2003-07-02  Martin Baulig  <martin@ximian.com>
1601
1602         * class.cs (MethodData.Define): When implementing interface
1603         methods, set Final unless we're Virtual.
1604
1605         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
1606         check work for interface methods.
1607
1608 2003-07-01  Martin Baulig  <martin@ximian.com>
1609
1610         * ecore.cs (EmitContext.This): Replaced this property with a
1611         GetThis() method which takes a Location argument.  This ensures
1612         that we get the correct error location for a CS0188.
1613
1614 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
1615
1616         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
1617         ImplicitStandardConversion.
1618
1619         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
1620
1621 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
1622
1623         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
1624         optimization.
1625
1626 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
1627
1628         * class.cs (Constructor.Define): Turn off initlocals for unsafe
1629         constructors.
1630
1631         (MethodData.Define): Turn off initlocals for unsafe methods.
1632
1633 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
1634
1635         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
1636         complete;  Fixes #37521.
1637
1638         * delegate.cs: Use Modifiers.TypeAttr to compute the
1639         TypeAttributes, instead of rolling our own.  This makes the flags
1640         correct for the delegates.
1641
1642 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
1643
1644         * class.cs (Constructor.Define): Set the private flag for static
1645         constructors as well.
1646
1647         * cs-parser.jay (statement_expression): Set the return value to
1648         null, to avoid a crash when we catch an error.
1649
1650 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
1651
1652         * cs-parser.jay: Applied patch from Jackson that adds support for
1653         extern and unsafe modifiers to destructor declarations.
1654
1655         * expression.cs: Report error 21 if the user is trying to index a
1656         System.Array.
1657
1658         * driver.cs: Add an error message, suggested by the bug report.
1659
1660         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
1661         if we do not have a ": this ()" constructor initializer.  Fixes 45149
1662
1663 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
1664
1665         * namespace.cs: Add some information to reduce FAQs.
1666
1667 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
1668
1669         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
1670         underlying enumeration types.  Fixes #43915.
1671
1672         * expression.cs: Treat ushort/short as legal values to be used in
1673         bitwise operations.
1674
1675 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
1676
1677         * delegate.cs: transfer custom attributes for paramenters from
1678         the delegate declaration to Invoke and BeginInvoke.
1679
1680 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
1681
1682         * attribute.cs: handle custom marshalers and emit marshal info
1683         for fields, too.
1684
1685 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
1686
1687         * makefile.gnu: Added anonymous.cs to the compiler sources.
1688
1689 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
1690
1691         * iterators.cs: Change the name of the proxy class to include two
1692         underscores.
1693
1694         * cs-parser.jay: Update grammar to include anonymous methods.
1695         
1696         * anonymous.cs: new file.
1697
1698 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
1699
1700         * class.cs (Field.Define): Add missing test for pointers and
1701         safety. 
1702
1703 2003-05-27  Ravi Pratap  <ravi@ximian.com>
1704
1705         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
1706         we use the stobj opcode.
1707
1708         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
1709         since it wasn't the correct fix. 
1710
1711         It still is puzzling that we are required to use stobj for IntPtr
1712         which seems to be a ValueType.
1713
1714 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
1715
1716         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
1717         during regular simple name resolution.   Now, the trick is that
1718         instead of returning for processing the simplename, we do a
1719         TypeManager.LookupType (ie, a rooted lookup as opposed to a
1720         contextual lookup type).   If a match is found, return that, if
1721         not, return for further composition.
1722
1723         This fixes long-standing 30485.
1724
1725         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
1726         using the address to initialize an object, do an Stobj instead of
1727         using the regular Stelem.
1728
1729         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
1730         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
1731         Because if we are a BaseIndexerAccess that value will be true.
1732         Fixes 43643.
1733
1734         * statement.cs (GotoCase.Resolve): Return after reporting an
1735         error, do not attempt to continue. 
1736
1737         * expression.cs (PointerArithmetic.Emit): If our operand is a
1738         long, convert our constants to match the operand before
1739         multiplying.  Convert to I type before adding.   Fixes 43670.
1740         
1741 2003-05-14  Ravi Pratap  <ravi@ximian.com>
1742
1743         * enum.cs (ImplicitConversionExists) : Rename to
1744         ImplicitEnumConversionExists to remove ambiguity. 
1745
1746         * ecore.cs (NullCast): New type of cast expression class which
1747         basically is very similar to EmptyCast with the difference being
1748         it still is a constant since it is used only to cast a null to
1749         something else
1750         (eg. (string) null)
1751
1752         * convert.cs (ImplicitReferenceConversion): When casting a null
1753         literal, we return a NullCast.
1754
1755         * literal.cs (NullLiteralTyped): Remove - I don't see why this
1756         should be around anymore.
1757
1758         The renaming (reported was slightly wrong). Corrections:
1759
1760         ConvertImplicitStandard -> ImplicitConversionStandard
1761         ConvertExplicitStandard -> ExplicitConversionStandard
1762
1763         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
1764         before passing them in !
1765
1766         * convert.cs (ImplicitConversionStandard): When comparing for
1767         equal expr and target types, ensure that expr is not a
1768         NullLiteral.
1769
1770         In general, we must not be checking (expr_type ==
1771         target_type) in the top level conversion methods
1772         (ImplicitConversion, ExplicitConversion etc). This checking is
1773         done in the methods that they delegate to.
1774
1775 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
1776
1777         * convert.cs: Move Error_CannotConvertType,
1778         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
1779         ImplicitNumericConversion, ImplicitConversionExists,
1780         ImplicitUserConversionExists, StandardConversionExists,
1781         FindMostEncompassedType, FindMostSpecificSource,
1782         FindMostSpecificTarget, ImplicitUserConversion,
1783         ExplicitUserConversion, GetConversionOperators,
1784         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
1785         TryImplicitIntConversion, Error_CannotConvertImplicit,
1786         ConvertImplicitRequired, ConvertNumericExplicit,
1787         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
1788         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
1789         its own file.
1790
1791         Perform the following renames:
1792         
1793         StandardConversionExists -> ImplicitStandardConversionExists
1794         ConvertImplicit -> ImplicitConversion
1795         ConvertImplicitStandard -> ImplicitStandardConversion
1796         TryImplicitIntConversion -> ImplicitIntConversion
1797         ConvertImplicitRequired -> ImplicitConversionRequired
1798         ConvertNumericExplicit -> ExplicitNumericConversion
1799         ConvertReferenceExplicit -> ExplicitReferenceConversion
1800         ConvertExplicit -> ExplicitConversion
1801         ConvertExplicitStandard -> ExplicitStandardConversion
1802
1803 2003-05-19  Martin Baulig  <martin@ximian.com>
1804
1805         * statement.cs (TypeInfo.StructInfo): Made this type protected.
1806         (TypeInfo): Added support for structs having structs as fields.
1807
1808         * ecore.cs (FieldExpr): Implement IVariable.
1809         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
1810         VariableInfo for the field.
1811
1812 2003-05-18  Martin Baulig  <martin@ximian.com>
1813
1814         * expression.cs (This.DoResolve): Report a CS0027 if we're
1815         emitting a field initializer.
1816
1817 2003-05-18  Martin Baulig  <martin@ximian.com>
1818
1819         * expression.cs (This.ResolveBase): New public function.
1820         (This.DoResolve): Check for CS0188.
1821
1822         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
1823         This.Resolve().
1824
1825         * ecore.cs (MethodGroupExpr.DoResolve): Set the
1826         `instance_expression' to null if we don't have any non-static
1827         methods.
1828
1829 2003-05-18  Martin Baulig  <martin@ximian.com>
1830
1831         Reworked the way how local variables and parameters are handled by
1832         the flow analysis code.
1833
1834         * statement.cs (TypeInfo, VariableMap): New public classes.
1835         (VariableInfo): New public class.  This is now responsible for
1836         checking whether a variable has been assigned.  It is used for
1837         parameters and local variables.
1838         (Block.EmitMeta): Take the InternalParameters as argument; compute
1839         the layout of the flow vectors here.
1840         (Block.LocalMap, Block.ParameterMap): New public properties.
1841         (FlowBranching): The .ctor doesn't get the InternalParameters
1842         anymore since Block.EmitMeta() now computes the layout of the flow
1843         vector.
1844         (MyStructInfo): This class is now known as `StructInfo' and nested
1845         in `TypeInfo'; we don't access this directly anymore.
1846
1847         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
1848         property and removed IsAssigned(), IsFieldAssigned(),
1849         SetAssigned() and SetFieldAssigned(); we now call them on the
1850         VariableInfo so we don't need to duplicate this code everywhere.
1851
1852         * expression.cs (ParameterReference): Added `Block block' argument
1853         to the .ctor.
1854         (LocalVariableReference, ParameterReference, This): The new
1855         VariableInfo class is now responsible for all the definite
1856         assignment stuff.
1857
1858         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
1859         IsParameterAssigned, SetParameterAssigned): Removed.
1860
1861 2003-05-18  Martin Baulig  <martin@ximian.com>
1862
1863         * typemanager.cs (InitCoreTypes): Try calling
1864         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
1865         the 3-args-version.  Corlib now also needs our `void_type'.
1866         (GetMethod): Added overloaded version which takes an optional
1867         `bool report_errors' to allow lookups of optional methods.
1868
1869 2003-05-12  Martin Baulig  <martin@ximian.com>
1870
1871         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
1872         only used for locals and not for parameters.
1873
1874 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
1875
1876         * support.cs (InternalParameters.ParameterType): Return the
1877         ExternalType of the parameter.
1878
1879         * parameter.cs (Parameter.ExternalType): drop the two arguments,
1880         they were unused.
1881
1882 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
1883
1884         * class.cs (MethodData.Define): Do not set the `newslot' on
1885         interface members, if they are also flagged as "override".
1886
1887         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
1888         better code for ++i and i++.  This only works for static fields
1889         and local variables.
1890
1891         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
1892         want to pull the DeclSpace out of the builder_to_declspace instead
1893         of the TypeBuilder (like in TypeContainer.FindMembers).
1894
1895         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
1896         instead of LookupTypeContainer.  Fixes the crash on .NET for
1897         looking up interface members.
1898
1899         * const.cs: Create our own emit context during the Definition
1900         stage, so that constants are evaluated in the proper context, when
1901         a recursive definition happens.
1902
1903 2003-05-11  Martin Baulig  <martin@ximian.com>
1904
1905         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
1906         new block for a switch section.
1907         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
1908         the adding/lookup in the switch block.  Fixes #39828.
1909
1910 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
1911
1912         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
1913         functionality: I needed to convert the data after I had performed
1914         the add/sub operation into the operands type size.
1915
1916         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
1917         pass the type for the box operation, otherwise the resulting
1918         object would have been of type object.
1919
1920         (BoxedCast): Add constructor to specify the type to box as.
1921
1922 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
1923
1924         * iterators.cs: I was reusing the `count' variable inadvertently,
1925         take steps to not allow this to happen.
1926
1927 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
1928
1929         * attribute.cs (Attribute.Resolve): Params attributes are encoded
1930         by creating an array at the point where the params starts and
1931         putting all those arguments there, then adjusting the size of the
1932         array.
1933
1934 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
1935
1936         * expression.cs (New.AddressOf): Implement interface
1937         IMemoryLocation.  This is used when the `new' operator is used in
1938         the context of an invocation to a method on a value type.
1939
1940         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
1941         example. 
1942
1943         * namespace.cs: Also check the using aliases here.
1944
1945         * driver.cs: Move the test for using validity after the types have
1946         been entered, so we do a single pass that also includes the using
1947         aliases. 
1948
1949         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
1950         in the regular case.   CreateSiblingForFinally is doing extra
1951         error checking.
1952
1953         * attribute.cs (GetAttributeArgumentExpression): Store the result
1954         on an out value, and use the return value to indicate failure
1955         instead of using null (which is a valid return for Constant.GetValue).
1956
1957         * statement.cs: Perform the analysis flow for the increment
1958         portion after the statement, because this will be the real flow of
1959         execution.  Fixes #42385
1960
1961         * codegen.cs (EmitContext.EmitArgument,
1962         EmitContext.EmitStoreArgument): New helper functions when the
1963         RemapToProxy flag is set.
1964
1965         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
1966         function.
1967
1968         Add support for remapping parameters. 
1969
1970         * iterators.cs: Propagate parameter values;  Store parameter
1971         values in the proxy classes.
1972         
1973 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
1974
1975         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
1976         need a proxy reference;  I do not know what I was thinking
1977
1978         * cs-parser.jay (constructor_initializer): catch another error,
1979         and display nice message.
1980         
1981         (field_declaration): catch void field declaration
1982         to flag a better error. 
1983
1984         * class.cs (MemberBase.CheckBase): Report an error instead of a
1985         warning if a new protected member is declared in a struct. 
1986         (Field.Define): catch the error of readonly/volatile.
1987
1988         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
1989
1990         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
1991         volatile variable is taken
1992
1993 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
1994
1995         * statement.cs (Fixed.Resolve): Report an error if we are not in
1996         an unsafe context.
1997
1998 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
1999
2000         * typemanager.cs: reuse the code that handles type clashes for
2001         delegates and enumerations.
2002
2003         * class.cs (Report28): Always report.
2004
2005         * expression.cs (EncodeAsAttribute): Allow nulls here.
2006
2007 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
2008
2009         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
2010         the functionality for testing whether an expression is valid for
2011         an attribute here.  Also handle the case of arrays of elements
2012         being stored. 
2013
2014         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
2015         encoding a linear array into an array of objects that are suitable
2016         to be passed to an CustomAttributeBuilder.
2017
2018         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
2019
2020         * ecore.cs: (FieldExpr): Handle field remapping here.
2021
2022         * iteratators.cs: Pass the instance variable (if the method is an
2023         instance method) to the constructors, so we can access the field
2024         variables on the class.
2025
2026         TODO: Test this with structs.  I think the THIS variable on
2027         structs might have to be a pointer, and not a refenrece
2028
2029 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
2030
2031         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
2032         local variables to fields in a proxy class.
2033
2034         * iterators.cs (PopulateProxy): Rename our internal fields to
2035         <XXX>.  
2036         Create a <THIS> field if we are an instance method, so we can
2037         reference our parent container variables.
2038         (MapVariable): Called back from the EmitContext code to enter a
2039         new variable to field mapping into the proxy class (we just create
2040         a FieldBuilder).
2041
2042         * expression.cs
2043         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
2044         for using the remapped locals to fields.
2045
2046         I placed the code here, because that gives the same semantics to
2047         local variables, and only changes the Emit code.
2048
2049         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
2050         statements inside iterators.
2051         (VariableInfo): Add a FieldBuilder for the cases when we are
2052         remapping local variables to fields in a proxy class
2053
2054         * ecore.cs (SimpleNameResolve): Avoid testing two times for
2055         current_block != null.
2056
2057         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
2058         not cope with strings, as it has been moved to the
2059         TableSwitchEmit.  Fixed bug in switch generation.
2060
2061         * expression.cs (New.DoResolve): Provide more context for the user
2062         when reporting an error.
2063
2064         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
2065         pointers. 
2066
2067         * expression.cs (MemberAccess.DoResolve): When we get a type back,
2068         check the permissions for it.  Note than in a type-resolution
2069         context the check was already present in DeclSpace.ResolveType,
2070         but was missing from the MemberAccess.
2071
2072         (ArrayCreation.CheckIndices): warn if the user has
2073         more nested levels of expressions, but there are no more
2074         dimensions specified.  Avoids crash on bug 41906.
2075
2076 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
2077
2078         * statement.cs (Block): replace Implicit bool, for a generic
2079         flags.   
2080         New flag: `Unchecked'.  This is used during the EmitMeta phase
2081         (which is out-of-line with the regular Resolve/Emit process for a
2082         statement, as this is done ahead of time, but still gets a chance
2083         to call constant resolve).
2084         
2085         (Block.Flags): new enum for adding a new flag.
2086
2087         (Block.EmitMeta): track the state of unchecked.
2088         
2089         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
2090         to enable constant resolution to work there as well.
2091
2092 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
2093
2094         * typemanager.cs (ienumerable_type): Also look up
2095         System.Collections.IEnumerable. 
2096
2097 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
2098
2099         TODO: Test more than one conditional per method.
2100         
2101         * class.cs (Indexer.Define): Report the location where the user is
2102         referencing the unsupported feature.
2103
2104         (MethodData): Overload the use of `conditionals' to
2105         minimize the creation of needless ArrayLists.   This saves roughly
2106         212kb on my machine.
2107
2108         (Method): Implement the new IIteratorContainer interface.
2109         (Method.SetYields): Implement the method by setting the ModFlags
2110         to contain METHOD_YIELDS.
2111         
2112         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
2113         which just got set to null.
2114
2115         * iterators.cs: New file.
2116
2117         (Yield, YieldBreak): New statements.
2118
2119         * statement.cs (Return.Resolve): Flag an error if we are used in
2120         an iterator method.
2121
2122         * codegen.cs (InIterator): New flag set if the code is being
2123         compiled in an iterator method.
2124
2125         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
2126         internal modifier, and we just use it to avoid adding extra
2127         fields, as this is seldom used.  
2128
2129         * cs-parser.jay: Add yield_statement (yield and yield break).
2130
2131         * driver.cs: New flag -v2 to turn on version 2 features. 
2132
2133         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
2134         hashtable when v2 is enabled.
2135
2136 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
2137
2138         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
2139         there is already a namespace defined with this name.
2140
2141         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
2142         people upgraded their corlibs.
2143
2144         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
2145         always use fully qualified types, no need to use the compiler
2146         front end.
2147
2148         (TypeManager.IsNamespace): Use binarysearch.
2149         
2150         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
2151         AddDelegate): I did not quite use the new IsValid API properly: I
2152         have to pass the short-name and the fullname.  I was passing only
2153         the basename instead of the fullname sometimes. 
2154
2155         (TypeContainer.DefineType): call NamespaceClash.
2156
2157         * interface.cs (Interface.DefineType): use NamespaceClash before
2158         defining the type.
2159
2160         * delegate.cs (Delegate.DefineType): use NamespaceClash before
2161         defining the type.
2162
2163         * enum.cs: (Enum.DefineType): use NamespaceClash before
2164         defining the type.
2165
2166         * typemanager.cs (: 3-line patch that gives us some tasty 11%
2167         speed increase.  First, use the negative_hits cache when we get a
2168         negative.  Second, add the type with its full original name
2169         instead of the new . and + encoded name (reflection uses + to
2170         separate type from a nested type).  Use LookupTypeReflection
2171         directly which bypasses the type->name hashtable (that we already
2172         know does not contain the type.
2173         
2174         * decl.cs (DeclSpace.ResolveTypeExpr): track the
2175         location/container type. 
2176
2177         * driver.cs: When passing utf8, use directly the UTF8Encoding.
2178
2179 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
2180
2181         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
2182
2183         * delegate.cs (NewDelegate.Resolve): Test whether an instance
2184         method is being referenced in the method group from a static
2185         context, and report error 120 if so.
2186
2187         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
2188         Error118. 
2189
2190         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
2191         is created, we create the A namespace).
2192
2193         * cs-parser.jay: A namespace also introduces a DeclarationFound.
2194         Fixes #41591
2195
2196 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
2197
2198         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
2199         invocation to ModuleBuilder.GetType with the same values will
2200         return a new type instance, so we need to cache its return
2201         values. 
2202
2203         * expression.cs (Binary.ResolveOperator): Only allow the compare
2204         operators on enums if they are of the same type.
2205
2206         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
2207         types of ValueType on their own case.  Before we were giving them
2208         the same treatment as objects.
2209
2210         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
2211         fullname.  Short name is used to compare against container name.
2212         Fullname is used to check against defined namespace names.
2213         
2214         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
2215         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
2216
2217         (Method.CheckBase): Call parent.
2218         (MemberBase.CheckBase): Check for protected members on sealed
2219         classes.
2220         (PropertyBase.CheckBase): Call parent.
2221         (Field.Define): Call parent.
2222
2223         * report.cs: Negative error codes are now mapped to 8000 - code,
2224         so that the display is render more nicely.
2225
2226         * typemanager.cs: Do not use try/catch, instead report a regular
2227         error. 
2228
2229         (GetPointerType, GetReferenceType): These methods provide
2230         mechanisms to obtain the T* and T& from a T.  We had the code
2231         previously scattered around the code base, and it also used
2232         TypeManager.LookupType that would go through plenty of caches.
2233         This one goes directly to the type source.
2234
2235         In some places we did the Type.GetType followed by
2236         ModuleBuilder.GetType, but not in others, so this unifies the
2237         processing as well.
2238
2239         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
2240         statements now that we have namespace information.
2241
2242         * typemanager.cs (IsNamespace): New method, returns whether the
2243         string presented is a namespace or not.
2244
2245         (ComputeNamespaces): New public entry point, computes the list of
2246         available namespaces, using the GetNamespaces API call in Mono, or
2247         the slower version in MS.NET.   
2248
2249         Now before we start the semantic analysis phase, we have a
2250         complete list of namespaces including everything that the user has
2251         provided.
2252
2253         Deleted old code to cache namespaces in .nsc files.
2254
2255 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
2256
2257         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
2258         class/struct location definition Location for the implicit
2259         constructor location.
2260
2261         (Operator.Define): Use the location of the operator for the
2262         implicit Method definition.
2263
2264         (Constructor.Emit): use the constructor location for the implicit
2265         base initializer constructor.
2266
2267         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
2268         and the Expression class now contains two new methods:
2269
2270         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
2271         isolate type lookup from the rest of the resolution process.
2272
2273         Since we use Expressions to hold type definitions due to the way
2274         we parse the input we have historically overloaded Resolve to
2275         perform the Type lookups if a special flag is passed.  Now this is
2276         eliminated and two methods take their place. 
2277         
2278         The differences in the two methods between xStep and xTerminal is
2279         that xStep is involved in our current lookup system that uses
2280         SimpleNames to compose a name, while xTerminal is used just to
2281         catch the case where the simplename lookup failed.
2282         
2283 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
2284
2285         * expression.cs (ResolveMemberAccess): Remove redundant code.
2286         TypeExpr expressions are always born fully resolved.
2287
2288         * interface.cs (PopulateMethod): Do not lookup the types twice.
2289         We were doing it once during SemanticAnalysis and once during
2290         PopulateMethod.
2291
2292         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
2293         in local variable type definitions, were being returned as a
2294         SimpleName (we decomposed everything into a string), that is
2295         because primary_expression was being used instead of a type in the
2296         grammar (reduce/reduce conflicts).
2297
2298         The part that was wrong is that we converted the expression into a
2299         string (an oversimplification in one hand, compounded with primary
2300         expressions doing string concatenation).
2301
2302         So things like:
2303
2304         A.B.C [] x;
2305
2306         Would return "A.B.C[]" as a SimpleName.  This stopped things like
2307         using clauses from working on this particular context.  And a type
2308         was being matched directly against "A.B.C[]".
2309
2310         We now use the correct approach, and allow for ComposedCast to be
2311         part of the unary expression.  So the "A.B.C []" become a composed
2312         cast of "A.B.C" (as a nested group of MemberAccess with a
2313         SimpleName at the end) plus the rank composition "[]". 
2314
2315         Also fixes 35567
2316         
2317 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
2318
2319         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
2320         for the access level checking.
2321
2322         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
2323         `TypeContainer container', because I kept getting confused when I
2324         was debugging this code.
2325
2326         * expression.cs (Indexers): Instead of tracking getters/setters,
2327         we now track them in parallel.  We create one arraylist less, but
2328         most importantly it is possible now for the LValue code to find a
2329         matching get for a set.
2330
2331         (IndexerAccess.DoResolveLValue): Update the code.
2332         GetIndexersForType has been modified already to extract all the
2333         indexers from a type.  The code assumed it did not.
2334
2335         Also make the code set the correct return type for the indexer.
2336         This was fixed a long time ago for properties, but was missing for
2337         indexers.  It used to be void_type.
2338
2339         (Binary.Emit): Test first for doubles instead of
2340         floats, as they are more common.
2341
2342         (Binary.EmitBranchable): Use the .un version of the branch opcodes
2343         when dealing with floats and the <=, >= operators.  This fixes bug
2344         #39314 
2345
2346         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
2347         to load the array value by emitting a load on the foreach variable
2348         type.  This was incorrect.  
2349
2350         We now emit the code to load an element using the the array
2351         variable type, and then we emit the conversion operator.
2352
2353         Fixed #40176
2354
2355 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
2356
2357         * attribute.cs: Avoid allocation of ArrayLists in the common case.
2358
2359 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
2360
2361         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
2362         test for protection before we test for signatures. 
2363
2364         (MethodSignature.ToString): implement.
2365
2366         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
2367         to the case where we reduced into a LongConstant.
2368
2369         * decl.cs (CheckAccessLevel): If the type is an array, we can not
2370         depend on whether the information is acurrate, because the
2371         Microsoft runtime will always claim that the array type is public,
2372         regardless of the real state.
2373
2374         If the type is a pointer, another problem happens: the type is
2375         reported as non-public in Microsoft.  
2376
2377         In both cases we have to call CheckAccessLevel recursively with
2378         the underlying type as the argument to be tested.
2379
2380 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
2381
2382         * assign.cs (Assign.Emit): If we are dealing with a compound
2383         assignment expression, we should use the code path that stores the
2384         intermediate result in a temporary value.  This fixes #40903.
2385
2386         *expression.cs (Indirection.ToString): Provide ToString method for
2387         debugging. 
2388         
2389 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
2390
2391         * class.cs: Null out fields holding references to Block objects so
2392         they can be garbage collected.
2393
2394         * expression.cs (OverloadResolve): Remove unused local.
2395
2396 2003-04-07  Martin Baulig  <martin@ximian.com>
2397
2398         * codegen.cs (EmitContext.CurrentFile): New public field.
2399         (EmitContext.Mark): Use the CurrentFile to check whether the
2400         location is in the correct file.
2401         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
2402
2403 2003-04-07  Martin Baulig  <martin@ximian.com>
2404
2405         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
2406
2407         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
2408         location.  [FIXME: The location argument which gets passed to this
2409         method is sometimes wrong!]
2410
2411 2003-04-07  Nick Drochak <ndrochak@gol.com>
2412
2413         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
2414
2415 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
2416
2417         * expression.cs (Indirection.EmitAssign): We were using the
2418         temporary, but returning immediately instead of continuing the
2419         EmitAssing flow.
2420
2421 2003-04-06  Martin Baulig  <martin@ximian.com>
2422
2423         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
2424         if it's a nested child, but also deriving from the outer class.
2425         See test 190.cs.
2426
2427         * typemanager.cs (IsNestedChildOf): Make this work if it's a
2428         nested child, but also deriving from the outer class.  See
2429         test-190.cs.
2430         (FilterWithClosure): We may access private members of the outer
2431         class if we're a nested child and deriving from the outer class.
2432         (RealMemberLookup): Only set `closure_private_ok' if the
2433         `original_bf' contained BindingFlags.NonPublic.
2434
2435 2003-04-05  Martin Baulig  <martin@ximian.com>
2436
2437         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
2438
2439 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
2440
2441         * class.cs (Event.Define): Do not allow abstract events to have
2442         initializers. 
2443
2444 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
2445
2446         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
2447         block in event declarations.
2448
2449         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
2450         value type, get its address.
2451
2452         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
2453         leaving a class on the stack instead of a boolean value (int
2454         0/1).  Change the code so we compare against null, and then the
2455         result against zero.
2456
2457         * class.cs (TypeContainer.GetClassBases): We were checking for the
2458         parent class being sealed too late.
2459
2460         * expression.cs (Binary.Emit): For <= and >= when dealing with
2461         floating point values, use cgt.un and clt.un instead of cgt and
2462         clt alone.
2463
2464 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
2465
2466         * statement.cs: Apply the same optimization as MS: skip the 
2467         GetEnumerator returning an IEnumerator, and use the one returning a 
2468         CharEnumerator instead. This allows us to avoid the try-finally block 
2469         and the boxing.
2470
2471 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
2472
2473         * cs-parser.jay: Attributes cannot be applied to
2474                          namespaces. Fixes #40473
2475
2476 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2477
2478         * class.cs:
2479         (Add*): check if the name is valid using the full name for constants,
2480         fields, properties and events.
2481
2482 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
2483
2484         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
2485         char constants to be part of the enumeration.
2486
2487         * expression.cs (Conditional.DoResolve): Add support for operator
2488         true. Implements the missing functionality from 14.12
2489
2490         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
2491         operator true/false as required by the spec.
2492
2493         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
2494         implicit conversion to boolean.
2495
2496         * statement.cs (Statement.ResolveBoolean): A boolean expression is
2497         also one where the type implements `operator true'. 
2498
2499         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
2500         get an expression that will invoke operator true based on an
2501         expression.  
2502
2503         (GetConversionOperators): Removed the hack that called op_True
2504         here.  
2505
2506         (Expression.ResolveBoolean): Move this from Statement.
2507
2508 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
2509
2510         * ecore.cs (FieldExpr): do not allow initialization of initonly
2511         fields on derived classes
2512
2513 2003-03-13  Martin Baulig  <martin@ximian.com>
2514
2515         * statement.cs (Block.Emit): Call ig.BeginScope() and
2516         ig.EndScope() when compiling with debugging info; call
2517         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
2518
2519 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
2520
2521         * expression.cs (Indexers): Do not construct immediately, allow
2522         for new members to be appended as we go.  Fixes 38143
2523
2524 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2525
2526         * expression.cs: save/restore context when resolving an unchecked
2527         expression.
2528
2529 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
2530
2531         * cfold.cs: Catch division by zero in modulus operator during
2532         constant folding.
2533
2534 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
2535
2536         * interface.cs (Interface.DefineMembers): Avoid defining members
2537         twice. 
2538
2539 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
2540
2541         * driver.cs: handle the +/- options for -noconfig
2542
2543         * statement.cs (Unckeched.Resolve): Also track the state of
2544         unchecked in the Resolve phase.
2545
2546 2003-02-27  Martin Baulig  <martin@ximian.com>
2547
2548         * ecore.cs (Expression.MemberLookup): Don't create a
2549         MethodGroupExpr for something which is not a method.  Fixes #38291.
2550
2551 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
2552
2553         * class.cs (MemberBase.CheckParameters): Also check that the type
2554         is unmanaged if it is a pointer.
2555
2556         * expression.cs (SizeOf.Resolve): Add location information.
2557
2558         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
2559         a managed type is declared.
2560
2561         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
2562         parameter modifiers as well.  Fixes bug 38606
2563
2564         * class.cs: Very sad.  Am backing out the speed up changes
2565         introduced by the ArrayList -> Array in the TypeContainer, as they
2566         were not actually that much faster, and introduced a bug (no error
2567         reports on duplicated methods).
2568
2569         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
2570         source first, this will guarantee that we have a valid expression
2571         before calling in lower levels functions that will require a
2572         resolved object.  Then use this original_source in the
2573         target.ResolveLValue instead of the original source that was
2574         passed to us.
2575
2576         Another change.  Use target.Resolve instead of LValueResolve.
2577         Although we are resolving for LValues, we will let the Assign code
2578         take care of that (it will be called again from Resolve).  This
2579         basically allows code like this:
2580
2581         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
2582         class Y { void A (X x) { x [0] += o; }
2583
2584         The problem was that the indexer was trying to resolve for
2585         set_Item (idx, object o) and never finding one.  The real set_Item
2586         was set_Item (idx, X).  By delaying the process we get the right
2587         semantics. 
2588
2589         Fixes bug 36505
2590         
2591 2003-02-23  Martin Baulig  <martin@ximian.com>
2592
2593         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
2594         while calling DoEmit ().
2595
2596         * codegen.cs (EmitContext.Mark): Don't mark locations in other
2597         source files; if you use the #line directive inside a method, the
2598         compiler stops emitting line numbers for the debugger until it
2599         reaches the end of the method or another #line directive which
2600         restores the original file.
2601
2602 2003-02-23  Martin Baulig  <martin@ximian.com>
2603
2604         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
2605
2606 2003-02-23  Martin Baulig  <martin@ximian.com>
2607
2608         * statement.cs (Block.AddChildVariableNames): We need to call this
2609         recursively, not just for our immediate children.
2610
2611 2003-02-23  Martin Baulig  <martin@ximian.com>
2612
2613         * class.cs (Event.Define): Always make the field private, like csc does.
2614
2615         * typemanager.cs (TypeManager.RealMemberLookup): Make events
2616         actually work, fixes bug #37521.
2617
2618 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
2619
2620         * delegate.cs: When creating the various temporary "Parameters"
2621         classes, make sure that we call the ComputeAndDefineParameterTypes
2622         on those new parameters (just like we do with the formal ones), to
2623         allow them to be resolved in the context of the DeclSpace.
2624
2625         This fixes the bug that Dick observed in Bugzilla #38530.
2626
2627 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
2628
2629         * expression.cs (ResolveMemberAccess): When resolving a constant,
2630         do not attempt to pull a constant if the value was not able to
2631         generate a valid constant.
2632
2633         * const.cs (LookupConstantValue): Do not report more errors than required.
2634
2635 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2636
2637         * expression.cs: fixes bug #38328.
2638
2639 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
2640
2641         * class.cs: Changed all the various members that can be part of a
2642         class from being an ArrayList to be an Array of the right type.
2643         During the DefineType type_list, interface_list, delegate_list and
2644         enum_list are turned into types, interfaces, delegates and enums
2645         arrays.  
2646
2647         And during the member population, indexer_list, event_list,
2648         constant_list, field_list, instance_constructor_list, method_list,
2649         operator_list and property_list are turned into their real arrays.
2650
2651         Although we could probably perform this operation earlier, for
2652         good error reporting we need to keep the lists and remove the
2653         lists for longer than required.
2654
2655         This optimization was triggered by Paolo profiling the compiler
2656         speed on the output of `gen-sample-program.pl' perl script. 
2657
2658         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
2659         not crash in methods like MemberLookupFailed that use this field.  
2660
2661         This problem arises when the compiler fails to resolve a type
2662         during interface type definition for example.
2663
2664 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
2665
2666         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
2667         inherit from System.Object, so we have to stop at null, not only
2668         when reaching System.Object.
2669
2670 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
2671
2672         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
2673         DeclaredOnly because the parent indexer might have had a different
2674         name, but did not loop until the top of the hierarchy was reached.
2675
2676         The problem this one fixes is 35492: when a class implemented an
2677         indexer from an interface, we were getting the interface method
2678         (which was abstract) and we were flagging an error (can not invoke
2679         abstract method).
2680
2681         This also keeps bug 33089 functioning, and test-148 functioning.
2682
2683         * typemanager.cs (IsSpecialMethod): The correct way of figuring
2684         out if a method is special is to see if it is declared in a
2685         property or event, or whether it is one of the predefined operator
2686         names.   This should fix correctly #36804.
2687
2688 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
2689
2690         The goal here is to remove the dependency on EmptyCast.Peel ().
2691         Killing it completely.
2692         
2693         The problem is that currently in a number of places where
2694         constants are expected, we have to "probe" for an EmptyCast, and
2695         Peel, which is not the correct thing to do, as this will be
2696         repetitive and will likely lead to errors. 
2697
2698         The idea is to remove any EmptyCasts that are used in casts that
2699         can be reduced to constants, so we only have to cope with
2700         constants. 
2701
2702         This bug hunt was triggered by Bug 37363 and the desire to remove
2703         the duplicate pattern where we were "peeling" emptycasts to check
2704         whether they were constants.  Now constants will always be
2705         constants.
2706         
2707         * ecore.cs: Use an enumconstant here instead of wrapping with
2708         EmptyCast.  
2709
2710         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
2711         throwing me off.  By handling this we can get rid of a few hacks.
2712         
2713         * statement.cs (Switch): Removed Peel() code.
2714
2715 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
2716
2717         * class.cs: Location information for error 508
2718
2719         * expression.cs (New.DoResolve): Add a guard against double
2720         resolution of an expression.  
2721
2722         The New DoResolve might be called twice when initializing field
2723         expressions (see EmitFieldInitializers, the call to
2724         GetInitializerExpression will perform a resolve on the expression,
2725         and later the assign will trigger another resolution
2726
2727         This leads to bugs (#37014)
2728
2729         * delegate.cs: The signature for EndInvoke should contain any ref
2730         or out parameters as well.  We were not doing this in the past. 
2731
2732         * class.cs (Field.Define): Do not overwrite the type definition
2733         inside the `volatile' group.  Turns out that volatile enumerations
2734         were changing the type here to perform a validity test, which
2735         broke conversions. 
2736
2737 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
2738
2739         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
2740         and structs, we do not want to load the instance variable
2741
2742         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
2743         enum_type has to be handled like an object reference (implicit
2744         conversions exists from this to object), but the regular IsClass
2745         and IsValueType tests will never return true for this one.
2746
2747         Also we use TypeManager.IsValueType instead of type.IsValueType,
2748         just for consistency with the rest of the code (this is only
2749         needed if we ever use the construct exposed by test-180.cs inside
2750         corlib, which we dont today).
2751
2752 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
2753
2754         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
2755         just InternalCall.
2756
2757 2003-02-09  Martin Baulig  <martin@ximian.com>
2758
2759         * namespace.cs (Namespace..ctor): Added SourceFile argument.
2760         (Namespace.DefineNamespaces): New static public method; this is
2761         called when we're compiling with debugging to add all namespaces
2762         to the symbol file.
2763
2764         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
2765         pass it to the Namespace's .ctor.
2766
2767         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
2768         and MethodBase arguments; pass the namespace ID to the symwriter;
2769         pass the MethodBase instead of the token to the symwriter.
2770         (SymbolWriter.DefineNamespace): New method to add a namespace to
2771         the symbol file.
2772
2773 2003-02-09  Martin Baulig  <martin@ximian.com>
2774
2775         * symbolwriter.cs: New file.  This is a wrapper around
2776         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
2777         methods here in near future.
2778
2779 2003-02-09  Martin Baulig  <martin@ximian.com>
2780
2781         * codegen.cs (EmitContext.Mark): Just pass the arguments to
2782         ILGenerator.MarkSequencePoint() which are actually used by the
2783         symbol writer.
2784
2785 2003-02-09  Martin Baulig  <martin@ximian.com>
2786
2787         * location.cs (SourceFile): New public sealed class.  This
2788         contains the name and an index which is used in the location's token.
2789         (Location): Reserve an appropriate number of bits in the token for
2790         the source file instead of walking over that list, this gives us a
2791         really huge performance improvement when compiling with debugging.
2792
2793         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
2794         `SourceFile' argument instead of a string.
2795         (Driver.ProcessFile): Add all the files via Location.AddFile(),
2796         but don't parse/tokenize here, we need to generate the list of all
2797         source files before we do that.
2798         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
2799         the files.
2800
2801         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
2802         instead of a string.
2803
2804         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
2805         of a string.
2806
2807 2003-02-09  Martin Baulig  <martin@ximian.com>
2808
2809         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
2810         filename on `#line default'.
2811
2812 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
2813
2814         * statement.cs: don't clear the pinned var when the fixed statement
2815         returns from the method (fixes bug#37752).
2816
2817 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
2818
2819         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
2820         to IsValueType.
2821
2822 2003-02-07  Martin Baulig  <martin@ximian.com>
2823
2824         * driver.cs: Removed the `--debug-args' command line argument.
2825
2826         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
2827         automatically by the AsssemblyBuilder.
2828         (CodeGen.InitializeSymbolWriter): We don't need to call any
2829         initialization function on the symbol writer anymore.  This method
2830         doesn't take any arguments.
2831
2832 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
2833
2834         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
2835         from referenced assemblies as well.
2836
2837 2003-02-02  Martin Baulig  <martin@ximian.com>
2838
2839         * class.cs (MethodData.Emit): Generate debugging info for external methods.
2840
2841 2003-02-02  Martin Baulig  <martin@ximian.com>
2842
2843         * class.cs (Constructor.Emit): Open the symbol writer before
2844         emitting the constructor initializer.
2845         (ConstructorInitializer.Emit): Call ec.Mark() to allow
2846         single-stepping through constructor initializers.
2847
2848 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
2849
2850         * class.cs: Handle error 549: do not allow virtual methods in
2851         sealed classes. 
2852
2853 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
2854
2855         * decl.cs: Check access levels when resolving types
2856         
2857 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
2858
2859         * statement.cs: Add parameters and locals set in catch blocks that might 
2860         return to set vector
2861
2862 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
2863
2864         * class.cs (Operator): Set the SpecialName flags for operators.
2865         
2866         * expression.cs (Invocation.DoResolve): Only block calls to
2867         accessors and operators on SpecialName methods.
2868
2869         (Cast.TryReduce): Handle conversions from char constants.
2870
2871
2872 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
2873
2874         * statement.cs: small memory and time optimization in FlowBranching.
2875         
2876 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
2877
2878         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
2879         problem that the last fix but in the other sid (Set).
2880
2881         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
2882         access when there is no indexer in the hierarchy.
2883         
2884 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
2885
2886         * class.cs: Combine some if statements.
2887
2888 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2889
2890         * driver.cs: fixed bug #37187.
2891
2892 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
2893
2894         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
2895         any indexer, it's needed to build a list with all the indexers in the
2896         hierarchy (AllGetters), else we have problems. Fixes #35653.
2897
2898 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
2899
2900         * class.cs (MethodData.Define): It is wrong for an interface
2901         implementation to be static in both cases: explicit and implicit.
2902         We were only handling this in one case.
2903
2904         Improve the if situation there to not have negations.
2905         
2906         * class.cs (Field.Define): Turns out that we do not need to check
2907         the unsafe bit on field definition, only on usage.  Remove the test.
2908
2909 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2910
2911         * driver.cs: use assembly.Location instead of Codebase (the latest
2912         patch made mcs fail when using MS assemblies).
2913
2914 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
2915
2916         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
2917         get the path to *corlib.dll.
2918
2919 2003-01-21  Nick Drochak <ndrochak@gol.com>
2920
2921         * cs-tokenizer.cs:
2922         * pending.cs:
2923         * typemanager.cs: Remove compiler warnings
2924
2925 2003-01-20  Duncan Mak  <duncan@ximian.com>
2926
2927         * AssemblyInfo.cs: Bump the version number to 0.19.
2928         
2929 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2930
2931         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
2932
2933 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
2934
2935         * class.cs (Constructor::Emit): Emit debugging info for constructors.
2936
2937 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
2938
2939         * cs-parser.jay: Small fix: we were not comparing the constructor
2940         name correctly.   Thanks to Zoltan for the initial pointer.
2941
2942 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
2943
2944         * cs-tokenizer.cs: Set file name when specified with #line
2945
2946 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
2947
2948         * cs-parser.jay: Only perform the constructor checks here if we
2949         are named like the class;  This will help provider a better
2950         error.  The constructor path is taken when a type definition is
2951         not found, but most likely the user forgot to add the type, so
2952         report that rather than the constructor error.
2953
2954 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
2955
2956         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
2957         allocations.
2958
2959 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
2960
2961         * cs-parser.jay: Add cleanup call.
2962
2963 2003-01-13  Duncan Mak  <duncan@ximian.com>
2964
2965         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
2966         consistent with other methods.
2967
2968 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
2969
2970         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
2971         
2972 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
2973
2974         * attribute.cs: only set GuidAttr to true when we have a
2975         GuidAttribute.
2976
2977 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2978
2979         * ecore.cs:
2980         * expression.cs:
2981         * typemanager.cs: fixes to allow mcs compile corlib with the new
2982         Type.IsSubclassOf fix.
2983
2984 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
2985
2986         * expression.cs (LocalVariableReference.DoResolve): Classify a
2987         constant as a value, not as a variable.   Also, set the type for
2988         the variable.
2989
2990         * cs-parser.jay (fixed_statement): take a type instead of a
2991         pointer_type, so we can produce a better error message later.
2992         
2993         * statement.cs (Fixed.Resolve): Flag types that are not pointers
2994         as an error.  
2995         
2996         (For.DoEmit): Make inifinite loops have a
2997         non-conditional branch back.
2998
2999         (Fixed.DoEmit): First populate the pinned variables, then emit the
3000         statement, then clear the variables.  Before I was emitting the
3001         code once for each fixed piece.
3002
3003
3004 2003-01-08  Martin Baulig  <martin@ximian.com>
3005
3006         * statement.cs (FlowBranching.MergeChild): A break in a
3007         SWITCH_SECTION does not leave a loop.  Fixes #36155.
3008
3009 2003-01-08  Martin Baulig  <martin@ximian.com>
3010
3011         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
3012         lives in the same number space than `param_map'.  Fixes #36154.
3013
3014 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
3015
3016         * cs-parser.jay (constructor_declaration): Set the
3017         Constructor.ModFlags before probing for it.  This makes the
3018         compiler report 514, 515 and 132 (the code was there, but got
3019         broken). 
3020
3021         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
3022         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
3023         (GotoCase.Resolve): Set `Returns' to ALWAYS.
3024
3025 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
3026
3027         * enum.cs: create the enum static fields using the enum type.
3028
3029 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
3030
3031         * class.cs: don't try to create the ParamBuilder for the return
3032         type if it's not needed (and handle it breaking for the ms runtime
3033         anyway).
3034
3035 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
3036
3037         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
3038
3039 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
3040
3041         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
3042         the command.   This showed up while compiling the JANET source
3043         code, which used \r as its only newline separator.
3044
3045 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
3046
3047         * class.cs (Method.Define): If we are an operator (because it
3048         reuses our code), then set the SpecialName and HideBySig.  #36128
3049
3050 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
3051
3052         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
3053         exception, report error 120 `object reference required'.
3054
3055         * driver.cs: Add --pause option, used during to measure the size
3056         of the process as it goes with --timestamp.
3057
3058         * expression.cs (Invocation.DoResolve): Do not allow methods with
3059         SpecialName to be invoked.
3060
3061 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
3062
3063         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
3064         number before adding it.
3065
3066 2002-12-21  Ravi Pratap  <ravi@ximian.com>
3067
3068         * ecore.cs (StandardImplicitConversion): When in an unsafe
3069         context, we allow conversion between void * to any other pointer
3070         type. This fixes bug #35973.
3071
3072 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
3073
3074         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
3075         is not thrown when extensionless outputs are used 
3076
3077 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3078
3079         * rootcontext.cs: fixed compilation of corlib.
3080
3081 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
3082
3083         * attribute.cs (Attributes.Contains): Add new method.
3084
3085         * class.cs (MethodCore.LabelParameters): if the parameter is an
3086         `out' parameter, check that no attribute `[In]' has been passed.
3087
3088         * enum.cs: Handle the `value__' name in an enumeration.
3089
3090 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
3091
3092         * decl.cs: Added special case to allow overrides on "protected
3093         internal" methods
3094         
3095 2002-12-18  Ravi Pratap  <ravi@ximian.com>
3096
3097         * attribute.cs (Attributes.AddAttributeSection): Rename to this
3098         since it makes much more sense.
3099
3100         (Attributes.ctor): Don't require a Location parameter.
3101         
3102         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
3103
3104         * attribute.cs (ApplyAttributes): Remove extra Location parameters
3105         since we already have that information per attribute.
3106
3107         * everywhere : make appropriate changes.
3108
3109         * class.cs (LabelParameters): Write the code which actually
3110         applies attributes to the return type. We can't do this on the MS
3111         .NET runtime so we flag a warning in the case an exception is
3112         thrown.
3113
3114 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
3115
3116         * const.cs: Handle implicit null conversions here too.
3117
3118 2002-12-17  Ravi Pratap  <ravi@ximian.com>
3119
3120         * class.cs (MethodCore.LabelParameters): Remove the extra
3121         Type [] parameter since it is completely unnecessary. Instead
3122         pass in the method's attributes so that we can extract
3123         the "return" attribute.
3124
3125 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
3126
3127         * cs-parser.jay (parse): Use Report.Error to flag errors instead
3128         of ignoring it and letting the compile continue.
3129
3130         * typemanager.cs (ChangeType): use an extra argument to return an
3131         error condition instead of throwing an exception.
3132
3133 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
3134
3135         * expression.cs (Unary.TryReduce): mimic the code for the regular
3136         code path.  Perform an implicit cast in the cases where we can
3137         implicitly convert to one of the integral types, and then reduce
3138         based on that constant.   This fixes bug #35483.
3139
3140 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3141
3142         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
3143
3144 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3145
3146         * namespace.cs: fixed bug #35489.
3147
3148 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
3149
3150         * class.cs: Remove some dead code.
3151
3152         * cs-parser.jay: Estimate the number of methods needed
3153         (RootContext.MethodCount);
3154
3155         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
3156         numbers instead of StringBuilders.
3157
3158         * support.cs (PtrHashtable): Add constructor with initial size;
3159         We can now reduce reallocations of the method table.
3160
3161 2002-12-10  Ravi Pratap  <ravi@ximian.com>
3162
3163         * attribute.cs (ApplyAttributes): Keep track of the emitted
3164         attributes on a per-target basis. This fixes bug #35413.
3165
3166 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
3167
3168         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
3169         default to the Windows 1252 encoding.
3170
3171         (UnixParseOption): Support version, thanks to Alp for the missing
3172         pointer. 
3173
3174         * AssemblyInfo.cs: Add nice assembly information.
3175
3176         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
3177         (bug 35169).
3178
3179         * cs-parser.jay: Allow a trailing comma before the close bracked
3180         in the attribute_section production.
3181
3182         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
3183         address of the instance was being taken, I will take this out,
3184         because we take the address of the object immediately here.
3185
3186 2002-12-09  Ravi Pratap  <ravi@ximian.com>
3187
3188         * typemanager.cs (AreMultipleAllowed): Take care of the most
3189         obvious case where attribute type is not in the current assembly -
3190         stupid me ;-)
3191
3192 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
3193
3194         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
3195         definitions, instead of doing that afterwards.  
3196
3197         Also we use a nice little hack, depending on the constructor, we
3198         know if we are a "composed" name or a simple name.  Hence, we
3199         avoid the IndexOf test, and we avoid 
3200
3201         * codegen.cs: Add code to assist in a bug reporter to track down
3202         the source of a compiler crash. 
3203
3204 2002-12-07  Ravi Pratap  <ravi@ximian.com>
3205
3206         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
3207         types have been emitted for a given element and flag an error
3208         if something which does not have AllowMultiple set is used more
3209         than once.
3210
3211         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
3212         attribute types and their corresponding AllowMultiple properties
3213
3214         (AreMultipleAllowed): Check the property for a given type.
3215
3216         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
3217         property in the case we have a TypeContainer.
3218
3219         (Attributes.AddAttribute): Detect duplicates and just skip on
3220         adding them. This trivial fix catches a pretty gross error in our
3221         attribute emission - global attributes were being emitted twice!
3222
3223         Bugzilla bug #33187 is now fixed.
3224
3225 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
3226
3227         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
3228         instead of pp_and).
3229
3230         * expression.cs (Binary.ResolveOperator): I can only use the
3231         Concat (string, string, string) and Concat (string, string,
3232         string, string) if the child is actually a concatenation of
3233         strings. 
3234
3235 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
3236
3237         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
3238         context where we need a 2-character lookahead.
3239
3240         * pending.cs (PendingImplementation): Rework so we can keep track
3241         of interface types all the time, and flag those which were
3242         implemented by parents as optional.
3243
3244 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
3245
3246         * expression.cs (Binary.ResolveOperator): Use
3247         String.Concat(string,string,string) or
3248         String.Concat(string,string,string,string) when possible. 
3249
3250         * typemanager: More helper methods.
3251
3252
3253 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
3254
3255         * pending.cs: remove the bogus return from GetMissingInterfaces()
3256         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
3257
3258 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3259
3260         * namespace.cs: avoid duplicated 'using xxx' being added to
3261         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
3262         when we get more than one 'using' statement for the same namespace.
3263         Report a CS0105 warning for it.
3264
3265 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
3266
3267         * cs-tokenizer.cs (consume_identifier): use read directly, instead
3268         of calling getChar/putback, uses internal knowledge of it.    
3269
3270         (xtoken): Reorder tokenizer so most common patterns are checked
3271         first.  This reduces the compilation time in another 5% (from 8.11s
3272         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
3273
3274         The parsing time is 22% of the compilation in mcs, and from that
3275         64% is spent on the tokenization process.  
3276
3277         I tried using a binary search for keywords, but this is slower
3278         than the hashtable.  Another option would be to do a couple of
3279         things:
3280
3281                 * Not use a StringBuilder, instead use an array of chars,
3282                   with a set value.  Notice that this way we could catch
3283                   the 645 error without having to do it *afterwards*.
3284
3285                 * We could write a hand-parser to avoid the hashtable
3286                   compares altogether.
3287
3288         The identifier consumption process takes 37% of the tokenization
3289         time.  Another 15% is spent on is_number.  56% of the time spent
3290         on is_number is spent on Int64.Parse:
3291
3292                 * We could probably choose based on the string length to
3293                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
3294                   computations. 
3295
3296         Another 3% is spend on wrapping `xtoken' in the `token' function.
3297
3298         Handle 0xa0 as whitespace (#34752)
3299         
3300 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
3301
3302         * typemanager.cs (IsCLRType): New routine to tell whether a type
3303         is one of the builtin types.  
3304
3305         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
3306         typecode in more places instead of doing pointer comparissions.
3307         We could leverage some knowledge about the way the typecodes are
3308         laid out.
3309
3310         New code to cache namespaces in assemblies, it is currently not
3311         invoked, to be used soon.
3312
3313         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
3314
3315         * expression.cs (Binary.ResolveOperator): specially handle
3316         strings, and do not perform user-defined operator overloading for
3317         built-in types.
3318
3319 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
3320
3321         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
3322         internalcall as it is a pretty simple operation;  Avoid whenever
3323         possible to call Char.IsLetter.
3324
3325         (consume_identifier): Cut by half the number of
3326         hashtable calls by merging the is_keyword and GetKeyword behavior.
3327
3328         Do not short-circuit, because if we do, we
3329         report errors (ie, #if false && true would produce an invalid
3330         directive error);
3331         
3332
3333 2002-11-24  Martin Baulig  <martin@ximian.com>
3334
3335         * expression.cs (Cast.TryReduce): If we're in checked syntax,
3336         check constant ranges and report a CS0221.  Fixes #33186.
3337
3338 2002-11-24  Martin Baulig  <martin@ximian.com>
3339
3340         * cs-parser.jay: Make this work for uninitialized variable
3341         declarations in the `for' initializer.  Fixes #32416.
3342
3343 2002-11-24  Martin Baulig  <martin@ximian.com>
3344
3345         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
3346         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
3347
3348 2002-11-24  Martin Baulig  <martin@ximian.com>
3349
3350         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
3351         argument; if true, we also check for user-defined conversions.
3352         This is only needed if both arguments are of a user-defined type.
3353         Fixes #30443, added test-175.cs.
3354         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
3355
3356         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
3357
3358 2002-11-24  Martin Baulig  <martin@ximian.com>
3359
3360         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
3361         function to get the store opcode.
3362         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
3363         only emit the Ldelema if the store opcode is Stobj.  You must run
3364         both test-34 and test-167 to test this.  Fixes #34529.
3365
3366 2002-11-23  Martin Baulig  <martin@ximian.com>
3367
3368         * ecore.cs (Expression.MemberLookup): Added additional
3369         `qualifier_type' argument which is used when we're being called
3370         from MemberAccess.DoResolve() and null if we're called from a
3371         SimpleName lookup.
3372         (Expression.MemberLookupFailed): New method to report errors; this
3373         does the CS1540 check and reports the correct error message.
3374
3375         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
3376         argument for the CS1540 check and redone the way how we're dealing
3377         with private members.  See the comment in the source code for details.
3378         (FilterWithClosure): Reverted this back to revision 1.197; renamed
3379         `closure_start_type' to `closure_qualifier_type' and check whether
3380         it's not null.  It was not this filter being broken, it was just
3381         being called with the wrong arguments.
3382
3383         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
3384         and pass it the correct `qualifier_type'; this also does the error
3385         handling for us.
3386
3387 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
3388
3389         * expression.cs (Invocation.EmitParams): If the we are dealing
3390         with a non-built-in value type, load its address as well.
3391
3392         (ArrayCreation): Use a a pretty constant instead
3393         of the hardcoded value 2.   Use 6 instead of 2 for the number of
3394         static initializers.  
3395
3396         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
3397         because they are not really value types, just glorified integers. 
3398
3399         * driver.cs: Do not append .exe, the CSC compiler does not do it.
3400
3401         * ecore.cs: Remove redundant code for enumerations, make them use
3402         the same code path as everything else, fixes the casting issue
3403         with enumerations in Windows.Forms.
3404
3405         * attribute.cs: Do only cast to string if it is a string, the
3406         validation happens later.
3407
3408         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
3409         people upgrade their corlibs.
3410
3411         * ecore.cs: Oops, enumerations were not following the entire code path
3412
3413 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
3414
3415         * typemanager.cs (FilterWithClosure): Commented out the test for
3416         1540 in typemanager.cs, as it has problems when accessing
3417         protected methods from a parent class (see test-174.cs). 
3418
3419         * attribute.cs (Attribute.ValidateGuid): new method.
3420         (Attribute.Resolve): Use above.
3421
3422 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
3423
3424         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
3425
3426         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
3427         handling for enumerations, as we only needed the TypeContainer
3428         functionality to begin with (this is required for the fix below to
3429         work for enums that reference constants in a container class for
3430         example). 
3431
3432         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
3433
3434         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
3435         a valid TypeBuilder to perform lookups on.o
3436
3437         * class.cs (InheritableMemberSignatureCompare): Use true in the
3438         call to GetGetMethod and GetSetMethod, because we are comparing
3439         the signature, and we need to get the methods *even* if they are
3440         private. 
3441
3442         (PropertyBase.CheckBase): ditto.
3443
3444         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
3445         GotoCase.Resolve): Use Peel on EmpytCasts.
3446
3447         * ecore.cs (EmptyCast): drop child, add Peel method.
3448
3449 2002-11-17  Martin Baulig  <martin@ximian.com>
3450
3451         * ecore.cs (EmptyCast.Child): New public property.
3452
3453         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
3454         label resolved to an EmptyCast.  Fixes #34162.
3455         (GotoCase.Resolve): Likewise.
3456         (Block.EmitMeta): Likewise.
3457
3458 2002-11-17  Martin Baulig  <martin@ximian.com>
3459
3460         * expression.cs (Invocation.BetterConversion): Prefer int over
3461         uint; short over ushort; long over ulong for integer literals.
3462         Use ImplicitConversionExists instead of StandardConversionExists
3463         since we also need to check for user-defined implicit conversions.
3464         Fixes #34165.  Added test-173.cs.
3465
3466 2002-11-16  Martin Baulig  <martin@ximian.com>
3467
3468         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
3469         with the `true' and `false' literals.  Fixes #33151.
3470
3471 2002-11-16  Martin Baulig  <martin@ximian.com>
3472
3473         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
3474         October 22nd; don't do the cs1540 check for static members.
3475
3476         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
3477         now using our own filter here and doing the cs1540 check again.
3478
3479 2002-11-16  Martin Baulig  <martin@ximian.com>
3480
3481         * support.cs (InternalParameters): Don't crash if we don't have
3482         any fixed parameters.  Fixes #33532.
3483
3484 2002-11-16  Martin Baulig  <martin@ximian.com>
3485
3486         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
3487         when looking up static methods to make this work on Windows.
3488         Fixes #33773.
3489
3490 2002-11-16  Martin Baulig  <martin@ximian.com>
3491
3492         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
3493         a setter rather than using PropertyInfo.CanWrite.
3494
3495 2002-11-15  Nick Drochak  <ndrochak@gol.com>
3496
3497         * class.cs: Allow acces to block member by subclasses. Fixes build
3498         breaker.
3499
3500 2002-11-14  Martin Baulig  <martin@ximian.com>
3501
3502         * class.cs (Constructor.Emit): Added the extern/block check.
3503         Fixes bug #33678.
3504
3505 2002-11-14  Martin Baulig  <martin@ximian.com>
3506
3507         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
3508         iteration while looking for indexers, this is needed because the
3509         indexer may have a different name in our base classes.  Fixed the
3510         error reporting (no indexers at all, not get accessor, no
3511         overloaded match).  Fixes bug #33089.
3512         (IndexerAccess.DoResolveLValue): Likewise.
3513
3514 2002-11-14  Martin Baulig  <martin@ximian.com>
3515
3516         * class.cs (PropertyBase.CheckBase): Make this work for multiple
3517         indexers.  Fixes the first part of bug #33089.
3518         (MethodSignature.InheritableMemberSignatureCompare): Added support
3519         for properties.
3520
3521 2002-11-13  Ravi Pratap  <ravi@ximian.com>
3522
3523         * attribute.cs (Attribute.Resolve): Catch the
3524         NullReferenceException and report it since it isn't supposed to
3525         happen. 
3526         
3527 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
3528
3529         * expression.cs (Binary.EmitBranchable): Also handle the cases for
3530         LogicalOr and LogicalAnd that can benefit from recursively
3531         handling EmitBranchable.  The code now should be nice for Paolo.
3532
3533 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
3534
3535         * typemanager.cs (LookupType): Added a negative-hit hashtable for
3536         the Type lookups, as we perform quite a number of lookups on
3537         non-Types.  This can be removed once we can deterministically tell
3538         whether we have a type or a namespace in advance.
3539
3540         But this might require special hacks from our corlib.
3541
3542         * TODO: updated.
3543
3544         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
3545         and double which avoids a conversion from an integer to a double.
3546
3547         * expression.cs: tiny optimization, avoid calling IsConstant,
3548         because it effectively performs the lookup twice.
3549
3550 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
3551
3552         But a bogus return here to keep the semantics of the old code
3553         until the Mono runtime is fixed.
3554         
3555         * pending.cs (GetMissingInterfaces): New method used to remove all
3556         the interfaces that are already implemented by our parent
3557         classes from the list of pending methods. 
3558
3559         * interface.cs: Add checks for calls after ResolveTypeExpr.
3560
3561 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
3562
3563         * class.cs (Class.Emit): Report warning 67: event not used if the
3564         warning level is beyond 3.
3565
3566         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
3567         being a NullLiteral.
3568
3569         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
3570         specifiers. 
3571
3572         * class.cs (TypeContainer.GetClassBases): Cover a missing code
3573         path that might fail if a type can not be resolved.
3574
3575         * expression.cs (Binary.Emit): Emit unsigned versions of the
3576         operators. 
3577
3578         * driver.cs: use error 5.
3579         
3580 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
3581
3582         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
3583
3584 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
3585
3586         * cs-parser.jay (switch_section): A beautiful patch from Martin
3587         Baulig that fixed 33094.
3588
3589 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
3590
3591         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
3592         Check whether the base is abstract and report an error if so.
3593
3594         * expression.cs (IndexerAccess.DoResolveLValue,
3595         IndexerAccess.DoResolve): ditto. 
3596
3597         (Invocation.DoResolve): ditto.
3598         
3599         (Invocation.FullMethodDesc): Improve the report string.
3600
3601         * statement.cs (Block): Eliminate IsVariableDefined as it is
3602         basically just a wrapper for GetVariableInfo.
3603
3604         * ecore.cs (SimpleName): Use new 
3605
3606         * support.cs (ReflectionParamter.ParameterType): We unwrap the
3607         type, as we return the actual parameter ref/unref state on a
3608         different call.
3609
3610 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
3611
3612         * support.cs: Return proper flags REF/OUT fixing the previous
3613         commit.  
3614
3615         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
3616         not used to mean `ref' but `ref or out' in ParameterReference
3617         
3618         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
3619         full type signature instead of calling TypeManger.CSharpName
3620         ourselves. 
3621
3622         * support.cs (InternalParameters.ParameterDesc): Do not compare
3623         directly to the modflags, because REF/OUT will actually be bitsets
3624         if set. 
3625
3626         * delegate.cs (VerifyMethod): Check also the modifiers.
3627
3628         * cs-tokenizer.cs: Fix bug where floating point values with an
3629         exponent where a sign was missing was ignored.
3630
3631         * driver.cs: Allow multiple assemblies to be specified in a single
3632         /r: argument
3633
3634 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
3635
3636         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
3637         because identifiers after a parenthesis would end up in this kind
3638         of production, and we needed to desamiguate it for having casts
3639         like:
3640
3641                 (UserDefinedType *) xxx
3642
3643 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
3644
3645         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
3646         we should set on the Bindingflags.NonPublic, but not turn on
3647         private_ok.  private_ok controls whether a Private member is
3648         returned (this is chekced on the filter routine), while the
3649         BindingFlags.NonPublic just controls whether private/protected
3650         will be allowed.   This fixes the problem part of the problem of
3651         private properties being allowed to be used in derived classes.
3652
3653         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
3654         so we can call the children DoResolveLValue method (this will
3655         properly signal errors on lvalue assignments to base properties)
3656         
3657         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
3658         getter are null, and we have a property info, we know that this
3659         happened because the lookup failed, so we report an error 122 for
3660         protection level violation.
3661
3662         We also silently return if setter and getter are null in the
3663         resolve functions, this condition only happens if we have flagged
3664         the error before.  This is the other half of the problem. 
3665
3666         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
3667         not have accessibility information, that is why we were returning
3668         true in the filter function in typemanager.cs.
3669
3670         To properly report 122 (property is inaccessible because of its
3671         protection level) correctly, we report this error in ResolveAccess
3672         by failing if both the setter and the getter are lacking (ie, the
3673         lookup failed). 
3674
3675         DoResolve and DoLResolve have been modified to check for both
3676         setter/getter being null and returning silently, the reason being
3677         that I did not want to put the knowledge about this error in upper
3678         layers, like:
3679
3680         int old = Report.Errors;
3681         x = new PropertyExpr (...);
3682         if (old != Report.Errors)
3683                 return null;
3684         else
3685                 return x;
3686
3687         So the property expr is returned, but it is invalid, so the error
3688         will be flagged during the resolve process. 
3689
3690         * class.cs: Remove InheritablePropertySignatureCompare from the
3691         class, as we no longer depend on the property signature to compute
3692         whether it is possible to implement a method or not.
3693
3694         The reason is that calling PropertyInfo.GetGetMethod will return
3695         null (in .NET, in Mono it works, and we should change this), in
3696         cases where the Get Method does not exist in that particular
3697         class.
3698
3699         So this code:
3700
3701         class X { public virtual int A { get { return 1; } } }
3702         class Y : X { }
3703         class Z : Y { public override int A { get { return 2; } } }
3704
3705         Would fail in Z because the parent (Y) would not have the property
3706         defined.  So we avoid this completely now (because the alternative
3707         fix was ugly and slow), and we now depend exclusively on the
3708         method names.
3709
3710         (PropertyBase.CheckBase): Use a method-base mechanism to find our
3711         reference method, instead of using the property.
3712
3713         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
3714         routines are gone now.
3715
3716         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
3717         names, they were incorrectly named.
3718
3719         * cs-tokenizer.cs: Return are more gentle token on failure. 
3720
3721         * pending.cs (PendingImplementation.InterfaceMethod): This routine
3722         had an out-of-sync index variable, which caused it to remove from
3723         the list of pending methods the wrong method sometimes.
3724
3725 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
3726
3727         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
3728         CanWrite, because those refer to this particular instance of the
3729         property, and do not take into account the fact that we can
3730         override single members of a property.
3731
3732         Constructor requires an EmitContext.  The resolution process does
3733         not happen here, but we need to compute the accessors before,
3734         because the resolution does not always happen for properties.
3735         
3736         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
3737         subclass, before we did not update this flag, but we did update
3738         bindingflags. 
3739
3740         (GetAccessors): Drop this routine, as it did not work in the
3741         presence of partially overwritten set/get methods. 
3742
3743         Notice that this broke the cs1540 detection, but that will require
3744         more thinking. 
3745         
3746 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3747
3748         * class.cs:
3749         * codegen.cs:
3750         * driver.cs: issue a warning instead of an error if we don't support
3751         debugging for the platform. Also ignore a couple of errors that may
3752         arise when trying to write the symbols. Undo my previous patch.
3753
3754 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3755
3756         * driver.cs: ignore /debug switch except for Unix platforms.
3757
3758 2002-10-23  Nick Drochak  <ndrochak@gol.com>
3759
3760         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
3761
3762 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
3763
3764         * driver.cs: Do not make mcs-debug conditional, so we do not break
3765         builds that use it.
3766
3767         * statement.cs (UsageVector.MergeChildren): I would like Martin to
3768         review this patch.  But basically after all the children variables
3769         have been merged, the value of "Breaks" was not being set to
3770         new_breaks for Switch blocks.  I think that it should be set after
3771         it has executed.  Currently I set this to the value of new_breaks,
3772         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
3773         conservative, but I do not understand this code very well.
3774
3775         I did not break anything in the build, so that is good ;-)
3776
3777         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
3778
3779 2002-10-20  Mark Crichton  <crichton@gimp.org>
3780
3781         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
3782
3783 2002-10-20  Nick Drochak  <ndrochak@gol.com>
3784
3785         * cfold.cs: Fixed compile blocker.
3786
3787 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
3788
3789         * driver.cs: I was chekcing the key, not the file.
3790
3791 2002-10-19  Ravi Pratap  <ravi@ximian.com>
3792
3793         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
3794         message that we were generating - we just need to silently return
3795         a null.
3796
3797 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
3798
3799         * class.cs (Event.Define): Change my previous commit, as this
3800         breaks the debugger.  This is a temporary hack, as it seems like
3801         the compiler is generating events incorrectly to begin with.
3802
3803         * expression.cs (Binary.ResolveOperator): Added support for 
3804         "U operator - (E x, E y)"
3805
3806         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
3807         y)".
3808
3809         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
3810         init-only variables, but this path did not take into account that
3811         there might be also instance readonly variables.  Correct this
3812         problem. 
3813
3814         This fixes bug 32253
3815
3816         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
3817         delegates as well.
3818
3819         * driver.cs: Change the extension for modules to `netmodule'
3820
3821         * cs-parser.jay: Improved slightly the location tracking for
3822         the debugger symbols.
3823
3824         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
3825         modifiers that were specified instead of the hardcoded value
3826         (FamAndAssem).  This was basically ignoring the static modifier,
3827         and others.  Fixes 32429.
3828
3829         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
3830         fixed a bug in the process (32476)
3831
3832         * expression.cs (ArrayAccess.EmitAssign): Patch from
3833         hwang_rob@yahoo.ca that fixes bug 31834.3
3834
3835 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
3836
3837         * driver.cs: Make the module extension .netmodule.
3838
3839 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
3840
3841         * driver.cs: Report an error if the resource file is not found
3842         instead of crashing.
3843
3844         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
3845         false, like Emit does.
3846
3847 2002-10-16  Nick Drochak  <ndrochak@gol.com>
3848
3849         * typemanager.cs: Remove unused private member.  Also reported mcs
3850         bug to report this as a warning like csc.
3851
3852 2002-10-15  Martin Baulig  <martin@gnome.org>
3853
3854         * statement.cs (Statement.Emit): Made this a virtual method; emits
3855         the line number info and calls DoEmit().
3856         (Statement.DoEmit): New protected abstract method, formerly knows
3857         as Statement.Emit().
3858
3859         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
3860
3861 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
3862
3863         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
3864         have fixed a remaining problem: not every AddXXXX was adding a
3865         fully qualified name.  
3866
3867         Now everyone registers a fully qualified name in the DeclSpace as
3868         being defined instead of the partial name.  
3869
3870         Downsides: we are slower than we need to be due to the excess
3871         copies and the names being registered this way.  
3872
3873         The reason for this is that we currently depend (on the corlib
3874         bootstrap for instance) that types are fully qualified, because
3875         we dump all the types in the namespace, and we should really have
3876         types inserted into the proper namespace, so we can only store the
3877         basenames in the defined_names array.
3878
3879 2002-10-10  Martin Baulig  <martin@gnome.org>
3880
3881         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
3882         from bug #31834, see the bug report for a testcase which is
3883         miscompiled.
3884
3885 2002-10-10  Martin Baulig  <martin@gnome.org>
3886
3887         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
3888         flow analysis code for this.
3889
3890         * statement.cs (Do, While, For): Tell the flow analysis code about
3891         infinite loops.
3892         (FlowBranching.UsageVector): Added support for infinite loops.
3893         (Block.Resolve): Moved the dead code elimination here and use flow
3894         analysis to do it.
3895
3896 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
3897
3898         * class.cs (Field.Define): Catch cycles on struct type
3899         definitions. 
3900
3901         * typemanager.cs (IsUnmanagedtype): Do not recursively check
3902         fields if the fields are static.  We only need to check instance
3903         fields. 
3904
3905         * expression.cs (As.DoResolve): Test for reference type.
3906
3907         * statement.cs (Using.ResolveExpression): Use
3908         ConvertImplicitRequired, not ConvertImplicit which reports an
3909         error on failture
3910         (Using.ResolveLocalVariableDecls): ditto.
3911
3912         * expression.cs (Binary.ResolveOperator): Report errors in a few
3913         places where we had to.
3914
3915         * typemanager.cs (IsUnmanagedtype): Finish implementation.
3916
3917 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
3918
3919         * expression.cs: Use StoreFromPtr instead of extracting the type
3920         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
3921
3922         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
3923         an enumeration value to a System.Enum, but System.Enum is not a
3924         value type, but an class type, so we need to box.
3925
3926         (Expression.ConvertExplicit): One codepath could return
3927         errors but not flag them.  Fix this.  Fixes #31853
3928
3929         * parameter.cs (Resolve): Do not allow void as a parameter type.
3930
3931 2002-10-06  Martin Baulig  <martin@gnome.org>
3932
3933         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
3934         if it's a class type and not a struct.  Fixes #31815.
3935
3936 2002-10-06  Martin Baulig  <martin@gnome.org>
3937
3938         * statement.cs: Reworked the flow analysis code a bit to make it
3939         usable for dead code elimination.
3940
3941 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3942
3943         * cs-parser.jay: allow empty source files. Fixes bug #31781.
3944
3945 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
3946
3947         * expression.cs (ComposedCast.DoResolveType): A quick workaround
3948         to fix the test 165, will investigate deeper.
3949
3950 2002-10-04  Martin Baulig  <martin@gnome.org>
3951
3952         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
3953         finally blocks actually work.
3954         (Try.Resolve): We don't need to create a sibling for `finally' if
3955         there is no finally block.
3956
3957 2002-10-04  Martin Baulig  <martin@gnome.org>
3958
3959         * class.cs (Constructor.Define): The default accessibility for a
3960         non-default constructor is private, not public.
3961
3962 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
3963
3964         * class.cs (Constructor): Make AllowedModifiers public, add
3965         EXTERN.
3966
3967         * cs-parser.jay: Perform the modifiers test here, as the
3968         constructor for the Constructor class usually receives a zero
3969         because of the way we create it (first we create, later we
3970         customize, and we were never checking the modifiers).
3971
3972         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
3973         is a version of LookupTypeReflection that includes the type-name
3974         cache.  This can be used as a fast path for functions that know
3975         the fully qualified name and are only calling into *.GetType() to
3976         obtain a composed type.
3977
3978         This is also used by TypeManager.LookupType during its type
3979         composition.
3980
3981         (LookupType): We now also track the real type name, as sometimes
3982         we can get a quey for the real type name from things like
3983         ComposedCast.  This fixes bug 31422.
3984         
3985         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
3986         complete type fullname, it does not have to go through the type
3987         resolution system to obtain the composed version of the type (for
3988         obtaining arrays or pointers).
3989         
3990         (Conditional.Emit): Use the EmitBoolExpression to
3991         generate nicer code, as requested by Paolo.
3992
3993         (ArrayCreation.CheckIndices): Use the patch from
3994         hwang_rob@yahoo.ca to validate the array initializers. 
3995
3996 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
3997
3998         * class.cs (ConstructorInitializer.Emit): simplify code by using
3999         Invocation.EmitCall, and at the same time, fix the bugs in calling
4000         parent constructors that took variable arguments. 
4001
4002         * ecore.cs (Expression.ConvertNumericExplicit,
4003         Expression.ImplicitNumericConversion): Remove the code that
4004         manually wrapped decimal (InternalTypeConstructor call is now gone
4005         as well).
4006
4007         * expression.cs (Cast.TryReduce): Also handle decimal types when
4008         trying to perform a constant fold on the type.
4009
4010         * typemanager.cs (IsUnmanagedtype): Partially implemented.
4011
4012         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
4013         that only turned off an error report, and did nothing else. 
4014
4015 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
4016
4017         * driver.cs: Handle and ignore /fullpaths
4018
4019 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
4020
4021         * expression.cs (Binary.ResolveOperator): Catch the case where
4022         DoNumericPromotions returns true, 
4023
4024         (Binary.DoNumericPromotions): Simplify the code, and the tests.
4025
4026 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
4027
4028         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
4029         report error 70.
4030
4031 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
4032
4033         * ecore.cs (ConvertNumericExplicit): It is not enough that the
4034         conversion exists, but it is also required that the conversion be
4035         performed.  This manifested in "(Type64Enum) 2".  
4036
4037         * class.cs (TypeManager.AddMethod): The fix is not to change
4038         AddEnum, because that one was using a fully qualified name (every
4039         DeclSpace derivative does), but to change the AddMethod routine
4040         that was using an un-namespaced name.  This now correctly reports
4041         the duplicated name.
4042
4043         Revert patch until I can properly fix it.  The issue
4044         is that we have a shared Type space across all namespaces
4045         currently, which is wrong.
4046
4047         Options include making the Namespace a DeclSpace, and merge
4048         current_namespace/current_container in the parser.
4049
4050 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
4051
4052         * cs-parser.jay: Improve error reporting when we get a different
4053         kind of expression in local_variable_type and
4054         local_variable_pointer_type. 
4055
4056         Propagate this to avoid missleading errors being reported.
4057
4058         * ecore.cs (ImplicitReferenceConversion): treat
4059         TypeManager.value_type as a target just like object_type.   As
4060         code like this:
4061
4062         ValueType v = 1;
4063
4064         Is valid, and needs to result in the int 1 being boxed before it
4065         is assigned to the value type v.
4066
4067         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
4068         to validate the enumeration name.
4069
4070         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
4071         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
4072         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
4073
4074         * ecore.cs (TryImplicitIntConversion): When doing an
4075         implicit-enumeration-conversion, check if the type is 64-bits and
4076         perform a conversion before passing to EnumConstant.
4077
4078 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
4079
4080         * decl.cs (Error_AmbiguousTypeReference); New routine used to
4081         report ambiguous type references.  Unlike the MS version, we
4082         report what the ambiguity is.   Innovation at work ;-)
4083
4084         (DeclSpace.FindType): Require a location argument to
4085         display when we display an ambiguous error.
4086
4087         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
4088
4089         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
4090
4091         * expression.cs (EmitDynamicInitializers): Apply patch from
4092         hwang_rob@yahoo.ca that fixes the order in which we emit our
4093         initializers. 
4094
4095 2002-09-21  Martin Baulig  <martin@gnome.org>
4096
4097         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
4098         delegate takes no arguments.
4099
4100 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
4101
4102         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
4103         from integers.
4104
4105         * expression.cs: Extract the underlying type.
4106
4107         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
4108
4109         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
4110
4111 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
4112
4113         * class.cs (TypeContainer.DefineType): We can not use the nice
4114         PackingSize with the size set to 1 DefineType method, because it
4115         will not allow us to define the interfaces that the struct
4116         implements.
4117
4118         This completes the fixing of bug 27287
4119
4120         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
4121         means also structs.  This fixes part of the problem. 
4122         (Expresion.ImplicitReferenceConversionExists): ditto.
4123
4124         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
4125         error if there were no errors reported during the type lookup
4126         process, to avoid duplicates or redundant errors.  Without this
4127         you would get an ambiguous errors plus a type not found.  We have
4128         beaten the user enough with the first error.  
4129
4130         (DeclSparce.FindType): Emit a warning if we have an ambiguous
4131         reference. 
4132
4133         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
4134         during the resolution process, stop the lookup, this avoids
4135         repeated error reports (same error twice).
4136
4137         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
4138
4139         * typemanager.cs (LookupType): Redo the type lookup code to match
4140         the needs of System.Reflection.  
4141
4142         The issue is that System.Reflection requires references to nested
4143         types to begin with a "+" sign instead of a dot.  So toplevel
4144         types look like: "NameSpace.TopLevelClass", and nested ones look
4145         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
4146         levels. 
4147
4148 2002-09-19  Martin Baulig  <martin@gnome.org>
4149
4150         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
4151         says that a method always returns or always throws an exception,
4152         don't report the CS0161.
4153
4154         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
4155         set `Returns = new_returns'.
4156
4157 2002-09-19  Martin Baulig  <martin@gnome.org>
4158
4159         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
4160         to an enum constant, check for a CS0176.
4161
4162 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
4163
4164         * class.cs (TypeContainer.CheckPairedOperators): Now we check
4165         for operators that must be in pairs and report errors.
4166
4167         * ecore.cs (SimpleName.DoResolveType): During the initial type
4168         resolution process, when we define types recursively, we must
4169         check first for types in our current scope before we perform
4170         lookups in the enclosing scopes.
4171
4172         * expression.cs (MakeByteBlob): Handle Decimal blobs.
4173
4174         (Invocation.VerifyArgumentsCompat): Call
4175         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
4176         I thought we were supposed to always call this, but there are a
4177         few places in the code where we dont do it.
4178
4179 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
4180
4181         * driver.cs: Add support in -linkres and -resource to specify the
4182         name of the identifier.
4183
4184 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
4185
4186         * ecore.cs (StandardConversionExists): Sync with the conversion
4187         code: allow anything-* to void* conversions.
4188
4189         (FindMostSpecificSource): Use an Expression argument
4190         instead of a Type, because we might be handed over a Literal which
4191         gets a few more implicit conversions that plain types do not.  So
4192         this information was being lost.
4193
4194         Also, we drop the temporary type-holder expression when not
4195         required.
4196
4197 2002-09-17  Martin Baulig  <martin@gnome.org>
4198
4199         * class.cs (PropertyBase.CheckBase): Don't check the base class if
4200         this is an explicit interface implementation.
4201
4202 2002-09-17  Martin Baulig  <martin@gnome.org>
4203
4204         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
4205         different `IndexerName' attributes.
4206
4207         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
4208         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
4209         virtual CommonResolve().
4210
4211 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
4212
4213         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
4214         and convert that to the UnderlyingType.
4215
4216         * statement.cs (Foreach.Resolve): Indexers are just like variables
4217         or PropertyAccesses.
4218
4219         * cs-tokenizer.cs (consume_string): Track line numbers and columns
4220         inside quoted strings, we were not doing this before.
4221
4222 2002-09-16  Martin Baulig  <martin@gnome.org>
4223
4224         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
4225         resolve it.  This is needed for the definite assignment check of the
4226         instance expression, fixes bug #29846.
4227         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
4228
4229 2002-09-16  Nick Drochak  <ndrochak@gol.com>
4230
4231         * parameter.cs: Fix compile error.  Cannot reference static member
4232         from an instance object.  Is this an mcs bug?
4233
4234 2002-09-14  Martin Baulig  <martin@gnome.org>
4235
4236         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
4237         multiple times.  Fixes bug #30295, added test-166.cs.
4238
4239 2002-09-14  Martin Baulig  <martin@gnome.org>
4240
4241         * statement.cs (Block.Emit): Don't emit unreachable code.
4242         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
4243         `break' statements.
4244         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
4245
4246 2002-09-14  Martin Baulig  <martin@gnome.org>
4247
4248         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
4249         is set.
4250
4251 2002-09-14  Martin Baulig  <martin@gnome.org>
4252
4253         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
4254         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
4255         be false on the ms runtime.
4256
4257 2002-09-13  Martin Baulig  <martin@gnome.org>
4258
4259         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
4260         the CS0038 error message.
4261
4262 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
4263
4264         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
4265         constant inside, return it.
4266
4267 2002-09-12  Martin Baulig  <martin@gnome.org>
4268
4269         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
4270         implicit conversion can be done between enum types.
4271
4272         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
4273         check whether an implicit conversion to the current enum's UnderlyingType
4274         exists and report an error if not.
4275
4276         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
4277         without debugging support.
4278
4279         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
4280         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
4281
4282 2002-09-12  Martin Baulig  <martin@gnome.org>
4283
4284         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
4285
4286         * ecore.cs (IMemberExpr.DeclaringType): New property.
4287         (SimpleName.SimpleNameResolve): Check whether we're accessing a
4288         nonstatic member of an outer type (CS0038).
4289
4290 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
4291
4292         * driver.cs: Activate the using-error detector at warning level
4293         4 (at least for MS-compatible APIs).
4294
4295         * namespace.cs (VerifyUsing): Small buglett fix.
4296
4297         * pending.cs (PendingImplementation): pass the container pointer. 
4298
4299         * interface.cs (GetMethods): Allow for recursive definition.  Long
4300         term, I would like to move every type to support recursive
4301         definitions, not the current ordering mechanism that we have right
4302         now.
4303
4304         The situation is this: Attributes are handled before interfaces,
4305         so we can apply attributes to interfaces.  But some attributes
4306         implement interfaces, we will now handle the simple cases
4307         (recursive definitions will just get an error).  
4308
4309         * parameter.cs: Only invalidate types at the end if we fail to
4310         lookup all types.  
4311
4312 2002-09-09  Martin Baulig  <martin@gnome.org>
4313
4314         * ecore.cs (PropertyExpr.Emit): Also check for
4315         TypeManager.system_int_array_get_length so this'll also work when
4316         compiling corlib.  Fixes #30003.
4317
4318 2002-09-09  Martin Baulig  <martin@gnome.org>
4319
4320         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
4321         and throw an exception if we can't get the type's size.  Fixed #30040,
4322         added test-165.cs.
4323
4324 2002-09-09  Martin Baulig  <martin@gnome.org>
4325
4326         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
4327
4328         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
4329         context.  Fixes bug #30027.
4330
4331         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
4332         virtual functions.  Fixes bug #30043, added test-164.cs.
4333
4334 2002-09-08  Ravi Pratap  <ravi@ximian.com>
4335
4336         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
4337
4338 2002-09-08  Nick Drochak  <ndrochak@gol.com>
4339
4340         * driver.cs: Use an object to get the windows codepage since it's not a
4341         static property.
4342
4343 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
4344
4345         * statement.cs (For.Emit): for infinite loops (test == null)
4346         return whether there is a break inside, not always "true".
4347
4348         * namespace.cs (UsingEntry): New struct to hold the name of the
4349         using definition, the location where it is defined, and whether it
4350         has been used in a successful type lookup.
4351         
4352         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
4353         strings.
4354
4355         * decl.cs: ditto.
4356
4357 2002-09-06  Ravi Pratap  <ravi@ximian.com>
4358
4359         * attribute.cs : Fix incorrect code which relied on catching
4360         a NullReferenceException to detect a null being passed in
4361         where an object was expected.
4362
4363 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
4364
4365         * statement.cs (Try): flag the catch variable as assigned
4366
4367         * expression.cs (Cast): Simplified by using ResolveType instead of
4368         manually resolving.
4369
4370         * statement.cs (Catch): Fix bug by using ResolveType.
4371
4372 2002-09-06  Ravi Pratap  <ravi@ximian.com>
4373
4374         * expression.cs (BetterConversion): Special case for when we have
4375         a NullLiteral as the argument and we have to choose between string
4376         and object types - we choose string the way csc does.
4377
4378         * attribute.cs (Attribute.Resolve): Catch the
4379         NullReferenceException and report error #182 since the Mono
4380         runtime no more has the bug and having this exception raised means
4381         we tried to select a constructor which takes an object and is
4382         passed a null.
4383
4384 2002-09-05  Ravi Pratap  <ravi@ximian.com>
4385
4386         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
4387         message (1502, 1503) when we can't locate a method after overload
4388         resolution. This is much more informative and closes the bug
4389         Miguel reported.
4390
4391         * interface.cs (PopulateMethod): Return if there are no argument
4392         types. Fixes a NullReferenceException bug.
4393
4394         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
4395         expressions too. Previously we were checking only in one place for
4396         positional arguments leaving out named arguments.
4397
4398         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
4399         type to the enum type is not allowed. Remove code corresponding to
4400         that.
4401
4402         (ConvertNumericExplicit): Allow explicit conversions from
4403         the underlying type to enum type. This precisely follows the spec
4404         and closes a bug filed by Gonzalo.
4405         
4406 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4407
4408         * compiler.csproj:
4409         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
4410
4411 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
4412
4413         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
4414         it was important that we stored the right value after the
4415         reduction in `converted'.
4416
4417 2002-09-04  Martin Baulig  <martin@gnome.org>
4418
4419         * location.cs (Location.SymbolDocument): Use full pathnames for the
4420         source files.
4421
4422 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
4423
4424         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
4425         of the expression resolve mechanism, because that will catch the
4426         SimpleName error failures.
4427
4428         (Conditional): If we can not resolve the
4429         expression, return, do not crash.
4430
4431 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4432
4433         * cs-tokenizer.cs:
4434         (location): display token name instead of its number.
4435
4436 2002-08-28  Martin Baulig  <martin@gnome.org>
4437
4438         * expression.cs (Binary.ResolveOperator): Don't silently return
4439         but return an error if an operator cannot be applied between two
4440         enum types.
4441
4442 2002-08-28  Martin Baulig  <martin@gnome.org>
4443
4444         * class.cs (Constructor.Define): Set the permission attributes
4445         correctly instead of making all constructors public.
4446
4447 2002-08-28  Martin Baulig  <martin@gnome.org>
4448
4449         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
4450         for private members before reporting a CS0103; if we find anything,
4451         it's a CS0122.
4452
4453 2002-08-28  Martin Baulig  <martin@gnome.org>
4454
4455         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
4456         to check whether `closure_start_type == closure_invocation_type',
4457         we also need to check whether `m.DeclaringType == closure_invocation_type'
4458         before bypassing the permission checks.  We might be accessing
4459         protected/private members from the base class.
4460         (TypeManager.RealMemberLookup): Only set private_ok if private
4461         members were requested via BindingFlags.NonPublic.
4462
4463         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
4464
4465         * expression.cs (MemberAccess.ResolveMemberAccess): Set
4466         MethodGroupExpr.IsExplicitImpl if appropriate.
4467         (Invocation.DoResolve): Don't report the CS0120 for explicit
4468         interface implementations.
4469
4470 2002-08-27  Martin Baulig  <martin@gnome.org>
4471
4472         * expression.cs (Invocation.DoResolve): If this is a static
4473         method and we don't have an InstanceExpression, we must report
4474         a CS0120.
4475
4476 2002-08-25  Martin Baulig  <martin@gnome.org>
4477
4478         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
4479         `==' between a valuetype and an object.
4480
4481 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
4482
4483         * ecore.cs (TypeExpr): Provide a ToString method.
4484
4485 2002-08-24  Martin Baulig  <martin@gnome.org>
4486
4487         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
4488         now called proggie.dbg and it's a binary file.
4489
4490 2002-08-23  Martin Baulig  <martin@gnome.org>
4491
4492         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
4493
4494 2002-08-23  Martin Baulig  <martin@gnome.org>
4495
4496         * struct.cs (MyStructInfo.ctor): Make this work with empty
4497         structs; it's not allowed to use foreach() on null.
4498
4499 2002-08-23  Martin Baulig  <martin@gnome.org>
4500
4501         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
4502         writer the full pathname of the generated assembly.
4503
4504 2002-08-23  Martin Baulig  <martin@gnome.org>
4505
4506         * statements.cs (FlowBranching.UsageVector.MergeChildren):
4507         A `finally' block never returns or breaks; improved handling of
4508         unreachable code.
4509
4510 2002-08-23  Martin Baulig  <martin@gnome.org>
4511
4512         * statement.cs (Throw.Resolve): Allow `throw null'.
4513
4514 2002-08-23  Martin Baulig  <martin@gnome.org>
4515
4516         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
4517         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
4518         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
4519         MemberLookup would return a wrong event if this is an explicit
4520         interface implementation and the class has an event with the same
4521         name.
4522
4523 2002-08-23  Martin Baulig  <martin@gnome.org>
4524
4525         * statement.cs (Block.AddChildVariableNames): New public method.
4526         (Block.AddChildVariableName): Likewise.
4527         (Block.IsVariableNameUsedInChildBlock): Likewise.
4528         (Block.AddVariable): Check whether a variable name has already
4529         been used in a child block.
4530
4531         * cs-parser.jay (declare_local_variables): Mark all variable names
4532         from the current block as being used in a child block in the
4533         implicit block.
4534
4535 2002-08-23  Martin Baulig  <martin@gnome.org>
4536
4537         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
4538         find the symbol writer.
4539
4540         * driver.cs: csc also allows the arguments to /define being
4541         separated by commas, not only by semicolons.
4542
4543 2002-08-23  Martin Baulig  <martin@gnome.org>
4544
4545         * interface.cs (Interface.GetMembers): Added static check for events.
4546
4547 2002-08-15  Martin Baulig  <martin@gnome.org>
4548
4549         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
4550         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
4551
4552         * ecore.cs (Expression.MemberLookup): Added documentation and explained
4553         why the MethodData.EmitDestructor() change was necessary.
4554
4555 2002-08-20  Martin Baulig  <martin@gnome.org>
4556
4557         * class.cs (TypeContainer.FindMembers): Added static check for events.
4558
4559         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
4560
4561         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
4562         use Type.GetEvents(), not Type.FindMembers().
4563
4564 2002-08-20  Martin Baulig  <martin@gnome.org>
4565
4566         * decl.cs (MemberCache): Added a special method cache which will
4567         be used for method-only searched.  This ensures that a method
4568         search will return a MethodInfo with the correct ReflectedType for
4569         inherited methods.      
4570
4571 2002-08-20  Martin Baulig  <martin@gnome.org>
4572
4573         * decl.cs (DeclSpace.FindMembers): Made this public.
4574
4575 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4576
4577         * delegate.cs: fixed build on windows.
4578         [FIXME:  Filed as bug #29150: MCS must report these errors.]
4579
4580 2002-08-19  Ravi Pratap  <ravi@ximian.com>
4581
4582         * ecore.cs (StandardConversionExists): Return a false
4583         if we are trying to convert the void type to anything else
4584         since that is not allowed.
4585
4586         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
4587         we flag error 70 in the event an event is trying to be accessed
4588         directly from outside the declaring type.
4589
4590 2002-08-20  Martin Baulig  <martin@gnome.org>
4591
4592         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
4593         MemberCache from typemanager.cs to decl.cs.
4594
4595 2002-08-19  Martin Baulig  <martin@gnome.org>
4596
4597         * class.cs (TypeContainer): Implement IMemberContainer.
4598         (TypeContainer.DefineMembers): Create the MemberCache.
4599         (TypeContainer.FindMembers): Do better BindingFlags checking; only
4600         return public members if BindingFlags.Public was given, check
4601         whether members are static.
4602
4603 2002-08-16  Martin Baulig  <martin@gnome.org>
4604
4605         * decl.cs (DeclSpace.Define): Splitted this in Define and
4606         DefineMembers.  DefineMembers is called first and initializes the
4607         MemberCache.
4608
4609         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
4610         DefineMembers() on all our DeclSpaces.
4611
4612         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
4613         but call DefineMembers() on all nested interfaces.  We call their
4614         Define() in our new Define() function.
4615
4616         * interface.cs (Interface): Implement IMemberContainer.
4617         (Interface.Define): Moved all code except the attribute stuf to
4618         DefineMembers().
4619         (Interface.DefineMembers): Initialize the member cache.
4620
4621         * typemanager.cs (IMemberFinder): Removed this interface, we don't
4622         need this anymore since we can use MemberCache.FindMembers directly.
4623
4624 2002-08-19  Martin Baulig  <martin@gnome.org>
4625
4626         * typemanager.cs (MemberCache): When creating the cache for an
4627         interface type, add all inherited members.
4628         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
4629         to `out bool used_cache' and documented it.
4630         (TypeManager.MemberLookup): If we already used the cache in the first
4631         iteration, we don't need to do the interfaces check.
4632
4633 2002-08-19  Martin Baulig  <martin@gnome.org>
4634
4635         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
4636         here from IMemberFinder and don't implement this interface anymore.
4637         (DeclSpace.MemberCache): Moved here from IMemberFinder.
4638
4639         * typemanager.cs (IMemberFinder): This interface is now only used by
4640         classes which actually support the member cache.
4641         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
4642         since we only put DeclSpaces into this Hashtable.
4643         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
4644         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
4645
4646 2002-08-16  Martin Baulig  <martin@gnome.org>
4647
4648         * typemanager.cs (ICachingMemberFinder): Removed.
4649         (IMemberFinder.MemberCache): New property.
4650         (TypeManager.FindMembers): Merged this with RealFindMembers().
4651         This function will never be called from TypeManager.MemberLookup()
4652         so we can't use the cache here, just the IMemberFinder.
4653         (TypeManager.MemberLookup_FindMembers): Check whether the
4654         IMemberFinder has a MemberCache and call the cache's FindMembers
4655         function.
4656         (MemberCache): Rewrote larger parts of this yet another time and
4657         cleaned it up a bit.
4658
4659 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
4660
4661         * driver.cs (LoadArgs): Support quoting.
4662
4663         (Usage): Show the CSC-like command line arguments.
4664
4665         Improved a few error messages.
4666
4667 2002-08-15  Martin Baulig  <martin@gnome.org>
4668
4669         * typemanager.cs (IMemberContainer.Type): New property.
4670         (IMemberContainer.IsInterface): New property.
4671
4672         The following changes are conditional to BROKEN_RUNTIME, which is
4673         defined at the top of the file.
4674
4675         * typemanager.cs (MemberCache.MemberCache): Don't add the base
4676         class'es members, but add all members from TypeHandle.ObjectType
4677         if we're an interface.
4678         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
4679         is the current type.
4680         (MemberCache.CacheEntry.Container): Removed this field.
4681         (TypeHandle.GetMembers): Include inherited members.
4682
4683 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4684
4685         * typemanager.cs: fixed compilation and added a comment on a field that
4686         is never used.
4687
4688 2002-08-15  Martin Baulig  <martin@gnome.org>
4689
4690         * class.cs (ConstructorInitializer.Resolve): In the
4691         Expression.MemberLookup call, use the queried_type as
4692         invocation_type.
4693
4694         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
4695         declared' attribute, it's always true.
4696         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
4697         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
4698         temporary wrapper for FindMembers which tells MemberLookup whether
4699         members from the base classes are included in the return value.
4700         This will go away soon.
4701         (TypeManager.MemberLookup): Use this temporary hack here; once the
4702         new MemberCache is completed, we don't need to do the DeclaredOnly
4703         looping here anymore since the MemberCache will take care of this.
4704         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
4705         (MemberCache): When creating the MemberCache for a class, get
4706         members from the current class and all its base classes.
4707         (MemberCache.CacheEntry.Container): New field.  This is a
4708         temporary hack until the Mono runtime is fixed to distinguish
4709         between ReflectedType and DeclaringType.  It allows us to use MCS
4710         with both the MS runtime and the unfixed Mono runtime without
4711         problems and without accecting performance.
4712         (MemberCache.SearchMembers): The DeclaredOnly looping from
4713         TypeManager.MemberLookup is now done here.      
4714
4715 2002-08-14  Martin Baulig  <martin@gnome.org>
4716
4717         * statement.cs (MyStructInfo.MyStructInfo): Don't call
4718         Type.GetFields on dynamic types but get the fields from the
4719         corresponding TypeContainer.
4720         (MyStructInfo.GetStructInfo): Added check for enum types.
4721
4722         * typemanager.cs (MemberList.IsSynchronized): Implemented.
4723         (MemberList.SyncRoot): Implemented.
4724         (TypeManager.FilterWithClosure): No need to check permissions if
4725         closure_start_type == closure_invocation_type, don't crash if
4726         closure_invocation_type is null.
4727
4728 2002-08-13  Martin Baulig  <martin@gnome.org>
4729
4730         Rewrote TypeContainer.FindMembers to use a member cache.  This
4731         gives us a speed increase of about 35% for the self-hosting MCS
4732         build and of about 15-20% for the class libs (both on GNU/Linux).
4733
4734         * report.cs (Timer): New class to get enhanced profiling.  This
4735         whole class is "TIMER" conditional since it remarkably slows down
4736         compilation speed.
4737
4738         * class.cs (MemberList): New class.  This is an IList wrapper
4739         which we're now using instead of passing MemberInfo[]'s around to
4740         avoid copying this array unnecessarily.
4741         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
4742         (ICachingMemberFinder, IMemberContainer): New interface.
4743         (TypeManager.FilterWithClosure): If `criteria' is null, the name
4744         has already been checked, otherwise use it for the name comparision.
4745         (TypeManager.FindMembers): Renamed to RealMemberFinder and
4746         provided wrapper which tries to use ICachingMemberFinder.FindMembers
4747         if possible.  Returns a MemberList, not a MemberInfo [].
4748         (TypeHandle): New class, implements IMemberContainer.  We create
4749         one instance of this class per type, it contains a MemberCache
4750         which is used to do the member lookups.
4751         (MemberCache): New class.  Each instance of this class contains
4752         all members of a type and a name-based hash table.
4753         (MemberCache.FindMembers): This is our new member lookup
4754         function.  First, it looks up all members of the requested name in
4755         the hash table.  Then, it walks this list and sorts out all
4756         applicable members and returns them.
4757
4758 2002-08-13  Martin Baulig  <martin@gnome.org>
4759
4760         In addition to a nice code cleanup, this gives us a performance
4761         increase of about 1.4% on GNU/Linux - not much, but it's already
4762         half a second for the self-hosting MCS compilation.
4763
4764         * typemanager.cs (IMemberFinder): New interface.  It is used by
4765         TypeManager.FindMembers to call FindMembers on a TypeContainer,
4766         Enum, Delegate or Interface.
4767         (TypeManager.finder_to_member_finder): New PtrHashtable.
4768         (TypeManager.finder_to_container): Removed.
4769         (TypeManager.finder_to_delegate): Removed.
4770         (TypeManager.finder_to_interface): Removed.
4771         (TypeManager.finder_to_enum): Removed.
4772
4773         * interface.cs (Interface): Implement IMemberFinder.
4774
4775         * delegate.cs (Delegate): Implement IMemberFinder.
4776
4777         * enum.cs (Enum): Implement IMemberFinder.
4778
4779         * class.cs (TypeContainer): Implement IMemberFinder.
4780
4781 2002-08-12  Martin Baulig  <martin@gnome.org>
4782
4783         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
4784
4785 2002-08-12  Martin Baulig  <martin@gnome.org>
4786
4787         * ecore.cs (ITypeExpression): New interface for expressions which
4788         resolve to a type.
4789         (TypeExpression): Renamed to TypeLookupExpression.
4790         (Expression.DoResolve): If we're doing a types-only lookup, the
4791         expression must implement the ITypeExpression interface and we
4792         call DoResolveType() on it.
4793         (SimpleName): Implement the new ITypeExpression interface.
4794         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
4795         hack, the situation that we're only looking up types can't happen
4796         anymore when this method is called.  Moved the type lookup code to
4797         DoResolveType() and call it.
4798         (SimpleName.DoResolveType): This ITypeExpression interface method
4799         is now doing the types-only lookup.
4800         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
4801         (ResolveFlags): Added MaskExprClass.
4802
4803         * expression.cs (MemberAccess): Implement the ITypeExpression
4804         interface.
4805         (MemberAccess.DoResolve): Added support for a types-only lookup
4806         when we're called via ITypeExpression.DoResolveType().
4807         (ComposedCast): Implement the ITypeExpression interface.
4808
4809         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
4810         Expression.Resolve() with ResolveFlags.Type instead.
4811
4812 2002-08-12  Martin Baulig  <martin@gnome.org>
4813
4814         * interface.cs (Interface.Define): Apply attributes.
4815
4816         * attribute.cs (Attribute.ApplyAttributes): Added support for
4817         interface attributes.
4818
4819 2002-08-11  Martin Baulig  <martin@gnome.org>
4820
4821         * statement.cs (Block.Emit): Only check the "this" variable if we
4822         do not always throw an exception.
4823
4824         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
4825         whether the property has a set accessor.
4826
4827 2002-08-11  Martin Baulig  <martin@gnome.org>
4828
4829         Added control flow analysis support for structs.
4830
4831         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
4832         with control flow analysis turned off.
4833         (IVariable): New interface.
4834         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
4835         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
4836         (FieldExpr.DoResolve): Resolve the instance expression with flow
4837         analysis turned off and do the definite assignment check after the
4838         resolving when we know what the expression will resolve to.
4839
4840         * expression.cs (LocalVariableReference, ParameterReference):
4841         Implement the new IVariable interface, only call the flow analysis
4842         code if ec.DoFlowAnalysis is true.
4843         (This): Added constructor which takes a Block argument.  Implement
4844         the new IVariable interface.
4845         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
4846         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
4847         This does the definite assignment checks for struct members.
4848
4849         * class.cs (Constructor.Emit): If this is a non-static `struct'
4850         constructor which doesn't have any initializer, call
4851         Block.AddThisVariable() to tell the flow analysis code that all
4852         struct elements must be initialized before control returns from
4853         the constructor.
4854
4855         * statement.cs (MyStructInfo): New public class.
4856         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
4857         argument to this indexer.  If non-zero, check an individual struct
4858         member, not the whole struct.
4859         (FlowBranching.CheckOutParameters): Check struct members.
4860         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
4861         overloaded versions of these methods which take an additional
4862         `int field_idx' argument to check struct members.
4863         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
4864         overloaded versions of these methods which take an additional
4865         `string field_name' argument to check struct member.s
4866         (VariableInfo): Implement the IVariable interface.
4867         (VariableInfo.StructInfo): New public property.  Returns the
4868         MyStructInfo instance of the variable if it's a struct or null.
4869         (Block.AddThisVariable): New public method.  This is called from
4870         Constructor.Emit() for non-static `struct' constructor which do
4871         not have any initializer.  It creates a special variable for the
4872         "this" instance variable which will be checked by the flow
4873         analysis code to ensure that all of the struct's fields are
4874         initialized before control returns from the constructor.
4875         (UsageVector): Added support for struct members.  If a
4876         variable/parameter is a struct with N members, we reserve a slot
4877         in the usage vector for each member.  A struct is considered fully
4878         initialized if either the struct itself (slot 0) or all its
4879         members are initialized.
4880
4881 2002-08-08  Martin Baulig  <martin@gnome.org>
4882
4883         * driver.cs (Driver.MainDriver): Only report an error CS5001
4884         if there were no compilation errors.
4885
4886         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
4887         `UnsafeContext' property to determine whether the parent is in
4888         unsafe context rather than checking the parent's ModFlags:
4889         classes nested in an unsafe class are unsafe as well.
4890
4891 2002-08-08  Martin Baulig  <martin@gnome.org>
4892
4893         * statement.cs (UsageVector.MergeChildren): Distinguish between
4894         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
4895         we return.  Added test17() and test18() to test-154.cs.
4896
4897 2002-08-08  Martin Baulig  <martin@gnome.org>
4898
4899         * typemanager.cs (TypeManager.FilterWithClosure): If we have
4900         Family access, make sure the invoking type isn't a subclass of the
4901         queried type (that'd be a CS1540).
4902
4903         * ecore.cs (Expression.MemberLookup): Added overloaded version of
4904         this method which takes an additional `Type invocation_type'.
4905
4906         * expression.cs (BaseAccess.DoResolve): Use the base type as
4907         invocation and query type.
4908         (MemberAccess.DoResolve): If the lookup failed and we're about to
4909         report a CS0122, try a lookup with the ec.ContainerType - if this
4910         succeeds, we must report a CS1540.
4911
4912 2002-08-08  Martin Baulig  <martin@gnome.org>
4913
4914         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
4915         (MethodGroupExpr): Implement the IMemberExpr interface.
4916
4917         * expression (MemberAccess.ResolveMemberAccess): No need to have
4918         any special code for MethodGroupExprs anymore, they're now
4919         IMemberExprs.   
4920
4921 2002-08-08  Martin Baulig  <martin@gnome.org>
4922
4923         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
4924         Family, FamANDAssem and FamORAssem permissions.
4925         (TypeManager.IsSubclassOrNestedChildOf): New public method.
4926
4927 2002-08-08  Martin Baulig  <martin@gnome.org>
4928
4929         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
4930         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
4931         or loop block.
4932
4933 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
4934
4935         * driver.cs: implemented /resource option to embed managed resources.
4936
4937 2002-08-07  Martin Baulig  <martin@gnome.org>
4938
4939         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
4940         (FieldBase.HasFieldInitializer): New public property.
4941         (FieldBase.GetInitializerExpression): New public method.  Resolves and
4942         returns the field initializer and makes sure it is only resolved once.
4943         (TypeContainer.EmitFieldInitializers): Call
4944         FieldBase.GetInitializerExpression to get the initializer, this ensures
4945         that it isn't resolved multiple times.
4946
4947         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
4948         the resolving process (SimpleName/MemberLookup) that we're currently
4949         emitting a field initializer (which must not access any instance members,
4950         this is an error CS0236).
4951
4952         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
4953         argument, if the `IsFieldInitializer' flag is set, we must report and
4954         error CS0236 and not an error CS0120.   
4955
4956 2002-08-07  Martin Baulig  <martin@gnome.org>
4957
4958         * ecore.cs (IMemberExpr): New public interface.
4959         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
4960         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
4961         if the expression is an IMemberExpr.
4962
4963         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
4964         to be null, implicitly default to `this' if we're non-static in
4965         this case.  Simplified the code a lot by using the new IMemberExpr
4966         interface.  Also fixed bug #28176 here.
4967
4968 2002-08-06  Martin Baulig  <martin@gnome.org>
4969
4970         * cs-parser.jay (SimpleLookup): Removed.  We need to create
4971         ParameterReferences during semantic analysis so that we can do a
4972         type-only search when resolving Cast, TypeOf and SizeOf.
4973         (block): Pass the `current_local_parameters' to the Block's
4974         constructor.
4975
4976         * class.cs (ConstructorInitializer): Added `Parameters parameters'
4977         argument to the constructor.
4978         (ConstructorInitializer.Resolve): Create a temporary implicit
4979         block with the parameters.
4980
4981         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
4982         references here if we aren't doing a type-only search.
4983
4984         * statement.cs (Block): Added constructor which takes a
4985         `Parameters parameters' argument.
4986         (Block.Parameters): New public property.
4987
4988         * support.cs (InternalParameters.Parameters): Renamed `parameters'
4989         to `Parameters' and made it public readonly.
4990
4991 2002-08-06  Martin Baulig  <martin@gnome.org>
4992
4993         * ecore.cs (Expression.Warning): Made this public as well.
4994
4995         * report.cs (Report.Debug): Print the contents of collections.
4996
4997 2002-08-06  Martin Baulig  <martin@gnome.org>
4998
4999         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
5000         used to tell Resolve() which kinds of expressions it may return.
5001         (Expression.Resolve): Added overloaded version of this method which
5002         takes a `ResolveFlags flags' argument.  This can be used to tell
5003         Resolve() which kinds of expressions it may return.  Reports a
5004         CS0118 on error.
5005         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
5006         ResolveFlags.SimpleName.
5007         (Expression.Error118): Added overloaded version of this method which
5008         takes a `ResolveFlags flags' argument.  It uses the flags to determine
5009         which kinds of expressions are allowed.
5010
5011         * expression.cs (Argument.ResolveMethodGroup): New public method.
5012         Resolves an argument, but allows a MethodGroup to be returned.
5013         This is used when invoking a delegate.
5014
5015         * TODO: Updated a bit.
5016
5017 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5018
5019         Fixed compilation with csc.
5020
5021         * ecore.cs: Expression.Error made public. Is this correct? Should
5022         Warning be made public too?
5023
5024         * expression.cs: use ea.Location instead of ea.loc.
5025         [FIXME:  Filed as bug #28607: MCS must report these errors.]
5026
5027 2002-08-06  Martin Baulig  <martin@gnome.org>
5028
5029         * ecore.cs (Expression.loc): Moved the location here instead of
5030         duplicating it in all derived classes.
5031         (Expression.Location): New public property.
5032         (Expression.Error, Expression.Warning): Made them non-static and
5033         removed the location argument.
5034         (Expression.Warning): Added overloaded version which takes an
5035         `int level' argument.
5036         (Expression.Error118): Make this non-static and removed the
5037         expression and location arguments.
5038         (TypeExpr): Added location argument to the constructor.
5039
5040         * expression.cs (StaticCallExpr): Added location argument to
5041         the constructor.
5042         (Indirection, PointerArithmetic): Likewise.
5043         (CheckedExpr, UnCheckedExpr): Likewise.
5044         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
5045         (StringPtr): Likewise.
5046
5047
5048 2002-08-05  Martin Baulig  <martin@gnome.org>
5049
5050         * expression.cs (BaseAccess.DoResolve): Actually report errors.
5051
5052         * assign.cs (Assign.DoResolve): Check whether the source
5053         expression is a value or variable.
5054
5055         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
5056         while resolving the corresponding blocks.
5057
5058         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
5059         an error, don't silently return null.
5060
5061         * statement.cs (Block.AddVariable): Do the error reporting here
5062         and distinguish between CS0128 and CS0136.
5063         (Block.DoResolve): Report all unused labels (warning CS0164).
5064         (LabeledStatement): Pass the location to the constructor.
5065         (LabeledStatement.HasBeenReferenced): New property.
5066         (LabeledStatement.Resolve): Set it to true here.
5067
5068         * statement.cs (Return.Emit): Return success even after reporting
5069         a type mismatch error (CS0126 or CS0127), this is what csc does and
5070         it avoids confusing the users with any consecutive errors.
5071
5072 2002-08-05  Martin Baulig  <martin@gnome.org>
5073
5074         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
5075
5076         * const.cs (Const.LookupConstantValue): Catch circular definitions.
5077
5078         * expression.cs (MemberAccess.DoResolve): Silently return if an
5079         error has already been reported.
5080
5081         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
5082         error has already been reported.
5083
5084 2002-08-05  Martin Baulig  <martin@gnome.org>
5085
5086         * statement.cs (UsageVector): Only initialize the `parameters'
5087         vector if we actually have any "out" parameters.
5088
5089 2002-08-05  Martin Baulig  <martin@gnome.org>
5090
5091         * expression.cs (Binary.ResolveOperator): When combining delegates,
5092         they must have the same type.
5093
5094 2002-08-05  Martin Baulig  <martin@gnome.org>
5095
5096         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
5097         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
5098         work with the ms runtime and we also don't need it: if we're a
5099         PropertyBuilder and not in the `indexer_arguments' hash, then we
5100         are a property and not an indexer.
5101
5102         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
5103         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
5104         since the latter one doesn't work with the ms runtime.
5105
5106 2002-08-03  Martin Baulig  <martin@gnome.org>
5107
5108         Fixed bugs #27998 and #22735.
5109
5110         * class.cs (Method.IsOperator): New public field.
5111         (Method.CheckBase): Report CS0111 if there's already a method
5112         with the same parameters in the current class.  Report CS0508 when
5113         attempting to change the return type of an inherited method.
5114         (MethodData.Emit): Report CS0179 if a method doesn't have a body
5115         and it's not marked abstract or extern.
5116         (PropertyBase): New abstract base class for Property and Indexer.
5117         (PropertyBase.CheckBase): Moved here from Property and made it work
5118         for indexers.
5119         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
5120         the same so we can reuse it there.
5121         (Property, Indexer): Derive from PropertyBase.
5122         (MethodSignature.inheritable_property_signature_filter): New delegate
5123         to find properties and indexers.
5124
5125         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
5126         argument and improved error reporting.
5127
5128         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
5129         EmptyReadOnlyParameters and made it a property.
5130
5131         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
5132         version of this method which takes a `PropertyInfo indexer'.
5133         (TypeManager.RegisterIndexer): New method.
5134
5135         * class.cs: Added myself as author of this file :-)
5136
5137 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5138
5139         * class.cs: fixed compilation on windoze.
5140
5141 2002-08-03  Martin Baulig  <martin@gnome.org>
5142
5143         * interface.cs (Interface.GetInterfaceBases): Check whether all
5144         base interfaces are at least as accessible than the current one.
5145
5146         * class.cs (TypeContainer.GetClassBases): Check whether base types
5147         are at least as accessible than the current type.
5148         (TypeContainer.AsAccessible): Implemented and made non-static.
5149         (MemberBase.CheckParameters): Report errors if the accessibility
5150         checks fail.
5151
5152         * delegate.cs (Delegate.Delegate): The default visibility is
5153         internal for top-level types and private for nested types.
5154         (Delegate.Define): Report errors if the accessibility checks fail.
5155
5156         * enum.cs (Enum.Enum): The default visibility is internal for
5157         top-level types and private for nested types.
5158         (Enum.DefineType): Compute the correct visibility.
5159
5160         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
5161         function which takes a `bool is_toplevel' instead of a TypeContainer.
5162
5163         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
5164         builtin type.
5165
5166 2002-08-02  Martin Baulig  <martin@gnome.org>
5167
5168         * expression.cs (LocalVariableReferenc): Added constructor which
5169         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
5170         (LocalVariableReference.IsReadOnly): New property.
5171         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
5172         variable is readonly, use our own readonly flag to do this; you can
5173         use the new constructor to get a writable reference to a read-only
5174         variable.
5175
5176         * cs-parser.jay (foreach_statement, using_statement): Get a writable
5177         reference to the local variable.
5178
5179 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
5180
5181         * rootcontext.cs (ResolveCore): Also include System.Exception
5182
5183         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
5184         we reach an EmptyStatement.
5185
5186         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
5187         is also fine.
5188
5189         * expression.cs (Binary.ResolveOperator): Check error result in
5190         two places.
5191
5192         use brtrue/brfalse directly and avoid compares to null.
5193
5194 2002-08-02  Martin Baulig  <martin@gnome.org>
5195
5196         * class.cs (TypeContainer.Define): Define all nested interfaces here.
5197         Fixes bug #28407, added test-155.cs.
5198
5199 2002-08-01  Martin Baulig  <martin@gnome.org>
5200
5201         * class.cs (Event.EmitDefaultMethod): Make this work with static
5202         events.  Fixes #28311, added verify-3.cs.
5203
5204 2002-08-01  Martin Baulig  <martin@gnome.org>
5205
5206         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
5207         `is_disposable' fields.
5208         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
5209         `hm.is_disposable' if we're using the collection pattern.
5210         (Foreach.EmitCollectionForeach): Use the correct type for the
5211         enumerator's local variable, only emit the try/finally block if
5212         necessary (fixes #27713).
5213
5214 2002-08-01  Martin Baulig  <martin@gnome.org>
5215
5216         * ecore.cs (Expression.report118): Renamed to Error118 and made
5217         it public static.
5218
5219         * statement.cs (Throw.Resolve): Check whether the expression is of
5220         the correct type (CS0118) and whether the type derives from
5221         System.Exception (CS0155).
5222         (Catch.Resolve): New method.  Do the type lookup here and check
5223         whether it derives from System.Exception (CS0155).
5224         (Catch.CatchType, Catch.IsGeneral): New public properties.
5225
5226         * typemanager.cs (TypeManager.exception_type): Added.
5227
5228 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
5229
5230         * driver.cs: Updated About function.
5231
5232 2002-07-31  Martin Baulig  <martin@gnome.org>
5233
5234         Implemented Control Flow Analysis.
5235
5236         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
5237         (EmitContext.CurrentBranching): Added.
5238         (EmitContext.StartFlowBranching): Added.
5239         (EmitContext.EndFlowBranching): Added.
5240         (EmitContext.KillFlowBranching): Added.
5241         (EmitContext.IsVariableAssigned): Added.
5242         (EmitContext.SetVariableAssigned): Added.
5243         (EmitContext.IsParameterAssigned): Added.
5244         (EmitContext.SetParameterAssigned): Added.
5245         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
5246         Added control flow analysis stuff here.
5247
5248         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
5249         resolve the expression as lvalue.
5250         (LocalVariableReference.DoResolve): Check whether the variable has
5251         already been assigned.
5252         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
5253         the parameter as assigned here.
5254         (ParameterReference.DoResolve): Check whether the parameter has already
5255         been assigned.
5256         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
5257         expression as lvalue.
5258
5259         * statement.cs (FlowBranching): New class for the flow analysis code.
5260         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
5261         (LabeledStatement.IsDefined): New public property.
5262         (LabeledStatement.AddUsageVector): New public method to tell flow
5263         analyis that the label may be reached via a forward jump.
5264         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
5265         flow analysis.
5266         (VariableInfo.Number): New public field.  This is used by flow analysis
5267         to number all locals of a block.
5268         (Block.CountVariables): New public property.  This is the number of
5269         local variables in this block (including the locals from all parent
5270         blocks).
5271         (Block.EmitMeta): Number all the variables.
5272
5273         * statement.cs: Added flow analysis support to all classes.
5274
5275 2002-07-31  Martin Baulig  <martin@gnome.org>
5276
5277         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
5278         To get debugging messages, compile mcs with /define:MCS_DEBUG and
5279         then use this argument.
5280
5281         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
5282
5283         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
5284         use this to specify /define options.
5285
5286 2002-07-29  Martin Baulig  <martin@gnome.org>
5287
5288         * statement.cs (Fixed): Moved all code that does variable lookups
5289         and resolvings from Emit to Resolve.
5290
5291         * statement.cs (For): Moved all code that does variable lookups
5292         and resolvings from Emit to Resolve.
5293
5294         * statement.cs (Using): Moved all code that does variable lookups
5295         and resolvings from Emit to Resolve.
5296
5297 2002-07-29  Martin Baulig  <martin@gnome.org>
5298
5299         * attribute.cs (Attribute.Resolve): Explicitly catch a
5300         System.NullReferenceException when creating the
5301         CustromAttributeBuilder and report a different warning message.
5302
5303 2002-07-29  Martin Baulig  <martin@gnome.org>
5304
5305         * support.cs (ParameterData.ParameterName): Added method to
5306         get the name of a parameter.
5307
5308         * typemanager.cs (TypeManager.IsValueType): New public method.
5309
5310 2002-07-29  Martin Baulig  <martin@gnome.org>
5311
5312         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
5313         is a flag which specifies that it's either ref or out.
5314         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
5315         the out parameter to `out Parameter.Modifier mod', also set the
5316         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
5317
5318         * support.cs (InternalParameters.ParameterModifier): Distinguish
5319         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
5320         Parameter.Modifier.ISBYREF flag if it's either ref or out.
5321
5322         * expression.cs (Argument.GetParameterModifier): Distinguish
5323         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
5324         Parameter.Modifier.ISBYREF flag if it's either ref or out.
5325
5326 2002-07-29  Martin Baulig  <martin@gnome.org>
5327
5328         * expression.cs (ParameterReference.ParameterReference): Added
5329         `Location loc' argument to the constructor.
5330
5331         * cs-parser.jay: Pass location to ParameterReference.
5332
5333 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
5334
5335         * statement.cs (Try): Initialize the location.
5336
5337         * cs-parser.jay: pass location to Try.
5338
5339         * expression.cs (Unary.Reduce): Change the prototype to return
5340         whether a constant fold could be performed or not.  The result is
5341         returned in an out parameters.  In the case of Indirection and
5342         AddressOf, we want to perform the full tests.
5343
5344 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
5345
5346         * statement.cs (Statement.Emit): Flag dead code.
5347
5348 2002-07-27  Andrew Birkett  <andy@nobugs.org>
5349
5350         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
5351
5352 2002-07-27  Martin Baulig  <martin@gnome.org>
5353
5354         * class.cs (MethodData.Define): Put back call to
5355         TypeManager.AddMethod(), accidentally commented this out.
5356
5357         * report.cs (Debug): New public method to print debugging information,
5358         this is `[Conditional ("DEBUG")]'.
5359
5360 2002-07-26  Martin Baulig  <martin@gnome.org>
5361
5362         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
5363         (switch_statement): Push the current_block to the switch_stack and
5364         pop it again when we're done with the switch.
5365         (switch_section): The new block is a child of the current_block.
5366         Fixes bug #24007, added test-152.cs.
5367
5368 2002-07-27  Martin Baulig  <martin@gnome.org>
5369
5370         * expression.cs (Invocation.EmitArguments): When calling a varargs
5371         function with only its fixed arguments, we need to pass an empty
5372         array.
5373
5374 2002-07-27  Martin Baulig  <martin@gnome.org>
5375
5376         Mono 0.13 has been released.
5377
5378 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
5379
5380         * driver.cs: Rename --resource to --linkres, because that is what
5381         we do currently, we dont support --resource yet.
5382
5383         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
5384
5385 2002-07-25  Martin Baulig  <martin@gnome.org>
5386
5387         * class.cs (MethodData): New public class.  This is a `method builder'
5388         class for a method or one accessor of a Property/Indexer/Event.
5389         (MethodData.GetMethodFlags): Moved here from MemberBase.
5390         (MethodData.ApplyAttributes): Likewise.
5391         (MethodData.ApplyObsoleteAttribute): Likewise.
5392         (MethodData.ApplyConditionalAttribute): Likewise.
5393         (MethodData.ApplyDllImportAttribute): Likewise.
5394         (MethodData.CheckAbstractAndExternal): Likewise.
5395         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
5396         (MethodData.Emit): Formerly known as Method.Emit().
5397         (MemberBase): Moved everything which was specific to a single
5398         accessor/method to MethodData.
5399         (Method): Create a new MethodData and call Define() and Emit() on it.
5400         (Property, Indexer, Event): Create a new MethodData objects for each
5401         accessor and call Define() and Emit() on them.
5402
5403 2002-07-25  Martin Baulig  <martin@gnome.org>
5404
5405         Made MethodCore derive from MemberBase to reuse the code from there.
5406         MemberBase now also checks for attributes.
5407
5408         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
5409         (MemberBase.GetMethodFlags): Moved here from class Method and marked
5410         as virtual.
5411         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
5412         `CallingConventions cc' and `Attributes opt_attrs' arguments.
5413         (MemberBase.ApplyAttributes): New virtual method; applies the
5414         attributes to a method or accessor.
5415         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
5416         (MemberBase.ApplyConditionalAttribute): Likewise.
5417         (MemberBase.ApplyDllImportAttribute): Likewise.
5418         (MemberBase.CheckAbstractAndExternal): Likewise.
5419         (MethodCore.ParameterTypes): This is now a property instead of a
5420         method, it's initialized from DoDefineParameters().
5421         (MethodCore.ParameterInfo): Removed the set accessor.
5422         (MethodCore.DoDefineParameters): New protected virtual method to
5423         initialize ParameterTypes and ParameterInfo.
5424         (Method.GetReturnType): We can now simply return the MemberType.
5425         (Method.GetMethodFlags): Override the MemberBase version and add
5426         the conditional flags.
5427         (Method.CheckBase): Moved some code from Define() here, call
5428         DoDefineParameters() here.
5429         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
5430         here to avoid some larger code duplication.
5431         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
5432         ensure that abstract and external accessors don't declare a body.
5433
5434         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
5435         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
5436         lookup in the attribute's parent classes, so we need to abort as soon
5437         as we found the first match.
5438         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
5439         the attribute has no arguments.
5440
5441         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
5442         of a Method.
5443
5444 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5445
5446         * cs-parser.jay: reverted previous patch.
5447
5448 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5449
5450         * cs-parser.jay: fixed bug #22119.
5451
5452 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5453
5454         * attribute.cs: fixed compilation. The error was:
5455         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
5456         be assigned to before control leaves the current method."
5457         [FIXME:  Filed as bug #28186: MCS must report this error.]
5458
5459 2002-07-25  Martin Baulig  <martin@gnome.org>
5460
5461         * attribute.cs (Attribute.Conditional_GetConditionName): New static
5462         method to pull the condition name ouf of a Conditional attribute.
5463         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
5464         the obsolete message and error flag out of an Obsolete attribute.
5465
5466         * class.cs (Method.GetMethodFlags): New public method to get the
5467         TypeManager.MethodFlags for this method.
5468         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
5469         private methods.
5470         (Method.Define): Get and apply the Obsolete and Conditional attributes;
5471         if we're overriding a virtual function, set the new private variable
5472         `parent_method'; call the new TypeManager.AddMethod().
5473
5474         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
5475         the MethodBuilder and the Method in a PtrHashtable.
5476         (TypeManager.builder_to_method): Added for this purpose.
5477         (TypeManager.MethodFlags): Added IsObsoleteError.
5478         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
5479         Obsolete and Conditional arguments in MethodBuilders.  If we discover
5480         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
5481         the message from the attribute.
5482
5483 2002-07-24  Martin Baulig  <martin@gnome.org>
5484
5485         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
5486         preprocessor directives, ensure that the argument to #define/#undef is
5487         exactly one identifier and that it's actually an identifier.
5488
5489         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
5490         did not work ....
5491
5492 2002-07-24  Martin Baulig  <martin@gnome.org>
5493
5494         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
5495         initialize it to TypeManager.object_type in the constructor.
5496         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
5497         of the `hm.get_current' method if we're using the collection pattern.
5498         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
5499         for the explicit conversion to make it work when we're using the collection
5500         pattern and the `Current' property has a different return type than `object'.
5501         Fixes #27713.
5502
5503 2002-07-24  Martin Baulig  <martin@gnome.org>
5504
5505         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
5506         does not match, but don't report any errors.  This method is called in
5507         order for all methods in a MethodGroupExpr until a matching method is
5508         found, so we don't want to bail out if the first method doesn't match.
5509         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
5510         matches, report the 123.  Fixes #28070.
5511
5512 2002-07-24  Martin Baulig  <martin@gnome.org>
5513
5514         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
5515         TypeManager.TypeToCoreType() to the top of the method so the
5516         following equality checks will work.  Fixes #28107.
5517
5518 2002-07-24  Martin Baulig  <martin@gnome.org>
5519
5520         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
5521         operand is of type uint, and the other operand is of type sbyte,
5522         short or int, the operands are converted to type long." -
5523         Actually do what this comment already told us.  Fixes bug #28106,
5524         added test-150.cs.
5525
5526 2002-07-24  Martin Baulig  <martin@gnome.org>
5527
5528         * class.cs (MethodBase): New abstract class.  This is now a base
5529         class for Property, Indexer and Event to avoid some code duplication
5530         in their Define() and DefineMethods() methods.
5531         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
5532         generic methods for Define() and DefineMethods().
5533         (FieldBase): Derive from MemberBase, not MemberCore.
5534         (Property): Derive from MemberBase, not MemberCore.
5535         (Property.DefineMethod): Moved all the code from this method to the
5536         new MethodBase.DefineAccessor(), just call it with appropriate
5537         argumetnts.
5538         (Property.Define): Call the new Property.DoDefine(), this does some
5539         sanity checks and we don't need to duplicate the code everywhere.
5540         (Event): Derive from MemberBase, not MemberCore.
5541         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
5542         accessors, this will also make them work with interface events.
5543         (Indexer): Derive from MemberBase, not MemberCore.
5544         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
5545         (Indexer.Define): Use the new MethodBase functions.
5546
5547         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
5548         argument to the constructor.
5549         (Interface.FindMembers): Added support for interface events.
5550         (Interface.PopluateEvent): Implemented.
5551
5552         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
5553
5554 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
5555
5556         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
5557         but this is required to check for a method name being the same as
5558         the containing class.  
5559
5560         Handle this now.
5561
5562 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5563
5564         * interface.cs: initialize variable.
5565
5566 2002-07-23  Martin Baulig  <martin@gnome.org>
5567
5568         Implemented the IndexerName attribute in interfaces.
5569
5570         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
5571         name if this is an explicit interface implementation.
5572         (Indexer.InterfaceIndexerName): New public variable.  If we're
5573         implementing an interface indexer, this is the IndexerName in that
5574         interface.  Otherwise, it's the IndexerName.
5575         (Indexer.DefineMethod): If we're implementing interface indexer,
5576         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
5577         and Pending.ImplementIndexer methods.
5578         (Indexer.Define): Also define the PropertyBuilder if we're
5579         implementing an interface indexer and this is neither an explicit
5580         interface implementation nor do the IndexerName match the one in
5581         the interface.
5582
5583         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
5584         If a method is defined here, then we always need to create a proxy
5585         for it.  This is used when implementing interface indexers.
5586         (Pending.IsInterfaceIndexer): New public method.
5587         (Pending.ImplementIndexer): New public method.
5588         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
5589         This is used when implementing interface indexers to define a proxy
5590         if necessary.
5591         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
5592         define a proxy if necessary.
5593
5594         * interface.cs (Interface.IndexerName): New public variable.
5595         (Interface.PopulateIndexer): Set the IndexerName.
5596         (Interface.DefineIndexers): New private method.  Populate all the
5597         indexers and make sure their IndexerNames match.
5598
5599         * typemanager.cs (IndexerPropertyName): Added support for interface
5600         indexers.
5601
5602 2002-07-22  Martin Baulig  <martin@gnome.org>
5603
5604         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
5605         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
5606         ret if HasReturnLabel.
5607         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
5608         variables.
5609
5610         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
5611         and set the ec.LoopBeginTryCatchLevel.
5612         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
5613         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
5614         the current ec.TryCatchLevel, the branch goes out of an exception
5615         block.  In this case, we need to use Leave and not Br.
5616
5617 2002-07-22  Martin Baulig  <martin@gnome.org>
5618
5619         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
5620         block unless the block does not always return or it is contained in
5621         another try { ... } catch { ... } block.  Fixes bug #26506.
5622         Added verify-1.cs to the test suite.
5623
5624 2002-07-22  Martin Baulig  <martin@gnome.org>
5625
5626         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
5627         then we do not always return.  Fixes bug #24985.
5628
5629 2002-07-22  Martin Baulig  <martin@gnome.org>
5630
5631         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
5632         lookup on a per-class level; ie. walk up the class hierarchy until we
5633         found at least one applicable method, then choose the best among them.
5634         Fixes bug #24463 and test-29.cs.
5635
5636 2002-07-22  Martin Baulig  <martin@gnome.org>
5637
5638         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
5639         return types of the methods.  The return type is not part of the
5640         signature and we must not check it to make the `new' modifier work.
5641         Fixes bug #27999, also added test-147.cs.
5642         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
5643
5644         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
5645         on the method's return type.
5646
5647 2002-07-21  Martin Baulig  <martin@gnome.org>
5648
5649         * assign.cs: Make this work if the rightmost source is a constant and
5650         we need to do an implicit type conversion.  Also adding a few more tests
5651         to test-38.cs which should have caught this.
5652
5653         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
5654         target in the makefile for this.  The makefile.gnu is primarily intended
5655         for end-users who don't want to debug the compiler.
5656
5657 2002-07-21  Martin Baulig  <martin@gnome.org>
5658
5659         * assign.cs: Improved the Assign class so it can now handle embedded
5660         assignments (X = Y = Z = something).  As a side-effect this'll now also
5661         consume less local variables.  test-38.cs now passes with MCS, added
5662         a few new test cases to that test.
5663
5664 2002-07-20  Martin Baulig  <martin@gnome.org>
5665
5666         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
5667         instructions.  Fixes bug #27977, also added test-146.cs.
5668
5669 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5670
5671         * cs-tokenizer.cs: fixed getHex ().
5672
5673 2002-07-19  Martin Baulig  <martin@gnome.org>
5674
5675         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
5676         not Type.GetType() to lookup the array type.  This is needed when
5677         we're constructing an array of a user-defined type.
5678         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
5679         single-dimensional arrays, but also for single-dimensial arrays of
5680         type decimal.
5681
5682 2002-07-19  Martin Baulig  <martin@gnome.org>
5683
5684         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
5685         this function is called, it's not allowed to share LocalBuilders
5686         among ILGenerators.
5687
5688 2002-07-19  Martin Baulig  <martin@gnome.org>
5689
5690         * expression.cs (Argument.Resolve): Report an error 118 when trying
5691         to pass a type as argument.
5692
5693 2002-07-18  Martin Baulig  <martin@gnome.org>
5694
5695         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
5696         Conv_R_Un for the signed `long' type.
5697
5698 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
5699
5700         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
5701         `expr' for the temporary result, as that will fail if we do
5702         multiple resolves on the same expression.
5703
5704 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
5705
5706         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
5707         ec.TypeContainer for looking up aliases. 
5708
5709         * class.cs (TypeContainer): Remove LookupAlias from here.
5710
5711         * decl.cs (DeclSpace); Move here.
5712
5713 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
5714
5715         * class.cs (FindMembers): Only call filter if the constructor
5716         bulider is not null.
5717
5718         Also handle delegates in `NestedTypes' now.  Now we will perform
5719         type lookups using the standard resolution process.  This also
5720         fixes a bug.
5721
5722         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
5723         This uses Expressions (the limited kind that can be parsed by the
5724         tree) instead of strings.
5725
5726         * expression.cs (ComposedCast.ToString): Implement, used to flag
5727         errors since now we have to render expressions.
5728
5729         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
5730         FormArrayType. 
5731
5732         * ecore.cs (SimpleName.ToString): ditto.
5733
5734         * cs-parser.jay: Instead of using strings to assemble types, use
5735         Expressions to assemble the type (using SimpleName, ComposedCast,
5736         MemberAccess).  This should fix the type lookups in declarations,
5737         because we were using a different code path for this.
5738
5739         * statement.cs (Block.Resolve): Continue processing statements
5740         even when there is an error.
5741
5742 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
5743
5744         * class.cs (Event.Define): Also remove the `remove' method from
5745         the list of pending items.
5746
5747         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
5748         generate more compact code. 
5749
5750 2002-07-17  Martin Baulig  <martin@gnome.org>
5751
5752         * const.cs (Const.LookupConstantValue): Add support for constant
5753         `unchecked' and `checked' expressions.
5754         Also adding test case test-140.cs for this.
5755
5756 2002-07-17  Martin Baulig  <martin@gnome.org>
5757
5758         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
5759         check whether mi.ReturnType implements the IEnumerator interface; the
5760         `==' and the IsAssignableFrom() will fail in this situation.
5761
5762 2002-07-16  Ravi Pratap  <ravi@ximian.com>
5763
5764         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
5765         here too.
5766
5767 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5768
5769         * expression.cs: fixed bug #27811.
5770
5771 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
5772
5773         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
5774         Molaro: when we are a ref, the value already contains a pointer
5775         value, do not take the address of it.
5776
5777 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
5778         * removed mb-parser.jay and mb-tokenizer.cs
5779
5780 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
5781
5782         * expression.cs: check against the building corlib void type.
5783
5784 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
5785
5786         * ecore.cs: fix for valuetype static readonly fields: when 
5787         initializing them, we need their address, not the address of a copy.
5788
5789 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
5790
5791         * typemanager.cs: register also enum_type in corlib.
5792
5793 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
5794
5795         * class.cs: allow calling this (but not base) initializers in structs.
5796
5797 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
5798
5799         * ecore.cs: make sure we compare against the building base types
5800         in GetTypeSize ().
5801
5802 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
5803
5804         * typemanager.cs: fix TypeToCoreType() to handle void and object
5805         (corlib gets no more typerefs after this change).
5806
5807 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
5808
5809         * expression.cs (ArrayCreation.EmitArrayArguments): use
5810         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
5811
5812         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
5813         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
5814         array indexes, the runtime actually forbids them.
5815
5816         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
5817         for array arguments here.
5818
5819         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
5820         instead of the default for ValueTypes.
5821
5822         (New.DoEmit): Use IsValueType instead of
5823         IsSubclassOf (value_type)
5824         (New.DoResolve): ditto.
5825         (Invocation.EmitCall): ditto.
5826
5827         * assign.cs (Assign): ditto.
5828
5829         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
5830         Statements *are* currently doing part of their resolution during
5831         Emit.  
5832
5833         Expressions do always resolve during resolve, but statements are
5834         only required to propagate resolution to their children.
5835
5836 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
5837
5838         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
5839
5840         (LoadAssembly): Do not add the dll if it is already specified
5841         
5842         (MainDriver): Add the System directory to the link path at the end,
5843         after all the other -L arguments. 
5844
5845         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
5846         wrong opcode for loading bytes and bools (ldelem.i1 instead of
5847         ldelem.u1) and using the opposite for sbytes.
5848
5849         This fixes Digger, and we can finally run it.
5850
5851         * driver.cs (UnixParseOption): Move the option parsing here.  
5852         (CSCParseOption): Implement CSC-like parsing of options.
5853
5854         We now support both modes of operation, the old Unix way, and the
5855         new CSC-like way.  This should help those who wanted to make cross
5856         platform makefiles.
5857
5858         The only thing broken is that /r:, /reference: and /lib: are not
5859         implemented, because I want to make those have the same semantics
5860         as the CSC compiler has, and kill once and for all the confussion
5861         around this.   Will be doing this tomorrow.
5862
5863         * statement.cs (Unsafe.Resolve): The state is checked during
5864         resolve, not emit, so we have to set the flags for IsUnsfe here.
5865
5866 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
5867
5868         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
5869         not catch the Error_ObjectRefRequired in SimpleName (as it is
5870         possible to have a class/instance variable name that later gets
5871         deambiguated), we have to check this here.      
5872
5873 2002-07-10  Ravi Pratap  <ravi@ximian.com>
5874
5875         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
5876         make static and put into Expression.
5877
5878         (Event.Define): Register the private field of the event with the 
5879         TypeManager so that GetFieldFromEvent can get at it.
5880
5881         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
5882         keep track of the private field associated with an event which
5883         has no accessors.
5884
5885         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
5886         private field.
5887
5888         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
5889         
5890 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
5891
5892         * expression.cs (Binary.EmitBranchable): this routine emits the
5893         Binary expression in a branchable context.  This basically means:
5894         we need to branch somewhere, not just get the value on the stack.
5895
5896         This works together with Statement.EmitBoolExpression.
5897
5898         * statement.cs (Statement.EmitBoolExpression): Use
5899         EmitBranchable. 
5900
5901 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
5902
5903         * statement.cs (For): Reduce the number of jumps in loops.
5904
5905         (For): Implement loop inversion for the For statement.
5906
5907         (Break): We can be breaking out of a Try/Catch controlled section
5908         (foreach might have an implicit try/catch clause), so we need to
5909         use Leave instead of Br.
5910
5911         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
5912         now).  If the instace expression supports IMemoryLocation, we use
5913         the AddressOf method from the IMemoryLocation to extract the
5914         address instead of emitting the instance.
5915
5916         This showed up with `This', as we were emitting the instance
5917         always (Emit) instead of the Address of This.  Particularly
5918         interesting when This is a value type, as we dont want the Emit
5919         effect (which was to load the object).
5920         
5921 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
5922
5923         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
5924
5925         * statement.cs (Checked): Set the CheckedState during the resolve
5926         process too, as the ConvCast operations track the checked state on
5927         the resolve process, and not emit.
5928
5929         * cs-parser.jay (namespace_member_declaration): Flag that we have
5930         found a declaration when we do.  This is used to flag error 1529
5931
5932         * driver.cs: Report ok when we display the help only.
5933
5934 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
5935
5936         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
5937
5938 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
5939
5940         * cs-tokenizer.cs (define): We also have to track locally the
5941         defines.  AllDefines is just used for the Conditional Attribute,
5942         but we also need the local defines for the current source code. 
5943
5944 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
5945
5946         * statement.cs (While, For, Do): These loops can exit through a
5947         Break statement, use this information to tell whether the
5948         statement is the last piece of code.
5949
5950         (Break): Flag that we break.
5951
5952         * codegen.cs (EmitContexts): New `Breaks' state variable.
5953
5954 2002-07-03  Martin Baulig  <martin@gnome.org>
5955
5956         * class.cs (TypeContainer.MethodModifiersValid): Allow override
5957         modifiers in method declarations in structs.  Otherwise, you won't
5958         be able to override things like Object.Equals().
5959
5960 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
5961
5962         * class.cs (Method, Property, Indexer): Do not allow the public
5963         modifier to be used in explicit interface implementations.
5964
5965         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
5966         override modifiers in method declarations in structs
5967
5968 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
5969
5970         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
5971         integer or real overflow, report an error
5972
5973 2002-07-02  Martin Baulig  <martin@gnome.org>
5974
5975         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
5976         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
5977         to tell the runtime about our newly created System.Object and
5978         System.ValueType types.
5979
5980 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
5981
5982         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
5983         struct instead of Ldarg/Starg.
5984
5985 2002-07-02  Martin Baulig  <martin@gnome.org>
5986
5987         * expression.cs (Indirection.Indirection): Call
5988         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
5989
5990 2002-07-02  Martin Baulig  <martin@gnome.org>
5991
5992         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
5993         ValueType, call TypeManager.TypeToCoreType() on it.
5994         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
5995         the OpCodes.Newarr argument.
5996
5997 2002-07-02  Martin Baulig  <martin@gnome.org>
5998
5999         * expression.cs (Invocation.EmitCall): When compiling corlib,
6000         replace all calls to the system's System.Array type to calls to
6001         the newly created one.
6002
6003         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
6004         System.Array methods.
6005         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
6006         from the system's System.Array type which must be replaced.
6007
6008 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
6009
6010         * typemanager.cs: load unverifiable_code_ctor so we can build
6011         corlib using the correct type. Avoid using GetTypeCode() with
6012         TypeBuilders.
6013         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
6014         TypeManager.object_type to allow building corlib.
6015
6016 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
6017
6018         * ecore.cs: handle System.Enum separately in LoadFromPtr().
6019
6020 2002-07-01  Martin Baulig  <martin@gnome.org>
6021
6022         * class.cs: Make the last change actually work, we need to check
6023         whether `ifaces != null' to avoid a crash.
6024
6025 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
6026
6027         * class.cs: when we build structs without fields that implement
6028         interfaces, we need to add the interfaces separately, since there is
6029         no API to both set the size and add the interfaces at type creation
6030         time.
6031
6032 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
6033
6034         * expression.cs: the dimension arguments to the array constructors
6035         need to be converted if they are a long.
6036
6037 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
6038
6039         * class.cs: don't emit ldarg.0 if there is no parent constructor
6040         (fixes showstopper for corlib).
6041
6042 2002-06-29  Martin Baulig  <martin@gnome.org>
6043
6044         MCS now compiles corlib on GNU/Linux :-)
6045
6046         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
6047         ie. check for MethodImplOptions.InternalCall.
6048
6049         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
6050         and TypeManager.attribute_type are null, so we must explicitly check
6051         whether parent is not null to find out whether it's an attribute type.
6052         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
6053         and SetBuilder, not only if the property is neither abstract nor external.
6054         This is necessary to set the MethodImplOptions on the accessor methods.
6055         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
6056         SetBuilder, see Property.Emit().
6057
6058         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
6059         populate "System.Object", "System.ValueType" and "System.Attribute" since
6060         they've already been populated from BootCorlib_PopulateCoreTypes().
6061
6062 2002-06-29  Martin Baulig  <martin@gnome.org>
6063
6064         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
6065         is the NullLiteral, we also need to make sure that target_type is not
6066         an enum type.   
6067
6068 2002-06-29  Martin Baulig  <martin@gnome.org>
6069
6070         * rootcontext.cs (RootContext.ResolveCore): We must initialize
6071         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
6072         before calling BootstrapCorlib_ResolveDelegate ().
6073
6074 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6075
6076         * statement.cs: fixed build-breaker. All tests passed ok.
6077
6078 2002-06-27  Martin Baulig  <martin@gnome.org>
6079
6080         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
6081         for System.Decimal when compiling corlib.
6082
6083 2002-06-27  Martin Baulig  <martin@gnome.org>
6084
6085         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
6086         switch blocks which contain nothing but a default clause.
6087
6088 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
6089
6090        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
6091
6092 2002-06-27  Martin Baulig  <martin@gnome.org>
6093
6094         * ecore.cs (PropertyExpr.PropertyExpr): Call
6095         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
6096
6097         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
6098         is already a TypeBuilder.
6099
6100 2002-06-27  Martin Baulig  <martin@gnome.org>
6101
6102         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
6103         `target_type == TypeManager.array_type', not IsAssignableFrom() in
6104         the "from an array-type to System.Array" case.  This makes it work
6105         when compiling corlib.
6106
6107 2002-06-27  Martin Baulig  <martin@gnome.org>
6108
6109         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
6110         non-static PropertyExpr, set its InstanceExpression.  This makes
6111         the `ICollection.Count' property work in System/Array.cs.
6112
6113 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
6114
6115         * driver.cs: Made error handling more consistent.  Errors now
6116         tracked by Report class, so many methods which used to return int
6117         now return void.  Main() now prints success/failure and 
6118         errors/warnings message.
6119
6120         Renamed '--probe' compiler argument to '--expect-error'.  Removed
6121         the magic number return values (123 and 124).  Now, if the
6122         expected error occurs, the compiler exits with success (exit value
6123         0).  If the compilation completes without seeing that particular
6124         error, the compiler exits with failure (exit value 1).  The
6125         makefile in mcs/errors has been changed to handle the new behaviour.
6126
6127         * report.cs: Made 'expected error' number a property and renamed
6128         it from 'Probe' to 'ExpectedError'.
6129
6130         * genericparser.cs: Removed error handling support, since it is
6131         now all done by Report class.
6132
6133         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
6134         class, so parse() no longer returns an int.
6135
6136         * namespace.cs: Use Report.Error instead of GenericParser.error
6137
6138 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
6139
6140         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
6141         TypeContainer.AddOperator): At the front of the list put the
6142         explicit implementations, so they get resolved/defined first. 
6143
6144 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
6145
6146         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
6147         interface type is implemented by this TypeContainer.  Used during
6148         explicit interface implementation.
6149
6150         (Property.Define, Indexer.Define, Method.Define): Validate that
6151         the given interface in the explicit implementation is one of the
6152         base classes for the containing type.
6153
6154         Also if we are explicitly implementing an interface, but there is
6155         no match in the pending implementation table, report an error.
6156
6157         (Property.Define): Only define the property if we are
6158         not explicitly implementing a property from an interface.  Use the
6159         correct name also for those properties (the same CSC uses,
6160         although that is really not needed).
6161         
6162         (Property.Emit): Do not emit attributes for explicitly implemented
6163         properties, as there is no TypeBuilder.
6164
6165         (Indexer.Emit): ditto.
6166
6167         Hiding then means that we do not really *implement* a pending
6168         implementation, which makes code fail.
6169
6170 2002-06-22  Martin Baulig  <martin@gnome.org>
6171
6172         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
6173         the return value of Object.GetType().  [FIXME: we need to do this whenever
6174         we get a type back from the reflection library].
6175
6176 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
6177
6178         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
6179
6180 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
6181
6182         * attribute.cs: Return null if we can not look up the type.
6183
6184         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
6185         the interface types found.
6186
6187         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
6188         interface types found.
6189
6190         * typemanager.cs (GetInterfaces): Make this routine returns alll
6191         the interfaces and work around the lame differences between
6192         System.Type and System.Reflection.Emit.TypeBuilder in the results
6193         result for GetInterfaces.
6194         
6195         (ExpandInterfaces): Given an array of interface types, expand and
6196         eliminate repeated ocurrences of an interface.  This expands in
6197         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
6198         be IA, IB, IC.
6199         
6200 2002-06-21  Martin Baulig  <martin@gnome.org>
6201
6202         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
6203         on System.Enum.
6204
6205 2002-06-21  Martin Baulig  <martin@gnome.org>
6206
6207         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
6208         and called with one of the core types, return the corresponding typebuilder for
6209         that type.
6210
6211         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
6212         element type.
6213
6214 2002-06-21  Martin Baulig  <martin@gnome.org>
6215
6216         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
6217         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
6218         (Expression.ConvertReferenceExplicit): Likewise.
6219
6220         * expression.cs (ElementAccess.DoResolve): Likewise.
6221         (ElementAccess.DoResolveLValue): Likewise.
6222
6223 2002-06-10  Martin Baulig  <martin@gnome.org>
6224
6225         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
6226         add the "value" parameter to the parameter list.
6227
6228         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
6229         to our caller.
6230
6231 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
6232
6233         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
6234         the argument to an int, uint, long or ulong, per the spec.  Also
6235         catch negative constants in array creation.
6236
6237 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
6238
6239         * class.cs: do not allow the same interface to appear twice in
6240         the definition list.
6241
6242 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
6243
6244         * ecore.cs: don't use ldlen with System.Array.
6245
6246 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
6247
6248         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
6249
6250 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
6251
6252         * modifiers.cs: produce correct field attributes for protected
6253         internal. Easy fix so miguel can work on ther harder stuff:-)
6254
6255 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
6256
6257         * pending.cs: New file.  Move the code from class.cs here.
6258         Support clearning the pending flag for all methods (when not doing
6259         explicit interface implementation).
6260
6261 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
6262
6263         * rootcontext.cs: added a couple more types needed to bootstrap.
6264
6265 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
6266
6267         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
6268         constructor in the type, instead of any constructor in the type
6269         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
6270         a bug in the Mono runtime when applying the params attribute). 
6271
6272 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
6273         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
6274
6275 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
6276
6277         * expression.cs (Unary.ResolveOperator): Use TypeManager
6278         to resolve the type.
6279         
6280 2002-06-13  Ravi Pratap  <ravi@ximian.com>
6281
6282         * cs-parser.jay (enum_member_declaration): Pass in the attributes
6283         attached.
6284
6285         * enum.cs (AddEnumMember): Add support to store the attributes associated 
6286         with each member too.
6287
6288         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
6289         field builders too - this takes care of the enum member case.
6290
6291 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
6292
6293         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
6294         address-of operator on both value types and pointers.
6295         
6296 2002-06-10  Martin Baulig  <martin@gnome.org>
6297
6298         * interface.cs (Interface.PopulateIndexer): Add the indexer's
6299         PropertyBuilder to the `property_builders' list.
6300
6301         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
6302         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
6303         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
6304         find any indexers which are inherited from an interface.
6305
6306 2002-06-09  Martin Baulig  <martin@gnome.org>
6307
6308         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
6309         the same type as the constant if necessary.  There's also a test-130.cs
6310         for this.
6311
6312         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
6313
6314         * typemanager.cs (TypeManager.ChangeType): Previously known as
6315         Enum.ChangeEnumType().
6316
6317 2002-06-09  Martin Baulig  <martin@gnome.org>
6318
6319         * expression.cs (Cast.TryReduce): Added support for consts.
6320
6321 2002-06-08  Ravi Pratap  <ravi@ximian.com>
6322
6323         * class.cs (Accessor): Hold attributes information so we can pass
6324         it along.
6325
6326         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
6327         Modify to pass in attributes attached to the methods.
6328
6329         (add_accessor_declaration, remove_accessor_declaration): Ditto.
6330
6331         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
6332         to handle the Accessor kind :-)
6333
6334         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
6335         
6336 2002-06-08  Martin Baulig  <martin@gnome.org>
6337
6338         * expression.cs (Unary.TryReduceNegative): Added support for
6339         ULongConstants.
6340
6341 2002-06-08  Martin Baulig  <martin@gnome.org>
6342
6343         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
6344         name can't be found in the `defined_names' - the caller will do a
6345         MemberLookup in this case and thus find methods in System.Enum
6346         such as Enum.IsDefined().
6347
6348 2002-06-08  Martin Baulig  <martin@gnome.org>
6349
6350         * enum.cs (Enum.ChangeEnumType): This is a custom version of
6351         Convert.ChangeType() which works with TypeBuilder created types.
6352         (Enum.LookupEnumValue, Enum.Define): Use it here.
6353
6354         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
6355         `TypeBuilder.BaseType != null' check.
6356         (TypeContainer.FindMembers): Only lookup parent members if we
6357         actually have a parent.
6358         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
6359         (ConstructorInitializer.Resolve): Likewise.
6360
6361         * interface.cs (Interface.FindMembers): Added
6362         `TypeBuilder.BaseType != null' check.
6363
6364         * rootcontext.cs (RootContext.ResolveCore): Added
6365         "System.Runtime.CompilerServices.IndexerNameAttribute" to
6366         classes_second_stage.
6367
6368         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
6369         debug_type and trace_type when compiling with --nostdlib.       
6370
6371 2002-06-07  Martin Baulig  <martin@gnome.org>
6372
6373         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
6374         (AddField): Set it to true when adding a non-static field.
6375         (DefineType): Use `have_nonstatic_fields' to find out whether we
6376         have non-static fields, not `Fields != null'.
6377
6378 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
6379
6380         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
6381         dereferencing a null on the static-field code path)
6382
6383 2002-05-30  Martin Baulig  <martin@gnome.org>
6384
6385         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
6386         to take command line arguments.  Use reflection to call the new
6387         custom `Initialize' function on the symbol writer and pass it the
6388         command line arguments.
6389
6390         * driver.cs (--debug-args): New command line argument to pass command
6391         line arguments to the symbol writer.
6392
6393 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
6394
6395         * assign.cs (DoResolve): Forgot to do the implicit conversion to
6396         the target type for indexers and properties.  Thanks to Joe for
6397         catching this.
6398
6399 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
6400
6401         * typemanager.cs (MethodFlags): returns the method flags
6402         (Obsolete/ShouldIgnore) that control warning emission and whether
6403         the invocation should be made, or ignored. 
6404
6405         * expression.cs (Invocation.Emit): Remove previous hack, we should
6406         not do this on matching a base type, we should do this based on an attribute
6407
6408         Only emit calls to System.Diagnostics.Debug and
6409         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
6410         on the command line.
6411
6412         * rootcontext.cs: Global settings for tracing and debugging.
6413
6414         * cs-tokenizer.cs (define): New utility function to track
6415         defines.   Set the global settings for TRACE and DEBUG if found.
6416
6417 2002-05-25  Ravi Pratap  <ravi@ximian.com>
6418
6419         * interface.cs (Populate*): Pass in the TypeContainer as well as
6420         the DeclSpace as parameters so that we can create EmitContexts and
6421         then use that to apply attributes etc.
6422
6423         (PopulateMethod, PopulateEvent, PopulateProperty)
6424         (PopulateIndexer): Apply attributes everywhere.
6425
6426         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
6427         etc.
6428
6429         (ApplyAttributes): Update accordingly.
6430
6431         We now apply interface attributes for all members too.
6432
6433 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
6434
6435         * class.cs (Indexer.Define); Correctly check if we are explicit
6436         implementation (instead of checking the Name for a ".", we
6437         directly look up if the InterfaceType was specified).
6438
6439         Delay the creation of the PropertyBuilder.
6440
6441         Only create the PropertyBuilder if we are not an explicit
6442         interface implementation.   This means that explicit interface
6443         implementation members do not participate in regular function
6444         lookups, and hence fixes another major ambiguity problem in
6445         overload resolution (that was the visible effect).
6446
6447         (DefineMethod): Return whether we are doing an interface
6448         implementation. 
6449         
6450         * typemanager.cs: Temporary hack until we get attributes in
6451         interfaces (Ravi is working on that) and we get IndexerName
6452         support in interfaces.
6453
6454         * interface.cs: Register the indexers as properties.
6455
6456         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
6457         warning, I have verified that this is a bug in the .NET runtime
6458         (JavaScript suffers of the same problem).
6459
6460         * typemanager.cs (MemberLookup): When looking up members for
6461         interfaces, the parent of an interface is the implicit
6462         System.Object (so we succeed in searches of Object methods in an
6463         interface method invocation.  Example:  IEnumerable x;  x.ToString
6464         ()) 
6465
6466 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
6467
6468         * class.cs (Event): Events should also register if they do
6469         implement the methods that an interface requires.
6470
6471         * typemanager.cs (MemberLookup); use the new GetInterfaces
6472         method. 
6473
6474         (GetInterfaces): The code used to lookup interfaces for a type is
6475         used in more than one place, factor it here. 
6476
6477         * driver.cs: Track the errors at the bottom of the file, we kept
6478         on going.
6479
6480         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
6481         instance if the method we are calling is static!
6482
6483 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
6484
6485         * attribute.cs (ApplyAttributes): Make this function filter out
6486         the IndexerName attribute (as that attribute in reality is never
6487         applied) and return the string constant for the IndexerName
6488         attribute. 
6489
6490         * class.cs (TypeContainer.Emit): Validate that all the indexers
6491         have the same IndexerName attribute, and if so, set the
6492         DefaultName attribute on the class. 
6493
6494         * typemanager.cs: The return value might contain other stuff (not
6495         only methods).  For instance, consider a method with an "Item"
6496         property and an Item method.
6497
6498         * class.cs: If there is a problem with the parameter types,
6499         return. 
6500
6501 2002-05-24  Ravi Pratap  <ravi@ximian.com>
6502
6503         * ecore.cs (ImplicitConversionExists): Wrapper function which also
6504         looks at user defined conversion after making a call to 
6505         StandardConversionExists - we need this for overload resolution.
6506
6507         * expression.cs : Update accordingly the various method calls.
6508
6509         This fixes 2 bugs filed against implicit user defined conversions 
6510
6511 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
6512
6513         * statement.cs: Track the result of the assignment.
6514
6515 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
6516
6517         * expression.cs (MemberAccess): Improved error reporting for
6518         inaccessible members.
6519
6520 2002-05-22  Martin Baulig  <martin@gnome.org>
6521
6522         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
6523         itself with debugging support.
6524
6525 2002-05-22  Martin Baulig  <martin@gnome.org>
6526
6527         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
6528         Removed, this isn't needed anymore.
6529
6530 2002-05-20  Martin Baulig  <martin@gnome.org>
6531
6532         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
6533         be underlying type for an enum.
6534
6535 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
6536
6537         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
6538         that splits out the loading of just the core types.
6539
6540         * rootcontext.cs (ResolveCore): Split the struct resolution in
6541         two, so we can load the enumeration underlying types before any
6542         enums are used.
6543
6544         * expression.cs (Is): Bandaid until we fix properly Switch (see
6545         bug #24985 for details).
6546
6547         * typemanager.cs (ImplementsInterface): The hashtable will contain
6548         a null if there are no interfaces implemented.
6549
6550 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
6551
6552         * cs-parser.jay (indexer_declarator): It is fine to have array
6553         parameters
6554
6555 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
6556
6557         * typemanager.cs: (RegisterBuilder): New function used to register
6558         TypeBuilders that implement interfaces.  Since
6559         TypeBuilder.GetInterfaces (as usual) does not work with lame
6560         Reflection.Emit. 
6561         (AddUserType): register interfaces.
6562
6563         (ImplementsInterface): Use the builder_to_ifaces hash if we are
6564         dealing with TypeBuilder.  Also, arrays are showing up as
6565         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
6566         methods can not be invoked on them!
6567
6568         * ecore.cs (ExplicitReferenceConversionExists): Made public.
6569         (ImplicitReferenceConversionExists): Split out from
6570         StandardConversionExists. 
6571
6572         * expression.cs (As): We were only implementing one of the three
6573         cases for the as operator.  We now implement them all.
6574         (Is): Implement the various other cases for Is as well.
6575
6576         * typemanager.cs (CACHE): New define used to control if we want or
6577         not the FindMembers cache.  Seems to have a negative impact on
6578         performance currently
6579
6580         (MemberLookup): Nested types have full acess to
6581         enclosing type members
6582
6583         Remove code that coped with instance/static returns for events, we
6584         now catch this in RealFindMembers.
6585
6586         (RealFindMembers): only perform static lookup if the instance
6587         lookup did not return a type or an event.  
6588
6589 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
6590
6591         * assign.cs (CompoundAssign): We pass more semantic information
6592         now to Compound Assignments than we did before: now we have all
6593         the information at hand, and now we resolve the target *before* we
6594         do the expression expansion, which allows the "CacheValue" method
6595         to have the effect we intended (before, a [x] += 1 would generate
6596         two differen ArrayAccess expressions from the ElementAccess,
6597         during the resolution process).
6598
6599         (CompoundAssign.DoResolve): Resolve target and original_source here.
6600
6601 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
6602
6603         * expression.cs (ArrayAccess): dropped debugging information. 
6604
6605         * typemanager.cs: Small bug fix: I was always returning i_members,
6606         instead of one of i_members or s_members (depending on which had
6607         the content).
6608
6609         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
6610         method is invoked before any code generation takes place, and it
6611         is a mechanism to inform that the expression will be invoked more
6612         than once, and that the method should use temporary values to
6613         avoid having side effects
6614
6615         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
6616         
6617         * ecore.cs (Expression.CacheTemporaries): Provide empty default
6618         implementation.
6619
6620         * expression.cs (Indirection, ArrayAccess): Add support for
6621         CacheTemporaries in these two bad boys. 
6622
6623         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
6624         ldobj or ldind_ref.  
6625         (StoreFromPtr): Handle stobj as well.
6626
6627         * expression.cs (UnaryMutator): Share more code.
6628         
6629         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
6630         down: I was not tracking the Filter function as well, which
6631         was affecting the results of the cache.
6632
6633 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
6634
6635         * attribute.cs: Remove the hack to handle the CharSet property on
6636         StructLayouts. 
6637
6638 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
6639
6640         * attribute.cs (DoResolve): More uglyness, we now only try to
6641         resolve the attribute partially, to extract the CharSet
6642         information (only if we are a StructLayout attribute).  Otherwise 
6643
6644         (GetExtraTypeInfo): Add some code to conditionally kill in the
6645         future this.   I am more and more convinced that the .NET
6646         framework has special code to handle the attribute setting on
6647         certain elements.
6648
6649         * expression.cs (IsParamsMethodApplicable): Revert my previous
6650         foreach change here, it was wrong.
6651
6652 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
6653
6654         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
6655         (pp_expr): do not abort on unknown input, just return.
6656         (eval): abort if there are pending chars.
6657
6658         * attribute.cs (Attribute.Resolve): Positional parameters are
6659         optional.  Deal with that case.
6660
6661         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
6662         the Ansi/Unicode/Auto information for the type.
6663
6664         (TypeContainer.DefineType): instantiate the EmitContext here, as
6665         we will be using it during the type definition (to resolve
6666         attributes) and during the emit phase.
6667
6668         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
6669         to pull type information out of the attributes
6670
6671         (Attribute.Resolve): track the constructor builder, and allow for
6672         multiple invocations (structs and classes will use this).
6673
6674         * ecore.cs (MemberLookupFinal): new version with all the
6675         parameters customizable.
6676
6677         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
6678         constructors.  Return if the result value is null (as the error
6679         would have been flagged already by MemberLookupFinal)
6680
6681         Do not allow instances of abstract classes or interfaces to be
6682         created.
6683         
6684         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
6685         We have to compare the assembly property here when dealing with
6686         FamANDAssem and Assembly access modifiers, because we might be
6687         creating an assembly from *modules* (that means that we are not
6688         getting TypeBuilders for types defined in other modules that are
6689         part of this assembly).
6690
6691         (Method.Emit): If the method is marked abstract and has a body,
6692         emit an error. 
6693
6694         (TypeContainer.DefineMembers): If both the defined member and the
6695         parent name match are methods, then do not emit any warnings: let
6696         the Method.Define routine take care of flagging warnings.  But if
6697         there is a mismatch (method overrides something else, or method is
6698         overriwritten by something, then emit warning).
6699
6700         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
6701         set to null, this means `do not check for the return type on the
6702         signature'. 
6703
6704         (Method.Define): set the return type for the method signature to
6705         null, so that we get methods with the same name and parameters and
6706         different return types.  This is used to flag warning 114 (you are
6707         hiding a method, and you probably want to use the new/override
6708         keywords instead).
6709
6710         * typemanager.cs (MemberLookup): Implemented proper access
6711         control, closing a long standing set of bug reports.  The problem
6712         was that the Framework only has two bits: Public and NonPublic,
6713         and NonPublic includes private and protected methods, but we need
6714         to enforce the FamANDAssem, FamOrAssem and Family. 
6715
6716 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
6717
6718         * statement.cs (GotoCase): Return true: Ammounts to giving up
6719         knowledge on whether we return or not, and letting the other case
6720         be responsible for it.
6721
6722 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
6723
6724         * driver.cs: Do not load directories for each file processed, only
6725         do it if there is a pattern.
6726
6727         * ecore.cs: Report readonly assigns here as well, as we might have
6728         been resolved only by MemberAccess.
6729
6730         (SimpleName.SimpleNameResolve): Also be useful for LValue
6731         resolution.   We need this to propagate assign to local readonly variables
6732
6733         * typemanager.cs: Use a ptrhashtable for the criteria, because we
6734         do not want to reuse potential criteria memory.
6735
6736         * class.cs (MyEventBuilder): Set reflected_type;
6737
6738         * ecore.cs (Constantify): Added support for constifying bools.
6739
6740         (RootContext.LookupType): Added a cache for values looked up in
6741         the declaration space.
6742
6743         * typemanager.cs (FindMembers): Now is a front-end to
6744         RealFindMembers, and provides a two-level hashtable-based cache to
6745         the request.  
6746
6747         15% performance improvement: from 22.5 to 19.2 seconds.
6748
6749         * expression.cs (IsParamsMethodApplicable): use foreach.
6750         (Invocation.DoResolve): ditto.
6751         (New.DoResolve): ditto.
6752         (ArrayCreation.DoResolve): ditto.
6753
6754         * ecore.cs (FindMostEncompassingType): use foreach.
6755
6756         * delegate.cs (NewDelegate.DoResolve): Use foreach
6757
6758         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
6759         (RemoveMethods): use foreach.
6760
6761         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
6762         nested foreach statements instead of for, and also break out of
6763         the inner loop once a match is found.
6764         
6765         (Invocation.OverloadResolve): Use foreach, simplify the code. 
6766
6767 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
6768
6769         * cfold.cs (BinaryFold): During an enumeration evaluation context,
6770         we actually unwrap the expression to allow for extra information
6771         to be extracted. 
6772
6773         * expression.cs: Use Shr_Un on unsigned operations. 
6774
6775 2002-05-08  Ravi Pratap  <ravi@ximian.com>
6776
6777         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
6778         applicable operators was not being considered correctly. This closes
6779         the bug Miguel reported.
6780
6781 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
6782
6783         * attribute.cs: check that the type derives from System.Attribute
6784         and report the correct error in that case (moved the duplicate code to
6785         its own method, too).
6786
6787 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
6788
6789         * attribute.cs: lookup attribute type name as the spec says: first the
6790         bare attribute name and then name + "Attribute" (nant compiles with
6791         mcs after this fix).
6792
6793 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
6794
6795         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
6796         Because of the way we parse things, we should try to see if a
6797         UIntConstant can fit in an integer.
6798
6799 2002-05-07  Ravi Pratap  <ravi@ximian.com>
6800
6801         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
6802         when we are in an explicit context.
6803
6804         (ConvertReferenceExplicit): When converting from Iface type S to Class
6805         T make sure the rules are implemented as an OR.
6806
6807         * parameter.cs (ParameterType): Make it a property for now although the
6808         purpose really isn't anything immediate.
6809         
6810         * expression.cs (Is*Applicable): Do better checking on the parameter type
6811         of a ref/out parameter. The ones from the system assemblies are already 
6812         marked with the correct type so we don't need to do any correction.
6813
6814         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
6815         the object type is standard too so include that.
6816
6817 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6818
6819         * ecore.cs (StandardConversionExists): Augment with missing code:
6820         deal with IntConstant, LongConstants and Enumerations.
6821
6822         * assign.cs: Report the error, instead of failing silently
6823
6824         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
6825         typecontainer that they are declared, because the
6826         typecontainer/namespace will have the list of using clauses that
6827         need to be applied.
6828
6829         Assembly Attributes were escaping the normal registration
6830         mechanism. 
6831
6832         (EmitCode): Apply attributes within an EmitContext that represents
6833         the container they were declared on.
6834         
6835         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
6836
6837 2002-05-06  Ravi Pratap  <ravi@ximian.com>
6838
6839         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
6840         Revamp completely - make much cleaner as we now operate only
6841         on a set of Types.
6842
6843         (FindMostSpecificSource, FindMostSpecificTarget): New methods
6844         to implement the logic detailed in the spec more correctly.
6845
6846         (UserDefinedConversion): Update accordingly.
6847
6848 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6849
6850         * statement.cs: Return flow analysis information up.
6851
6852         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
6853         and the default.
6854
6855         (token): Do not consume an extra character before calling
6856         decimal_digits.
6857
6858 2002-05-06  Piers Haken <piersh@friskit.com>
6859
6860         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
6861
6862 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6863
6864         * class.cs (Constructor.Emit): Set the IsStatic flag in the
6865         EmitContext during the instance constructor initializer
6866         resolution, to stop access to instance variables.
6867
6868         This is mandated by the spec, last paragraph of the `constructor
6869         initializers' section. 
6870
6871 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
6872
6873         * cs-parser.jay, class.cs (Accessor): new class used to represent
6874         an accessor (get or set).  In the past we used `null' to represent
6875         a missing accessor.  But this is ambiguous because there was no
6876         way to tell in abstract indexers/properties if one of them was
6877         specified.
6878
6879         Now there is a way of addressing that.
6880
6881         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
6882         instead of FindMembers.
6883
6884         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
6885         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
6886
6887         * attribute.cs: Treat indexers and properties as the same in terms
6888         of applying attributes
6889
6890         * ecore.cs (FindMostEncompassedType): Use statically initialized
6891         EmptyExpressions()s like we do elsewhere to avoid creating useless
6892         objects (and we take this out of the tight loop).
6893
6894         (GetConversionOperators): Move the code to extract the actual
6895         operators to a separate routine to clean things up.
6896
6897 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
6898
6899         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
6900         events are always registered FieldBuilders.
6901         
6902         * class.cs (FieldBase): New class shared by Fields 
6903
6904         * delegate.cs: If we are a toplevel delegate, use our full name.
6905         If we are a nested delegate, then only use our tail name.
6906
6907 2002-05-02  Ravi Pratap  <ravi@ximian.com>
6908
6909         * expression.cs (IsApplicable): Ensure that we add the "&" to
6910         ref/out types before comparing it with the type of the argument.
6911
6912         (IsParamsMethodApplicable): Ditto.
6913
6914         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
6915         silly me ;-)
6916
6917         * delegate.cs : Handle the case when we have more than one applicable
6918         method. Flag an error only when we finish checking all.
6919
6920 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
6921
6922         * expression.cs: Add support for boolean static initializers.
6923
6924 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
6925
6926         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
6927
6928         * parameter.cs (ComputeParameterTypes,
6929         ComputeAndDefineParameterTypes): Better error handling: now we
6930         clear the `types' cache if we fail during any of the type lookups.
6931         We also return the status code correctly to our caller
6932
6933         * delegate.cs: If we fail to define a delegate, abort the extra
6934         steps. 
6935
6936         * expression.cs (Binary.ResolveOperator): for
6937         operator==(object,object) and operator !=(object, object) we also
6938         have to verify that there is an implicit conversion from one to
6939         the other.
6940
6941         (ArrayAccess.DoResolve): Array Access can operate on
6942         non-variables. 
6943
6944 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
6945
6946         * assign.cs (CompoundAssign): A new class used as a "flag" that
6947         the assignment actually is happening as part of a compound
6948         assignment operator.
6949
6950         During compound assignment, a few new rules exist to enable things
6951         like:
6952
6953         byte b |= 1 + 2
6954
6955         From the spec:
6956         
6957         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
6958         to the type of x) if y is implicitly convertible to the type of x,
6959         and the operator is a builtin operator and the return type of the
6960         operator is explicitly convertible to the type of x. 
6961
6962         * rootcontext.cs: Reset warning level to 2.  4 catches various
6963         "interesting" features in mcs, we must clean this up at some
6964         point, but currently am trying to kill other bugs ;-)
6965
6966         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
6967         in container classes as well.  
6968
6969         * expression.cs (Binary.ResolveOperator): Handle string case
6970         before anything else (as operator overloading does emit an error
6971         before doing anything else).
6972
6973         This code could go away when we move to a table driven model, but
6974         i could not come up with a good plan last night.
6975         
6976 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
6977
6978         * typemanager.cs (CSharpName): reimplementation using regex.
6979         * class.cs: added null check for fields in Emit
6980         * rootcontext.cs: set warninglevel to 4
6981
6982 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
6983
6984         * typemanager.cs (CSharpName): reimplemented with Lupus
6985         suggestion.
6986
6987 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
6988
6989         * statement.cs (If): correclty implement Resolve, because we were
6990         not catching sem errors in there.  The same process is needed
6991         everywhere else. 
6992         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
6993         
6994
6995         (Statement.Warning_DeadCodeFound): Factorize code.
6996         (While): Report dead code here too.
6997
6998         (Statement): Added Resolve virtual method to allow
6999         for resolution split from the emit code.
7000
7001 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
7002
7003         * statement.cs (EmitBoolExpression): No longer try to resolve the
7004         expression here.    
7005         (MakeBoolean): New utility function that resolve, implicitly
7006         converts to boolean and tags the expression. 
7007         
7008
7009         (If, Do): Implement dead code elimination.
7010         (While): Implement loop inversion
7011
7012         (Do, While, For, If): Resolve the expression prior to calling our
7013         code generation.
7014
7015 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
7016
7017         * class.cs:
7018           - added method Report28 (warning: program has more than one entry point)
7019           - added method IsEntryPoint, implements paragraph 10.1 of the spec
7020           - modified method Method.Define, the part at the end of the method
7021
7022         * rootcontext.cs: added static public Location EntryPointLocation;
7023           
7024         * ../errors/cs0028.cs : Add test case for the above warning.              
7025
7026         * typemanager.cs:
7027           - modified method CSharpName to allow arrays of primitive type to
7028             be printed nicely (e.g. instead of System.Int32[][] it now prints
7029             int[][])
7030           - added method CSharpSignature: returns the signature of a method
7031             in string format to be used in reporting errors, warnings, etc.
7032
7033         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
7034         with String.Empty.
7035         
7036 2002-04-26  Ravi Pratap  <ravi@ximian.com>
7037
7038         * delegate.cs (Define): Fix extremely silly bug where I was
7039         setting the type of the 'object' parameter of the BeginInvoke
7040         method to System.IAsyncResult instead of System.Object ;-)
7041
7042 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
7043
7044         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
7045         here. 
7046
7047         (Constructor.Emit): return if we fail to initialize the
7048         constructor.  Another door closed!  
7049
7050         * expression.cs (New.DoResolve): Improve error message (from -6 to
7051         1501).  Use DeclaredOnly lookup to find the exact constructor.
7052
7053         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
7054         loop.  This is useful.
7055
7056         * cs-parser.jay: Adjust the default parameters so that destructors
7057         have the proper signature.
7058
7059 2002-04-26  Martin Baulig  <martin@gnome.org>
7060
7061         * driver.cs (LoadAssembly): If `assembly' contains any characters
7062         which are only valid in path names and not in assembly names
7063         (currently slash, backslash and point), use Assembly.LoadFrom ()
7064         instead of Assembly.Load () on the `assembly' (before iteration
7065         over the link_paths).
7066
7067 2002-04-26  Martin Baulig  <martin@gnome.org>
7068
7069         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
7070
7071 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
7072
7073         * class.cs (Property): use the new typemanager.MemberLookup
7074
7075         (TypeContainer.MemberLookup): Implement using the
7076         TypeManager.MemberLookup now. 
7077         
7078         * typemanager.cs: Make MemberLookup a function of the TypeManager,
7079         and return MemberInfos, so that these can be used without an
7080         EmitContext (what we had before).
7081
7082 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
7083
7084         * expression.cs: Fix the case where the argument to params if the
7085         type of the params.  I omitted handling this before.   Fixed
7086
7087 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
7088
7089         * driver.cs: Call BootCorlib_PopulateCoreType
7090
7091         * class.cs (Property.CheckBase): Check for properties only, not
7092         for all members. 
7093
7094         * interface.cs: Temporary hack: try/catch around the
7095         CustomAttributeBuilder, because I am getting an exception that I
7096         do not understand.
7097
7098         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
7099         types whose definitions are required to be there (attributes are
7100         defined before standard types).
7101
7102         Compute definitions as we boot the various types, as they are used
7103         immediately (value_type class will need object_type, but if we do
7104         not initialize object_type, we will pass a null, which will let
7105         the runtime pick the System.Object from the existing corlib, which
7106         is not what we want).
7107
7108 2002-04-22  Patrik Torstensson <totte@labs2.com>
7109
7110         * cs-tokenizer.cs: fixed a number of trim() issues.
7111
7112 2002-04-22  Ravi Pratap  <ravi@ximian.com>
7113
7114         * expression.cs (Argument.Type): Ensure that we return the correct
7115         type when we have out or ref parameters [in which case we 
7116         append a "&"].
7117         
7118 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
7119
7120         * class.cs (Property, Indexer): Allow extern modifier in there. 
7121
7122         * typemanager.cs (InitBaseTypes): Initializes object_type and
7123         value_type, since those will be used early on during the bootstrap
7124         process to compile corlib.
7125
7126         (InitCoreTypes): Move code from here to InitBaseTypes.
7127
7128 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
7129
7130         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
7131         single-dimension arrays as using the ldlen opcode.  
7132
7133         Daniel Lewis discovered this optimization.  
7134
7135         * typemanager.cs: Add signature for System.Array::get_Length
7136
7137 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7138
7139         * statement.cs: report the error when the foreach does not apply to an
7140         array nor a collection.
7141
7142 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
7143
7144         * expression.cs: Add implicit conversions to the operator ~.
7145
7146         * constant.cs (DecimalConstant.Emit): Emit decimal value.
7147
7148         * typemanager.cs: Locate the decimal constructor.
7149
7150 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7151
7152         * attribute.cs: use the new property of TypeOf.
7153         * expression.cs: added 'get' property around typearg.
7154
7155         These changes fix a build breaker reported by NickD. Is this the
7156         correct way to fix?  If not, please, revert my changes and make it
7157         work :-).
7158
7159 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
7160
7161         * attribute.cs: Add support for typeof in attribute invocations.
7162         I am not sure that this is right though.
7163
7164 2002-04-14  Duncan Mak  <duncan@ximian.com>
7165
7166         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
7167         Binary.Operator.Division case.
7168
7169 2002-04-13  Ravi Pratap  <ravi@ximian.com>
7170
7171         * class.cs (DefineType): Ensure that we do a proper check on
7172         attribute types and also register it with the TypeManager.
7173
7174         (TypeContainer.Targets): The default for attribute types is
7175         AttributeTargets.All.
7176         
7177         * attribute.cs (ApplyAttributes): Registering the attribute type
7178         is done elsewhere, not when we discover we have a Usage attribute.
7179
7180 2002-04-12  Ravi Pratap  <ravi@ximian.com>
7181
7182         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
7183         and get rid of is_delegate parameter.
7184
7185         * everywhere : update.
7186         
7187 2002-04-12  Ravi Pratap  <ravi@ximian.com>
7188
7189         * cs-parser.jay (compilation_unit): Revamp completely to use
7190         some new ideas that I got from Rhys' grammar to solve the problems
7191         with assembly level attributes.
7192
7193         (outer_declaration): New grammar production.
7194
7195         (attribute_sections): Add.
7196
7197         (opt_attributes): Base on attribute_sections
7198
7199         (namespace_declaration): Allow opt_attributes to tackle the case
7200         when we have assembly level attributes - we are clever in this
7201         regard now ;-)
7202
7203         * attribute.cs (ApplyAttributes): Do not worry about assembly 
7204         attributes in the non-global context.
7205
7206         * rootcontext.cs (AddGlobalAttributes): Go back to using this
7207         instead of SetGlobalAttributes.
7208
7209         * class.cs, rootcontext.cs : Ensure we define and generate 
7210         attribute types before anything else.
7211
7212         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
7213         and flag the new error -20 for the case when the attribute type
7214         does not have valid targets specified. csc does not catch this.
7215
7216         * ../errors/errors.txt : update for error # -20
7217
7218 2002-04-11  Ravi Pratap  <ravi@ximian.com>
7219
7220         * support.cs (InternalParameters.ParameterModifier): Do some null
7221         checking and return sane values.
7222
7223         * class.cs (Method.Define): If we are a PInvoke method, ensure
7224         that we are static and extern. Report error # 601
7225
7226         * ../errors/cs0601.cs : Add test case for the above error.
7227
7228 2002-04-07  Ravi Pratap  <ravi@ximian.com>
7229
7230         * rootcontext.cs (attribute_types): We need to keep type of
7231         all attribute types separately and emit code for them first.
7232
7233         (RegisterAttribute) : Implement.
7234
7235         * class.cs (DefineType): Check if the current Type is a custom
7236         attribute type and register it accordingly.
7237
7238         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
7239         adding the first attribute twice and rename to
7240
7241         (SetGlobalAttributes): this.
7242
7243         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
7244         lookups.
7245
7246         * attribute.cs (ApplyAttributes): Take an additional argument telling us
7247         if we are processing global arguments. Hmm, I am unsure of this.
7248
7249 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7250
7251         * expression.cs: added static array of strings to avoid calling
7252         Enum.ToString () for Operator in Binary. Significant recover of
7253         performance.
7254
7255 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
7256
7257         * class.cs (FindMembers): Allow the Builders of the various
7258         members to be null.  If they are skip them.  This only happens
7259         during the PInvoke declaration.
7260
7261 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
7262
7263         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
7264         failure, so we do not keep going afterwards.
7265
7266         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
7267         wanted to pass `false' as the `is_delegate' argument.  If this is
7268         the case, why not use delegate_type == null to mean `is_delegate =
7269         false' and anything else as is_delegate = true.
7270
7271 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
7272
7273         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
7274         code for the section, not the beginning of the tests.
7275
7276 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
7277
7278         * cfold.cs: Handle operator + (Enum x, Underlying x) 
7279
7280         * expression.cs (Binary): same.  Warn about errors where we have
7281         Enum/Enum in operator + as well.
7282
7283 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
7284
7285         * statement.cs:
7286                 - added support for switch(bool)
7287                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
7288                 - add TableSwitchEmit() to handle table-based switch statements
7289
7290 2002-04-05  Ravi Pratap  <ravi@ximian.com>
7291
7292         * expression.cs (Invocation.OverloadResolve): Factor out code which
7293         does parameter compatibility checking with arguments so that we can 
7294         re-use the code even from Delegate.VerifyApplicability
7295
7296         (VerifyArgumentsCompat): Move above code here.
7297
7298         * delegate.cs (VerifyApplicability): Get rid of duplicate code
7299         and instead make a call to the above method.
7300
7301 2002-03-31  Ravi Pratap  <ravi@ximian.com>
7302
7303         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
7304         We use it to keep track of classes which are attribute types.
7305
7306 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
7307
7308         * delegate.cs (Delegate.Define): Correctly define the types in the
7309         presence of fixed and array parameters.
7310
7311         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
7312         doing FindMembers.
7313
7314         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
7315         include NonPublic after the first iteration.
7316
7317         * class.cs (Indexer.CheckBase): Only check if both parents are
7318         non-null. 
7319         
7320         * cs-parser.jay (accessor_body): If empty, set to null.
7321
7322         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
7323         same code path here to resolve constants names that we did have in
7324         MemberAccess.DoResolve.  There is too much code duplicated here.
7325
7326 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
7327
7328         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
7329
7330         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
7331         to MakeUnionSet.
7332
7333         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
7334         tokens, numbers and strings.
7335
7336         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
7337         parenthesis.
7338
7339         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
7340         asyncronous parameters and the regular parameters.  
7341
7342         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
7343         specify the target directory.
7344
7345         * expression.cs: (This.DoResolve): Simplify
7346         (As.Emit): Optimize, do not generate IsInst if the expression is
7347         always of the given type.
7348
7349         (Is.DoResolve): Bug fix, we were reporting both always/never for
7350         the is expression.
7351
7352         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
7353         creating too many unnecessary arrays.
7354
7355 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
7356
7357         * class.cs (EmitFieldInitializer): Use Assign expression to assign
7358         fields instead of rolling our own initializer.   Takes care of all
7359         implicit conversions, and drops unnecessary static checks/argument.
7360
7361 2002-03-31  Dick Porter  <dick@ximian.com>
7362
7363         * driver.cs: use the GetDirectories() return values properly, and
7364         use "/" as path separator.
7365
7366 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
7367
7368         * expression.cs (Unary): Optimize - - expr into expr.
7369         (Binary): Optimize a + (-b) into a -b.
7370
7371         * codegen.cs (CodeGen): Made all methods static.
7372
7373 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
7374
7375         * rootcontext.cs: 
7376
7377         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
7378         TypeBuilder property.
7379
7380         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
7381         instead. 
7382
7383         * tree.cs: Removed the various RecordXXXX, and replaced with a
7384         single RecordDecl.  Removed all the accessor methods, and just
7385         left a single access point Type 
7386
7387         * enum.cs: Rename DefineEnum to DefineType.
7388
7389         * decl.cs: New abstract method `DefineType' used to unify the
7390         Defines for Enumerations, Interfaces, TypeContainers and
7391         Delegates.
7392
7393         (FindType): Moved LookupInterfaceOrClass here.  Moved the
7394         LookupBaseClasses method that used to live in class.cs and
7395         interface.cs here, and renamed to FindType.
7396         
7397         * delegate.cs: Implement DefineType.  Take advantage of the
7398         refactored pattern for locating the parent builder without taking
7399         the parent_builder argument (which we know does not work if we are
7400         nested, and triggering a toplevel definition).
7401
7402 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
7403
7404         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
7405         accessibility of a member has changed during override and report
7406         an error if so.
7407
7408         * class.cs (Method.Define, Property.Define): Only complain on
7409         overrides if the method is private, any other accessibility is
7410         fine (and since we just checked the permission is the same, we are
7411         good to go).
7412
7413         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
7414         and elif are processed always.  The other pre-processing
7415         directives are only processed if we are "taking" the path
7416
7417 2002-03-29  Martin Baulig  <martin@gnome.org>
7418
7419         * class.cs (Method.Emit): Only emit symbolic debugging info if the
7420         current location is not Null.
7421
7422         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
7423         a separate method so we can profile it.
7424
7425         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
7426         `span.Seconds' are just seconds, but no minutes or hours.
7427         (MainDriver): Profile the CodeGen.SaveSymbols calls.
7428
7429 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
7430
7431         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
7432         Remove the gratuitous set of Final:
7433
7434                                 // If an interface implementation, then we can set Final.
7435                                 if (((flags & MethodAttributes.Abstract) == 0) &&
7436                                     implementing.DeclaringType.IsInterface)
7437                                         flags |= MethodAttributes.Final;
7438
7439         I do not know what I was smoking when I used that.
7440         
7441
7442         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
7443         step into fixing the name resolution issues for delegates and
7444         unifying the toplevel name resolution.
7445
7446 2002-03-28  Martin Baulig  <martin@gnome.org>
7447
7448         * class.cs (Method.Emit): If we have a symbol writer, call its
7449         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
7450         tell it about the current method.
7451
7452         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
7453         writer that we're going to emit the first byte of IL code for a new
7454         statement (a new source line).
7455         (EmitContext.EmitTopBlock): If we have a symbol writer, call
7456         EmitContext.Mark() before emitting any code.
7457
7458         * location.cs (SymbolDocument): Return null when we're Null.
7459
7460         * statement.cs (Statement): Moved the `Location loc' variable here.
7461         (Statement.EmitBoolExpression): If we have a symbol writer, call
7462         ec.Mark() before emitting any code to tell it that we're at the
7463         beginning of a new statement.
7464         (StatementExpression): Added `Location' argument to the constructor.
7465         (Block): Added public readonly variable `StartLocation' and public
7466         variable `EndLocation'.  The latter is to be set using SetEndLocation().
7467         (Block): Added constructor which takes a start and end location.
7468         (Block.SetEndLocation): New method. This sets the end location.
7469         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
7470         local variables we create.
7471         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
7472         each statement and do also mark the begin and end of the block.
7473
7474         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
7475         tell it the current lexer.Location, use Location.Null for the end of the
7476         block.
7477         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
7478         current block, set its end location using SetEndLocation().
7479         (statement_expression): StatementExpression constructor now takes the
7480         lexer.Location as additional argument.
7481         (for_statement, declare_local_variables): Likewise.
7482         (declare_local_variables): When creating a new implicit block, use the
7483         new Block constructor and pass it the lexer.Location.
7484
7485 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
7486
7487         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
7488         members also on the parent interfaces recursively.
7489
7490 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
7491
7492         * report.cs: Use new formats, since Gonzalo finished the missing
7493         bits. 
7494
7495         * expression.cs (Binary.ResolveOperator): added missing operator|
7496         operator& and operator^ for bool/bool.
7497
7498         * cs-parser.jay: CheckDef now takes a Location argument that is
7499         used to report errors more precisly (instead of reporting the end
7500         of a definition, we try to track something which is a lot closer
7501         to the source of the problem).
7502
7503         * cs-tokenizer.cs: Track global token use, so we can properly flag
7504         the use of #define/#undef after the first token has been seen.
7505
7506         Also, rename the reportXXXX to Error_DescriptiveName
7507
7508         * decl.cs (DeclSpace.IsTopLevel): Move property here from
7509         TypeContainer, so that Enum and Interface can use this too.
7510
7511         * class.cs (TypeContainer.LookupInterfaceOrClass,
7512         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
7513         `builder' argument.  Typically this was used to pass the parent
7514         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
7515         the definition).  
7516
7517         The problem is that a nested class could trigger the definition of
7518         a toplevel class, and the builder would be obviously wrong in that
7519         case. 
7520
7521         So we drop this argument, and we compute dynamically the
7522         TypeBuilder/ModuleBuilder (the correct information was available
7523         to us anyways from DeclSpace.Parent)
7524
7525         * interface.cs (Interface.DefineInterface): Drop builder
7526         parameter cleanup like class.cs
7527
7528         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
7529         like class.cs
7530
7531         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
7532         values. 
7533
7534         (Try.Emit): Propagate the returns value from the statement.
7535
7536         (Return.Emit): Even if we are leavning 
7537
7538         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
7539
7540         * modifiers.cs: Fix the computation of MethodAttributes flags.
7541
7542 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
7543
7544         * driver.cs: allow compilation of files that start with '/'.
7545         Add a default case when checking the argument of --target.
7546
7547 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
7548
7549         * interface.cs: Implement the same search algorithm for types in
7550         the interface code.
7551
7552         * delegate.cs: Do not allow multiple definition.
7553
7554         * Recovered ChangeLog that got accidentally amputated
7555
7556         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
7557
7558         * rootcontext.cs: Load manually enum to allow core classes to
7559         contain enumerations.
7560
7561         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
7562         Update to new static methods in TypeManager.
7563
7564         * typemanager.cs (GetMethod, GetConstructor): Use our
7565         implementation of FindMembers to find the members, since during
7566         corlib compilation, the types are TypeBuilders and GetMethod and
7567         GetConstructor do not work.
7568
7569         Make all methods in TypeManager static.
7570
7571         (InitCodeHelpers): Split the functionality from
7572         the InitCodeTypes function.
7573
7574         * driver.cs: Call InitCodeHelpers after we have populated the
7575         types. 
7576
7577         * cs-parser.jay (delegate_declaration): we did not used to compute
7578         the delegate name correctly for void delegates.
7579
7580 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
7581
7582         * rootcontext.cs (RootContext): Init the interface_resolve_order
7583         and type_container_resolve_order always.
7584
7585         (ResolveCore, BootstrapCorlib_ResolveClass,
7586         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
7587         compiler when compiling with --nostdlib
7588
7589         * class.cs (TypeContainer.DefineType): Check that our parent is
7590         not null.  This test is most important when we are bootstraping
7591         the core types.
7592
7593         * codegen.cs: Split out the symbol writing code.
7594
7595 2002-03-25  Martin Baulig  <martin@gnome.org>
7596
7597         * driver.cs (-g): Made -g an alias for --debug.
7598
7599 2002-03-24  Martin Baulig  <martin@gnome.org>
7600
7601         * codegen.cs (SymbolWriter): New public variable. Returns the
7602         current symbol writer.
7603         (CodeGen): Added `bool want_debugging_support' argument to the
7604          constructor. If true, tell the ModuleBuild that we want debugging
7605         support and ask it for the ISymbolWriter.
7606         (Save): If we have a symbol writer, call it's Close() method after
7607         saving the assembly.
7608
7609         * driver.c (--debug): New command line argument to create a
7610         debugger information file.
7611
7612         * location.cs (SymbolDocument): New public property. Returns an
7613         ISymbolDocumentWriter object for the current source file or null
7614         if we don't have a symbol writer.
7615
7616 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
7617
7618         * driver.cs (LoadAssembly): Correctly return when all the paths
7619         have been tried and not before.
7620
7621         * statement.cs (Switch.Emit): return the actual coverage for this
7622         statement (returns/not-returns)
7623
7624         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
7625         switch of the statement if we are the last switch section.  That
7626         kills two problems: try/catch problems (we used to emit an empty
7627         nop at the end) and switch statements where all branches would
7628         return. 
7629
7630 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
7631
7632         * driver.cs: Add default assemblies (the equivalent to the
7633         Microsoft CSC.RSP file)
7634
7635         * cs-tokenizer.cs: When updating `cols and setting it to zero,
7636         also update tokens_seen and set it to false.
7637
7638         * driver.cs: Implement --recurse for Mike.
7639
7640         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
7641         correctly splitting out the paths.
7642
7643 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
7644
7645         * interface.cs (Interface.PopulateProperty): Instead of using
7646         `parent' as the declaration space for the set parameters, use
7647         `this' 
7648
7649         * support.cs (InternalParameters): InternalParameters constructor
7650         takes a DeclSpace instead of a TypeContainer.
7651
7652         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
7653         types are being initialized, load the address of it before calling
7654         the function.  
7655
7656         (New): Provide a mechanism to disable the generation of local
7657         value type temporaries when the caller will be providing us with
7658         an address to store it.
7659
7660         (ArrayCreation.EmitDynamicInitializers): Use it.
7661
7662 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
7663
7664         * expression.cs (Invocation.EmitArguments): Only probe for array
7665         property if there is more than one argument.  Sorry about that.
7666
7667         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
7668         empty param arrays.
7669         
7670         * class.cs (Method.LabelParameters): Fix incorrect code path that
7671         prevented the `ParamArrayAttribute' from being applied to the
7672         params attribute.
7673
7674 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
7675
7676         * support.cs (ReflectionParameters): Correctly compute whether the
7677         last argument is a params array.  Fixes the problem with
7678         string.Split ('a')
7679
7680         * typemanager.cs: Make the assemblies array always be non-null
7681         (empty, but non-null)
7682
7683         * tree.cs (RecordDecl): New function that abstracts the recording
7684         of names.  This reports error 101, and provides a pointer to the
7685         previous declaration.  Fixes a crash in the compiler.
7686
7687         * cs-parser.jay (constructor_declaration): Update to new grammar,
7688         and provide a constructor_body that can be empty.
7689
7690 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
7691
7692         * driver.cs: Add support for --resources.
7693
7694         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
7695         Make all types for the various array helper methods be integer.
7696
7697         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
7698         CheckState to ConvCast.
7699
7700         (ConvCast): Now it takes a `checked' state argument, to avoid
7701         depending on the emit context for the conversion, and just using
7702         the resolve time setting.
7703
7704         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
7705         instead of Invocation.EmitArguments.  We do not emit the original
7706         arguments, instead we emit those which have been converted to
7707         unsigned int expressions.
7708
7709         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
7710
7711         * codegen.cs: ditto.
7712
7713         * expression.cs (LocalVariableReference): Drop the use of the
7714         Store function that depended on the variable index.
7715
7716         * statement.cs (VariableInfo): Drop the `Idx' property from this
7717         class, as this is not taking into account the indexes for
7718         temporaries tat we generate during the execution, getting the
7719         indexes wrong.
7720
7721         * class.cs: First emit class initializers, then call the parent
7722         constructor. 
7723
7724         * expression.cs (Binary): Fix opcode emision.
7725         (UnaryMutator.EmitCode): Support checked code generation
7726
7727         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
7728         matches for events for both the Static and Instance scans,
7729         pointing to the same element.   Fix that.
7730
7731 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
7732
7733         * rootcontext.cs (ResolveTree): Always set the
7734         interface_resolve_order, because nested interfaces will be calling
7735         into us.
7736
7737         * class.cs (GetInterfaceOrClass): Track the same resolution
7738         process used by TypeManager.LookupType.  This fixes the nested
7739         type lookups in class declarations (separate path from
7740         LookupType). 
7741
7742         (TypeContainer.DefineType): Also define nested interfaces.
7743         (TypeContainer.RegisterOrder): New public function used to
7744         register the order in which child interfaces need to be closed.
7745
7746         Nested interfaces need to be closed after their parents have been
7747         created. 
7748         
7749         * interface.cs (InterfaceAttr): Put all the logic for computing
7750         the interface attribute here. 
7751
7752         (DefineInterface): Register our interface order with the
7753         RootContext or with the TypeContainer depending on the case.
7754
7755 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
7756
7757         * cs-parser.jay: rework foreach statement to work with the new
7758         changes to the policy on SimpleNames.
7759         
7760         * report.cs: support Stacktrace on warnings as well.
7761
7762         * makefile: drop --unsafe and /unsafe from the compile.
7763
7764 2002-03-13  Ravi Pratap  <ravi@ximian.com>
7765
7766         * ecore.cs (StandardConversionExists): Modify to take an Expression
7767         as the first parameter. Ensure we do null -> reference type conversion
7768         checking.
7769
7770         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
7771         temporary Expression objects.
7772
7773 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
7774
7775         * interface.cs: workaround bug in method overloading resolution
7776         (there is already a bugzilla bug for it).
7777
7778 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
7779
7780         We could also solve this problem by having a separate path for
7781         performing type lookups, instead of DoResolve, we could have a
7782         ResolveType entry point, and only participating pieces of the
7783         production (simplename, deref, array) would implement this. 
7784         
7785         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
7786         signal SimpleName to only resolve type names and not attempt to
7787         resolve anything else.
7788
7789         * expression.cs (Cast): Set the flag.
7790
7791         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
7792
7793         * class.cs: Only report 108 if there is no `new' modifier.
7794
7795         * cs-parser.jay: rework foreach statement to work with the new
7796         changes to the policy on SimpleNames.
7797         
7798         * report.cs: support Stacktrace on warnings as well.
7799
7800         * makefile: drop --unsafe and /unsafe from the compile.
7801
7802 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
7803
7804         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
7805         lookups here, instead of doing that at parse time.  This means
7806         that our grammar will not introduce `LocalVariableReferences' as
7807         expressions at this point.  That solves the problem of code like
7808         this:
7809
7810         class X {
7811            static void Main ()
7812            { int X = 1;
7813             { X x = null }}}
7814
7815         This is only half the fix.  The full fix requires parameters to
7816         also be handled in this way.
7817
7818         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
7819         makes the use more obvious of the DeclSpace.  The
7820         ec.TypeContainer.TypeBuilder is now only used to pull the
7821         TypeBuilder for it.
7822
7823         My theory is that I can get rid of the TypeBuilder completely from
7824         the EmitContext, and have typecasts where it is used (from
7825         DeclSpace to where it matters).  
7826
7827         The only pending problem is that the code that implements Aliases
7828         is on TypeContainer, and probably should go in DeclSpace.
7829
7830         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
7831         lookups here, instead of doing that at parse time.  This means
7832         that our grammar will not introduce `LocalVariableReferences' as
7833         expressions at this point.  That solves the problem of code like
7834         this:
7835
7836         class X {
7837            static void Main ()
7838            { int X = 1;
7839             { X x = null }}}
7840
7841         This is only half the fix.  The full fix requires parameters to
7842         also be handled in this way.
7843
7844         * class.cs (Property.DefineMethod): When implementing an interface
7845         method, set newslot, when implementing an abstract method, do not
7846         set the flag (before we tried never setting it, or always setting
7847         it, which is the difference).
7848         (Indexer.DefineMethod): same.
7849         (Method.DefineMethod): same.
7850
7851         * ecore.cs: Only set the status used flag if we get back a Field.
7852
7853         * attribute.cs: Temporary hack, so Paolo can keep working.
7854
7855 2002-03-08  Ravi Pratap  <ravi@ximian.com>
7856
7857         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
7858         the unmanaged type in the case we have a MarshalAs attribute.
7859
7860         (Resolve): Handle the case when we are parsing the special MarshalAs
7861         attribute [we need to store the unmanaged type to use later]
7862         
7863         * typemanager.cs (marshal_as_attr_type): Built in type for the 
7864         MarshalAs Attribute.
7865
7866         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
7867         on parameters and accordingly set the marshalling info.
7868         
7869 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
7870
7871         * class.cs: Optimizing slightly by removing redundant code after
7872         we switched to the `NoTypes' return value.
7873         (Property.DefineMethod): use NoTypes here too.
7874
7875         This fixes the bug I introduced in my last batch of changes.
7876
7877 2002-03-05  Ravi Pratap  <ravi@ximian.com>
7878
7879         * tree.cs (RecordEnum): Add. We now keep track of enums too.
7880
7881         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
7882         Enums since those are types too. 
7883
7884         * cs-parser.jay (enum_declaration): Record enums as we parse them.
7885         
7886         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
7887         thanks to a call during the lookup process.
7888
7889 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
7890
7891         * statement.cs (Foreach): Lots of work to accomodate a particular
7892         kind of foreach statement that I had not kept in mind.  It is
7893         possible to have foreachs on classes that provide a GetEnumerator
7894         method that return objects that implement the "pattern" for using
7895         a foreach, there is no need to support GetEnumerator
7896         specifically. 
7897
7898         This is needed to compile nant.
7899
7900         * decl.cs: Only report 114 if the member is not `Finalize' and if
7901         the warning level is at least 2.
7902
7903         * class.cs: Moved the compare function from Method to
7904         MethodSignature. 
7905
7906         (MethodSignature.InheritableMemberSignatureCompare): Add new
7907         filter function that is used to extract inheritable methods from a
7908         class. 
7909
7910         (Method.Define): Use the new `inheritable_method_signature_filter'
7911         delegate
7912
7913         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
7914         command. 
7915
7916 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
7917
7918         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
7919
7920         * cs-parser.jay: Add opt_semicolon to the interface declaration.
7921
7922         * expression.cs: Pass location information to
7923         ConvertImplicitStandard. 
7924
7925         * class.cs: Added debugging code to track return values from
7926         interfaces. 
7927
7928 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
7929
7930         * expression.cs (Is.DoResolve): If either side of the `is' is an
7931         interface, do not flag the warning.
7932
7933         * ecore.cs (ImplicitReferenceConversion): We need a separate test
7934         for interfaces
7935
7936         * report.cs: Allow for --fatal to be used with --probe.
7937         
7938         * typemanager.cs (NoTypes): Move the definition for the empty Type
7939         array here. 
7940
7941         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
7942         properties. 
7943         (TypeContainer.DefineProxy): New function used to proxy to parent
7944         implementations when implementing interfaces.
7945         (TypeContainer.ParentImplements): used to lookup if our parent
7946         implements a public function that is required by an interface.
7947         (TypeContainer.VerifyPendingMethods): Hook this up.
7948
7949         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
7950         `modules' and `assemblies' arraylists into arrays.  We only grow
7951         these are the very early start up of the program, so this improves
7952         the speedof LookupType (nicely measured).
7953
7954         * expression.cs (MakeByteBlob): Replaced unsafe code with
7955         BitConverter, as suggested by Paolo.
7956
7957         * cfold.cs (ConstantFold.Binary): Special case: perform constant
7958         folding of string concatenation, but if either side is a string,
7959         and the other is not, then return null, and let the runtime use
7960         the concatenation on the string plus the object (using
7961         `Object.ToString'). 
7962
7963 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
7964
7965         Constant Folding has been implemented now.
7966         
7967         * expression.cs (Unary.Reduce): Do not throw an exception, catch
7968         the error instead on types that are not supported in one's
7969         complement. 
7970
7971         * constant.cs (Constant and all children): New set of functions to
7972         perform implict and explicit conversions.
7973         
7974         * ecore.cs (EnumConstant): Implement the new functions to perform
7975         conversion by proxying to the child expression.
7976
7977         * codegen.cs: (ConstantCheckState): Constant evaluation has its
7978         own separate setting that can not be turned off from the command
7979         line using --unchecked or --checked and is only controlled using
7980         the checked/unchecked statements and expressions.  This setting is
7981         used by the constant folder to flag errors.
7982
7983         * expression.cs (CheckedExpr, UncheckedExpr): Set the
7984         ConstantCheckState as well.   
7985
7986         During Resolve, they also have to flag the state, because the
7987         constant folder runs completely in the Resolve phase.
7988
7989         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
7990         well.
7991
7992 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
7993
7994         * cfold.cs: New file, this file contains the constant folder.
7995         
7996         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
7997         argument to track whether we are using the resulting address to
7998         load or store a value and provide better error messages. 
7999
8000         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
8001         new AddressOf arguments.
8002
8003         * statement.cs (Foreach.EmitCollectionForeach): Update
8004
8005         * expression.cs (Argument.Emit): Call AddressOf with proper
8006         arguments to track usage.
8007
8008         (New.DoEmit): Call AddressOf with new arguments.
8009
8010         (Unary.Emit): Adjust AddressOf call.
8011
8012 2002-03-01  Ravi Pratap  <ravi@ximian.com>
8013
8014         * cs-parser.jay (member_access): Change the case for pre-defined types
8015         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
8016         this suggestion.
8017
8018         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
8019         a method body.
8020
8021         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
8022         essentially like methods and apply attributes like MethodImplOptions to them too.
8023
8024         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
8025         not being null.
8026
8027         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
8028         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
8029         is the DeclSpace.
8030
8031         * Update code everywhere accordingly.
8032
8033         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
8034
8035         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
8036
8037 2002-02-28  Ravi Pratap  <ravi@ximian.com>
8038
8039         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
8040         try performing lookups against those instead of jumping straight into using
8041         the 'using' clauses.
8042
8043         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
8044
8045         (LookupType): Perform lookups in implicit parents too.
8046
8047         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
8048         sequence as RootContext.LookupType. 
8049
8050         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
8051         the various cases of namespace lookups into this method.
8052
8053 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
8054
8055         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
8056         in positional arguments)
8057
8058         * class.cs (Operator): Update the AllowedModifiers to contain
8059         extern. 
8060
8061         * cs-parser.jay: Update operator declaration to allow for the
8062         operator body to be empty.
8063
8064         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
8065         values. 
8066
8067 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
8068
8069         * class.cs (Method.Emit): Label parameters.
8070
8071         * driver.cs: Return 1 or 0 as the program exit code.
8072
8073 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
8074
8075         * expression.cs: Special case the `null' object when trying to
8076         auto-compute the type, as anything can be explicitly converted to
8077         that. 
8078
8079         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
8080         spotting this Paolo.
8081
8082         (Expression.ImplicitNumericConversion): Perform comparissions of
8083         the type using the underlying type in the case of an enumeration
8084         rather than using the enumeration type for the compare.
8085
8086         Cope with the underlying == type case, which is not possible to
8087         catch before. 
8088
8089         (Expression.ConvertNumericExplicit): Perform comparissions of
8090         the type using the underlying type in the case of an enumeration
8091         rather than using the enumeration type for the compare.
8092
8093         * driver.cs: If the user does not supply an extension, assume .exe
8094
8095         * cs-parser.jay (if_statement): Rewrote so that we can track the
8096         location for the if statement.
8097
8098         * expression.cs (Binary.ConstantFold): Only concat strings when
8099         the operation is "+", not everything ;-)
8100
8101         * statement.cs (Statement.EmitBoolExpression): Take a location
8102         argument. 
8103         (If, While, Do): Track location.
8104
8105         * expression.cs (Binary.ResolveOperator): In the object + string
8106         case, I was missing a call to ConvertImplicit
8107
8108 2002-02-25  Ravi Pratap  <ravi@ximian.com>
8109
8110         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
8111         Location arguments. Ensure we use RootContext.LookupType to do our work
8112         and not try to do a direct Type.GetType and ModuleBuilder.GetType
8113
8114         * interface.cs (PopulateMethod): Handle the type of the parameter being
8115         null gracefully.
8116
8117         * expression.cs (Invocation.BetterFunction): Handle the case when we 
8118         have a params method with no fixed arguments and a call is made with no
8119         arguments.
8120
8121 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
8122
8123         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
8124         the verbatim-string-literal
8125
8126         * support.cs (InternalParameters.ParameterModifier): handle null
8127         fixed parameters.
8128         (InternalParameters.ParameterType): ditto.
8129
8130         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
8131         duplicating the name of the variable parameter.
8132         (GetParameterByName): Fix bug where we were not looking up array
8133         paramters if they were the only present (thanks Paolo!).
8134         (GetParameterInfo): We only have an empty set of types if both
8135         fixed and array are set to null.
8136         (GetParameterInfo-idx): Handle FixedParameter == null
8137
8138         * cs-parser.jay: Handle the case where there is no catch
8139         statements (missing null test).
8140
8141 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
8142
8143         * driver.cs (MainDriver): Be conservative on our command line
8144         handling.
8145
8146         Catch DirectoryNotFoundException when calling GetFiles.
8147         
8148         (SplitPathAndPattern): Used to split the input specification into
8149         a path and a pattern that we can feed to Directory.GetFiles.
8150
8151 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
8152
8153         * statement.cs (Fixed): Implement the last case of the Fixed
8154         statement (string handling).
8155
8156         * expression.cs (StringPtr): New class used to return a char * to
8157         a string;  Used by the Fixed statement.
8158
8159         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
8160
8161         * expression.cs (Binary.ResolveOperator): Remove redundant
8162         MemberLookup pn parent type.
8163         Optimize union call, we do not need a union if the types are the same.
8164         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
8165         type.
8166
8167         Specialize the use of MemberLookup everywhere, instead of using
8168         the default settings. 
8169
8170         (StackAlloc): Implement stackalloc keyword.
8171
8172         * cs-parser.jay: Add rule to parse stackalloc.
8173         
8174         * driver.cs: Handle /h, /help, /?
8175
8176         * expression.cs (MakeByteBlob): Removed the hacks we had in place
8177         before we supported unsafe code.
8178         
8179         * makefile: add --unsafe to the self compilation of mcs.
8180
8181 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
8182
8183         * expression.cs (PointerArithmetic): New class that is used to
8184         perform pointer arithmetic.
8185         (Binary.Resolve): Handle pointer arithmetic
8186         Handle pointer comparission.
8187         (ArrayPtr): Utility expression class that is used to take the
8188         address of an array.
8189
8190         (ElementAccess): Implement array access for pointers
8191         
8192         * statement.cs (Fixed): Implement fixed statement for arrays, we
8193         are missing one more case before we are done.
8194
8195         * expression.cs (Indirection): Implement EmitAssign and set the
8196         ExprClass to Variable.  This allows pointer dereferences to be
8197         treated as variables, and to have values assigned to them.
8198         
8199         * ecore.cs (Expression.StoreFromPtr): New utility function to
8200         store values dereferencing.
8201
8202 2002-02-20  Ravi Pratap  <ravi@ximian.com>
8203
8204         * expression.cs (Binary.ResolveOperator): Ensure that we are
8205         not trying to operate on a void type - this fixes the reported
8206         bug.
8207
8208         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
8209         the parent implementation is sealed.
8210
8211         * ../errors/cs0239.cs : Add.
8212
8213         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
8214
8215         * typemanager.cs (unverifiable_code_type): Corresponds to 
8216         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
8217         which have unsafe code in them.
8218
8219         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
8220         unsafe context.
8221
8222 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
8223
8224         * cs-tokenizer.cs: Add support for @"litreal strings"
8225
8226         Make tokenizer accept pre-processor directives
8227         on any column (remove the old C-like limitation). 
8228
8229         * rootcontext.cs (EmitCode): Emit any global attributes.
8230         (AddGlobalAttributes): Used to keep track of assembly attributes. 
8231
8232         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
8233
8234         * cs-parser.jay: Add support for global attributes.  
8235
8236 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
8237
8238         * expression.cs (Indirection): New helper class.  Unary will
8239         create Indirection classes to be able to implement the
8240         IMemoryLocation interface on it.
8241
8242 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
8243
8244         * cs-parser.jay (fixed_statement): reference the right statement.
8245
8246         * statement.cs (Fixed.Emit): Finish implementing the fixed
8247         statement for the &x case.
8248
8249 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
8250
8251         * class.cs (Property.Define, Method.Define): Remove newslot when
8252         `implementing'.  
8253
8254         * modifiers.cs: My use of NewSlot when `Abstract' was set was
8255         wrong.  NewSlot should only be used if the `new' keyword is present.
8256
8257         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
8258         locating our system dir.  Sorry about this.
8259
8260 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
8261
8262         * driver.cs (GetSystemDir): Compute correctly the location of our
8263         system assemblies.  I was using the compiler directory instead of
8264         the library directory.
8265
8266 2002-02-13  Ravi Pratap  <ravi@ximian.com>
8267
8268         * expression.cs (BetterFunction): Put back in what Miguel commented out
8269         since it is the correct fix. The problem is elsewhere ;-)
8270
8271         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
8272         parameters of the parms method are themselves compatible or not !
8273
8274         (StandardConversionExists): Fix very dangerous bug where we were forgetting
8275         to check that a class implements an interface before saying that an implicit
8276         conversion was allowed. Use ImplementsInterface to do the checking.
8277
8278 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
8279
8280         * class.cs (Method.Define): Track whether we are an explicit
8281         implementation or not.  And only call DefineMethodOverride if we
8282         are an explicit implementation.
8283
8284         (Property.DefineMethod): Ditto.
8285
8286 2002-02-11  Ravi Pratap  <ravi@ximian.com>
8287
8288         * expression.cs (BetterFunction): Catch hideous bug which was
8289          preventing us from detecting ambiguous calls due to implicit casts i.e
8290         cs0121.
8291
8292 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
8293
8294         * support.cs (Pair): Remove un-needed method.  I figured why I was
8295         getting the error in cs-parser.jay, the variable in a foreach loop
8296         is readonly, and the compiler does not really treat this as a variable.
8297
8298         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
8299         instead of EQUALS in grammar.  
8300
8301         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
8302
8303         * expression.cs (Unary.DoResolve): Check whether the argument is
8304         managed or not.
8305
8306 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
8307
8308         * support.cs: Api for Pair to set a value.  Despite the fact that
8309         the variables are public the MS C# compiler refuses to compile
8310         code that accesses the field if the variable is part of a foreach
8311         statement. 
8312
8313         * statement.cs (Fixed): Begin implementation of the fixed
8314         statement.
8315
8316         (Block.AddVariable): Return the VariableInfo on success and null
8317         on failure instead of true/false. 
8318
8319         * cs-parser.jay (foreach): Catch errors on variables already
8320         defined (we were ignoring this value before) and properly unwind
8321         the block hierarchy
8322
8323         (fixed_statement): grammar for the fixed statement.
8324
8325 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
8326
8327         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
8328         pointer types to be incretemented.
8329
8330         (SizeOf): Implement.
8331
8332         * cs-parser.jay (pointer_member_access): Implement
8333         expr->IDENTIFIER production.
8334
8335         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
8336         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
8337         on safe contexts.
8338
8339         (Unary): Implement indirection.
8340
8341         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
8342         use in non-unsafe context).
8343
8344         (SimpleName.DoResolve): Check for pointers in field access on safe
8345         contexts. 
8346
8347         (Expression.LoadFromPtr): Factor the load-indirect code in this
8348         function.  This was duplicated in UnboxCast and ParameterReference
8349
8350 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
8351
8352         * expression.cs (ComposedCast): report an error if a pointer cast
8353         is used in a safe region.
8354
8355         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
8356         pointer type casts in unsafe context.
8357
8358         * codegen.cs (EmitContext): Set up IsUnsafe.
8359
8360         * cs-parser.jay (non_expression_type): Add productions for pointer
8361         casts. 
8362
8363         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
8364         code.  We should not use force into static mode if the method is
8365         not virtual.  Fixes bug in MIS
8366
8367         * statement.cs (Do.Emit, While.Emit, For.Emit,
8368         Statement.EmitBoolExpression): Add support to Do and While to
8369         propagate infinite loop as `I do return' semantics.
8370
8371         Improve the For case to also test for boolean constants.
8372
8373         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
8374         to the list of attributes we can add.
8375
8376         Remove `EmitContext' argument.
8377
8378         * class.cs (Method.Define): Apply parameter attributes.
8379         (Constructor.Define): Apply parameter attributes.
8380         (MethodCore.LabelParameters): Move here the core of labeling
8381         parameters. 
8382
8383         * support.cs (ReflectionParameters.ParameterModifier,
8384         InternalParameters.ParameterModifier): Use IsByRef on the type and
8385         only return the OUT bit for these parameters instead of in/out/ref
8386         flags.
8387
8388         This is because I miss-understood things.  The ParameterInfo.IsIn
8389         and IsOut represent whether the parameter has the [In] and [Out]
8390         attributes set.  
8391
8392 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
8393
8394         * ecore.cs (FieldExpr.Emit): Release temporaries.
8395
8396         * assign.cs (LocalTemporary.Release): new function.
8397
8398         * codegen.cs (EmitContext.GetTemporaryStorage,
8399         EmitContext.FreeTemporaryStorage): Rework the way we deal with
8400         temporary storage.  Now we can "put back" localbuilders when we
8401         are done with them
8402
8403 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
8404
8405         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
8406         need to make a copy of the variable to generate verifiable code.
8407
8408 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
8409
8410         * driver.cs: Compute dynamically the system directory.
8411
8412         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
8413         Slower, but more generally useful.  Used by the abstract
8414         registering implementation. 
8415
8416         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
8417         the rules for the special rule on Type/instances.  First check if
8418         we have the same name, and if so, try that special static path
8419         rather than the instance path.
8420         
8421 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
8422
8423         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
8424         for, while and if.
8425
8426         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
8427         Enum, ValueType, Delegate or Array for non-corlib compiles.
8428
8429         * cs-tokenizer.cs: Catch long identifiers (645)
8430
8431         * typemanager.cs (IndexerPropetyName): Ravi never tested this
8432         piece of code.
8433
8434         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
8435         fix, we were returning too early, so we were not registering
8436         pending methods from abstract classes.
8437
8438         Do not register pending methods if the class is abstract.
8439
8440         * expression.cs (Conditional.DoResolve): Report circular implicit
8441         conversions when we neecd to compute it for conditional
8442         expressions. 
8443
8444         (Is.DoResolve): If the expression is always of the provided type,
8445         flag warning 183.  If the expression can not ever be of the
8446         provided type flag warning 184.
8447
8448         * class.cs: Catch 169 as well.
8449
8450         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
8451         read. 
8452
8453 2002-01-18  Nick Drochak  <ndrochak@gol.com>
8454
8455         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
8456
8457 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
8458
8459         * interface.cs: (PopulateMethod): Check for pointers being defined
8460         only if the unsafe context is active.
8461         (PopulateProperty): ditto.
8462         (PopulateIndexer): ditto.
8463
8464         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
8465         specified.  If pointers are present, make sure that they are
8466         present in an unsafe context.
8467         (Constructor, Constructor.Define): ditto.
8468         (Field, Field.Define): ditto.
8469         (Property, Property.Define): ditto.
8470         (Event, Event.Define): ditto.
8471
8472         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
8473         hashtable if there are classes or structs defined.
8474
8475         * expression.cs (LocalVariableReference.DoResolve): Simplify this
8476         code, as the constant resolution moved.
8477
8478         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
8479         the metadata, so we can flag error 133. 
8480
8481         * decl.cs (MemberCore.UnsafeOK): New function to test that a
8482         pointer is being declared in an unsafe context.
8483
8484 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
8485
8486         * modifiers.cs (Modifiers.Check): Require a Location argument.
8487         Report error 227 for Unsafe use.
8488
8489         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
8490
8491         * statement.cs (For.Emit): If the test is null, then report that
8492         we do `return', as we wont reach anything afterwards.
8493
8494         (Switch.SwitchGoverningType): Track the expression that matched
8495         the conversion.
8496
8497         * driver.cs: Allow negative numbers as an error code to flag.
8498
8499         * cs-parser.jay: Handle 1551.
8500
8501         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
8502
8503 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
8504
8505         * cs-parser.jay: Report 1518 (type declaration can only contain
8506         class, struct, interface, enum or delegate)
8507
8508         (switch_label): Report 1523 (keywords `case' or `default' must
8509         preced code)
8510
8511         (opt_switch_sections): Report 1522 (empty switch)
8512
8513         * driver.cs: Report 1515 (response file specified multiple times)
8514         Report 1516 (Source file specified multiple times).
8515
8516         * expression.cs (Argument.Resolve): Signal 1510
8517
8518         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
8519         access not allowed in static code)
8520
8521 2002-01-11  Ravi Pratap  <ravi@ximian.com>
8522
8523         * typemanager.cs (IsPointerType): Utility method which we are going
8524         to need a lot.
8525
8526         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
8527         the object type, so we take care of that.
8528
8529         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
8530         
8531         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
8532         added to non-params parameters :-)
8533
8534         * typemanager.cs (CSharpName): Include 'void' type too. 
8535
8536         (void_ptr_type): Include in the set of core types.
8537
8538         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
8539         duplicating code.
8540
8541         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
8542         an unsafe context.
8543
8544         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
8545         completely forgotten about it.
8546
8547 2002-01-10  Ravi Pratap  <ravi@ximian.com>
8548
8549         * cs-parser.jay (pointer_type): Add. This begins our implementation
8550         of parsing rules for unsafe code.
8551
8552         (unsafe_statement): Implement.
8553
8554         (embedded_statement): Modify to include the above.
8555
8556         * statement.cs (Unsafe): Implement new class for unsafe blocks.
8557
8558         * codegen.cs (EmitContext.InUnsafe): Add. This determines
8559         if the current context is an unsafe one.
8560
8561         * cs-parser.jay (local_variable_pointer_type): Since local variable types
8562         are handled differently, we need separate rules for them.
8563
8564         (local_variable_declaration): Update to use local_variable_pointer_type
8565         to allow variable declarations of unmanaged pointer types.
8566
8567         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
8568         in unsafe contexts.
8569
8570         * ../errors/cs0214.cs : Add.
8571
8572 2002-01-16  Nick Drochak  <ndrochak@gol.com>
8573
8574         * makefile: remove 'response' file when cleaning.
8575
8576 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
8577
8578         * cs-parser.jay: Report 1524.
8579
8580 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
8581
8582         * typemanager.cs (RegisterMethod): drop checking if we have
8583         registered this from here
8584
8585 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
8586
8587         * class.cs (Method.EmitDestructor): Implement calling our base
8588         destructor. 
8589
8590         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
8591         value of InFinally.
8592
8593         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
8594         this routine and will wrap the call in a try/catch block.  Deal
8595         with the case.
8596
8597 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
8598
8599         * ecore.cs (Expression.MemberLookup): instead of taking a
8600         parameter `same_type' that was used to tell whether we could
8601         access private members we compute our containing type from the
8602         EmitContext.
8603
8604         (FieldExpr): Added partial support for volatile fields.  This does
8605         not work for volatile fields exposed from assemblies, as I can not
8606         figure out how to extract the modreq from it.
8607
8608         Updated all the source files to use this.
8609
8610         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
8611         because it is referenced by MemberLookup very often. 
8612
8613 2002-01-09  Ravi Pratap  <ravi@ximian.com>
8614
8615         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
8616         TypeBuilder.GetCustomAttributes to retrieve what we need.
8617
8618         Get rid of redundant default_member_attr_type as this is the same as
8619         default_member_type which already exists.
8620
8621         * interface.cs, attribute.cs : Update accordingly.
8622         
8623 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
8624
8625         * typemanager.cs: Enable IndexerPropertyName again.  It does not
8626         work for TYpeBuilders though.  Ravi, can you please fix this?
8627
8628         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
8629
8630         * expression.cs (Argument.Emit): Handle the case of ref objects
8631         being passed to ref functions;  
8632
8633         (ParameterReference.EmitLoad): Loads the content of the pointer
8634         without dereferencing.
8635
8636 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
8637
8638         * cs-tokenizer.cs: Implemented the pre-processing expressions.
8639
8640 2002-01-08  Ravi Pratap  <ravi@ximian.com>
8641
8642         * class.cs (Indexer.DefineMethod): Incorporate the interface
8643         type in the name of the method if we are doing explicit interface
8644         implementation.
8645
8646         * expression.cs (ConversionExists): Remove as it is completely obsolete.
8647
8648         (BetterConversion): Fix extremely trivial bug where we were referring to
8649         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
8650         again !
8651
8652         * ../errors/bug16.cs : Add although we have fixed it.
8653
8654 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
8655
8656         * expression.cs (BaseIndexer): Begin implementation.
8657
8658         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
8659
8660         * cs-parser.jay (indexer_declarator): Use qualified_identifier
8661         production directly to remove a shift/reduce, and implement
8662         explicit interface implementation.
8663
8664         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
8665         after a floating point suffix.
8666
8667         * expression.cs (DoNumericPromotions): Improved the conversion for
8668         uint/uint.  If we have a constant, we avoid doing a typecast to a
8669         larger type.
8670
8671         * class.cs (Indexer): Implement explicit interface implementation
8672         for indexers.
8673         
8674 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
8675
8676         * class.cs: make the default instance constructor public and hidebysig.
8677
8678 2001-01-03  Ravi Pratap  <ravi@ximian.com>
8679
8680         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
8681         so we can call it from elsewhere.
8682
8683         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
8684         we emit it internally if the class has a defined indexer; otherwise the user
8685         emits it by decorating the class definition with the DefaultMemberAttribute.
8686
8687         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
8688         attribute is not used on a type which defines an indexer.
8689
8690         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
8691         character when we skip whitespace.
8692
8693         * ../errors/cs0646.cs : Add.
8694
8695 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
8696
8697         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
8698         again. 
8699
8700         * makefile: Add practical target `mcs3.exe' which builds the third
8701         generation compiler. 
8702
8703         * expression.cs (New): Fix structures constructor calling.
8704
8705         * class.cs (Property, Method, Indexer): Emit Final flag on the
8706         method if we are an interface implementation and we are not
8707         abstract. 
8708
8709         * ecore.cs (PropertyExpr): New public field `IsBase', tells
8710         whether this property is referencing a `base' method.
8711
8712         * expression.cs (Invocation.EmitCall): take an extra argument:
8713         is_base, this is used to determine whether the `call' or
8714         `callvirt' opcode should be used.
8715
8716         
8717         * delegate.cs: update EmitCall.
8718
8719         * class.cs (Method.Define): Set NewSlot for the cases where we are
8720         not implementing an interface method.
8721
8722         (Property.Define): ditto.
8723
8724 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
8725
8726         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
8727         'r'.  Allows mcs to parse itself fully.
8728
8729 2002-01-02  Ravi Pratap  <ravi@ximian.com>
8730
8731         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
8732         of the number of initializers that require the InitializeArray method.
8733
8734         (CheckIndices): Store the Expression in all cases - not the plain value. Also
8735         update the above field where necessary.
8736
8737         (MakeByteBlob): Update accordingly.
8738
8739         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
8740         greater than 2.
8741
8742         (EmitDynamicInitializers): Update in accordance with the new optimization.
8743
8744         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
8745         same OpCode applies.
8746
8747         * cs-parser.jay : Fix some glaring errors I introduced.
8748
8749 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
8750
8751         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
8752         so that we can check for name clashes there too.
8753
8754         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
8755         for interface indexers.
8756
8757         * interfaces.cs (Define): Emit the default member attribute.
8758
8759         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
8760         variable was being referred to while setting the value ;-)
8761
8762 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
8763
8764         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
8765         byte-by-byte information when we know the data is zero.
8766
8767         Make the block always a multiple of 4, because
8768         DefineInitializedData has a bug.
8769
8770         * assign.cs: Fix, we should assign from the temporary, not from
8771         the source. 
8772
8773         * expression.cs (MakeByteBlob): Fix my incorrect code.
8774
8775 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
8776
8777         * typemanager.cs (EnumToUnderlying): This function is used to get
8778         the underlying type from an enumeration, because it does not
8779         always work. 
8780
8781         * constant.cs: Use the I4_S form for values between -128 and 127.
8782
8783         * statement.cs (Block.LookupLabel): Looks up a label.
8784         (Block): Drop support for labeled blocks.
8785
8786         (LabeledStatement): New kind of statement that represents a label
8787         only.
8788
8789         (Goto): Finally implement this bad boy.
8790         
8791         * cs-parser.jay: Update to reflect new mechanism to implement
8792         labels.
8793
8794 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
8795
8796         * codegen.cs (EmitContext.This): a codegen property that keeps the
8797         a single instance of this instead of creating many different this
8798         instances. 
8799
8800         * delegate.cs (Delegate.DoResolve): Update to use the property;
8801
8802         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
8803
8804         * expression.cs (BaseAccess.DoResolve): Ditto.
8805
8806 2001-12-29  Ravi Pratap  <ravi@ximian.com>
8807
8808         * typemanager.cs (methodimpl_attr_type): Add to hold the type
8809         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
8810
8811         (InitCoreTypes): Update accordingly.
8812
8813         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
8814         so we can quickly store the state.
8815
8816         (ApplyAttributes): Set the correct implementation flags
8817         for InternalCall methods.
8818
8819 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
8820
8821         * expression.cs (EmitCall): if a method is not virtual, then do
8822         not use callvirt on it.
8823
8824         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
8825         user defined stuff) requires the use of stobj, which takes an
8826         address on the stack instead of an array and an index.  So emit
8827         the Ldelema operation for it.
8828
8829         (EmitStoreOpcode): Use stobj for valuetypes.
8830
8831         (UnaryMutator.EmitCode): Use the right 1 value depending on
8832         whether we are dealing with int64/uint64, float or doubles.
8833
8834         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
8835         constructors that I implemented last night.
8836
8837         (Constructor.IsDefault): Fix to work properly for static
8838         constructors.
8839
8840         * cs-parser.jay (CheckDef): report method signature errors.
8841         Update error number 103 to be 132.
8842
8843         * decl.cs: New AdditionResult enumeration value: MethodExists.
8844         Although we do this check for methods later on in the semantic
8845         analysis, catching repeated default constructors is so easy that
8846         we catch these here. 
8847         
8848         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
8849         promotions code.
8850
8851         (ParameterReference.EmitAssign, Emit): handle
8852         bools as bytes.
8853
8854         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
8855         (ArrayAccess.EmitStoreOpcode): ditto.
8856
8857         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
8858
8859         * expression.cs (MakeByteBlob): Complete all the missing types
8860         (uint, short, ushort, byte, sbyte)
8861
8862         * class.cs: Only init instance field initializers on instance
8863         constructors. 
8864
8865         Rename `constructors' to instance_constructors. 
8866
8867         (TypeContainer.AddConstructor): Only add constructors to the list
8868         if it is not static.
8869
8870         Make sure that we handle default_static_constructor independently
8871         everywhere where we handle instance_constructors
8872
8873 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
8874
8875         * class.cs: Do not lookup or create a base initializer for a
8876         static constructor.
8877
8878         (ConstructorInitializer.Resolve): use the proper type to lookup
8879         for constructors.
8880
8881         * cs-parser.jay: Report error 1585 (modifiers between type and name).
8882
8883         * enum.cs, interface.cs: Remove CloseType, this is taken care by
8884         in DeclSpace. 
8885
8886         * decl.cs: CloseType is now an virtual method, the default
8887         implementation just closes this type.
8888         
8889 2001-12-28  Ravi Pratap  <ravi@ximian.com>
8890
8891         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
8892         to PreserveSig by default. Also emit HideBySig on such methods.
8893
8894         Basically, set the defaults to standard values.
8895
8896         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
8897         argument, if candidate is better, it can't be worse than the best !
8898
8899         (Invocation): Re-write bits to differentiate between methods being
8900         applicable in their expanded form and their normal form - for params
8901         methods of course.
8902
8903         Get rid of use_standard everywhere as only standard conversions are allowed
8904         in overload resolution. 
8905
8906         More spec conformance.
8907         
8908 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
8909
8910         * driver.cs: Add --timestamp, to see where the compiler spends
8911         most of its time.
8912
8913         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
8914         `this' in static code.
8915
8916         (SimpleName.DoResolve): Implement in terms of a helper function
8917         that allows static-references to be passed upstream to
8918         MemberAccess.
8919
8920         (Expression.ResolveWithSimpleName): Resolve specially simple
8921         names when called by MemberAccess to implement the special
8922         semantics. 
8923
8924         (Expression.ImplicitReferenceConversion): Handle conversions from
8925         Null to reference types before others, as Null's type is
8926         System.Object. 
8927
8928         * expression.cs (Invocation.EmitCall): Handle the special case of
8929         calling methods declared on a reference type from a ValueType
8930         (Base classes System.Object and System.Enum)
8931
8932         (MemberAccess.Resolve): Only perform lookups on Enumerations if
8933         the left hand side is a TypeExpr, not on every enumeration. 
8934
8935         (Binary.Resolve): If types are reference types, then do a cast to
8936         object on operators != and == of both arguments.
8937         
8938         * typemanager.cs (FindMembers): Extract instance and static
8939         members if requested.
8940
8941         * interface.cs (PopulateProperty): Use void_type instead of null
8942         as the return type for the setter method.
8943
8944         (PopulateIndexer): ditto.
8945
8946 2001-12-27  Ravi Pratap  <ravi@ximian.com>
8947
8948         * support.cs (ReflectionParameters): Fix minor bug where we
8949         were examining the wrong parameter for the ParamArray attribute.
8950
8951         Cope with requests for the type of the parameter at position
8952         greater than the params parameter's. We now return the element
8953         type of the params array as that makes more sense.
8954
8955         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
8956         accordingly as we no longer have to extract the element type
8957         ourselves.
8958
8959         (Invocation.OverloadResolve): Update.
8960
8961 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
8962
8963         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
8964         against IEnumerator, test whether the return value is a descendant
8965         of the IEnumerator interface.
8966
8967         * class.cs (Indexer.Define): Use an auxiliary method to implement
8968         the other bits of the method definition.  Begin support for
8969         explicit interface implementation.
8970
8971         (Property.DefineMethod): Use TypeManager.void_type instead of null
8972         for an empty return value.
8973
8974 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
8975
8976         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
8977         dealing with a FieldExpr which is composed of a FieldBuilder, in
8978         the code path we did extract the constant, but we should have
8979         obtained the underlying value to be able to cast it (otherwise we
8980         end up in an infinite loop, this is what Ravi was running into).
8981
8982         (ArrayCreation.UpdateIndices): Arrays might be empty.
8983
8984         (MemberAccess.ResolveMemberAccess): Add support for section
8985         14.5.4.1 that deals with the special case of E.I when E is a type
8986         and something else, that I can be a reference to a static member.
8987
8988         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
8989         handle a particular array type to create byte blobs, it is just
8990         something we dont generate byteblobs for.
8991
8992         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
8993         arguments. 
8994
8995         * location.cs (Push): remove the key from the hashtable that we
8996         are about to add.   This happens for empty files.
8997
8998         * driver.cs: Dispose files after we have parsed them.
8999
9000         (tokenize): new function that only runs the tokenizer on its
9001         input, for speed testing.
9002
9003 2001-12-26  Ravi Pratap  <ravi@ximian.com>
9004
9005         * class.cs (Event.Define): Define the private field only if there
9006         are no accessors defined.
9007
9008         * expression.cs (ResolveMemberAccess): If there is no associated
9009         field with the event, that means we have an event defined with its
9010         own accessors and we should flag error cs0070 since transforming
9011         ourselves into a field is not valid in that case.
9012
9013         * ecore.cs (SimpleName.DoResolve): Same as above.
9014
9015         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
9016         and charset to sane values.
9017
9018 2001-12-25  Ravi Pratap  <ravi@ximian.com>
9019
9020         * assign.cs (DoResolve): Perform check on events only if they 
9021         are being accessed outside the declaring type.
9022
9023         * cs-parser.jay (event_declarations): Update rules to correctly
9024         set the type of the implicit parameter etc.
9025
9026         (add_accessor, remove_accessor): Set current local parameters.
9027
9028         * expression.cs (Binary): For delegate addition and subtraction,
9029         cast the return value from the method into the appropriate delegate
9030         type.
9031
9032 2001-12-24  Ravi Pratap  <ravi@ximian.com>
9033
9034         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
9035         of these as the workaround is unnecessary.
9036
9037         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
9038         delegate data - none of that is needed at all.
9039
9040         Re-write bits to extract the instance expression and the delegate method
9041         correctly.
9042
9043         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
9044         on delegates too.
9045
9046         * attribute.cs (ApplyAttributes): New method to take care of common tasks
9047         of attaching attributes instead of duplicating code everywhere.
9048
9049         * everywhere : Update code to do attribute emission using the above method.
9050
9051 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
9052
9053         * expression.cs (IsParamsMethodApplicable): if there are not
9054         parameters, return immediately.
9055
9056         * ecore.cs: The 0 literal can be implicity converted to an enum
9057         type. 
9058
9059         (SimpleName.DoResolve): First lookup the type, then lookup the
9060         members. 
9061
9062         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
9063         want to get its address.  If the InstanceExpression is not
9064         addressable, store the result in a temporary variable, then get
9065         the address of it.
9066
9067         * codegen.cs: Only display 219 errors on warning level or above. 
9068
9069         * expression.cs (ArrayAccess): Make it implement the
9070         IMemoryLocation interface.
9071
9072         (Binary.DoResolve): handle the operator == (object a, object b)
9073         and operator != (object a, object b) without incurring into a
9074         BoxedCast (because 5 != o should never be performed).
9075
9076         Handle binary enumerator operators.
9077
9078         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
9079         value type, otherwise use Ldelem_ref.
9080
9081         Use precomputed names;
9082
9083         (AddressOf): Implement address of
9084
9085         * cs-parser.jay (labeled_statement): Fix recursive block
9086         addition by reworking the production.
9087
9088         * expression.cs (New.DoEmit): New has a special case:
9089                 
9090                  If we are dealing with a ValueType, we have a few
9091                  situations to deal with:
9092                 
9093                     * The target of New is a ValueType variable, that is
9094                       easy, we just pass this as the variable reference
9095                 
9096                     * The target of New is being passed as an argument,
9097                       to a boxing operation or a function that takes a
9098                       ValueType.
9099                 
9100                       In this case, we need to create a temporary variable
9101                       that is the argument of New.
9102
9103
9104 2001-12-23  Ravi Pratap  <ravi@ximian.com>
9105
9106         * rootcontext.cs (LookupType): Check that current_type is not null before
9107         going about looking at nested types.
9108
9109         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
9110         not implement the IAssignMethod interface any more.
9111
9112         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
9113         where we tranform them into FieldExprs if they are being resolved from within
9114         the declaring type.
9115
9116         * ecore.cs (SimpleName.DoResolve): Do the same here.
9117
9118         * assign.cs (DoResolve, Emit): Clean up code considerably. 
9119
9120         * ../errors/bug10.cs : Add.
9121
9122         * ../errors/cs0070.cs : Add.
9123
9124         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
9125
9126         * assign.cs : Get rid of EventIsLocal everywhere.
9127         
9128 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
9129
9130         * ecore.cs (ConvertIntLiteral): finished the implementation.
9131
9132         * statement.cs (SwitchLabel): Convert the value we are using as a
9133         key before looking up the table.
9134
9135 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
9136
9137         * codegen.cs (EmitTopBlock): Require a Location argument now.
9138
9139         * cs-parser.jay (constructor_declarator): We need to setup
9140         current_local_parameters before we parse the
9141         opt_constructor_initializer, to allow the variables to be bound
9142         to the constructor arguments.
9143
9144         * rootcontext.cs (LookupType): First lookup nested classes in our
9145         class and our parents before we go looking outside our class.
9146
9147         * expression.cs (ConstantFold): Extract/debox the values at the
9148         beginnning. 
9149
9150         * rootcontext.cs (EmitCode): Resolve the constants first before we
9151         resolve the types.  This is not really needed, but it helps debugging.
9152
9153         * statement.cs: report location.
9154         
9155         * cs-parser.jay: pass location to throw statement.
9156
9157         * driver.cs: Small bug fix.
9158
9159         * report.cs: Updated format to be 4-zero filled digits.
9160
9161 2001-12-22  Ravi Pratap  <ravi@ximian.com>
9162
9163         * expression.cs (CheckIndices): Fix minor bug where the wrong
9164         variable was being referred to ;-)
9165
9166         (DoEmit): Do not call EmitStaticInitializers when the 
9167         underlying type is System.Object.
9168
9169 2001-12-21  Ravi Pratap  <ravi@ximian.com>
9170
9171         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
9172         and do the usual workaround for SRE.
9173
9174         * class.cs (MyEventBuilder.EventType): New member to get at the type
9175         of the event, quickly.
9176
9177         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
9178
9179         * assign.cs (Assign.DoResolve): Handle the case when the target
9180         is an EventExpr and perform the necessary checks.
9181
9182         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
9183         interface.
9184
9185         (SimpleName.MemberStaticCheck): Include check for EventExpr.
9186
9187         (EventExpr): Set the type in the constructor itself since we 
9188         are meant to be born fully resolved.
9189
9190         (EventExpr.Define): Revert code I wrote earlier.
9191                 
9192         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
9193         instance expression is null. The instance expression is a This in that case
9194         or a null, depending on whether it is a static method or not.
9195
9196         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
9197         refers to more than one method.
9198
9199         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
9200         and accordingly flag errors.
9201
9202 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
9203
9204         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
9205
9206 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
9207
9208         * location.cs (ToString): Provide useful rutine.
9209
9210 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
9211
9212         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
9213         objects, return the actual integral boxed.
9214
9215         * statement.cs (SwitchLabel): define an ILLabel for each
9216         SwitchLabel. 
9217         
9218         (Switch.CheckSwitch): If the value is a Literal, extract
9219         the underlying literal.
9220         
9221         Also in the unused hashtable we had, add the SwitchLabel so we can
9222         quickly look this value up.
9223
9224         * constant.cs: Implement a bunch of new constants.  Rewrite
9225         Literal based on this.  Made changes everywhere to adapt to this.
9226         
9227         * expression.cs (Expression.MakeByteBlob): Optimize routine by
9228         dereferencing array only once, and also copes with enumrations.
9229
9230         bytes are two bytes wide, not one.
9231
9232         (Cast): Perform constant conversions.
9233         
9234         * ecore.cs (TryImplicitIntConversion): Return literals instead of
9235         wrappers to the literals here.
9236
9237         * expression.cs (DoNumericPromotions): long literals can converted
9238         to ulong implicity (this is taken care of elsewhere, but I was
9239         missing this spot).
9240
9241         * ecore.cs (Expression.Literalize): Make the return type Literal,
9242         to improve type checking.
9243
9244         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
9245
9246 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
9247
9248         * literal.cs: Revert code from ravi that checked the bounds.  The
9249         bounds are sane by the definition of the type itself. 
9250
9251         * typemanager.cs: Fix implementation of ImplementsInterface.  We
9252         need to actually look up in our parent hierarchy for interfaces
9253         implemented. 
9254
9255         * const.cs: Use the underlying type for enumerations
9256
9257         * delegate.cs: Compute the basename for the delegate creation,
9258         that should fix the delegate test case, and restore the correct
9259         Type Lookup semantics in rootcontext
9260
9261         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
9262         referencing a nested type with the Reflection API is using the "+"
9263         sign. 
9264
9265         * cs-parser.jay: Do not require EOF token at the end.
9266
9267 2001-12-20  Ravi Pratap  <ravi@ximian.com>
9268
9269         * rootcontext.cs (LookupType): Concatenate type names with
9270         a '.' instead of a '+' The test suite passes again.
9271
9272         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
9273         field of the enumeration.
9274
9275         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
9276         the case when the member is an EventExpr.
9277
9278         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
9279         static has an associated instance expression.
9280
9281         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
9282
9283         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
9284
9285         * class.cs (Event.Define): Register event and perform appropriate checks
9286         for error #111.
9287
9288         We define the Add and Remove methods even if the use provides none because
9289         in that case, we provide default implementations ourselves.
9290
9291         Define a private field of the type of the event. This is done by the CSC compiler
9292         and we should be doing it too ;-)
9293
9294         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
9295         More methods we use in code we generate.
9296
9297         (multicast_delegate_type, delegate_type): Two separate types since the distinction
9298         is important.
9299
9300         (InitCoreTypes): Update accordingly for the above.
9301
9302         * class.cs (Event.Emit): Generate code for default accessors that we provide
9303
9304         (EmitDefaultMethod): Do the job in the above.
9305
9306         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
9307         appropriate place.
9308
9309 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
9310
9311         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
9312         builders even if we were missing one.
9313
9314         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
9315         pass the Basename as our class name instead of the Name.  The
9316         basename will be correctly composed for us.
9317
9318         * parameter.cs (Paramters): Now takes a Location argument.
9319
9320         * decl.cs (DeclSpace.LookupType): Removed convenience function and
9321         make all the code call directly LookupType in RootContext and take
9322         this chance to pass the Location information everywhere.
9323
9324         * Everywhere: pass Location information.
9325
9326 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
9327
9328         * class.cs (Constructor.Define): Updated way of detecting the
9329         length of the parameters.
9330
9331         (TypeContainer.DefineType): Use basename as the type name for
9332         nested types.
9333
9334         (TypeContainer.Define): Do not recursively define types here, as
9335         definition is taken care in order by the RootContext.
9336
9337         * tree.cs: Keep track of namespaces in a per-file basis.
9338
9339         * parameter.cs (Parameter.ComputeSignature): Update to use
9340         DeclSpace. 
9341
9342         (Parameters.GetSignature): ditto.
9343
9344         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
9345         instead of a TypeContainer.
9346
9347         (Interface.SemanticAnalysis): Use `this' instead of our parent to
9348         resolve names.  Because we need to be resolve in our context, not
9349         our parents.
9350         
9351         * driver.cs: Implement response files.
9352
9353         * class.cs (TypeContainer.DefineType): If we are defined, do not
9354         redefine ourselves.
9355         
9356         (Event.Emit): Emit the code for add/remove handlers.
9357         (Event.Define): Save the MethodBuilders for add/remove.
9358
9359         * typemanager.cs: Use pair here too.
9360
9361         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
9362         DictionaryEntry requires the first argument to be non-null.  
9363         
9364         (enum_declaration): Compute full name for registering the
9365         enumeration.
9366         
9367         (delegate_declaration): Instead of using
9368         formal_parameter_list, use opt_formal_parameter_list as the list
9369         can be empty.
9370
9371         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
9372         (EventParsing): New property that controls whether `add' and
9373         `remove' are returned as tokens or identifiers (for events);
9374
9375 2001-12-19  Ravi Pratap  <ravi@ximian.com>
9376
9377         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
9378         use MyEventBuilder only and let it wrap the real builder for us.
9379
9380         (MyEventBuilder): Revamp constructor etc.
9381
9382         Implement all operations that we perform on EventBuilder in precisely the same
9383         way here too.
9384
9385         (FindMembers): Update to use the EventBuilder member.
9386
9387         (Event.Emit): Update accordingly.
9388
9389 2001-12-18  Ravi Pratap  <ravi@ximian.com>
9390
9391         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
9392         by calling the appropriate methods.
9393
9394         (GetCustomAttributes): Make stubs as they cannot possibly do anything
9395         useful.
9396
9397         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
9398
9399 2001-12-17  Ravi Pratap  <ravi@ximian.com>
9400
9401         * delegate.cs (Delegate.Populate): Check that the return type
9402         and various parameters types are indeed accessible.
9403
9404         * class.cs (Constructor.Define): Same here.
9405
9406         (Field.Define): Ditto.
9407
9408         (Event.Define): Ditto.
9409
9410         (Operator.Define): Check that the underlying Method defined itself
9411         correctly - so it's MethodBuilder should not be null.
9412
9413         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
9414         expression happens to be null.
9415
9416         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
9417         members but as of now we don't seem to be able to do anything really useful with it.
9418
9419         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
9420         not the EventBuilder.
9421
9422 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
9423
9424         * cs-tokenizer.cs: Add support for defines.
9425         Add support for #if, #elif, #else, #endif
9426         
9427         (eval_var): evaluates a variable.
9428         (eval): stubbed for evaluating functions.
9429
9430         * cs-parser.jay: Pass the defines information
9431
9432         * driver.cs: Add --define command line option.
9433
9434         * decl.cs: Move MemberCore here.
9435
9436         Make it the base class for DeclSpace.  This allows us to catch and
9437         report 108 and 109 for everything now.
9438
9439         * class.cs (TypeContainer.Define): Extract all the members
9440         before populating and emit the warning 108 (new keyword required
9441         to override) instead of having each member implement this.
9442
9443         (MemberCore.Define): New abstract method, we will be using this in
9444         the warning reporting engine in Populate.
9445         
9446         (Operator.Define): Adjust to new MemberCore protocol. 
9447
9448         * const.cs (Const): This does not derive from Expression, it is a
9449         temporary object we use to create fields, it is a MemberCore. 
9450
9451         * class.cs (Method.Define): Allow the entry point to be in a
9452         specific class.
9453
9454         * driver.cs: Rewrite the argument handler to clean it up a bit.
9455
9456         * rootcontext.cs: Made it just an auxiliary namespace feature by
9457         making everything static.
9458
9459         * driver.cs: Adapt code to use RootContext type name instead of
9460         instance variable.
9461
9462         * delegate.cs: Remove RootContext argument.
9463
9464         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
9465         argument. 
9466
9467         * class.cs (Event.Define): The lookup can fail.
9468         
9469         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
9470
9471         * expression.cs: Resolve the this instance before invoking the code.
9472
9473 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
9474
9475         * cs-parser.jay: Add a production in element_access that allows
9476         the thing to become a "type" reference.  This way we can parse
9477         things like "(string [])" as a type.
9478
9479         Note that this still does not handle the more complex rules of
9480         casts. 
9481         
9482
9483         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
9484
9485         * ecore.cs: (CopyNewMethods): new utility function used to
9486         assemble the list of methods from running FindMembers.
9487
9488         (MemberLookup): Rework FindMembers so that 
9489
9490 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
9491
9492         * class.cs (TypeContainer): Remove Delegates who fail to be
9493         defined.
9494
9495         * delegate.cs (Populate): Verify that we dont get null return
9496         values.   TODO: Check for AsAccessible.
9497
9498         * cs-parser.jay: Use basename to emit error 574 (destructor should
9499         have the same name as container class), not the full name.
9500
9501         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
9502         possible representation.  
9503
9504         Also implements integer type suffixes U and L.
9505
9506 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
9507
9508         * expression.cs (ArrayCreation.DoResolve): We need to do the
9509         argument resolution *always*.
9510
9511         * decl.cs: Make this hold the namespace.  Hold the root context as
9512         well.
9513         (LookupType): Move here.
9514
9515         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
9516
9517         * location.cs (Row, Name): Fixed the code, it was always returning
9518         references to the first file.
9519
9520         * interface.cs: Register properties defined through interfaces.
9521
9522         * driver.cs: Add support for globbing on the command line
9523
9524         * class.cs (Field): Make it derive from MemberCore as well.
9525         (Event): ditto.
9526
9527 2001-12-15  Ravi Pratap  <ravi@ximian.com>
9528
9529         * class.cs (Event::Define): Check that the type of the event is a delegate
9530         type else flag error #66.
9531
9532         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
9533         same.
9534
9535         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
9536         values of EntryPoint, CharSet etc etc.
9537
9538         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
9539
9540         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
9541         be null and we should ignore this. I am not sure if this is really clean. Apparently,
9542         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
9543         which needs this to do its work.
9544
9545         * ../errors/cs0066.cs : Add.
9546
9547 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
9548
9549         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
9550         helper functions.
9551
9552         * class.cs: (MethodSignature.MethodSignature): Removed hack that
9553         clears out the parameters field.
9554         (MemberSignatureCompare): Cleanup
9555
9556         (MemberCore): New base class used to share code between MethodCore
9557         and Property.
9558
9559         (RegisterRequiredImplementations) BindingFlags.Public requires
9560         either BindingFlags.Instace or Static.  Use instance here.
9561
9562         (Property): Refactored code to cope better with the full spec.
9563
9564         * parameter.cs (GetParameterInfo): Return an empty array instead
9565         of null on error.
9566
9567         * class.cs (Property): Abstract or extern properties have no bodies.
9568
9569         * parameter.cs (GetParameterInfo): return a zero-sized array.
9570
9571         * class.cs (TypeContainer.MethodModifiersValid): Move all the
9572         method modifier validation to the typecontainer so we can reuse
9573         this on properties.
9574
9575         (MethodCore.ParameterTypes): return an empty sized array of types.
9576
9577         (Property.Define): Test property modifier validity.
9578
9579         Add tests for sealed/override too.
9580
9581         (Method.Emit): abstract or extern methods have no bodies.
9582
9583 2001-12-14  Ravi Pratap  <ravi@ximian.com>
9584
9585         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
9586         thing.
9587
9588         (Method::Define, ::Emit): Modify accordingly.
9589
9590         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
9591
9592         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
9593
9594         * makefile: Pass in /unsafe.
9595
9596 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
9597
9598         * class.cs (MakeKey): Kill routine.
9599         
9600         * class.cs (TypeContainer.Define): Correctly define explicit
9601         method implementations (they require the full interface name plus
9602         the method name).
9603
9604         * typemanager.cs: Deply the PtrHashtable here and stop using the
9605         lame keys.  Things work so much better.
9606
9607         This of course broke everyone who depended on `RegisterMethod' to
9608         do the `test for existance' test.  This has to be done elsewhere.
9609
9610         * support.cs (PtrHashtable): A hashtable that avoid comparing with
9611         the object stupid Equals method (because, that like fails all over
9612         the place).  We still do not use it.
9613
9614         * class.cs (TypeContainer.SetRequiredInterface,
9615         TypeContainer.RequireMethods): Killed these two routines and moved
9616         all the functionality to RegisterRequiredImplementations.
9617
9618         (TypeContainer.RegisterRequiredImplementations): This routine now
9619         registers all the implementations required in an array for the
9620         interfaces and abstract methods.  We use an array of structures
9621         which can be computed ahead of time to reduce memory usage and we
9622         also assume that lookups are cheap as most classes will not
9623         implement too many interfaces.
9624
9625         We also avoid creating too many MethodSignatures.
9626
9627         (TypeContainer.IsInterfaceMethod): Update and optionally does not
9628         clear the "pending" bit if we find that there are problems with
9629         the declaration.
9630
9631         (TypeContainer.VerifyPendingMethods): Update to report errors of
9632         methods that look like implementations but are not.
9633
9634         (TypeContainer.Define): Add support for explicit interface method
9635         implementation. 
9636         
9637 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
9638
9639         * typemanager.cs: Keep track of the parameters here instead of
9640         being a feature of the TypeContainer.
9641
9642         * class.cs: Drop the registration of parameters here, as
9643         InterfaceMethods are also interface declarations.
9644
9645         * delegate.cs: Register methods with the TypeManager not only with
9646         the TypeContainer.  This code was buggy.
9647
9648         * interface.cs: Full registation here.
9649
9650 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
9651
9652         * expression.cs: Remove reducer for binary expressions, it can not
9653         be done this way.
9654
9655         * const.cs: Put here the code that used to go into constant.cs
9656
9657         * constant.cs: Put here the code for constants, this is a new base
9658         class for Literals.
9659
9660         * literal.cs: Make Literal derive from Constant.
9661
9662 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
9663
9664         * statement.cs (Return.Emit): Report error 157 if the user
9665         attempts to return from a finally block.
9666
9667         (Return.Emit): Instead of emitting a return, jump to the end of
9668         the function.
9669
9670         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
9671         LocalBuilder to store the result of the function.  ReturnLabel is
9672         the target where we jump.
9673         
9674
9675 2001-12-09  Radek Doulik  <rodo@ximian.com>
9676
9677         * cs-parser.jay: remember alias in current namespace
9678
9679         * ecore.cs (SimpleName::DoResolve): use aliases for types or
9680         namespaces
9681
9682         * class.cs (LookupAlias): lookup alias in my_namespace
9683
9684         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
9685         aliases hashtable
9686         (LookupAlias): lookup alias in this and if needed in parent
9687         namespaces
9688
9689 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
9690
9691         * support.cs: 
9692
9693         * rootcontext.cs: (ModuleBuilder) Made static, first step into
9694         making things static.  I need this to avoid passing the
9695         TypeContainer when calling ParameterType.
9696
9697         * support.cs (InternalParameters.ParameterType): Remove ugly hack
9698         that did string manipulation to compute the type and then call
9699         GetType.  Use Parameter.ParameterType instead.
9700
9701         * cs-tokenizer.cs: Consume the suffix for floating values.
9702
9703         * expression.cs (ParameterReference): figure out whether this is a
9704         reference parameter or not.  Kill an extra variable by computing
9705         the arg_idx during emission.
9706
9707         * parameter.cs (Parameters.GetParameterInfo): New overloaded
9708         function that returns whether a parameter is an out/ref value or not.
9709
9710         (Parameter.ParameterType): The type of the parameter (base,
9711         without ref/out applied).
9712         
9713         (Parameter.Resolve): Perform resolution here.
9714         (Parameter.ExternalType): The full type (with ref/out applied).
9715
9716         * statement.cs (Using.Emit, Using.EmitExpression): Implement
9717         support for expressions on the using statement.
9718
9719 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
9720
9721         * statement.cs (Using.EmitLocalVariableDecls): Split the
9722         localvariable handling of the using statement.
9723
9724         (Block.EmitMeta): Keep track of variable count across blocks.  We
9725         were reusing slots on separate branches of blocks.
9726
9727         (Try.Emit): Emit the general code block, we were not emitting it. 
9728
9729         Check the type of the declaration to be an IDisposable or
9730         something that can be implicity converted to it. 
9731
9732         Emit conversions if required.
9733
9734         * ecore.cs (EmptyExpression): New utility class.
9735         (Expression.ImplicitConversionExists): New utility function.
9736
9737 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
9738
9739         * statement.cs (Using): Implement.
9740
9741         * expression.cs (LocalVariableReference): Support read only variables.
9742
9743         * statement.cs: Remove the explicit emit for the Leave opcode.
9744         (VariableInfo): Add a readonly field.
9745
9746 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
9747
9748         * ecore.cs (ConvCast): new class used to encapsulate the various
9749         explicit integer conversions that works in both checked and
9750         unchecked contexts.
9751
9752         (Expression.ConvertNumericExplicit): Use new ConvCast class to
9753         properly generate the overflow opcodes.
9754
9755 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
9756
9757         * statement.cs: The correct type for the EmptyExpression is the
9758         element_type, not the variable type.  Ravi pointed this out.
9759
9760 2001-12-04  Ravi Pratap  <ravi@ximian.com>
9761
9762         * class.cs (Method::Define): Handle PInvoke methods specially
9763         by using DefinePInvokeMethod instead of the usual one.
9764
9765         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
9766         above to do the task of extracting information and defining the method.
9767         
9768 2001-12-04  Ravi Pratap  <ravi@ximian.com>
9769
9770         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
9771         of the condition for string type.
9772
9773         (Emit): Move that here. 
9774
9775         (ArrayCreation::CheckIndices): Keep string literals in their expression
9776         form.
9777
9778         (EmitDynamicInitializers): Handle strings appropriately.
9779
9780 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
9781
9782         * codegen.cs (EmitContext): Replace multiple variables with a
9783         single pointer to the current Switch statement.
9784
9785         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
9786         EmitContext.
9787
9788 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
9789
9790         * statement.cs 
9791
9792         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
9793         default'.
9794         
9795         (Foreach.Emit): Foreach on arrays was not setting
9796         up the loop variables (for break/continue).
9797
9798         (GotoCase): Semi-implented.
9799         
9800 2001-12-03  Ravi Pratap  <ravi@ximian.com>
9801
9802         * attribute.cs (CheckAttribute): Handle system attributes by using
9803         Attribute.GetAttributes to examine information we need.
9804
9805         (GetValidPlaces): Same here.
9806
9807         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
9808
9809         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
9810
9811         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
9812
9813         (Method::Define): Set appropriate flags if we have a DllImport attribute.
9814
9815         (Method::Emit): Handle the case when we are a PInvoke method.
9816
9817 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
9818
9819         * expression.cs: Use ResolveWithSimpleName on compound names.
9820
9821 2001-12-02  Ravi Pratap  <ravi@ximian.com>
9822
9823         * constant.cs (EmitConstant): Make sure we resolve the associated expression
9824         before trying to reduce it.
9825
9826         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
9827
9828         * constant.cs (LookupConstantValue): Implement.
9829
9830         (EmitConstant): Use the above in emitting the constant.
9831
9832         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
9833         that are user-defined by doing a LookupConstantValue on them.
9834
9835         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
9836         too, like above.
9837
9838 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
9839
9840         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
9841
9842         (BaseAccess.DoResolve): Implement.
9843
9844         (MemberAccess.DoResolve): Split this routine into a
9845         ResolveMemberAccess routine that can be used independently
9846
9847 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
9848
9849         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
9850         As that share bits of the implementation.  Is returns a boolean,
9851         while As returns the Type that is being probed.
9852
9853 2001-12-01  Ravi Pratap  <ravi@ximian.com>
9854
9855         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
9856         instead of a Literal - much easier.
9857
9858         (EnumInTransit): Remove - utterly useless :-)
9859
9860         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
9861
9862         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
9863
9864         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
9865         chain when we have no associated expression.
9866
9867 2001-11-30  Ravi Pratap  <ravi@ximian.com>
9868
9869         * constant.cs (Define): Use Location while reporting the errror.
9870
9871         Also emit a warning when 'new' is used and there is no inherited
9872         member to hide.
9873
9874         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
9875         populated.
9876
9877         (LookupEnumValue): Implement to lookup an enum member's value and define it
9878         if necessary.
9879
9880         (Populate): Re-write accordingly to use the above routine.
9881
9882 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
9883
9884         * expression.cs (This): Fix prototype for DoResolveLValue to
9885         override the base class DoResolveLValue.
9886
9887         * cs-parser.cs: Report errors cs574 and cs575 (destructor
9888         declarations) 
9889
9890         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
9891         (we need to load the address of the field here).  This fixes
9892         test-22. 
9893         
9894         (FieldExpr.DoResolveLValue): Call the DoResolve
9895         function to initialize the Instance expression.
9896         
9897         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
9898         correctly the GetEnumerator operation on a value type.
9899
9900         * cs-parser.jay: Add more simple parsing error catches.
9901
9902         * statement.cs (Switch): Add support for string switches.
9903         Handle null specially.
9904
9905         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
9906
9907 2001-11-28  Ravi Pratap  <ravi@ximian.com>
9908
9909         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
9910
9911         (declare_local_constant): New helper function.
9912
9913         * statement.cs (AddConstant): Keep a separate record of constants
9914
9915         (IsConstant): Implement to determine if a variable is a constant.
9916
9917         (GetConstantExpression): Implement.
9918
9919         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
9920
9921         * statement.cs (IsVariableDefined): Re-write.
9922
9923 2001-11-27  Ravi Pratap  <ravi@ximian.com>
9924
9925         * class.cs (TypeContainer::FindMembers): Look for constants
9926         in the case when we are looking for MemberTypes.Field
9927
9928         * expression.cs (MemberAccess::DoResolve): Check that in the
9929         case we are a FieldExpr and a Literal, we are not being accessed
9930         by an instance reference.
9931
9932         * cs-parser.jay (local_constant_declaration): Implement.
9933
9934         (declaration_statement): Implement for constant declarations.
9935
9936 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
9937
9938         * statement.cs (Switch): Catch double defaults.
9939
9940         (Switch): More work on the switch() statement
9941         implementation.  It works for integral values now, need to finish
9942         string support.
9943
9944
9945 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
9946
9947         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
9948         integer literals into other integer literals.  To be used by
9949         switch. 
9950
9951 2001-11-24  Ravi Pratap  <ravi@ximian.com>
9952
9953         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
9954         some memory.
9955
9956         (EmitDynamicInitializers): Cope with the above since we extract data
9957         directly from ArrayData now.
9958
9959         (ExpectInitializers): Keep track of whether initializers are mandatory
9960         or not.
9961
9962         (Bounds): Make it a hashtable to prevent the same dimension being 
9963         recorded for every element in that dimension.
9964
9965         (EmitDynamicInitializers): Fix bug which prevented the Set array method
9966         from being found.
9967
9968         Also fix bug which was causing the indices to be emitted in the reverse
9969         order.
9970
9971 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
9972
9973         * expression.cs (ArrayCreation): Implement the bits that Ravi left
9974         unfinished.  They do not work, because the underlying code is
9975         sloppy.
9976
9977 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9978
9979         * cs-parser.jay: Remove bogus fixme.
9980
9981         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
9982         on Switch statement.
9983         
9984 2001-11-23  Ravi Pratap  <ravi@ximian.com>
9985
9986         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
9987         the same. 
9988         
9989         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
9990         parameter. Apparently, any expression is allowed. 
9991
9992         (ValidateInitializers): Update accordingly.
9993
9994         (CheckIndices): Fix some tricky bugs thanks to recursion.
9995
9996         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
9997         I was being completely brain-dead.
9998
9999         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
10000         and re-write acordingly.
10001
10002         (DelegateInvocation): Re-write accordingly.
10003
10004         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
10005
10006         (MakeByteBlob): Handle types more correctly.
10007
10008         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
10009         initialization from expressions but it is incomplete because I am a complete
10010         Dodo :-|
10011
10012 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
10013
10014         * statement.cs (If.Emit): Fix a bug that generated incorrect code
10015         on If.  Basically, we have to return `true' (ie, we do return to
10016         our caller) only if both branches of the if return.
10017
10018         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
10019         short-circuit operators, handle them as short circuit operators. 
10020
10021         (Cast.DoResolve): Resolve type.
10022         (Cast.Cast): Take an expression as the target type.
10023
10024         * cs-parser.jay (cast_expression): Remove old hack that only
10025         allowed a limited set of types to be handled.  Now we take a
10026         unary_expression and we resolve to a type during semantic
10027         analysis.
10028
10029         Use the grammar productions from Rhys to handle casts (this is
10030         not complete like Rhys syntax yet, we fail to handle that corner
10031         case that C# has regarding (-x), but we will get there.
10032         
10033 2001-11-22  Ravi Pratap  <ravi@ximian.com>
10034
10035         * class.cs (EmitFieldInitializer): Take care of the case when we have a
10036         field which is an array type.
10037
10038         * cs-parser.jay (declare_local_variables): Support array initialization too.
10039
10040         * typemanager.cs (MakeKey): Implement.
10041
10042         (everywhere): Use the above appropriately.
10043
10044         * cs-parser.jay (for_statement): Update for array initialization while
10045         declaring variables.
10046
10047         * ecore.cs : The error message was correct, it's the variable's names that
10048         were misleading ;-) Make the code more readable.
10049
10050         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
10051         the correct type etc.
10052
10053         (ConvertExplicit): Handle Enum types by examining the underlying type.
10054
10055 2001-11-21  Ravi Pratap  <ravi@ximian.com>
10056
10057         * parameter.cs (GetCallingConvention): Always return
10058         CallingConventions.Standard for now.
10059
10060 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
10061
10062         * expression.cs (Binary.ResolveOperator): Update the values of `l'
10063         and `r' after calling DoNumericPromotions.
10064
10065         * ecore.cs: Fix error message (the types were in the wrong order).
10066
10067         * statement.cs (Foreach.ProbeCollectionType): Need to pass
10068         BindingFlags.Instance as well 
10069
10070         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
10071         implicit int literal conversion in an empty cast so that we
10072         propagate the right type upstream.
10073
10074         (UnboxCast): new class used to unbox value types.
10075         (Expression.ConvertExplicit): Add explicit type conversions done
10076         by unboxing.
10077
10078         (Expression.ImplicitNumericConversion): Oops, forgot to test for
10079         the target type before applying the implicit LongLiterals to ULong
10080         literal cast.
10081
10082 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
10083
10084         * cs-parser.jay (for_statement): Reworked the way For works: now
10085         we declare manually any variables that are introduced in
10086         for_initializer to solve the problem of having out-of-band code
10087         emition (that is what got for broken).
10088
10089         (declaration_statement): Perform the actual variable declaration
10090         that used to be done in local_variable_declaration here.
10091
10092         (local_variable_declaration): Do not declare anything, just pass
10093         the information on a DictionaryEntry
10094
10095 2001-11-20  Ravi Pratap  <ravi@ximian.com>
10096
10097         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
10098         re-write of the logic to now make it recursive.
10099
10100         (UpdateIndices): Re-write accordingly.
10101
10102         Store element data in a separate ArrayData list in the above methods.
10103
10104         (MakeByteBlob): Implement to dump the array data into a byte array.
10105
10106 2001-11-19  Ravi Pratap  <ravi@ximian.com>
10107
10108         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
10109         into CheckIndices.
10110
10111         * constant.cs (Define): Implement.
10112
10113         (EmitConstant): Re-write fully.
10114
10115         Pass in location info.
10116
10117         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
10118         respectively.
10119
10120         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
10121         DictionaryEntry since we need location info too.
10122
10123         (constant_declaration): Update accordingly.
10124
10125         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
10126         code into another method : UpdateIndices.
10127
10128 2001-11-18  Ravi Pratap  <ravi@ximian.com>
10129
10130         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
10131         some type checking etc.
10132
10133 2001-11-17  Ravi Pratap  <ravi@ximian.com>
10134
10135         * expression.cs (ArrayCreation::ValidateInitializers): Implement
10136         bits to provide dimension info if the user skips doing that.
10137
10138         Update second constructor to store the rank correctly.
10139
10140 2001-11-16  Ravi Pratap  <ravi@ximian.com>
10141
10142         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
10143         and try to implement.
10144
10145         * ../errors/cs0150.cs : Add.
10146
10147         * ../errors/cs0178.cs : Add.
10148
10149 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
10150
10151         * statement.cs: Implement foreach on multi-dimensional arrays. 
10152
10153         * parameter.cs (Parameters.GetParameterByName): Also lookup the
10154         name of the params argument.
10155
10156         * expression.cs: Use EmitStoreOpcode to get the right opcode while
10157         initializing the array.
10158
10159         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
10160         we can use this elsewhere.
10161
10162         * statement.cs: Finish implementation of foreach for single
10163         dimension arrays.
10164
10165         * cs-parser.jay: Use an out-of-band stack to pass information
10166         around, I wonder why I need this.
10167
10168         foreach_block: Make the new foreach_block the current_block.
10169
10170         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
10171         function used to return a static Parameters structure.  Used for
10172         empty parameters, as those are created very frequently.
10173
10174         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
10175
10176 2001-11-15  Ravi Pratap  <ravi@ximian.com>
10177
10178         * interface.cs : Default modifier is private, not public. The
10179         make verify test passes again.
10180
10181 2001-11-15  Ravi Pratap  <ravi@ximian.com>
10182
10183         * support.cs (ReflectionParameters): Fix logic to determine
10184         whether the last parameter is a params one. Test 9 passes again.
10185
10186         * delegate.cs (Populate): Register the builders we define with
10187         RegisterParameterForBuilder. Test 19 passes again.
10188
10189         * cs-parser.jay (property_declaration): Reference $6 instead
10190         of $$ to get at the location.
10191
10192         (indexer_declaration): Similar stuff.
10193
10194         (attribute): Ditto.
10195
10196         * class.cs (Property): Register parameters for the Get and Set methods
10197         if they exist. Test 23 passes again.
10198
10199         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
10200         call to EmitArguments as we are sure there aren't any params arguments. 
10201         Test 32 passes again.
10202
10203         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
10204         IndexOutOfRangeException. 
10205
10206         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
10207         Test 33 now passes again.
10208         
10209 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
10210
10211         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
10212         broke a bunch of things.  Will have to come up with a better way
10213         of tracking locations.
10214
10215         * statement.cs: Implemented foreach for single dimension arrays.
10216
10217 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
10218
10219         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
10220         an error.  This removes the lookup from the critical path.
10221
10222         * cs-parser.jay: Removed use of temporary_loc, which is completely
10223         broken. 
10224
10225 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
10226
10227         * support.cs (ReflectionParameters.ParameterModifier): Report
10228         whether the argument is a PARAMS argument or not.
10229
10230         * class.cs: Set the attribute `ParamArrayAttribute' on the
10231         parameter argument.
10232
10233         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
10234         and cons_param_array_attribute (ConstructorInfo for
10235         ParamArrayAttribute)., 
10236
10237         * codegen.cs: Emit the return using the `Return' statement, that
10238         way we can report the error correctly for missing return values. 
10239
10240         * class.cs (Method.Emit): Clean up.
10241
10242         * expression.cs (Argument.Resolve): Take another argument: the
10243         location where this argument is used.  Notice that this is not
10244         part of the "Argument" class as to reduce the size of the
10245         structure (we know the approximate location anyways).
10246
10247         Test if the argument is a variable-reference, if not, then
10248         complain with a 206.
10249
10250         (Argument.Emit): Emit addresses of variables.
10251
10252         (Argument.FullDesc): Simplify.
10253
10254         (Invocation.DoResolve): Update for Argument.Resolve.
10255
10256         (ElementAccess.DoResolve): ditto.
10257
10258         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
10259         method should be virtual, as this method is always virtual.
10260
10261         (NewDelegate.DoResolve): Update for Argument.Resolve.
10262
10263         * class.cs (ConstructorInitializer.DoResolve): ditto.
10264         
10265         * attribute.cs (Attribute.Resolve): ditto.
10266
10267 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
10268
10269         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
10270
10271         * expression.cs (ParameterReference): Drop IStackStorage and implement
10272         IAssignMethod instead. 
10273
10274         (LocalVariableReference): ditto.
10275         
10276         * ecore.cs (FieldExpr): Drop IStackStorage and implement
10277         IAssignMethod instead. 
10278
10279 2001-11-13  Miguel de Icaza <miguel@ximian.com>
10280
10281         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
10282         enumerations that are used in heavily used structures derive from
10283         byte in a laughable and pathetic attempt to reduce memory usage.
10284         This is the kind of pre-optimzations that you should not do at
10285         home without adult supervision.
10286
10287         * expression.cs (UnaryMutator): New class, used to handle ++ and
10288         -- separatedly from the other unary operators.  Cleans up the
10289         code, and kills the ExpressionStatement dependency in Unary.
10290
10291         (Unary): Removed `method' and `Arguments' from this class, making
10292         it smaller, and moving it all to SimpleCall, so I can reuse this
10293         code in other locations and avoid creating a lot of transient data
10294         strucutres when not required.
10295
10296         * cs-parser.jay: Adjust for new changes.
10297
10298 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
10299
10300         * enum.cs (Enum.Populate): If there is a failure during
10301         definition, return
10302
10303         * cs-parser.jay (opt_enum_base): we used to catch type errors
10304         here, but this is really incorrect.  The type error should be
10305         catched during semantic analysis.
10306
10307 2001-12-11  Ravi Pratap  <ravi@ximian.com>
10308
10309         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
10310         current_local_parameters as expected since I, in my stupidity, had forgotten
10311         to do this :-)
10312
10313         * attribute.cs (GetValidPlaces): Fix stupid bug.
10314
10315         * class.cs (Method::Emit): Perform check on applicability of attributes.
10316
10317         (Constructor::Emit): Ditto.
10318
10319         (Field::Emit): Ditto.
10320
10321         (Field.Location): Store location information.
10322
10323         (Property, Event, Indexer, Operator): Ditto.
10324
10325         * cs-parser.jay (field_declaration): Pass in location for each field.
10326
10327         * ../errors/cs0592.cs : Add.
10328
10329 2001-11-12  Ravi Pratap  <ravi@ximian.com>
10330
10331         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
10332
10333         (InitCoreTypes): Update accordingly.
10334
10335         (RegisterAttrType, LookupAttr): Implement.
10336
10337         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
10338         info about the same.
10339
10340         (Resolve): Update to populate the above as necessary.
10341
10342         (Error592): Helper.
10343
10344         (GetValidPlaces): Helper to the above.
10345
10346         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
10347
10348         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
10349
10350 2001-11-12  Ravi Pratap  <ravi@ximian.com>
10351
10352         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
10353
10354         * ../errors/cs0617.cs : Add.
10355
10356 2001-11-11  Ravi Pratap  <ravi@ximian.com>
10357
10358         * enum.cs (Emit): Rename to Populate to be more consistent with what
10359         we expect it to do and when exactly it is called.
10360
10361         * class.cs, rootcontext.cs : Update accordingly.
10362
10363         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
10364         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
10365
10366         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
10367
10368         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
10369         of a fieldinfo using the above, when dealing with a FieldBuilder.
10370
10371 2001-11-10  Ravi Pratap  <ravi@ximian.com>
10372
10373         * ../errors/cs0031.cs : Add.
10374
10375         * ../errors/cs1008.cs : Add.
10376
10377         * ../errrors/cs0543.cs : Add.
10378
10379         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
10380         enum type.
10381
10382         (FindMembers): Implement.
10383
10384         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
10385         enums and delegates too.
10386
10387         (enum_types): Rename to builder_to_enum.
10388
10389         (delegate_types): Rename to builder_to_delegate.
10390
10391         * delegate.cs (FindMembers): Implement.
10392
10393 2001-11-09  Ravi Pratap  <ravi@ximian.com>
10394
10395         * typemanager.cs (IsEnumType): Implement.
10396
10397         * enum.cs (Emit): Re-write parts to account for the underlying type
10398         better and perform checking etc.
10399
10400         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
10401         of the underlying type.
10402
10403         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
10404         value
10405
10406         * enum.cs (error31): Helper to report error #31.
10407
10408         * cs-parser.jay (enum_declaration): Store location of each member too.
10409
10410         * enum.cs (member_to_location): New hashtable. 
10411
10412         (AddEnumMember): Update location hashtable.
10413
10414         (Emit): Use the location of each member while reporting errors.
10415
10416 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
10417
10418         * cs-parser.jay: A for_initializer if is a
10419         local_variable_declaration really ammount to have an implicit
10420         block with the variable declaration and no initializer for for.
10421
10422         * statement.cs (For.Emit): Cope with null initializers.
10423
10424         This fixes the infinite loop on for initializers.
10425
10426 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
10427
10428         * enum.cs: More cleanup.
10429
10430         * ecore.cs: Remove dead code.
10431
10432         * class.cs (Property.Emit): More simplification.
10433         (Event.Emit): ditto.
10434
10435         Reworked to have less levels of indentation.
10436         
10437 2001-11-08  Ravi Pratap  <ravi@ximian.com>
10438
10439         * class.cs (Property): Emit attributes.
10440
10441         (Field): Ditto.
10442         
10443         (Event): Ditto.
10444
10445         (Indexer): Ditto.
10446
10447         (Operator): Ditto.
10448
10449         * enum.cs (Emit): Ditto.
10450
10451         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
10452         Enums too.
10453
10454         * class.cs (Field, Event, etc.): Move attribute generation into the
10455         Emit method everywhere.
10456
10457         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
10458         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
10459         as we had no way of defining nested enums !
10460
10461         * rootcontext.cs : Adjust code accordingly.
10462
10463         * typemanager.cs (AddEnumType): To keep track of enum types separately.
10464
10465 2001-11-07  Ravi Pratap  <ravi@ximian.com>
10466
10467         * expression.cs (EvalConstantExpression): Move into ecore.cs
10468         
10469         * enum.cs (Enum): Rename some members and make them public and readonly
10470         according to our convention.
10471
10472         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
10473         nothing else.
10474
10475         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
10476
10477         (Enum::Emit): Write a simple version for now which doesn't try to compute
10478         expressions. I shall modify this to be more robust in just a while.
10479
10480         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
10481
10482         (TypeContainer::CloseType): Create the Enum types too.
10483
10484         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
10485
10486         * expression.cs (EvalConstantExpression): Get rid of completely.
10487
10488         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
10489         user-defined values and other cases.
10490
10491         (IsValidEnumLiteral): Helper function.
10492
10493         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
10494         out there in the case we had a literal FieldExpr.
10495
10496         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
10497
10498         (Literalize): Revamp a bit to take two arguments.
10499         
10500         (EnumLiteral): New class which derives from Literal to wrap enum literals.
10501         
10502 2001-11-06  Ravi Pratap  <ravi@ximian.com>
10503
10504         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
10505
10506         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
10507
10508         (Resolve): Use the above to ensure we have proper initializers.
10509
10510 2001-11-05  Ravi Pratap  <ravi@ximian.com>
10511
10512         * expression.cs (Expression::EvalConstantExpression): New method to 
10513         evaluate constant expressions.
10514
10515         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
10516
10517 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
10518
10519         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
10520         in an array.
10521
10522         (Binary.ResolveOperator): Handle operator != (object a, object b)
10523         and operator == (object a, object b);
10524
10525         (Binary.DoNumericPromotions): Indicate whether the numeric
10526         promotion was possible.
10527
10528         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
10529         Implement.  
10530
10531         Made the ArrayAccess implement interface IAssignMethod instead of
10532         IStackStore as the order in which arguments are passed reflects
10533         this.
10534
10535         * assign.cs: Instead of using expr.ExprClass to select the way of
10536         assinging, probe for the IStackStore/IAssignMethod interfaces.
10537
10538         * typemanager.cs: Load InitializeArray definition.
10539
10540         * rootcontext.cs (RootContext.MakeStaticData): Used to define
10541         static data that can be used to initialize arrays. 
10542
10543 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
10544
10545         * expression.cs: Handle operator== and operator!= for booleans.
10546
10547         (Conditioal.Reduce): Implement reducer for the ?: operator.
10548
10549         (Conditional.Resolve): Implement dead code elimination.
10550
10551         (Binary.Resolve): Catch string literals and return a new
10552         concatenated string.
10553
10554         (Unary.Reduce): Implement reduction of unary expressions.
10555
10556         * ecore.cs: Split out the expression core handling here.
10557
10558         (Expression.Reduce): New method used to perform constant folding
10559         and CSE.  This is needed to support constant-expressions. 
10560         
10561         * statement.cs (Statement.EmitBoolExpression): Pass true and false
10562         targets, and optimize for !x.
10563
10564 2001-11-04  Ravi Pratap  <ravi@ximian.com>
10565
10566         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
10567         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
10568         set custom atttributes.
10569
10570         * literal.cs (Literal::GetValue): New abstract method to return the actual
10571         value of the literal, cast as an object.
10572
10573         (*Literal): Implement GetValue method.
10574
10575         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
10576         expressions to the arraylist but objects of type Argument.
10577
10578         * class.cs (TypeContainer::Emit): Emit our attributes too.
10579
10580         (Method::Emit, Constructor::Emit): Ditto.
10581
10582         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
10583         to be ignoring earlier.
10584
10585 2001-11-03  Ravi Pratap  <ravi@ximian.com>
10586
10587         * attribute.cs (AttributeSection::Define): Implement to do the business
10588         of constructing a CustomAttributeBuilder.
10589
10590         (Attribute): New trivial class. Increases readability of code.  
10591
10592         * cs-parser.jay : Update accordingly.
10593
10594         (positional_argument_list, named_argument_list, named_argument): New rules
10595
10596         (attribute_arguments): Use the above so that we are more correct.
10597         
10598 2001-11-02  Ravi Pratap  <ravi@ximian.com>
10599         
10600         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
10601         to perform all checks for a method with a params parameter.
10602
10603         (Invocation::OverloadResolve): Update to use the above method and therefore
10604         cope correctly with params method invocations.
10605
10606         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
10607         params too.
10608
10609         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
10610         constructors in our parent too because we can't afford to miss out on 
10611         protected ones ;-)
10612
10613         * attribute.cs (AttributeSection): New name for the class Attribute
10614
10615         Other trivial changes to improve readability.
10616
10617         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
10618         use the new class names.
10619         
10620 2001-11-01  Ravi Pratap  <ravi@ximian.com>
10621
10622         * class.cs (Method::Define): Complete definition for params types too
10623
10624         (Indexer::Define): Ditto.
10625
10626         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
10627         Cope everywhere with a request for info about the array parameter.
10628
10629 2001-11-01  Ravi Pratap  <ravi@ximian.com>
10630
10631         * tree.cs (RecordNamespace): Fix up to check for the correct key.
10632
10633         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
10634         local_variable_type to extract the string corresponding to the type.
10635
10636         (local_variable_type): Fixup the action to use the new helper method.
10637
10638         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
10639         go.
10640
10641         * expression.cs : Clean out code which uses the above.
10642
10643 2001-10-31  Ravi Pratap  <ravi@ximian.com>
10644         
10645         * typemanager.cs (RegisterMethod): Check if we already have an existing key
10646         and bale out if necessary by returning a false.
10647
10648         (RegisterProperty): Ditto.
10649
10650         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
10651         and print out appropriate error messages.
10652
10653         * interface.cs (everywhere): Ditto.
10654
10655         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
10656         location to constructor.
10657
10658         * class.cs (Property, Event, Indexer): Update accordingly.
10659
10660         * ../errors/cs111.cs : Added.
10661
10662         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
10663         of a method, as laid down by the spec.
10664
10665         (Invocation::OverloadResolve): Use the above method.
10666
10667 2001-10-31  Ravi Pratap  <ravi@ximian.com>
10668
10669         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
10670         now take a TypeContainer and a Parameters object.
10671
10672         (ParameterData): Modify return type of ParameterModifier method to be 
10673         Parameter.Modifier and not a string.
10674
10675         (ReflectionParameters, InternalParameters): Update accordingly.
10676
10677         * expression.cs (Argument::GetParameterModifier): Same here.
10678
10679         * support.cs (InternalParameters::ParameterType): Find a better way of determining
10680         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
10681         symbol in it at all so maybe this is only for now.
10682
10683 2001-10-30  Ravi Pratap  <ravi@ximian.com>
10684
10685         * support.cs (InternalParameters): Constructor now takes an extra argument 
10686         which is the actual Parameters class.
10687
10688         (ParameterDesc): Update to provide info on ref/out modifiers.
10689
10690         * class.cs (everywhere): Update call to InternalParameters to pass in
10691         the second argument too.
10692
10693         * support.cs (ParameterData): Add ParameterModifier, which is a method 
10694         to return the modifier info [ref/out etc]
10695
10696         (InternalParameters, ReflectionParameters): Implement the above.
10697
10698         * expression.cs (Argument::ParameterModifier): Similar function to return
10699         info about the argument's modifiers.
10700
10701         (Invocation::OverloadResolve): Update to take into account matching modifiers 
10702         too.
10703
10704         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
10705         a new SetFormalParameters object which we pass to InternalParameters.
10706
10707 2001-10-30  Ravi Pratap  <ravi@ximian.com>
10708
10709         * expression.cs (NewArray): Merge into the ArrayCreation class.
10710
10711 2001-10-29  Ravi Pratap  <ravi@ximian.com>
10712
10713         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
10714         NewUserdefinedArray into one as there wasn't much of a use in having
10715         two separate ones.
10716
10717         * expression.cs (Argument): Change field's name to ArgType from Type.
10718
10719         (Type): New readonly property which returns the proper type, taking into 
10720         account ref/out modifiers.
10721
10722         (everywhere): Adjust code accordingly for the above.
10723
10724         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
10725         whether we are emitting for a ref or out parameter.
10726
10727         * expression.cs (Argument::Emit): Use the above field to set the state.
10728
10729         (LocalVariableReference::Emit): Update to honour the flag and emit the
10730         right stuff.
10731
10732         * parameter.cs (Attributes): Set the correct flags for ref parameters.
10733
10734         * expression.cs (Argument::FullDesc): New function to provide a full desc.
10735
10736         * support.cs (ParameterData): Add method ParameterDesc to the interface.
10737
10738         (ReflectionParameters, InternalParameters): Implement the above method.
10739
10740         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
10741         reporting errors.
10742
10743         (Invocation::FullMethodDesc): Ditto. 
10744
10745 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
10746
10747         * cs-parser.jay: Add extra production for the second form of array
10748         creation. 
10749
10750         * expression.cs (ArrayCreation): Update to reflect the above
10751         change. 
10752
10753         * Small changes to prepare for Array initialization.
10754
10755 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
10756
10757         * typemanager.cs (ImplementsInterface): interface might be null;
10758         Deal with this problem;
10759
10760         Also, we do store negative hits on the cache (null values), so use
10761         this instead of calling t.GetInterfaces on the type everytime.
10762
10763 2001-10-28  Ravi Pratap  <ravi@ximian.com>
10764
10765         * typemanager.cs (IsBuiltinType): New method to help determine the same.
10766
10767         * expression.cs (New::DoResolve): Get rid of array creation code and instead
10768         split functionality out into different classes.
10769
10770         (New::FormArrayType): Move into NewBuiltinArray.
10771
10772         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
10773         quite useless.
10774
10775         (NewBuiltinArray): New class to handle creation of built-in arrays.
10776
10777         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
10778         account creation of one-dimensional arrays.
10779
10780         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
10781
10782         (NewUserdefinedArray::DoResolve): Implement.
10783
10784         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
10785
10786         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
10787         we maintain inside the TypeManager. This is necessary to perform lookups on the
10788         module builder.
10789
10790         (LookupType): Update to perform GetType on the module builders too.     
10791
10792         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
10793
10794         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
10795
10796 2001-10-23  Ravi Pratap  <ravi@ximian.com>
10797
10798         * expression.cs (New::DoResolve): Implement guts of array creation.
10799
10800         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
10801         
10802 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
10803
10804         * expression.cs: Fix bug I introduced lsat night that broke
10805         Delegates. 
10806
10807         (Expression.Resolve): Report a 246 error (can not resolve name)
10808         if we find a SimpleName in the stream.
10809         
10810         (Expression.ResolveLValue): Ditto.
10811         
10812         (Expression.ResolveWithSimpleName): This function is a variant of
10813         ResolveName, this one allows SimpleNames to be returned without a
10814         warning.  The only consumer of SimpleNames is MemberAccess
10815
10816 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
10817
10818         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
10819         might arrive here.  I have my doubts that this is correct.
10820
10821         * statement.cs (Lock): Implement lock statement.
10822
10823         * cs-parser.jay: Small fixes to support `lock' and `using'
10824
10825         * cs-tokenizer.cs: Remove extra space
10826
10827         * driver.cs: New flag --checked, allows to turn on integer math
10828         checking. 
10829
10830         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
10831         Threading.Monitor.Exit 
10832         
10833 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
10834
10835         * expression.cs (IndexerAccess::DoResolveLValue): Set the
10836         Expression Class to be IndexerAccess.
10837
10838         Notice that Indexer::DoResolve sets the eclass to Value.
10839
10840 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
10841
10842         * class.cs (TypeContainer::Emit): Emit code for indexers.
10843
10844         * assign.cs (IAssignMethod): New interface implemented by Indexers
10845         and Properties for handling assignment.
10846
10847         (Assign::Emit): Simplify and reuse code. 
10848         
10849         * expression.cs (IndexerAccess, PropertyExpr): Implement
10850         IAssignMethod, clean up old code. 
10851
10852 2001-10-22  Ravi Pratap  <ravi@ximian.com>
10853
10854         * typemanager.cs (ImplementsInterface): New method to determine if a type
10855         implements a given interface. Provides a nice cache too.
10856
10857         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
10858         method.
10859
10860         (ConvertReferenceExplicit): Ditto.
10861
10862         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
10863         various methods, with correct names etc.
10864
10865         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
10866         Operator.UnaryNegation.
10867
10868         * cs-parser.jay (operator_declarator): Be a little clever in the case where
10869         we have a unary plus or minus operator.
10870
10871         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
10872         UnaryMinus.
10873
10874         * everywhere : update accordingly.
10875
10876         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
10877         respectively.
10878
10879         * class.cs (Method::Define): For the case where we are implementing a method
10880         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
10881         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
10882         
10883 2001-10-21  Ravi Pratap  <ravi@ximian.com>
10884
10885         * interface.cs (FindMembers): Implement to work around S.R.E
10886         lameness.
10887
10888         * typemanager.cs (IsInterfaceType): Implement.
10889
10890         (FindMembers): Update to handle interface types too.
10891
10892         * expression.cs (ImplicitReferenceConversion): Re-write bits which
10893         use IsAssignableFrom as that is not correct - it doesn't work.
10894
10895         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
10896         and accordingly override EmitStatement.
10897
10898         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
10899         using the correct logic :-)
10900
10901 2001-10-19  Ravi Pratap  <ravi@ximian.com>
10902
10903         * ../errors/cs-11.cs : Add to demonstrate error -11 
10904
10905 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
10906
10907         * assign.cs (Assign::Resolve): Resolve right hand side first, and
10908         then pass this as a hint to ResolveLValue.
10909         
10910         * expression.cs (FieldExpr): Add Location information
10911
10912         (FieldExpr::LValueResolve): Report assignment to readonly
10913         variable. 
10914         
10915         (Expression::ExprClassFromMemberInfo): Pass location information.
10916
10917         (Expression::ResolveLValue): Add new method that resolves an
10918         LValue. 
10919
10920         (Expression::DoResolveLValue): Default invocation calls
10921         DoResolve. 
10922
10923         (Indexers): New class used to keep track of indexers in a given
10924         Type. 
10925
10926         (IStackStore): Renamed from LValue, as it did not really describe
10927         what this did.  Also ResolveLValue is gone from this interface and
10928         now is part of Expression.
10929
10930         (ElementAccess): Depending on the element access type
10931         
10932         * typemanager.cs: Add `indexer_name_type' as a Core type
10933         (System.Runtime.CompilerServices.IndexerNameAttribute)
10934
10935         * statement.cs (Goto): Take a location.
10936         
10937 2001-10-18  Ravi Pratap  <ravi@ximian.com>
10938
10939         * delegate.cs (Delegate::VerifyDelegate): New method to verify
10940         if two delegates are compatible.
10941
10942         (NewDelegate::DoResolve): Update to take care of the case when
10943         we instantiate a delegate from another delegate.
10944
10945         * typemanager.cs (FindMembers): Don't even try to look up members
10946         of Delegate types for now.
10947
10948 2001-10-18  Ravi Pratap  <ravi@ximian.com>
10949
10950         * delegate.cs (NewDelegate): New class to take care of delegate
10951         instantiation.
10952
10953         * expression.cs (New): Split the delegate related code out into 
10954         the NewDelegate class.
10955
10956         * delegate.cs (DelegateInvocation): New class to handle delegate 
10957         invocation.
10958
10959         * expression.cs (Invocation): Split out delegate related code into
10960         the DelegateInvocation class.
10961
10962 2001-10-17  Ravi Pratap  <ravi@ximian.com>
10963
10964         * expression.cs (New::DoResolve): Implement delegate creation fully
10965         and according to the spec.
10966
10967         (New::DoEmit): Update to handle delegates differently.
10968
10969         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
10970         because of which we were printing out arguments in reverse order !
10971
10972         * delegate.cs (VerifyMethod): Implement to check if the given method
10973         matches the delegate.
10974
10975         (FullDelegateDesc): Implement.
10976
10977         (VerifyApplicability): Implement.
10978
10979         * expression.cs (Invocation::DoResolve): Update to accordingly handle
10980         delegate invocations too.
10981
10982         (Invocation::Emit): Ditto.
10983
10984         * ../errors/cs1593.cs : Added.
10985
10986         * ../errors/cs1594.cs : Added.
10987
10988         * delegate.cs (InstanceExpression, TargetMethod): New properties.
10989
10990 2001-10-16  Ravi Pratap  <ravi@ximian.com>
10991
10992         * typemanager.cs (intptr_type): Core type for System.IntPtr
10993
10994         (InitCoreTypes): Update for the same.
10995
10996         (iasyncresult_type, asynccallback_type): Ditto.
10997
10998         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
10999         correct.
11000
11001         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
11002         too.
11003
11004         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
11005         the builders for the 4 members of a delegate type :-)
11006
11007         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
11008         type.
11009
11010         * expression.cs (New::DoResolve): Implement guts for delegate creation.
11011
11012         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
11013
11014 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
11015
11016         * statement.cs (Break::Emit): Implement.   
11017         (Continue::Emit): Implement.
11018
11019         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
11020         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
11021         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
11022         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
11023         end loop
11024         
11025         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
11026         properties that track the label for the current loop (begin of the
11027         loop and end of the loop).
11028
11029 2001-10-15  Ravi Pratap  <ravi@ximian.com>
11030
11031         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
11032         use of emitting anything at all.
11033
11034         * class.cs, rootcontext.cs : Get rid of calls to the same.
11035
11036         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
11037
11038         (Populate): Define the constructor correctly and set the implementation
11039         attributes.
11040
11041         * typemanager.cs (delegate_types): New hashtable to hold delegates that
11042         have been defined.
11043
11044         (AddDelegateType): Implement.
11045
11046         (IsDelegateType): Implement helper method.
11047
11048         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
11049
11050         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
11051         and accordingly handle it.
11052
11053         * delegate.cs (Populate): Take TypeContainer argument.
11054         Implement bits to define the Invoke method. However, I still haven't figured out
11055         how to take care of the native int bit :-(
11056
11057         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
11058         Qualify the name of the delegate, not its return type !
11059
11060         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
11061         conversion.
11062
11063         (StandardConversionExists): Checking for array types turns out to be recursive.
11064
11065         (ConvertReferenceExplicit): Implement array conversion.
11066
11067         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
11068         
11069 2001-10-12  Ravi Pratap  <ravi@ximian.com>
11070
11071         * cs-parser.jay (delegate_declaration): Store the fully qualified
11072         name as it is a type declaration.
11073
11074         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
11075         readonly.
11076
11077         (DefineDelegate): Renamed from Define. Does the same thing essentially,
11078         as TypeContainer::DefineType.
11079
11080         (Populate): Method in which all the definition of the various methods (Invoke)
11081         etc is done.
11082
11083         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
11084         see.
11085         
11086         (CloseDelegate): Finally creates the delegate.
11087
11088         * class.cs (TypeContainer::DefineType): Update to define delegates.
11089         (Populate, Emit and CloseType): Do the same thing here too.
11090
11091         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
11092         delegates in all these operations.
11093
11094 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
11095
11096         * expression.cs: LocalTemporary: a new expression used to
11097         reference a temporary that has been created.
11098
11099         * assign.cs: Handle PropertyAccess back here, so that we can
11100         provide the proper semantic access to properties.
11101
11102         * expression.cs (Expression::ConvertReferenceExplicit): Implement
11103         a few more explicit conversions. 
11104
11105         * modifiers.cs: `NEW' modifier maps to HideBySig.
11106
11107         * expression.cs (PropertyExpr): Make this into an
11108         ExpressionStatement, and support the EmitStatement code path. 
11109
11110         Perform get/set error checking, clean up the interface.
11111
11112         * assign.cs: recognize PropertyExprs as targets, and if so, turn
11113         them into toplevel access objects.
11114
11115 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
11116
11117         * expression.cs: PropertyExpr::PropertyExpr: use work around the
11118         SRE.
11119
11120         * typemanager.cs: Keep track here of our PropertyBuilders again to
11121         work around lameness in SRE.
11122
11123 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
11124
11125         * expression.cs (LValue::LValueResolve): New method in the
11126         interface, used to perform a second resolution pass for LValues. 
11127         
11128         (This::DoResolve): Catch the use of this in static methods.
11129
11130         (This::LValueResolve): Implement.
11131
11132         (This::Store): Remove warning, assigning to `this' in structures
11133         is 
11134
11135         (Invocation::Emit): Deal with invocation of
11136         methods on value types.  We need to pass the address to structure
11137         methods rather than the object itself.  (The equivalent code to
11138         emit "this" for structures leaves the entire structure on the
11139         stack instead of a pointer to it). 
11140
11141         (ParameterReference::DoResolve): Compute the real index for the
11142         argument based on whether the method takes or not a `this' pointer
11143         (ie, the method is static).
11144
11145         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
11146         value types returned from functions when we need to invoke a
11147         method on the sturcture.
11148         
11149
11150 2001-10-11  Ravi Pratap  <ravi@ximian.com>
11151
11152         * class.cs (TypeContainer::DefineType): Method to actually do the business of
11153         defining the type in the Modulebuilder or Typebuilder. This is to take
11154         care of nested types which need to be defined on the TypeBuilder using
11155         DefineNestedMethod.
11156
11157         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
11158         methods in RootContext, only ported to be part of TypeContainer.
11159
11160         (TypeContainer::GetInterfaceOrClass): Ditto.
11161
11162         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
11163
11164         * interface.cs (Interface::DefineInterface): New method. Does exactly
11165         what RootContext.CreateInterface did earlier, only it takes care of nested types 
11166         too.
11167
11168         (Interface::GetInterfaces): Move from RootContext here and port.
11169
11170         (Interface::GetInterfaceByName): Same here.
11171
11172         * rootcontext.cs (ResolveTree): Re-write.
11173
11174         (PopulateTypes): Re-write.
11175
11176         * class.cs (TypeContainer::Populate): Populate nested types too.
11177         (TypeContainer::Emit): Emit nested members too.
11178
11179         * typemanager.cs (AddUserType): Do not make use of the FullName property,
11180         instead just use the name argument passed in as it is already fully
11181         qualified.
11182
11183         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
11184         to TypeContainer mapping to see if a type is user-defined.
11185
11186         * class.cs (TypeContainer::CloseType): Implement. 
11187
11188         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
11189         the default constructor.
11190         
11191         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
11192         twice.
11193
11194         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
11195
11196         * interface.cs (CloseType): Create the type here.
11197         
11198         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
11199         the hierarchy.
11200
11201         Remove all the methods which are now in TypeContainer.
11202
11203 2001-10-10  Ravi Pratap  <ravi@ximian.com>
11204
11205         * delegate.cs (Define): Re-write bits to define the delegate
11206         correctly.
11207
11208 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
11209
11210         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
11211
11212         * expression.cs (ImplicitReferenceConversion): handle null as well
11213         as a source to convert to any reference type.
11214
11215         * statement.cs (Return): Perform any implicit conversions to
11216         expected return type.  
11217
11218         Validate use of return statement.  
11219
11220         * codegen.cs (EmitContext): Pass the expected return type here.
11221
11222         * class.cs (Method, Constructor, Property): Pass expected return
11223         type to EmitContext.
11224
11225 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
11226
11227         * expression.cs: Make DoResolve take an EmitContext instead of a
11228         TypeContainer.
11229
11230         Replaced `l' and `location' for `loc', for consistency.
11231         
11232         (Error, Warning): Remove unneeded Tc argument.
11233
11234         * assign.cs, literal.cs, constant.cs: Update to new calling
11235         convention. 
11236         
11237         * codegen.cs: EmitContext now contains a flag indicating whether
11238         code is being generated in a static method or not.
11239
11240         * cs-parser.jay: DecomposeQI, new function that replaces the old
11241         QualifiedIdentifier.  Now we always decompose the assembled
11242         strings from qualified_identifier productions into a group of
11243         memberaccesses.
11244
11245 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
11246
11247         * rootcontext.cs: Deal with field-less struct types correctly now
11248         by passing the size option to Define Type.
11249
11250         * class.cs: Removed hack that created one static field. 
11251
11252 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
11253
11254         * statement.cs: Moved most of the code generation here. 
11255
11256 2001-10-09  Ravi Pratap  <ravi@ximian.com>
11257
11258         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
11259         seem very right.
11260
11261         (ElementAccess): Remove useless bits for now - keep checks as the spec
11262         says.
11263
11264 2001-10-08  Ravi Pratap  <ravi@ximian.com>
11265
11266         * expression.cs (ElementAccess::DoResolve): Remove my crap code
11267         and start performing checks according to the spec.
11268
11269 2001-10-07  Ravi Pratap  <ravi@ximian.com>
11270
11271         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
11272         rank_specifiers instead.
11273
11274         (rank_specifiers): Change the order in which the rank specifiers are stored
11275
11276         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
11277
11278         * expression.cs (ElementAccess): Implement the LValue interface too.
11279         
11280 2001-10-06  Ravi Pratap  <ravi@ximian.com>
11281         
11282         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
11283         except that user defined conversions are not included.
11284
11285         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
11286         perform the conversion of the return type, if necessary.
11287
11288         (New::DoResolve): Check whether we are creating an array or an object
11289         and accordingly do the needful.
11290
11291         (New::Emit): Same here.
11292
11293         (New::DoResolve): Implement guts of array creation.
11294
11295         (New::FormLookupType): Helper function.
11296
11297 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
11298
11299         * codegen.cs: Removed most of the code generation here, and move the
11300         corresponding code generation bits to the statement classes. 
11301
11302         Added support for try/catch/finalize and throw.
11303         
11304         * cs-parser.jay: Added support for try/catch/finalize.
11305
11306         * class.cs: Catch static methods having the flags override,
11307         virtual or abstract.
11308
11309         * expression.cs (UserCast): This user cast was not really doing
11310         what it was supposed to do.  Which is to be born in fully resolved
11311         state.  Parts of the resolution were being performed at Emit time! 
11312
11313         Fixed this code.
11314
11315 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
11316
11317         * expression.cs: Implicity convert the result from UserCast.
11318
11319 2001-10-05  Ravi Pratap  <ravi@ximian.com>
11320
11321         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
11322         prevented it from working correctly. 
11323
11324         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
11325         merely ConvertImplicit.
11326
11327 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
11328
11329         * typemanager.cs: Make the LookupTypeContainer function static,
11330         and not per-instance.  
11331
11332         * class.cs: Make static FindMembers (the one that takes a Type
11333         argument). 
11334
11335         * codegen.cs: Add EmitForeach here.
11336
11337         * cs-parser.jay: Make foreach a toplevel object instead of the
11338         inline expansion, as we need to perform semantic analysis on it. 
11339
11340 2001-10-05  Ravi Pratap  <ravi@ximian.com>
11341
11342         * expression.cs (Expression::ImplicitUserConversion): Rename to
11343         UserDefinedConversion.
11344
11345         (Expression::UserDefinedConversion): Take an extra argument specifying 
11346         whether we look for explicit user conversions too.
11347
11348         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
11349
11350         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
11351
11352         (ExplicitUserConversion): Make it a call to UserDefinedConversion
11353         with the appropriate arguments.
11354
11355         * cs-parser.jay (cast_expression): Record location too.
11356
11357         * expression.cs (Cast): Record location info.
11358
11359         (Expression::ConvertExplicit): Take location argument.
11360
11361         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
11362         to determine if we are doing explicit conversions.
11363
11364         (UserCast::Emit): Update accordingly.
11365
11366         (Expression::ConvertExplicit): Report an error if everything fails.
11367
11368         * ../errors/cs0030.cs : Add.
11369
11370 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
11371
11372         * modifiers.cs: If the ABSTRACT keyword is present, also set the
11373         virtual and newslot bits. 
11374
11375         * class.cs (TypeContainer::RegisterRequiredImplementations):
11376         Record methods we need.
11377
11378         (TypeContainer::MakeKey): Helper function to make keys for
11379         MethodBases, since the Methodbase key is useless.
11380
11381         (TypeContainer::Populate): Call RegisterRequiredImplementations
11382         before defining the methods.   
11383
11384         Create a mapping for method_builders_to_methods ahead of time
11385         instead of inside a tight loop.
11386
11387         (::RequireMethods):  Accept an object as the data to set into the
11388         hashtable so we can report interface vs abstract method mismatch.
11389
11390 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
11391
11392         * report.cs: Make all of it static.
11393
11394         * rootcontext.cs: Drop object_type and value_type computations, as
11395         we have those in the TypeManager anyways.
11396
11397         Drop report instance variable too, now it is a global.
11398
11399         * driver.cs: Use try/catch on command line handling.
11400
11401         Add --probe option to debug the error reporting system with a test
11402         suite. 
11403
11404         * report.cs: Add support for exiting program when a probe
11405         condition is reached.
11406
11407 2001-10-03  Ravi Pratap  <ravi@ximian.com>
11408
11409         * expression.cs (Binary::DoNumericPromotions): Fix the case when
11410         we do a forcible conversion regardless of type, to check if 
11411         ForceConversion returns a null.
11412
11413         (Binary::error19): Use location to report error.
11414
11415         (Unary::error23): Use location here too.
11416
11417         * ../errors/cs0019.cs : Check in.
11418
11419         * ../errors/cs0023.cs : Check in.
11420
11421         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
11422         case of a non-null MethodInfo object with a length of 0 !
11423
11424         (Binary::ResolveOperator): Flag error if overload resolution fails to find
11425         an applicable member - according to the spec :-)
11426         Also fix logic to find members in base types.
11427
11428         (Unary::ResolveOperator): Same here.
11429
11430         (Unary::report23): Change name to error23 and make first argument a TypeContainer
11431         as I was getting thoroughly confused between this and error19 :-)
11432         
11433         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
11434         (::FindMostEncompassedType): Implement.
11435         (::FindMostEncompassingType): Implement.
11436         (::StandardConversionExists): Implement.
11437
11438         (UserImplicitCast): Re-vamp. We now need info about most specific
11439         source and target types so that we can do the necessary conversions.
11440
11441         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
11442         mathematical union with no duplicates.
11443
11444 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
11445
11446         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
11447         in order from base classes to child classes, so that we can in
11448         child classes look up in our parent for method names and
11449         attributes (required for handling abstract, virtual, new, override
11450         constructs: we need to instrospect our base class, and if we dont
11451         populate the classes in order, the introspection might be
11452         incorrect.  For example, a method could query its parent before
11453         the parent has any methods and would determine that the parent has
11454         no abstract methods (while it could have had them)).
11455
11456         (RootContext::CreateType): Record the order in which we define the
11457         classes.
11458
11459 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
11460
11461         * class.cs (TypeContainer::Populate): Also method definitions can
11462         fail now, keep track of this.
11463
11464         (TypeContainer::FindMembers): Implement support for
11465         DeclaredOnly/noDeclaredOnly flag.
11466
11467         (Constructor::Emit) Return the ConstructorBuilder.
11468
11469         (Method::Emit) Return the MethodBuilder. 
11470         Check for abstract or virtual methods to be public.
11471
11472         * rootcontext.cs (RootContext::CreateType): Register all the
11473         abstract methods required for the class to be complete and the
11474         interface methods that must be implemented. 
11475
11476         * cs-parser.jay: Report error 501 (method requires body if it is
11477         not marked abstract or extern).
11478
11479         * expression.cs (TypeOf::Emit): Implement.
11480
11481         * typemanager.cs: runtime_handle_type, new global type.
11482
11483         * class.cs (Property::Emit): Generate code for properties.
11484
11485 2001-10-02  Ravi Pratap  <ravi@ximian.com>
11486
11487         * expression.cs (Unary::ResolveOperator): Find operators on base type
11488         too - we now conform exactly to the spec.
11489
11490         (Binary::ResolveOperator): Same here.
11491
11492         * class.cs (Operator::Define): Fix minor quirk in the tests.
11493
11494         * ../errors/cs0215.cs : Added.
11495
11496         * ../errors/cs0556.cs : Added.
11497
11498         * ../errors/cs0555.cs : Added.
11499
11500 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
11501
11502         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
11503         single integer which is really efficient
11504
11505 2001-10-01  Ravi Pratap  <ravi@ximian.com>
11506
11507         *  expression.cs (Expression::ImplicitUserConversion): Use location
11508         even in the case when we are examining True operators.
11509  
11510         * class.cs (Operator::Define): Perform extensive checks to conform
11511         with the rules for operator overloading in the spec.
11512
11513         * expression.cs (Expression::ImplicitReferenceConversion): Implement
11514         some of the other conversions mentioned in the spec.
11515
11516         * typemanager.cs (array_type): New static member for the System.Array built-in
11517         type.
11518
11519         (cloneable_interface): For System.ICloneable interface.
11520
11521         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
11522         we start resolving the tree and populating types.
11523
11524         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
11525  
11526 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
11527
11528         * expression.cs (Expression::ExprClassFromMemberInfo,
11529         Expression::Literalize): Create literal expressions from
11530         FieldInfos which are literals.
11531
11532         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
11533         type casts, because they were wrong.  The test suite in tests
11534         caught these ones.
11535
11536         (ImplicitNumericConversion): ushort to ulong requires a widening
11537         cast. 
11538
11539         Int32 constant to long requires widening cast as well.
11540
11541         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
11542         for integers because the type on the stack is not i4.
11543
11544 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
11545
11546         * expression.cs (report118): require location argument. 
11547
11548         * parameter.cs: Do not dereference potential null value.
11549
11550         * class.cs: Catch methods that lack the `new' keyword when
11551         overriding a name.  Report warnings when `new' is used without
11552         anything being there to override.
11553
11554         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
11555
11556         * class.cs: Only add constructor to hashtable if it is non-null
11557         (as now constructors can fail on define).
11558
11559         (TypeManager, Class, Struct): Take location arguments.
11560
11561         Catch field instance initialization in structs as errors.
11562
11563         accepting_filter: a new filter for FindMembers that is static so
11564         that we dont create an instance per invocation.
11565
11566         (Constructor::Define): Catch errors where a struct constructor is
11567         parameterless 
11568
11569         * cs-parser.jay: Pass location information for various new
11570         constructs. 
11571         
11572         * delegate.cs (Delegate): take a location argument.
11573
11574         * driver.cs: Do not call EmitCode if there were problesm in the
11575         Definition of the types, as many Builders wont be there. 
11576
11577         * decl.cs (Decl::Decl): Require a location argument.
11578
11579         * cs-tokenizer.cs: Handle properly hex constants that can not fit
11580         into integers, and find the most appropiate integer for it.
11581
11582         * literal.cs: Implement ULongLiteral.
11583
11584         * rootcontext.cs: Provide better information about the location of
11585         failure when CreateType fails.
11586         
11587 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
11588
11589         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
11590         as well.
11591
11592         * expression.cs (Binary::CheckShiftArguments): Add missing type
11593         computation.
11594         (Binary::ResolveOperator): Add type to the logical and and logical
11595         or, Bitwise And/Or and Exclusive Or code paths, it was missing
11596         before.
11597
11598         (Binary::DoNumericPromotions): In the case where either argument
11599         is ulong (and most signed types combined with ulong cause an
11600         error) perform implicit integer constant conversions as well.
11601
11602 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
11603
11604         * expression.cs (UserImplicitCast): Method should always be
11605         non-null. 
11606         (Invocation::BetterConversion): Simplified test for IntLiteral.
11607
11608         (Expression::ImplicitNumericConversion): Split this routine out.
11609         Put the code that performs implicit constant integer conversions
11610         here. 
11611
11612         (Expression::Resolve): Become a wrapper around DoResolve so we can
11613         check eclass and type being set after resolve.
11614
11615         (Invocation::Badness): Remove this dead function
11616
11617         (Binary::ResolveOperator): Do not compute the expensive argumnets
11618         unless we have a union for it.
11619
11620         (Probe::Emit): Is needs to do an isinst and then
11621         compare against null.
11622
11623         (::CanConvert): Added Location argument.  If the Location argument
11624         is null (Location.Null), then we do not report errors.  This is
11625         used by the `probe' mechanism of the Explicit conversion.  We do
11626         not want to generate an error for something that the user
11627         explicitly requested to be casted.  But the pipeline for an
11628         explicit cast first tests for potential implicit casts.
11629
11630         So for now, if the Location is null, it means `Probe only' to
11631         avoid adding another argument.   Might have to revise this
11632         strategy later.
11633
11634         (ClassCast): New class used to type cast objects into arbitrary
11635         classes (used in Explicit Reference Conversions).
11636
11637         Implement `as' as well.
11638
11639         Reverted all the patches from Ravi below: they were broken:
11640
11641                 * The use of `level' as a mechanism to stop recursive
11642                   invocations is wrong.  That was there just to catch the
11643                   bug with a strack trace but not as a way of addressing
11644                   the problem.
11645
11646                   To fix the problem we have to *understand* what is going
11647                   on and the interactions and come up with a plan, not
11648                   just get things going.
11649
11650                 * The use of the type conversion cache that I proposed
11651                   last night had an open topic: How does this work across
11652                   protection domains.  A user defined conversion might not
11653                   be public in the location where we are applying the
11654                   conversion, a different conversion might be selected
11655                   (ie, private A->B (better) but public B->A (worse),
11656                   inside A, A->B applies, but outside it, B->A will
11657                   apply).
11658
11659                 * On top of that (ie, even if the above is solved),
11660                   conversions in a cache need to be abstract.  Ie, `To
11661                   convert from an Int to a Short use an OpcodeCast', not
11662                   `To convert from an Int to a Short use the OpcodeCast on
11663                   the variable 5' (which is what this patch was doing).
11664         
11665 2001-09-28  Ravi Pratap  <ravi@ximian.com>
11666
11667         * expression.cs (Invocation::ConversionExists): Re-write to use
11668         the conversion cache
11669         
11670         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
11671         cache all conversions done, not just user-defined ones.
11672
11673         (Invocation::BetterConversion): The real culprit. Use ConversionExists
11674         to determine if a conversion exists instead of acutually trying to 
11675         perform the conversion. It's faster too.
11676
11677         (Expression::ConvertExplicit): Modify to use ConversionExists to check
11678         and only then attempt the implicit conversion.
11679
11680 2001-09-28  Ravi Pratap  <ravi@ximian.com>
11681
11682         * expression.cs (ConvertImplicit): Use a cache for conversions
11683         already found. Check level of recursion and bail out if necessary.
11684         
11685 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
11686
11687         * typemanager.cs (string_concat_string_string, string_concat_object_object):
11688         Export standard methods that we expect for string operations.
11689         
11690         * statement.cs (Block::UsageWarning): Track usage of variables and
11691         report the errors for not used variables.
11692
11693         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
11694         operator. 
11695
11696 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
11697
11698         * codegen.cs: remove unnneded code 
11699
11700         * expression.cs: Removed BuiltinTypeAccess class
11701
11702         Fix the order in which implicit conversions are
11703         done.  
11704
11705         The previous fixed dropped support for boxed conversions (adding a
11706         test to the test suite now)
11707
11708         (UserImplicitCast::CanConvert): Remove test for source being null,
11709         that code is broken.  We should not feed a null to begin with, if
11710         we do, then we should track the bug where the problem originates
11711         and not try to cover it up here.
11712
11713         Return a resolved expression of type UserImplicitCast on success
11714         rather than true/false.  Ravi: this is what I was talking about,
11715         the pattern is to use a static method as a "constructor" for
11716         objects. 
11717
11718         Also, do not create arguments until the very last minute,
11719         otherwise we always create the arguments even for lookups that
11720         will never be performed. 
11721
11722         (UserImplicitCast::Resolve): Eliminate, objects of type
11723         UserImplicitCast are born in a fully resolved state. 
11724         
11725         * typemanager.cs (InitCoreTypes): Init also value_type
11726         (System.ValueType). 
11727
11728         * expression.cs (Cast::Resolve): First resolve the child expression.
11729
11730         (LValue): Add new method AddressOf to be used by
11731         the `&' operator.  
11732
11733         Change the argument of Store to take an EmitContext instead of an
11734         ILGenerator, because things like FieldExpr need to be able to call
11735         their children expression to generate the instance code. 
11736
11737         (Expression::Error, Expression::Warning): Sugar functions for
11738         reporting errors.
11739
11740         (Expression::MemberLookup): Accept a TypeContainer instead of a
11741         Report as the first argument.
11742
11743         (Expression::ResolvePrimary): Killed.  I still want to improve
11744         this as currently the code is just not right.
11745
11746         (Expression::ResolveMemberAccess): Simplify, but it is still
11747         wrong. 
11748
11749         (Unary::Resolve): Catch errors in AddressOf operators.
11750
11751         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
11752         index to a byte for the short-version, or the compiler will choose
11753         the wrong Emit call, which generates the wrong data.
11754
11755         (ParameterReference::Emit, ::Store): same.
11756
11757         (FieldExpr::AddressOf): Implement.
11758         
11759         * typemanager.cs: TypeManager: made public variable instead of
11760         property.
11761         
11762         * driver.cs: document --fatal.
11763
11764         * report.cs (ErrorMessage, WarningMessage): new names for the old
11765         Error and Warning classes.
11766
11767         * cs-parser.jay (member_access): Turn built-in access to types
11768         into a normal simplename
11769
11770 2001-09-27  Ravi Pratap  <ravi@ximian.com>
11771
11772         * expression.cs (Invocation::BetterConversion): Fix to cope
11773         with q being null, since this was introducing a bug.
11774
11775         * expression.cs (ConvertImplicit): Do built-in conversions first.
11776
11777 2001-09-27  Ravi Pratap  <ravi@ximian.com>
11778
11779         * expression.cs (UserImplicitCast::Resolve): Fix bug.
11780
11781 2001-09-27  Ravi Pratap  <ravi@ximian.com>
11782
11783         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
11784         I had introduced long ago (what's new ?).
11785
11786         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
11787         the work of all the checking. 
11788         (ConvertImplicit): Call CanConvert and only then create object if necessary.
11789         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
11790
11791         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
11792         that is the right way. 
11793
11794         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
11795         overloading resolution. Use everywhere instead of cutting and pasting code.
11796
11797         (Binary::ResolveOperator): Use MakeUnionSet.
11798
11799         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
11800         we have to convert to bool types. Not complete yet.
11801         
11802 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
11803
11804         * typemanager.cs (TypeManager::CSharpName): support ushort.
11805
11806         * expression.cs (Expression::TryImplicitIntConversion): Attempts
11807         to provide an expression that performsn an implicit constant int
11808         conversion (section 6.1.6).
11809         (Expression::ConvertImplicitRequired): Reworked to include
11810         implicit constant expression conversions.
11811
11812         (Expression::ConvertNumericExplicit): Finished.
11813
11814         (Invocation::Emit): If InstanceExpression is null, then it means
11815         that we perform a call on this.
11816         
11817 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
11818
11819         * expression.cs (Unary::Emit): Remove some dead code.
11820         (Probe): Implement Resolve and Emit for `is'.
11821         (Expression::ConvertImplicitRequired): Attempt to do constant
11822         expression conversions here.  Maybe should be moved to
11823         ConvertImplicit, but I am not sure.
11824         (Expression::ImplicitLongConstantConversionPossible,
11825         Expression::ImplicitIntConstantConversionPossible): New functions
11826         that tell whether is it possible to apply an implicit constant
11827         expression conversion.
11828
11829         (ConvertNumericExplicit): Started work on explicit numeric
11830         conversions.
11831
11832         * cs-parser.jay: Update operator constants.
11833
11834         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
11835         (Parameters::GetSignature): Hook up VerifyArgs here.
11836         (Parameters::VerifyArgs): Verifies that no two arguments have the
11837         same name. 
11838
11839         * class.cs (Operator): Update the operator names to reflect the
11840         ones that the spec expects (as we are just stringizing the
11841         operator names).
11842         
11843         * expression.cs (Unary::ResolveOperator): Fix bug: Use
11844         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
11845         previous usage did only work for our methods.
11846         (Expression::ConvertImplicit): Handle decimal implicit numeric
11847         conversions as well.
11848         (Expression::InternalTypeConstructor): Used to invoke constructors
11849         on internal types for default promotions.
11850
11851         (Unary::Emit): Implement special handling for the pre/post
11852         increment/decrement for overloaded operators, as they need to have
11853         the same semantics as the other operators.
11854
11855         (Binary::ResolveOperator): ditto.
11856         (Invocation::ConversionExists): ditto.
11857         (UserImplicitCast::Resolve): ditto.
11858         
11859 2001-09-26  Ravi Pratap  <ravi@ximian.com>
11860
11861         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
11862         operator, return after emitting body. Regression tests pass again !
11863
11864         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
11865         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
11866         (Invocation::OverloadResolve): Ditto.
11867         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
11868
11869         * everywhere : update calls to the above methods accordingly.
11870
11871 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
11872
11873         * assign.cs (Assign): Make it inherit from ExpressionStatement.
11874
11875         * expression.cs (ExpressionStatement): New base class used for
11876         expressions that can appear in statements, so that we can provide
11877         an alternate path to generate expression that do not leave a value
11878         on the stack.
11879
11880         (Expression::Emit, and all the derivatives): We no longer return
11881         whether a value is left on the stack or not.  Every expression
11882         after being emitted leaves a single value on the stack.
11883
11884         * codegen.cs (EmitContext::EmitStatementExpression): Use the
11885         facilties of ExpressionStatement if possible.
11886
11887         * cs-parser.jay: Update statement_expression.
11888
11889 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * driver.cs: Change the wording of message
11892
11893 2001-09-25  Ravi Pratap  <ravi@ximian.com>
11894
11895         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
11896         the type of the expression to the return type of the method if
11897         we have an overloaded operator match ! The regression tests pass again !
11898         (Unary::ResolveOperator): Ditto.
11899
11900         * expression.cs (Invocation::ConversionExists): Correct the member lookup
11901         to find "op_Implicit", not "implicit" ;-)
11902         (UserImplicitCast): New class to take care of user-defined implicit conversions.
11903         (ConvertImplicit, ForceConversion): Take TypeContainer argument
11904
11905         * everywhere : Correct calls to the above accordingly.
11906
11907         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
11908         (ConvertImplicit): Do user-defined conversion if it exists.
11909
11910 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
11911
11912         * assign.cs: track location.
11913         (Resolve): Use implicit conversions on assignment.
11914
11915         * literal.cs: Oops.  Not good, Emit of short access values should
11916         pass (Bytes) or the wrong argument will be selected.
11917
11918         * expression.cs (Unary::Emit): Emit code for -expr.
11919         
11920         (Unary::ResolveOperator): Handle `Substract' for non-constants
11921         (substract from zero from the non-constants).
11922         Deal with Doubles as well. 
11923         
11924         (Expression::ConvertImplicitRequired): New routine that reports an
11925         error if no implicit conversion exists. 
11926
11927         (Invocation::OverloadResolve): Store the converted implicit
11928         expressions if we make them
11929         
11930 2001-09-24  Ravi Pratap  <ravi@ximian.com>
11931
11932         * class.cs (ConstructorInitializer): Take a Location argument.
11933         (ConstructorBaseInitializer): Same here.
11934         (ConstructorThisInitializer): Same here.
11935
11936         * cs-parser.jay : Update all calls accordingly.
11937
11938         * expression.cs (Unary, Binary, New): Take location argument.
11939         Update accordingly everywhere.
11940
11941         * cs-parser.jay : Update all calls to the above to take a location
11942         argument.
11943
11944         * class.cs : Ditto.
11945
11946 2001-09-24  Ravi Pratap  <ravi@ximian.com>
11947
11948         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
11949         (Invocation::BetterConversion): Same here
11950         (Invocation::ConversionExists): Ditto.
11951
11952         (Invocation::ConversionExists): Implement.
11953
11954 2001-09-22  Ravi Pratap  <ravi@ximian.com>
11955
11956         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
11957         Also take an additional TypeContainer argument.
11958
11959         * All over : Pass in TypeContainer as argument to OverloadResolve.
11960
11961         * typemanager.cs (CSharpName): Update to check for the string type and return
11962         that too.
11963
11964         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
11965         a given method.
11966         
11967 2001-09-21  Ravi Pratap  <ravi@ximian.com>
11968
11969         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
11970         (Invocation::BetterFunction): Implement.
11971         (Invocation::BetterConversion): Implement.
11972         (Invocation::ConversionExists): Skeleton, no implementation yet.
11973
11974         Okay, things work fine !
11975
11976 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
11977
11978         * typemanager.cs: declare and load enum_type, delegate_type and
11979         void_type. 
11980
11981         * expression.cs (Expression::Emit): Now emit returns a value that
11982         tells whether a value is left on the stack or not.  This strategy
11983         might be reveted tomorrow with a mechanism that would address
11984         multiple assignments.
11985         (Expression::report118): Utility routine to report mismatches on
11986         the ExprClass.
11987
11988         (Unary::Report23): Report impossible type/operator combination
11989         utility function.
11990
11991         (Unary::IsIncrementableNumber): Whether the type can be
11992         incremented or decremented with add.
11993         (Unary::ResolveOperator): Also allow enumerations to be bitwise
11994         complemented. 
11995         (Unary::ResolveOperator): Implement ++, !, ~,
11996
11997         (Invocation::Emit): Deal with new Emit convetion.
11998         
11999         * All Expression derivatives: Updated their Emit method to return
12000         whether they leave values on the stack or not.
12001         
12002         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
12003         stack for expressions that are statements. 
12004
12005 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
12006
12007         * expression.cs (LValue): New interface.  Must be implemented by
12008         LValue objects.
12009         (LocalVariableReference, ParameterReference, FieldExpr): Implement
12010         LValue interface.
12011         
12012         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
12013         interface for generating code, simplifies the code.
12014
12015 2001-09-20  Ravi Pratap  <ravi@ximian.com>
12016
12017         * expression.cs (everywhere): Comment out return statements in ::Resolve
12018         methods to avoid the warnings.
12019
12020 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
12021
12022         * driver.cs (parse): Report error 2001 if we can not open the
12023         source file.
12024
12025         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
12026         not resolve it.
12027
12028         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
12029         object. 
12030
12031         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
12032         otherwise nested blocks end up with the same index.
12033
12034         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
12035
12036         * expression.cs:  Instead of having FIXMEs in the Resolve
12037         functions, throw exceptions so it is obvious that we are facing a
12038         bug. 
12039
12040         * cs-parser.jay (invocation_expression): Pass Location information.
12041
12042         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
12043         Use a basename for those routines because .NET does not like paths
12044         on them. 
12045
12046         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
12047         already defined.
12048
12049 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
12052         are loading the correct data types (throws an exception if not).
12053         (TypeManager::InitCoreTypes): Use CoreLookupType
12054
12055         * expression.cs (Unary::ResolveOperator): return the child
12056         expression for expressions which are just +expr.
12057         (Unary::ResolveOperator): Return negative literals for -LITERAL
12058         expressions (otherwise they are Unary {Literal}).
12059         (Invocation::Badness): Take into account `Implicit constant
12060         expression conversions'.
12061
12062         * literal.cs (LongLiteral): Implement long literal class.
12063         (IntLiteral): export the `Value' of the intliteral. 
12064
12065 2001-09-19  Ravi Pratap  <ravi@ximian.com>
12066
12067         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
12068
12069         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
12070         instead of 'Operator'
12071
12072         * expression.cs (Binary::ResolveOperator): Update accordingly.
12073         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
12074         and 'Minus'
12075
12076         * cs-parser.jay (unary_expression): Update to use the new names.
12077
12078         * gen-treedump.cs (GetUnary): Same here.
12079
12080         * expression.cs (Unary::Resolve): Implement.
12081         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
12082         operators are found instead of making noise ;-)
12083         (Unary::ResolveOperator): New method to do precisely the same thing which
12084         Binary::ResolveOperator does for Binary expressions.
12085         (Unary.method, .Arguments): Add.
12086         (Unary::OperName): Implement.   
12087         (Unary::ForceConversion): Copy and Paste !
12088
12089         * class.cs (Operator::Define): Fix a small bug for the case when we have 
12090         a unary operator.
12091
12092         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
12093         for the inbuilt operators. Only overloading works for now ;-)
12094
12095 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
12096
12097         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
12098         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
12099
12100         * expression.cs (This::Emit): Implement. 
12101         (This::Resolve): Implement.
12102         (TypeOf:Resolve): Implement.
12103         (Expression::ResolveSimpleName): Add an implicit this to instance
12104         field references. 
12105         (MemberAccess::Resolve): Deal with Parameters and Fields. 
12106         Bind instance variable to Field expressions.
12107         (FieldExpr::Instance): New field used to track the expression that
12108         represents the object instance.
12109         (FieldExpr::Resolve): Track potential errors from MemberLookup not
12110         binding 
12111         (FieldExpr::Emit): Implement.
12112
12113         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
12114         the last instruction contains a return opcode to avoid generating
12115         the last `ret' instruction (this generates correct code, and it is
12116         nice to pass the peverify output).
12117
12118         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
12119         initializer for static and instance variables.
12120         (Constructor::Emit): Allow initializer to be null in the case of
12121         static constructors.  Only emit initializer for instance
12122         constructors. 
12123
12124         (TypeContainer::FindMembers): Return a null array if there are no
12125         matches.
12126
12127         Also fix the code for the MemberTypes.Method branch, as it was not
12128         scanning that for operators (or tried to access null variables before).
12129
12130         * assign.cs (Assign::Emit): Handle instance and static fields. 
12131
12132         * TODO: Updated.
12133
12134         * driver.cs: Stop compilation if there are parse errors.
12135
12136         * cs-parser.jay (constructor_declaration): Provide default base
12137         initializer for non-static constructors.
12138         (constructor_declarator): Do not provide a default base
12139         initializers if none was specified.
12140         Catch the fact that constructors should not have parameters.
12141
12142         * class.cs: Do not emit parent class initializers for static
12143         constructors, that should be flagged as an error.
12144
12145 2001-09-18  Ravi Pratap  <ravi@ximian.com>
12146
12147         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
12148         Move back code into TypeContainer::Populate.
12149
12150 2001-09-18  Ravi Pratap  <ravi@ximian.com>
12151
12152         * class.cs (TypeContainer::AddConstructor): Fix the check to
12153         compare against Name, not Basename. 
12154         (Operator::OpType): Change Plus and Minus to Add and Subtract.
12155
12156         * cs-parser.jay : Update accordingly.
12157
12158         * class.cs (TypeContainer::FindMembers): For the case where we are searching
12159         for methods, don't forget to look into the operators too.
12160         (RegisterMethodBuilder): Helper method to take care of this for
12161         methods, constructors and operators.
12162         (Operator::Define): Completely revamp.
12163         (Operator.OperatorMethod, MethodName): New fields.
12164         (TypeContainer::Populate): Move the registering of builders into
12165         RegisterMethodBuilder.
12166         (Operator::Emit): Re-write.
12167
12168         * expression.cs (Binary::Emit): Comment out code path to emit method
12169         invocation stuff for the case when we have a user defined operator. I am
12170         just not able to get it right !
12171         
12172 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
12173
12174         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
12175         argument. 
12176
12177         (Expression::MemberLookup): Provide a version that allows to
12178         specify the MemberTypes and BindingFlags. 
12179
12180         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
12181         so it was not fetching variable information from outer blocks.
12182
12183         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
12184         Beforefieldinit as it was buggy.
12185
12186         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
12187         that Ravi put here.  
12188
12189         * class.cs (Constructor::Emit): Only emit if block is not null.
12190         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
12191         deal with this by semantically definining it as if the user had
12192         done it.
12193
12194         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
12195         constructors as we now "emit" them at a higher level.
12196
12197         (TypeContainer::DefineDefaultConstructor): Used to define the
12198         default constructors if none was provided.
12199
12200         (ConstructorInitializer): Add methods Resolve and Emit. 
12201         
12202         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
12203
12204 2001-09-17  Ravi Pratap  <ravi@ximian.com>
12205
12206         * class.cs (TypeContainer::EmitDefaultConstructor): Register
12207         the default constructor builder with our hashtable for methodbuilders
12208         to methodcores.
12209
12210         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
12211         and argument_count is 0 in which case we have a match.
12212         (Binary::ResolveOperator): More null checking and miscellaneous coding
12213         style cleanup.
12214
12215 2001-09-17  Ravi Pratap  <ravi@ximian.com>
12216
12217         * rootcontext.cs (IsNameSpace): Compare against null.
12218
12219         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
12220
12221         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
12222         and Unary::Operator.
12223
12224         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
12225         accordingly.
12226
12227         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
12228         we have overloaded operators.
12229         (Binary::ResolveOperator): Implement the part which does the operator overload
12230         resolution.
12231
12232         * class.cs (Operator::Emit): Implement.
12233         (TypeContainer::Emit): Emit the operators we have too.
12234
12235         * expression.cs (Binary::Emit): Update to emit the appropriate code for
12236         the case when we have a user-defined operator.
12237         
12238 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
12239
12240         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
12241
12242 2001-09-16  Ravi Pratap  <ravi@ximian.com>
12243
12244         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
12245         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
12246         (Constructor::Emit): Implement.
12247         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
12248         if we have no work to do. 
12249         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
12250         Emit method.
12251
12252         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
12253         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
12254
12255         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
12256         of parent.parent.
12257
12258 2001-09-15  Ravi Pratap  <ravi@ximian.com>
12259
12260         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
12261         in the source.
12262         (Tree::RecordNamespace): Method to do what the name says ;-)
12263         (Tree::Namespaces): Property to get at the namespaces hashtable.
12264
12265         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
12266         keep track.
12267
12268         * rootcontext.cs (IsNamespace): Fixed it :-)
12269
12270 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
12271
12272         * class.cs (TypeContainer::FindMembers): Add support for
12273         constructors. 
12274         (MethodCore): New class that encapsulates both the shared aspects
12275         of a Constructor and a Method.  
12276         (Method, Constructor): Factored pieces into MethodCore.
12277
12278         * driver.cs: Added --fatal which makes errors throw exceptions.
12279         Load System assembly as well as part of the standard library.
12280
12281         * report.cs: Allow throwing exceptions on errors for debugging.
12282
12283         * modifiers.cs: Do not use `parent', instead use the real type
12284         container to evaluate permission settings.
12285
12286         * class.cs: Put Ravi's patch back in.  He is right, and we will
12287         have to cope with the
12288
12289 2001-09-14  Ravi Pratap  <ravi@ximian.com>
12290
12291         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
12292         FamORAssem, not FamANDAssem.
12293         
12294 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
12295
12296         * driver.cs: Added --parse option that only parses its input files
12297         and terminates.
12298
12299         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
12300         incorrect.  IsTopLevel is not used to tell whether an object is
12301         root_types or not (that can be achieved by testing this ==
12302         root_types).  But to see if this is a top-level *class* (not
12303         necessarly our "toplevel" container). 
12304
12305 2001-09-14  Ravi Pratap  <ravi@ximian.com>
12306
12307         * enum.cs (Enum::Define): Modify to call the Lookup method on the
12308         parent instead of a direct call to GetType.
12309
12310 2001-09-14  Ravi Pratap  <ravi@ximian.com>
12311
12312         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
12313         Modifiers.TypeAttr. This should just be a call to that method.
12314
12315         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
12316         object so that we can determine if we are top-level or not.
12317
12318         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
12319         TypeContainer too.
12320
12321         * enum.cs (Enum::Define): Ditto.
12322
12323         * modifiers.cs (FieldAttr): Re-write.
12324
12325         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
12326         (TypeContainer::HaveStaticConstructor): New property to provide access
12327         to precisely that info.
12328
12329         * modifiers.cs (MethodAttr): Re-write.
12330         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
12331
12332         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
12333         of top-level types as claimed.
12334         
12335 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
12336
12337         * expression.cs (MemberLookup): Fruitless attempt to lookup
12338         constructors.  Maybe I need to emit default constructors?  That
12339         might be it (currently .NET emits this for me automatically).
12340         (Invocation::OverloadResolve): Cope with Arguments == null.
12341         (Invocation::EmitArguments): new function, shared by the new
12342         constructor and us.
12343         (Invocation::Emit): Handle static and instance methods.  Emit
12344         proper call instruction for virtual or non-virtual invocations.
12345         (New::Emit): Implement.
12346         (New::Resolve): Implement.
12347         (MemberAccess:Resolve): Implement.
12348         (MethodGroupExpr::InstanceExpression): used conforming to the spec
12349         to track instances.
12350         (FieldExpr::Resolve): Set type.
12351
12352         * support.cs: Handle empty arguments.
12353                 
12354         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
12355         SimpleLookup): Auxiliary routines to help parse a qualifier
12356         identifier.  
12357
12358         Update qualifier_identifier rule.
12359
12360         * codegen.cs: Removed debugging messages.
12361
12362         * class.cs: Make this a global thing, this acts just as a "key" to
12363         objects that we might have around.
12364
12365         (Populate): Only initialize method_builders_to_methods once.
12366
12367         * expression.cs (PropertyExpr): Initialize type from the
12368         PropertyType. 
12369
12370         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
12371         Resolve pattern.  Attempt to implicitly convert value to boolean.
12372         Emit code.
12373
12374         * expression.cs: Set the type for the int32/int32 argument case.
12375         (Binary::ResolveOperator): Set the return type to boolean for
12376         comparission operators
12377
12378         * typemanager.cs: Remove debugging print code.
12379
12380         (Invocation::Resolve): resolve type.
12381
12382         * class.cs: Allocate a MemberInfo of the correct size, as the code
12383         elsewhere depends on the test to reflect the correct contents.
12384
12385         (Method::) Keep track of parameters, due to System.Reflection holes
12386
12387         (TypeContainer::Populate): Keep track of MethodBuilders to Method
12388         mapping here.
12389
12390         (TypeContainer::FindMembers): Use ArrayList and then copy an array
12391         of the exact size and return that.
12392
12393         (Class::LookupMethodByBuilder): New function that maps
12394         MethodBuilders to its methods.  Required to locate the information
12395         on methods because System.Reflection bit us again.
12396
12397         * support.cs: New file, contains an interface ParameterData and
12398         two implementations: ReflectionParameters and InternalParameters
12399         used to access Parameter information.  We will need to grow this
12400         as required.
12401
12402         * expression.cs (Invocation::GetParameterData): implement a cache
12403         and a wrapper around the ParameterData creation for methods. 
12404         (Invocation::OverloadResolve): Use new code.
12405
12406 2001-09-13  Ravi Pratap  <ravi@ximian.com>
12407
12408         * class.cs (TypeContainer::EmitField): Remove and move into 
12409         (Field::Define): here and modify accordingly.
12410         (Field.FieldBuilder): New member.
12411         (TypeContainer::Populate): Update accordingly.
12412         (TypeContainer::FindMembers): Implement.
12413
12414 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
12415
12416         * statement.cs: (VariableInfo::VariableType): New field to be
12417         initialized with the full type once it is resolved. 
12418
12419 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
12420
12421         * parameter.cs (GetParameterInfo): Use a type cache to compute
12422         things only once, and to reuse this information
12423
12424         * expression.cs (LocalVariableReference::Emit): Implement.
12425         (OpcodeCast::Emit): fix.
12426
12427         (ParameterReference::Resolve): Implement.
12428         (ParameterReference::Emit): Implement.
12429
12430         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
12431         that are expressions need to stay as Expressions.
12432
12433         * typemanager.cs (CSharpName): Returns the C# name of a type if
12434         possible. 
12435
12436         * expression.cs (Expression::ConvertImplicit): New function that
12437         implements implicit type conversions.
12438
12439         (Expression::ImplicitReferenceConversion): Implements implicit
12440         reference conversions.
12441
12442         (EmptyCast): New type for transparent casts.
12443
12444         (OpcodeCast): New type for casts of types that are performed with
12445         a sequence of bytecodes.
12446         
12447         (BoxedCast): New type used for casting value types into reference
12448         types.  Emits a box opcode.
12449
12450         (Binary::DoNumericPromotions): Implements numeric promotions of
12451         and computation of the Binary::Type.
12452
12453         (Binary::EmitBranchable): Optimization.
12454
12455         (Binary::Emit): Implement code emission for expressions.
12456         
12457         * typemanager.cs (TypeManager): Added two new core types: sbyte
12458         and byte.
12459
12460 2001-09-12  Ravi Pratap  <ravi@ximian.com>
12461
12462         * class.cs (TypeContainer::FindMembers): Method which does exactly
12463         what Type.FindMembers does, only we don't have to use reflection. No
12464         implementation yet.
12465
12466         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
12467         typecontainer objects as we need to get at them.
12468         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
12469
12470         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
12471         typecontainer object.
12472
12473         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
12474         of just a Report object.
12475
12476 2001-09-11  Ravi Pratap  <ravi@ximian.com>
12477
12478         * class.cs (Event::Define): Go back to using the prefixes "add_" and
12479         "remove_"
12480         (TypeContainer::Populate): Now define the delegates of the type too.
12481         (TypeContainer.Delegates): Property to access the list of delegates defined
12482         in the type.
12483
12484         * delegates.cs (Delegate::Define): Implement partially.
12485
12486         * modifiers.cs (TypeAttr): Handle more flags.
12487
12488 2001-09-11  Ravi Pratap  <ravi@ximian.com>
12489
12490         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
12491         and not <=
12492         (Operator::Define): Re-write logic to get types by using the LookupType method
12493         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
12494         (Indexer::Define): Ditto.
12495         (Event::Define): Ditto.
12496         (Property::Define): Ditto.
12497         
12498 2001-09-10  Ravi Pratap  <ravi@ximian.com>
12499
12500         * class.cs (TypeContainer::Populate): Now define operators too. 
12501         (TypeContainer.Operators): New property to access the list of operators
12502         in a type.
12503         (Operator.OperatorMethodBuilder): New member to hold the method builder
12504         for the operator we are defining.
12505         (Operator::Define): Implement.
12506
12507 2001-09-10  Ravi Pratap  <ravi@ximian.com>
12508
12509         * class.cs (Event::Define): Make the prefixes of the accessor methods
12510         addOn_ and removeOn_ 
12511
12512         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
12513         of the location being passed in too. Ideally, this should go later since all
12514         error reporting should be done through the Report object.
12515
12516         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
12517         (Populate): Iterate thru the indexers we have and define them too.
12518         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
12519         for the get and set accessors.
12520         (Indexer::Define): Implement.
12521         
12522 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
12523
12524         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
12525         my previous implementation, did not work.
12526
12527         * typemanager.cs: Add a couple of missing types (the longs).
12528
12529         * literal.cs: Use TypeManager.bool_type instead of getting it.
12530
12531         * expression.cs (EventExpr): New kind of expressions.
12532         (Expressio::ExprClassFromMemberInfo): finish
12533
12534 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
12535
12536         * assign.cs: Emit stores to static fields differently.
12537
12538 2001-09-08  Ravi Pratap  <ravi@ximian.com>
12539
12540         * Merge in changes and adjust code to tackle conflicts. Backed out my
12541         code in Assign::Resolve ;-) 
12542
12543 2001-09-08  Ravi Pratap  <ravi@ximian.com>
12544
12545         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
12546         instead Report.Error and also pass in the location.
12547         (CSharpParser::Lexer): New readonly property to return the reference
12548         to the Tokenizer object.
12549         (declare_local_variables): Use Report.Error with location instead of plain 
12550         old error.
12551         (CheckDef): Ditto.
12552
12553         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
12554         (Operator.CheckBinaryOperator): Ditto.
12555
12556         * cs-parser.jay (operator_declarator): Update accordingly.
12557
12558         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
12559         (CheckBinaryOperator): Same here.
12560
12561         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
12562         on the name without any prefixes of namespace names etc. This is because we
12563         already might have something already fully qualified like 
12564         'System.Console.WriteLine'
12565
12566         * assign.cs (Resolve): Begin implementation. Stuck ;-)
12567
12568 2001-09-07  Ravi Pratap  <ravi@ximian.com>
12569
12570         * cs-tokenizer.cs (location): Return a string which also contains
12571         the file name.
12572
12573         * expression.cs (ElementAccess): New class for expressions of the
12574         type 'element access.'
12575         (BaseAccess): New class for expressions of the type 'base access.'
12576         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
12577         respectively.
12578         
12579         * cs-parser.jay (element_access): Implement action.
12580         (base_access): Implement actions.
12581         (checked_expression, unchecked_expression): Implement.
12582
12583         * cs-parser.jay (local_variable_type): Correct and implement.
12584         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
12585
12586         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
12587
12588         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
12589         name and the specifiers.
12590
12591         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
12592         
12593         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
12594         making them all public ;-)
12595
12596         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
12597         class anyways.
12598         
12599 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
12600
12601         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
12602         PropertyExprs.
12603         (FieldExpr, PropertyExprs): New resolved expressions.
12604         (SimpleName::MemberStaticCheck): Perform static checks for access
12605         to non-static fields on static methods. Maybe this should be
12606         generalized for MemberAccesses. 
12607         (SimpleName::ResolveSimpleName): More work on simple name
12608         resolution. 
12609
12610         * cs-parser.jay (primary_expression/qualified_identifier): track
12611         the parameter index.
12612
12613         * codegen.cs (CodeGen::Save): Catch save exception, report error.
12614         (EmitContext::EmitBoolExpression): Chain to expression generation
12615         instead of temporary hack.
12616         (::EmitStatementExpression): Put generic expression code generation.
12617
12618         * assign.cs (Assign::Emit): Implement variable assignments to
12619         local variables, parameters and fields.
12620
12621 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
12622
12623         * statement.cs (Block::GetVariableInfo): New method, returns the
12624         VariableInfo for a variable name in a block.
12625         (Block::GetVariableType): Implement in terms of GetVariableInfo
12626
12627         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
12628         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
12629
12630 2001-09-06  Ravi Pratap  <ravi@ximian.com>
12631
12632         * cs-parser.jay (operator_declaration): Continue on my quest : update
12633         to take attributes argument.
12634         (event_declaration): Ditto.
12635         (enum_declaration): Ditto.
12636         (indexer_declaration): Ditto.
12637         
12638         * class.cs (Operator::Operator): Update constructor accordingly.
12639         (Event::Event): Ditto.
12640
12641         * delegate.cs (Delegate::Delegate): Same here.
12642
12643         * enum.cs (Enum::Enum): Same here.
12644         
12645 2001-09-05  Ravi Pratap  <ravi@ximian.com>
12646
12647         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
12648
12649         * ../tests/cs0658.cs : New file to demonstrate error 0658.
12650
12651         * attribute.cs (Attributes): New class to encapsulate all attributes which were
12652         being passed around as an arraylist.
12653         (Attributes::AddAttribute): Method to add attribute sections.
12654
12655         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
12656         (struct_declaration): Update accordingly.
12657         (constant_declaration): Update.
12658         (field_declaration): Update.
12659         (method_header): Update.
12660         (fixed_parameter): Update.
12661         (parameter_array): Ditto.
12662         (property_declaration): Ditto.
12663         (destructor_declaration): Ditto.
12664         
12665         * class.cs (Struct::Struct): Update constructors accordingly.
12666         (Class::Class): Ditto.
12667         (Field::Field): Ditto.
12668         (Method::Method): Ditto.
12669         (Property::Property): Ditto.
12670         (TypeContainer::OptAttribute): update property's return type.
12671         
12672         * interface.cs (Interface.opt_attributes): New member.
12673         (Interface::Interface): Update to take the extra Attributes argument.
12674
12675         * parameter.cs (Parameter::Parameter): Ditto.
12676
12677         * constant.cs (Constant::Constant): Ditto.
12678
12679         * interface.cs (InterfaceMemberBase): New OptAttributes field.
12680         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
12681         the attributes as a parameter.
12682         (InterfaceProperty): Update constructor call.
12683         (InterfaceEvent): Ditto.
12684         (InterfaceMethod): Ditto.
12685         (InterfaceIndexer): Ditto.
12686
12687         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
12688         pass the attributes too.
12689         (interface_event_declaration): Ditto.
12690         (interface_property_declaration): Ditto.
12691         (interface_method_declaration): Ditto.
12692         (interface_declaration): Ditto.
12693
12694 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
12695
12696         * class.cs (Method::Define): Track the "static Main" definition to
12697         create an entry point. 
12698
12699         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
12700         EntryPoint if we find it. 
12701
12702         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
12703         (EmitContext::ig): Make this variable public.
12704
12705         * driver.cs: Make the default output file be the first file name
12706         with the .exe extension.  
12707
12708         Detect empty compilations
12709
12710         Handle various kinds of output targets.  Handle --target and
12711         rename -t to --dumper.
12712
12713         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
12714         methods inherited from Expression return now an Expression.  This
12715         will is used during the tree rewriting as we resolve them during
12716         semantic analysis.
12717
12718         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
12719         the spec.  Missing entirely is the information about
12720         accessability of elements of it.
12721
12722         (Expression::ExprClassFromMemberInfo): New constructor for
12723         Expressions that creates a fully initialized Expression based on
12724         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
12725         a Type.
12726
12727         (Invocation::Resolve): Begin implementing resolution of invocations.
12728         
12729         * literal.cs (StringLiteral):  Implement Emit.
12730
12731 2001-09-05  Ravi Pratap  <ravi@ximian.com>
12732
12733         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
12734         member.
12735         
12736 2001-09-04  Ravi Pratap  <ravi@ximian.com>
12737
12738         * cs-parser.jay (attribute_arguments): Implement actions.
12739         (attribute): Fix bug in production. Implement action.
12740         (attribute_list): Implement.
12741         (attribute_target): Implement.
12742         (attribute_target_specifier, opt_target_specifier): Implement
12743         (CheckAttributeTarget): New method to check if the attribute target
12744         is valid.
12745         (attribute_section): Implement.
12746         (opt_attributes): Implement.
12747
12748         * attribute.cs : New file to handle attributes.
12749         (Attribute): Class to hold attribute info.
12750
12751         * cs-parser.jay (opt_attribute_target_specifier): Remove production
12752         (attribute_section): Modify production to use 2 different rules to 
12753         achieve the same thing. 1 s/r conflict down !
12754         Clean out commented, useless, non-reducing dimension_separator rules.
12755         
12756         * class.cs (TypeContainer.attributes): New member to hold list
12757         of attributes for a type.
12758         (Struct::Struct): Modify to take one more argument, the attribute list.
12759         (Class::Class): Ditto.
12760         (Field::Field): Ditto.
12761         (Method::Method): Ditto.
12762         (Property::Property): Ditto.
12763         
12764         * cs-parser.jay (struct_declaration): Update constructor call to
12765         pass in the attributes too.
12766         (class_declaration): Ditto.
12767         (constant_declaration): Ditto.
12768         (field_declaration): Ditto.
12769         (method_header): Ditto.
12770         (fixed_parameter): Ditto.
12771         (parameter_array): Ditto.
12772         (property_declaration): Ditto.
12773
12774         * constant.cs (Constant::Constant): Update constructor similarly.
12775         Use System.Collections.
12776
12777         * parameter.cs (Parameter::Parameter): Update as above.
12778
12779 2001-09-02  Ravi Pratap  <ravi@ximian.com>
12780
12781         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
12782         (TypeContainer.delegates): New member to hold list of delegates.
12783
12784         * cs-parser.jay (delegate_declaration): Implement the action correctly 
12785         this time as I seem to be on crack ;-)
12786
12787 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
12788
12789         * rootcontext.cs (RootContext::IsNamespace): new function, used to
12790         tell whether an identifier represents a namespace.
12791
12792         * expression.cs (NamespaceExpr): A namespace expression, used only
12793         temporarly during expression resolution.
12794         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
12795         utility functions to resolve names on expressions.
12796
12797 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
12798
12799         * codegen.cs: Add hook for StatementExpressions. 
12800
12801         * class.cs: Fix inverted test for static flag in methods.
12802
12803 2001-09-02  Ravi Pratap  <ravi@ximian.com>
12804
12805         * class.cs (Operator::CheckUnaryOperator): Correct error number used
12806         to make it coincide with MS' number.
12807         (Operator::CheckBinaryOperator): Ditto.
12808
12809         * ../errors/errors.txt : Remove error numbers added earlier.
12810
12811         * ../errors/cs1019.cs : Test case for error # 1019
12812
12813         * ../errros/cs1020.cs : Test case for error # 1020
12814
12815         * cs-parser.jay : Clean out commented cruft.
12816         (dimension_separators, dimension_separator): Comment out. Ostensibly not
12817         used anywhere - non-reducing rule.
12818         (namespace_declarations): Non-reducing rule - comment out.
12819
12820         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
12821         with TypeContainer::AddEnum.
12822
12823         * delegate.cs : New file for delegate handling classes.
12824         (Delegate): Class for declaring delegates.
12825
12826         * makefile : Update.
12827
12828         * cs-parser.jay (delegate_declaration): Implement.
12829
12830 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
12831
12832         * class.cs (Event::Define): Implement.
12833         (Event.EventBuilder): New member.
12834
12835         * class.cs (TypeContainer::Populate): Update to define all enums and events
12836         we have.
12837         (Events): New property for the events arraylist we hold. Shouldn't we move to using
12838         readonly fields for all these cases ?
12839
12840 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
12841
12842         * class.cs (Property): Revamp to use the convention of making fields readonly.
12843         Accordingly modify code elsewhere.
12844
12845         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
12846         the Define method of the Property class.
12847
12848         * class.cs : Clean up applied patch and update references to variables etc. Fix 
12849         trivial bug.
12850         (TypeContainer::Populate): Update to define all the properties we have. Also
12851         define all enumerations.
12852
12853         * enum.cs (Define): Implement.
12854         
12855 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
12856
12857         * cs-parser.jay (overloadable_operator): The semantic value is an
12858         enum of the Operator class.
12859         (operator_declarator): Implement actions.
12860         (operator_declaration): Implement.
12861
12862         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
12863         validity of definitions.
12864         (Operator::CheckBinaryOperator): Static method to check for binary operators
12865         (TypeContainer::AddOperator): New method to add an operator to a type.
12866
12867         * cs-parser.jay (indexer_declaration): Added line to actually call the
12868         AddIndexer method so it gets added ;-)
12869
12870         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
12871         already taken care of by the MS compiler ?  
12872
12873 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
12874
12875         * class.cs (Operator): New class for operator declarations.
12876         (Operator::OpType): Enum for the various operators.
12877
12878 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
12879
12880         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
12881         ostensibly handle this in semantic analysis.
12882
12883         * cs-parser.jay (general_catch_clause): Comment out
12884         (specific_catch_clauses, specific_catch_clause): Ditto.
12885         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
12886         (catch_args, opt_catch_args): New productions.
12887         (catch_clause): Rewrite to use the new productions above
12888         (catch_clauses): Modify accordingly.
12889         (opt_catch_clauses): New production to use in try_statement
12890         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
12891         and re-write the code in the actions to extract the specific and
12892         general catch clauses by being a little smart ;-)
12893
12894         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
12895         Hooray, try and catch statements parse fine !
12896         
12897 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12898
12899         * statement.cs (Block::GetVariableType): Fix logic to extract the type
12900         string from the hashtable of variables.
12901
12902         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
12903         I end up making that mistake ;-)
12904         (catch_clauses): Fixed gross error which made Key and Value of the 
12905         DictionaryEntry the same : $1 !!
12906
12907 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12908
12909         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
12910
12911         * cs-parser.jay (event_declaration): Correct to remove the semicolon
12912         when the add and remove accessors are specified. 
12913
12914 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12915
12916         * cs-parser.jay (IndexerDeclaration): New helper class to hold
12917         information about indexer_declarator.
12918         (indexer_declarator): Implement actions.
12919         (parsing_indexer): New local boolean used to keep track of whether
12920         we are parsing indexers or properties. This is necessary because 
12921         implicit_parameters come into picture even for the get accessor in the 
12922         case of an indexer.
12923         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
12924
12925         * class.cs (Indexer): New class for indexer declarations.
12926         (TypeContainer::AddIndexer): New method to add an indexer to a type.
12927         (TypeContainer::indexers): New member to hold list of indexers for the
12928         type.
12929
12930 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
12931
12932         * cs-parser.jay (add_accessor_declaration): Implement action.
12933         (remove_accessor_declaration): Implement action.
12934         (event_accessors_declaration): Implement
12935         (variable_declarators): swap statements for first rule - trivial.
12936
12937         * class.cs (Event): New class to hold information about event
12938         declarations.
12939         (TypeContainer::AddEvent): New method to add an event to a type
12940         (TypeContainer::events): New member to hold list of events.
12941
12942         * cs-parser.jay (event_declaration): Implement actions.
12943
12944 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
12945
12946         * cs-parser.jay (dim_separators): Implement. Make it a string
12947         concatenating all the commas together, just as they appear.
12948         (opt_dim_separators): Modify accordingly
12949         (rank_specifiers): Update accordingly. Basically do the same
12950         thing - instead, collect the brackets here.
12951         (opt_rank_sepcifiers): Modify accordingly.
12952         (array_type): Modify to actually return the complete type string
12953         instead of ignoring the rank_specifiers.
12954         (expression_list): Implement to collect the expressions
12955         (variable_initializer): Implement. We make it a list of expressions
12956         essentially so that we can handle the array_initializer case neatly too.
12957         (variable_initializer_list): Implement.
12958         (array_initializer): Make it a list of variable_initializers
12959         (opt_array_initializer): Modify accordingly.
12960
12961         * expression.cs (New::NType): Add enumeration to help us
12962         keep track of whether we have an object/delegate creation
12963         or an array creation.
12964         (New:NewType, New::Rank, New::Indices, New::Initializers): New
12965         members to hold data about array creation.
12966         (New:New): Modify to update NewType
12967         (New:New): New Overloaded contructor for the array creation
12968         case.
12969
12970         * cs-parser.jay (array_creation_expression): Implement to call
12971         the overloaded New constructor.
12972         
12973 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
12974
12975         * class.cs (TypeContainer::Constructors): Return member
12976         constructors instead of returning null.
12977
12978 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
12979
12980         * typemanager.cs (InitCoreTypes): Initialize the various core
12981         types after we have populated the type manager with the user
12982         defined types (this distinction will be important later while
12983         compiling corlib.dll)
12984
12985         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
12986         on Expression Classification.  Now all expressions have a method
12987         `Resolve' and a method `Emit'.
12988
12989         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
12990         generation from working.     Also add some temporary debugging
12991         code. 
12992         
12993 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
12994
12995         * codegen.cs: Lots of code generation pieces.  This is only the
12996         beginning, will continue tomorrow with more touches of polish.  We
12997         handle the fundamentals of if, while, do, for, return.  Others are
12998         trickier and I need to start working on invocations soon.
12999         
13000         * gen-treedump.cs: Bug fix, use s.Increment here instead of
13001         s.InitStatement. 
13002
13003         * codegen.cs (EmitContext): New struct, used during code
13004         emission to keep a context.   Most of the code generation will be
13005         here. 
13006
13007         * cs-parser.jay: Add embedded blocks to the list of statements of
13008         this block.  So code generation proceeds in a top down fashion.
13009
13010 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
13011
13012         * statement.cs: Add support for multiple child blocks.
13013
13014 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
13015
13016         * codegen.cs (EmitCode): New function, will emit the code for a
13017         Block of code given a TypeContainer and its ILGenerator. 
13018
13019         * statement.cs (Block): Standard public readonly optimization.
13020         (Block::Block constructors): Link children. 
13021         (Block::Child): Child Linker.
13022         (Block::EmitVariables): Emits IL variable declarations.
13023
13024         * class.cs: Drop support for MethodGroups here, delay until
13025         Semantic Analysis.
13026         (Method::): Applied the same simplification that I did before, and
13027         move from Properties to public readonly fields.
13028         (Method::ParameterTypes): Returns the parameter types for the
13029         function, and implements a cache that will be useful later when I
13030         do error checking and the semantic analysis on the methods is
13031         performed.
13032         (Constructor::GetCallingConvention): Renamed from CallingConvetion
13033         and made a method, optional argument tells whether this is a class
13034         or a structure to apply the `has-this' bit.
13035         (Method::GetCallingConvention): Implement, returns the calling
13036         convention. 
13037         (Method::Define): Defines the type, a second pass is performed
13038         later to populate the methods.
13039
13040         (Constructor::ParameterTypes): implement a cache similar to the
13041         one on Method::ParameterTypes, useful later when we do semantic
13042         analysis. 
13043
13044         (TypeContainer::EmitMethod):  New method.  Emits methods.
13045
13046         * expression.cs: Removed MethodGroup class from here.
13047         
13048         * parameter.cs (Parameters::GetCallingConvention): new method.
13049
13050 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
13051
13052         * class.cs (TypeContainer::Populate): Drop RootContext from the
13053         argument. 
13054
13055         (Constructor::CallingConvention): Returns the calling convention.
13056         (Constructor::ParameterTypes): Returns the constructor parameter
13057         types. 
13058         
13059         (TypeContainer::AddConstructor): Keep track of default constructor
13060         and the default static constructor.
13061
13062         (Constructor::) Another class that starts using `public readonly'
13063         instead of properties. 
13064
13065         (Constructor::IsDefault): Whether this is a default constructor. 
13066
13067         (Field::) use readonly public fields instead of properties also.
13068
13069         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
13070         track of static constructors;  If none is used, turn on
13071         BeforeFieldInit in the TypeAttributes. 
13072
13073         * cs-parser.jay (opt_argument_list): now the return can be null
13074         for the cases where there are no arguments. 
13075
13076         (constructor_declarator): If there is no implicit `base' or
13077         `this', then invoke the default parent constructor. 
13078         
13079         * modifiers.cs (MethodAttr): New static function maps a set of
13080         modifiers flags into a MethodAttributes enum
13081         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
13082         MethodAttr, TypeAttr to represent the various mappings where the
13083         modifiers are used.
13084         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
13085
13086 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
13087
13088         * parameter.cs (GetParameterInfo): Fix bug where there would be no
13089         method arguments.
13090
13091         * interface.cs (PopulateIndexer): Implemented the code generator
13092         for interface indexers.
13093
13094 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
13095
13096         * interface.cs (InterfaceMemberBase): Now we track the new status
13097         here.  
13098
13099         (PopulateProperty): Implement property population.  Woohoo!  Got
13100         Methods and Properties going today. 
13101
13102         Removed all the properties for interfaces, and replaced them with
13103         `public readonly' fields. 
13104
13105 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
13106
13107         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
13108         initialize their hashtables/arraylists only when they are needed
13109         instead of doing this always.
13110
13111         * parameter.cs: Handle refs and out parameters.
13112
13113         * cs-parser.jay: Use an ArrayList to construct the arguments
13114         instead of the ParameterCollection, and then cast that to a
13115         Parameter[] array.
13116
13117         * parameter.cs: Drop the use of ParameterCollection and use
13118         instead arrays of Parameters.
13119
13120         (GetParameterInfo): Use the Type, not the Name when resolving
13121         types. 
13122
13123 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
13124
13125         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
13126         and instead use public readonly fields.
13127
13128         * class.cs: Put back walking code for type containers.
13129
13130 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
13131
13132         * class.cs (MakeConstant): Code to define constants.
13133
13134         * rootcontext.cs (LookupType): New function.  Used to locate types 
13135
13136         
13137 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
13138
13139         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
13140         this System.Reflection code is.  Kudos to Microsoft
13141         
13142         * typemanager.cs: Implement a type cache and avoid loading all
13143         types at boot time.  Wrap in LookupType the internals.  This made
13144         the compiler so much faster.  Wow.  I rule!
13145         
13146         * driver.cs: Make sure we always load mscorlib first (for
13147         debugging purposes, nothing really important).
13148
13149         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
13150         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
13151
13152         * rootcontext.cs: Lookup types on their namespace;  Lookup types
13153         on namespaces that have been imported using the `using' keyword.
13154
13155         * class.cs (TypeContainer::TypeAttr): Virtualize.
13156         (Class::TypeAttr): Return attributes suitable for this bad boy.
13157         (Struct::TypeAttr): ditto.
13158         Handle nested classes.
13159         (TypeContainer::) Remove all the type visiting code, it is now
13160         replaced with the rootcontext.cs code
13161
13162         * rootcontext.cs (GetClassBases): Added support for structs. 
13163
13164 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
13165
13166         * interface.cs, statement.cs, class.cs, parameter.cs,
13167         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
13168         Drop use of TypeRefs, and use strings instead.
13169
13170 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
13171
13172         * rootcontext.cs: 
13173
13174         * class.cs (Struct::Struct): set the SEALED flags after
13175         checking the modifiers.
13176         (TypeContainer::TypeAttr): new property, returns the
13177         TypeAttributes for a class.  
13178
13179         * cs-parser.jay (type_list): Oops, list production was creating a
13180         new list of base types.
13181
13182         * rootcontext.cs (StdLib): New property.
13183         (GetInterfaceTypeByName): returns an interface by type name, and
13184         encapsulates error handling here.
13185         (GetInterfaces): simplified.
13186         (ResolveTree): Encapsulated all the tree resolution here.
13187         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
13188         types. 
13189         
13190         * driver.cs: Add support for --nostdlib, to avoid loading the
13191         default assemblies.
13192         (Main): Do not put tree resolution here. 
13193
13194         * rootcontext.cs: Beginning of the class resolution.
13195
13196 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
13197
13198         * rootcontext.cs: Provide better error reporting. 
13199
13200         * cs-parser.jay (interface_base): set our $$ to be interfaces.
13201
13202         * rootcontext.cs (CreateInterface): Handle the case where there
13203         are no parent interfaces.
13204         
13205         (CloseTypes): Routine to flush types at the end.
13206         (CreateInterface): Track types.
13207         (GetInterfaces): Returns an array of Types from the list of
13208         defined interfaces.
13209
13210         * typemanager.c (AddUserType): Mechanism to track user types (puts
13211         the type on the global type hash, and allows us to close it at the
13212         end). 
13213         
13214 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
13215
13216         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
13217         RecordInterface instead.
13218
13219         * cs-parser.jay: Updated to reflect changes above.
13220
13221         * decl.cs (Definition): Keep track of the TypeBuilder type that
13222         represents this type here.  Not sure we will use it in the long
13223         run, but wont hurt for now.
13224
13225         * driver.cs: Smaller changes to accomodate the new code.
13226
13227         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
13228         when done. 
13229
13230         * rootcontext.cs (CreateInterface):  New method, used to create
13231         the System.TypeBuilder type for interfaces.
13232         (ResolveInterfaces): new entry point to resolve the interface
13233         hierarchy. 
13234         (CodeGen): Property, used to keep track of the code generator.
13235
13236 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
13237
13238         * cs-parser.jay: Add a second production for delegate_declaration
13239         with `VOID'.
13240
13241         (enum_body): Put an opt_comma here instead of putting it on
13242         enum_body or enum_member_declarations so we can handle trailing
13243         commas on enumeration members.  Gets rid of a shift/reduce.
13244         
13245         (type_list): Need a COMMA in the middle.
13246
13247         (indexer_declaration): Tell tokenizer to recognize get/set
13248
13249         * Remove old targets.
13250
13251         * Re-add the parser target.
13252
13253 2001-07-13  Simon Cozens <simon@simon-cozens.org>
13254
13255         * cs-parser.jay: Add precendence rules for a number of operators
13256         ot reduce the number of shift/reduce conflicts in the grammar.
13257         
13258 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
13259
13260         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
13261         and put it here.
13262
13263         Get rid of old crufty code.
13264
13265         * rootcontext.cs: Use this to keep track of the parsed
13266         representation and the defined types available to the program. 
13267
13268         * gen-treedump.cs: adjust for new convention.
13269
13270         * type.cs: Split out the type manager, and the assembly builder
13271         from here. 
13272
13273         * typemanager.cs: the type manager will live here now.
13274
13275         * cil-codegen.cs: And the code generator here. 
13276
13277 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
13278
13279         * makefile: Fixed up for easy making.
13280
13281 2001-07-13  Simon Cozens <simon@simon-cozens.org>
13282
13283         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
13284         the 
13285
13286         (unary_expression): Expand pre_increment_expression and
13287         post_decrement_expression to reduce a shift/reduce.
13288
13289 2001-07-11  Simon Cozens
13290
13291         * cs-tokenizer.cs: Hex numbers should begin with a 0.
13292
13293         Improve allow_keyword_as_indent name.
13294
13295 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
13296
13297         * Adjustments for Beta2. 
13298
13299 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
13300
13301         * decl.cs: Added `Define' abstract method.
13302         (InTransit): new property, used to catch recursive definitions. 
13303
13304         * interface.cs: Implement `Define'. 
13305
13306         * modifiers.cs: Map Modifiers.constants to
13307         System.Reflection.TypeAttribute flags.
13308
13309         * class.cs: Keep track of types and user-defined types.
13310         (BuilderInit): New method for creating an assembly
13311         (ResolveType): New function to launch the resolution process, only
13312         used by interfaces for now.
13313
13314         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
13315         that are inserted into the name space. 
13316
13317 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
13318
13319         * ARGH.  I have screwed up my tree so many times due to the use of
13320         rsync rather than using CVS.  Going to fix this at once. 
13321
13322         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
13323         load types.
13324
13325 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
13326
13327         * Experiment successful: Use System.Type rather that our own
13328         version of Type.  
13329
13330 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
13331
13332         * cs-parser.jay: Removed nsAliases from here.
13333
13334         Use new namespaces, handle `using XXX;' 
13335
13336         * namespace.cs: Reimplemented namespace handling, use a recursive
13337         definition of the class.  Now we can keep track of using clauses
13338         and catch invalid using clauses.
13339
13340 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
13341
13342         * gen-treedump.cs: Adapted for all the renaming.
13343
13344         * expression.cs (Expression): this class now has a Type property
13345         which returns an expression Type.
13346
13347         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
13348         `Type', as this has a different meaning now in the base
13349
13350 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
13351
13352         * interface.cs, class.cs: Removed from all the sources the
13353         references to signature computation, as we can not do method
13354         signature computation during the parsing time, as we are not
13355         trying to solve at that point distinguishing:
13356
13357         class X {
13358                 void a (Blah x) {}
13359                 void a (NS.Blah x) {}
13360         }
13361
13362         Which depending on the context might be valid or not, as we do not
13363         know if Blah is the same thing as NS.Blah at that point.
13364
13365         * Redid everything so the code uses TypeRefs now instead of
13366         Types.  TypeRefs are just temporary type placeholders, that need
13367         to be resolved.  They initially have a pointer to a string and the
13368         current scope in which they are used.  This is used later by the
13369         compiler to resolve the reference to an actual Type. 
13370
13371         * DeclSpace is no longer a CIR.Type, and neither are
13372         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
13373         are all DeclSpaces, but no Types. 
13374
13375         * type.cs (TypeRefManager): This implements the TypeRef manager,
13376         which keeps track of all the types that need to be resolved after
13377         the parsing has finished. 
13378
13379 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
13380
13381         * ARGH.  We are going to have to store `foreach' as a class rather
13382         than resolving it, as we need to verify error 1579 after name
13383         resolution.   *OR* we could keep a flag that says `This request to
13384         IEnumerator comes from a foreach statement' which we can then use
13385         to generate the error.
13386
13387 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
13388
13389         * class.cs (TypeContainer.AddMethod): we now add methods to the
13390         MethodGroup instead of the method hashtable.  
13391
13392         * expression.cs: Add MethodGroup abstraction, which gets us one
13393         step closer to the specification in the way we handle method
13394         declarations.  
13395
13396         * cs-parser.jay (primary_expression): qualified_identifier now
13397         tried to match up an identifier to a local variable reference or
13398         to a parameter reference.
13399
13400         current_local_parameters is now a parser global variable that
13401         points to the current parameters for the block, used during name
13402         lookup.
13403
13404         (property_declaration): Now creates an implicit `value' argument to
13405         the set accessor.
13406
13407 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
13408
13409         * parameter.cs: Do not use `param' arguments as part of the
13410         signature, per the spec.
13411
13412 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
13413
13414         * decl.cs: Base class for classes, structs and interfaces.  This
13415         is the "Declaration Space" 
13416
13417         * cs-parser.jay: Use CheckDef for checking declaration errors
13418         instead of having one on each function.
13419
13420         * class.cs: Factor out some code for handling error handling in
13421         accordance to the "Declarations" section in the "Basic Concepts"
13422         chapter in the ECMA C# spec.
13423
13424         * interface.cs: Make all interface member classes derive from
13425         InterfaceMemberBase.
13426
13427 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
13428
13429         * Many things: all interfaces are parsed and generated in
13430         gen-treedump.  Support for member variables, constructors,
13431         destructors, properties, constants is there.
13432
13433         Beginning of the IL backend, but very little done, just there for
13434         testing purposes. 
13435
13436 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
13437
13438         * cs-parser.jay: Fix labeled statement.
13439
13440         * cs-tokenizer.cs (escape): Escape " and ' always.
13441         ref_line, ref_name: keep track of the line/filename as instructed
13442         by #line by the compiler.
13443         Parse #line.
13444
13445 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
13446
13447         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
13448         to match the values in System.CodeDOM.
13449
13450         Divid renamed to Divide.
13451
13452         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
13453         statements. 
13454         (Statements.set): remove.
13455
13456         * System.CodeDOM/CodeCatchClause.cs: always have a valid
13457         statements. 
13458
13459         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
13460         falseStatements always have valid values. 
13461
13462         * cs-parser.jay: Use System.CodeDOM now.
13463