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