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