2004-10-24 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / ChangeLog
1 2004-10-24  Marek Safar  <marek.safar@seznam.cz>
2
3         Fixed bugs #63705, #67130
4         * decl.cs (MemberCache.MemberCache): Add parameter to distinguish
5         imported and defined interfaces.
6         (CacheEntry, EntryType): Changed to protected internal.
7
8         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
9         interfaces too.
10
11         * typemanager.cs (LookupInterfaceContainer): New method.
12         Fills member container from base interfaces.
13
14 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
15
16         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
17         561 report.
18         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
19
20 2004-10-18  Martin Baulig  <martin@ximian.com>
21
22         Merged latest changes into gmcs.  Please keep this comment in
23         here, it makes it easier for me to see what changed in MCS since
24         the last time I merged.
25
26 2004-10-18  Martin Baulig  <martin@ximian.com>
27
28         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
29         `Type' directly, but call ResolveType() on it.
30         (Catch.Resolve): Likewise.
31         (Foreach.Resolve): Likewise.
32
33 2004-10-18  Martin Baulig  <martin@ximian.com>
34
35         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
36         `Type' directly, but call ResolveType() on it.
37         (Probe.DoResolve): Likewise.
38         (ArrayCreation.LookupType): Likewise.
39         (TypeOf.DoResolve): Likewise.
40         (SizeOf.DoResolve): Likewise.
41
42 2004-10-18  Martin Baulig  <martin@ximian.com>
43
44         * expression.cs (Invocation.BetterFunction): Put back
45         TypeManager.TypeToCoreType().
46
47 2004-10-18  Raja R Harinath  <rharinath@novell.com>
48
49         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
50         the ResolveType.
51
52 2004-10-18  Martin Baulig  <martin@ximian.com>
53
54         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
55         `Type' directly, but call ResolveType() on it.
56
57 2004-10-18  Martin Baulig  <martin@ximian.com>
58
59         * class.cs (FieldMember.Define): Don't access the TypeExpr's
60         `Type' directly, but call ResolveType() on it.
61         (MemberBase.DoDefine): Likewise.
62
63         * expression.cs (New.DoResolve): Don't access the TypeExpr's
64         `Type' directly, but call ResolveType() on it.
65         (ComposedCast.DoResolveAsTypeStep): Likewise.
66
67         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
68         `Type' directly, but call ResolveType() on it.
69
70 2004-10-17  John Luke  <john.luke@gmail.com>
71
72         * class.cs (Operator.GetSignatureForError): use CSharpName
73
74         * parameter.cs (Parameter.GetSignatureForError): Returns
75         correct name even if was not defined.
76
77 2004-10-13  Raja R Harinath  <rharinath@novell.com>
78
79         Fix #65816.
80         * class.cs (TypeContainer.EmitContext): New property.
81         (DefineNestedTypes): Create an emitcontext for each part.
82         (MethodCore.DoDefineParameters): Use container's emitcontext.
83         Pass type array to InternalParameters.
84         (MemberBase.DoDefine): Use container's emitcontext.
85         (FieldMember.Define): Likewise.
86         (Event.Define): Likewise.
87         (SetMethod.GetParameterInfo): Change argument to EmitContext.
88         Pass type array to InternalParameters.
89         (SetIndexerMethod.GetParameterInfo): Likewise.
90         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
91         * delegate.cs (Define): Pass emitcontext to
92         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
93         array to InternalParameters.
94         * expression.cs (ParameterReference.DoResolveBase): Pass
95         emitcontext to GetParameterInfo.
96         (ComposedCast.DoResolveAsTypeStep): Remove check on
97         ec.ResolvingTypeTree.
98         * parameter.cs (Parameter.Resolve): Change argument to
99         EmitContext.  Use ResolveAsTypeTerminal.
100         (Parameter.GetSignature): Change argument to EmitContext.
101         (Parameters.ComputeSignature): Likewise.
102         (Parameters.ComputeParameterTypes): Likewise.
103         (Parameters.GetParameterInfo): Likewise.
104         (Parameters.ComputeAndDefineParameterTypes): Likewise.
105         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
106         * support.cs (InternalParameters..ctor): Remove variant that takes
107         a DeclSpace.
108         * typemanager.cs (system_intptr_expr): New.
109         (InitExpressionTypes): Initialize it.
110
111 2004-10-12  Chris Toshok  <toshok@ximian.com>
112
113         * cs-parser.jay: fix location for try_statement and catch_clause.
114
115 2004-10-11  Martin Baulig  <martin@ximian.com>
116
117         * report.cs: Don't make --fatal abort on warnings, we have
118         -warnaserror for that.
119
120 2004-10-07  Raja R Harinath  <rharinath@novell.com>
121
122         More DeclSpace.ResolveType avoidance.
123         * decl.cs (MemberCore.InUnsafe): New property.
124         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
125         with newly created EmitContext.
126         (FieldMember.Define): Likewise.
127         * delegate.cs (Delegate.Define): Likewise.
128         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
129         only if normal name-lookup fails.
130         (TypeExpr.DoResolve): Enable error-checking.
131         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
132         (SizeOf.DoResolve): Likewise.
133         (ComposedCast.DoResolveAsTypeStep): Likewise.
134         (StackAlloc.DoResolve): Likewise.
135         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
136         (Block.Unsafe): New property.
137         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
138         (Unsafe): Set 'unsafe' flag of contained block.
139         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
140         (Fixed.Resolve): Likewise.
141         (Catch.Resolve): Likewise.
142         (Using.ResolveLocalVariableDecls): Likewise.
143         (Foreach.Resolve): Likewise.
144
145 2004-10-05  John Luke <john.luke@gmail.com>
146
147         * cs-parser.jay: add location to error CS0175
148
149 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
150
151         * ecore.cs (Expression.Constantity): Add support for turning null
152         into a constant.
153
154         * const.cs (Const.Define): Allow constants to be reference types
155         as long as the value is Null.
156
157 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
158
159         * namespace.cs (NamespaceEntry.Using): No matter which warning
160         level is set, check if this namespace name has already been added.
161
162 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
163
164         * expression.cs: reftype [!=]= null should always use br[true,false].
165         # 67410
166
167 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
168
169         Fix #67108
170         * attribute.cs: Enum conversion moved to 
171         GetAttributeArgumentExpression to be applied to the all
172         expressions.
173
174 2004-10-01  Raja R Harinath  <rharinath@novell.com>
175
176         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
177         * class.c (TypeContainer.DefineType): Flag error if
178         base types aren't accessible due to access permissions.
179         * decl.cs (DeclSpace.ResolveType): Move logic to
180         Expression.ResolveAsTypeTerminal.
181         (DeclSpace.ResolveTypeExpr): Thin layer over
182         Expression.ResolveAsTypeTerminal.
183         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
184         Refactor code into NestedAccess.  Use it.
185         (DeclSpace.NestedAccess): New.
186         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
187         argument to silence errors.  Check access permissions.
188         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
189         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
190         (Cast.DoResolve): Likewise.
191         (New.DoResolve): Likewise.
192         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
193         (TypeOf.DoResolve): Likewise.
194
195         * expression.cs (Invocation.BetterConversion): Return the Type of
196         the better conversion.  Implement section 14.4.2.3 more faithfully.
197         (Invocation.BetterFunction): Make boolean.  Make correspondence to
198         section 14.4.2.2 explicit.
199         (Invocation.OverloadResolve): Update.
200         (Invocation): Remove is_base field.
201         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
202         (Invocation.Emit): Likewise.
203
204 2004-09-27  Raja R Harinath  <rharinath@novell.com>
205
206         * README: Update to changes.
207
208 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
209
210         * cs-parser.jay: Reverted 642 warning fix.
211
212 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
213
214         Fix bug #66615
215         * decl.cs (FindMemberWithSameName): Indexer can have more than
216         1 argument.
217
218 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
219
220         * expression.cs (LocalVariableReference.DoResolveLValue):
221         Do not report warning 219 for out values.
222         (EmptyExpression.Null): New member to avoid extra allocations.
223
224 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
225
226         * cs-parser.jay: Fix wrong warning 642 report.
227
228         * cs-tokenizer.cs (CheckNextToken): New helper;
229         Inspect next character if is same as expected.
230
231 2004-09-23  Martin Baulig  <martin@ximian.com>
232
233         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
234         (Convert.ImplicitReferenceConversionExists): Likewise.
235
236 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
237
238         * class.cs (Operator.Define): Add error 448 and 559 report.
239
240 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
241
242         * class.cs (MemberBase.IsTypePermitted): New protected
243         method for checking error CS0610.
244
245 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
246
247         * class.cs (TypeContainer.HasExplicitLayout): New property
248         Returns whether container has StructLayout attribute set Explicit.
249         (FieldMember): New abstract class for consts and fields.
250         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
251         (Field): Reuse FieldMember.
252
253         * const.cs (Const): Reuse FieldMember.
254
255         * rootcontext.cs: EmitConstants call moved to class.
256
257 2004-09-22  Martin Baulig  <martin@ximian.com>
258
259         Thanks to Peter Sestoft for this bug report.
260
261         * expression.cs (Conditional): If both the `trueExpr' and the
262         `falseExpr' is a NullLiteral, return a NullLiteral.
263
264 2004-09-22  Martin Baulig  <martin@ximian.com>
265
266         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
267         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
268         for the "get_Current" call.
269
270 2004-09-22  Martin Baulig  <martin@ximian.com>
271
272         Marek and me just fixed one of our oldest bugs: #28562 :-)
273
274         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
275
276         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
277         we're an EnumConstant, just return that.
278         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
279         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
280         to get the value which'll actually be written into the attribute.
281         However, we have to use GetValue() to access the attribute's value
282         in the compiler.        
283
284 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
285
286         * constant.cs (Constant.IsNegative): New abstract property
287         IsNegative.
288
289         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
290         (StackAlloc.DoResolve): Reused IsNegative.
291
292 2004-09-21  Martin Baulig  <martin@ximian.com>
293
294         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
295         if we're used in an iterator, we may be called from different
296         methods.
297
298         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
299         we actually have an exception block.
300
301 2004-09-20  John Luke <jluke@cfl.rr.com>
302
303         * class.cs, cs-parser.jay: Improve the error report for 1520:
304         report the actual line where the error happens, not where the
305         class was declared.
306
307         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
308         Pass location information that was available elsewhere.
309
310 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
311
312         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
313         runtime to delay sign assemblies.
314
315 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
316
317         * cs-parser.jay: Do not report the stack trace, this is barely
318         used nowadays.
319
320 2004-08-22  John Luke  <john.luke@gmail.com>
321  
322         * driver.cs : check that a resource id is not already used
323         before adding it, report CS1508 if it is, bug #63637
324
325 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
326
327         * ecore.cs: Removed dead code.
328
329 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
330
331         * class.cs: Do not report warning CS0067 on the interfaces.
332
333 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
334
335         * cs-parser.jay: Add error 504 report.
336
337 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
338
339         * rootcontext.cs: WarningLevel is 4 by default now.
340
341         * statement.cs (Fixed.Resolve): Do not null
342         VariableInfo.
343
344 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
345
346         Fixed bug #55780
347         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
348         deep search when property is not virtual.
349         (PropertyExpr.ResolveAccessors): Make one call for both
350         accessors.
351
352 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
353
354         Fixed bug #65766
355         * statement.cs: Error 152 report constains also location.
356
357 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
358
359         Fixed bug #65766
360         * const.cs: Explicitly set constant as static.
361
362 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
363
364         Fixed bug #64226
365         * cs-parser.jay: Add error 1017 report.
366
367 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
368
369         Fixed bug #59980, #64224
370         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
371
372         * typemanager.cs (IsSpecialMethod): Simplified
373
374 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
375
376         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
377         condition with better params.
378
379 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
380
381         Fixed bug #65238
382         * attribute.cs (Resolve): Property has to have both
383         accessors.
384
385 2004-09-14  Martin Baulig  <martin@ximian.com>
386
387         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
388
389 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
390
391         Fixed bug #61902
392         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
393         called and is obsolete then this member suppress message
394         when call is inside next [Obsolete] method or type.
395
396         * expression.cs: Use TestObsoleteMethodUsage member.
397
398 2004-09-14  Martin Baulig  <martin@ximian.com>
399
400         * cs-parser.jay: Sync a bit with the GMCS version.
401
402 2004-09-14  Martin Baulig  <martin@ximian.com>
403
404         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
405         (CSharpParser.yacc_verbose_flag): New public field.
406
407         * genericparser.cs: Removed.
408
409 2004-09-14  Raja R Harinath  <rharinath@novell.com>
410
411         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
412
413 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
414
415         * class.cs (MethodCore.CheckBase): Fix bug #65757.
416
417 2004-09-10  Martin Baulig  <martin@ximian.com>
418
419         Backported my MemberName changes from GMCS into MCS.
420
421         - we are now using a special `MemberName' class instead of using
422         strings; in GMCS, the `MemberName' also contains the type
423         arguments.
424
425         - changed the grammar rules a bit:
426           * the old `member_name' is now a `namespace_or_type_name':
427             The rule is that we use `namespace_or_type_name' everywhere
428             where we expect either a "member name" (GetEnumerator) or a
429             "member name" with an explicit interface name
430             (IEnumerable.GetEnumerator).
431             In GMCS, the explicit interface name may include type arguments
432             (IEnumerable<T>.GetEnumerator).
433           * we use `member_name' instead of just `IDENTIFIER' for
434             "member names":
435             The rule is that we use `member_name' wherever a member may
436             have type parameters in GMCS.       
437
438         * decl.cs (MemberName): New public class.
439         (MemberCore.MemberName): New public readonly field.
440         (MemberCore.ctor): Take a `MemberName' argument, not a string.
441         (DeclSpace): Likewise.
442
443         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
444         * enum.cs (Enum.ctor): Likewise.
445
446         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
447         MemberName.     
448         (AliasEntry.ctor): Take a MemberName, not an Expression.
449         (AliasEntry.UsingAlias): Likewise.
450
451         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
452         (IMethodData.MemberName): Changed type from string to MemberName.
453         (MemberBase.ExplicitInterfaceName): Likewise.
454         (AbstractPropertyEventMethod.SetupName): Make this private.
455         (AbstractPropertyEventMethod.ctor): Added `string prefix'
456         argument; compute the member name here.
457         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
458         on the `member.MemberName' and the `prefix'.
459
460         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
461         not `type_name'.
462         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
463         thus, we get a `MemberName' instead of a `string'.  These
464         declarations may have type parameters in GMCS.
465         (interface_method_declaration, delegate_declaration): Likewise.
466         (class_declaration, interface_declaration): Likewise.
467         (method_header): Use `namespace_or_type_name' instead of
468         `member_name'.  We may be an explicit interface implementation.
469         (property_declaration, event_declaration): Likewise.
470         (member_name): This is now just an `IDENTIFIER', not a
471         `namespace_or_type_name'.
472         (type_name, interface_type): Removed.
473         (namespace_or_type_name): Return a MemberName, not an Expression.
474         (primary_expression): Use `member_name' instead of `IDENTIFIER';
475         call GetTypeExpression() on the MemberName to get an expression.
476         (IndexerDeclaration.interface_type): Changed type from string to
477         MemberName.
478         (MakeName): Operate on MemberName's instead of string's.
479
480 2004-09-13  Raja R Harinath  <rharinath@novell.com>
481
482         Fix bug #55770.
483         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
484         (NamespaceEntry.Lookup): Add new argument to flag if we want the
485         lookup to avoid symbols introduced by 'using'.
486         * rootcontext.cs (NamespaceLookup): Update.
487
488 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
489
490         * class.cs (TypeContainer.DoDefineMembers): Do not call
491         DefineDefaultConstructor for static classes.
492
493 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
494
495         * attribute.cs (Attribute.Resolve): Add error 653 report.
496
497         * class.cs (Class.ApplyAttributeBuilder): Add error 641
498         report.
499         (Method.ApplyAttributeBuilder): Add error 685 report.
500         (Operator.Define): Add error 564 report.
501
502         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
503
504         * expression.cs (Invocation.DoResolve): Add error
505         245 and 250 report.
506
507         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
508         error 674 report.
509
510 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
511
512         * class.cs (ConstructorInitializer.Resolve):
513         Wrong error number (515->516).
514
515 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
516
517         * class.cs (Indexer.Define): Add error 631 report.
518
519 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
520
521         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
522
523 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
524
525         * expression.cs (Probe.DoResolve): Add error CS0241 report.
526
527 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
528
529         * cs-parser.jay: Added error CS0241 report.
530
531 2004-09-10  Raja R Harinath  <rharinath@novell.com>
532
533         * cs-parser.jay (fixed_statement): Introduce a scope for the
534         declaration in the 'fixed' statement.
535
536 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
537
538         * cs-parser.jay: Added CS0230 error report.
539
540 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
541
542         * cs-parser.jay: Added errors CS0231 and CS0257 report.
543
544 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
545
546         * expression.cs (Argument.Resolve): Added error CS0192 and
547         CS0199 report.
548
549 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
550
551         C# 2.0 #pragma warning feature
552
553         * cs-tokenizer.cs (PreProcessPragma): New method; 
554         Handles #pragma directive.
555
556         * report.cs (WarningRegions): New class; Support
557         class for #pragma warning directive. It tests whether
558         warning is enabled for a given line.
559
560 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
561
562         * const.cs: Add more descriptive error report, tahnks to
563         Sebastien. 
564
565 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
566
567         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
568
569 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
570
571         * expression.cs: Apply patch from Ben: Remove dead code from
572         ArrayCreation, and remove the TurnintoConstant call in const.cs,
573         as that code just threw an exception anwyays.
574
575         * const.cs: Remove the call to the turnintoconstant, for details
576         see bug: #63144
577         
578         * literal.cs: The type of the null-literal is the null type;  So
579         we use a placeholder type (literal.cs:System.Null, defined here)
580         for it.
581
582         * expression.cs (Conditional.DoResolve): Remove some old code that
583         is no longer needed, conversions have been fixed.
584
585         (ArrayCreationExpression.DoResolve): Return false if we fail to
586         resolve the inner expression.
587
588 2004-09-07  Raja R Harinath  <rharinath@novell.com>
589
590         Fix test-290.cs.
591         * cs-parser.jay (delegate_declaration): Record a delegate
592         declaration as a type declaration.
593         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
594
595 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
596
597         * parameter.cs: Do not crash if the type can not be resolved. 
598
599         * expression.cs: Report errors with unsafe pointers, fixes #64896
600
601 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
602
603         * expression.cs: Pointer arith always needs to do a conv.i
604         if the operand is a long. fix 65320
605
606 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
607
608         Fixed cs0619-37.cs, cs0619-38.cs
609
610         * enum.cs (GetObsoleteAttribute): Removed.
611
612         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
613         on Enum member is double staged. The first is tested member
614         and then enum.
615
616 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
617
618         Fixed #56986, #63631, #65231
619
620         * class.cs: (TypeContainer.AddToMemberContainer): New method,
621         adds member to name container.
622         (TypeContainer.AddToTypeContainer): New method, adds type to
623         name container.
624         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
625         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
626         AddOperator): Simplified by reusing AddToMemberContainer.
627         (TypeContainer.UserDefinedStaticConstructor): Changed to property
628         instead of field.
629         (Method.CheckForDuplications): Fixed implementation to test all
630         possibilities.
631         (MemberBase): Detection whether member is explicit interface
632         implementation is now in constructor.
633         (MemberBase.UpdateMemberName): Handles IndexerName.
634         (Accessor): Changed to keep also location information.
635         (AbstractPropertyEventMethod): Is derived from MemberCore.
636         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
637         will be emited or not.
638         (PropertyBase.AreAccessorsDuplicateImplementation):
639         Tests whether accessors are not in collision with some method.
640         (Operator): Is derived from MethodCore to simplify common
641         operations.
642
643         * decl.cs (Flags.TestMethodDuplication): Test for duplication
644         must be performed.
645         (DeclSpace.AddToContainer): Adds the member to defined_names
646         table. It tests for duplications and enclosing name conflicts.
647
648         * enum.cs (EnumMember): Clean up to reuse the base structures
649
650 2004-09-03  Martin Baulig  <martin@ximian.com>
651
652         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
653         into TypeContainer, to make partial classes work again.
654
655 2004-09-03  Martin Baulig  <martin@ximian.com>
656
657         * rootcontext.cs (RootContext.V2): Removed.
658
659 2004-03-23  Martin Baulig  <martin@ximian.com>
660
661         * expression.cs (Invocation.OverloadResolve): Added `bool
662         may_fail' argument and use it instead of the Location.IsNull() hack.
663
664 2004-09-03  Martin Baulig  <martin@ximian.com>
665
666         Merged latest changes into gmcs.  Please keep this comment in
667         here, it makes it easier for me to see what changed in MCS since
668         the last time I merged.
669
670 2004-09-03  Raja R Harinath  <rharinath@novell.com>
671
672         Fix #61128.
673         * expression.cs (BetterConversion): Don't allow either conversion 
674         to be null.  Remove redundant implicit conversion test when 'q ==
675         null' -- when this function is invoked, we already know that the
676         implicit conversion exists.
677         (BetterFunction): Assume that 'best' is non-null.  Remove
678         redundant reimplementation of IsApplicable when 'best' is null.
679         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
680         number of arguments.
681         (IsAncestralType): Extract from OverloadResolve.
682         (OverloadResolve): Make robust to the MethodGroupExpr being
683         unsorted.  Implement all the logic of Section 14.5.5.1, and
684         support overloading of methods from multiple applicable types.
685         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
686
687         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
688         (RealError, Warning): Append type of report to related symbol.
689
690 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
691
692         * enum.cs: Fixed CLS-Compliance checks for enum members.
693         Error tests cs3008-8.cs, cs3014-8.cs
694
695 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
696
697         Fixed bug #62342, #63102
698         * class.cs: ImplementIndexer uses member.IsExplicitImpl
699         like ImplementMethod.
700
701 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
702
703         * attribute.cs (Attribute.GetAttributeArgumentExpression):
704         Fixed bug #65170.
705
706 2004-09-02  Martin Baulig  <martin@ximian.com>
707
708         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
709         TypeManager.GetArgumentTypes() rather than calling GetParameters()
710         on the MethodBase.
711
712 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
713
714         C# 2.0 Static classes implemented
715
716         * class.cs (TypeContainer): instance_constructors,
717         initialized_fields, initialized_static_fields,
718         default_constructor, base_inteface_types are protected to be
719         accessible from StaticClass.
720         (TypeContainer.DefineDefaultConstructor): New virtual method
721         for custom default constructor generating
722         (StaticClass): New class to handle "Static classes" feature.
723
724         * cs-parser.jay: Handle static keyword on class like instance
725         of StaticClass.
726
727         * driver.cs: Added "/langversion" command line switch with two
728         options (iso-1, default).
729
730 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
731
732         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
733
734 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
735
736         * delegate.cs: Style.
737
738 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
739
740         * delegate.cs: Add seperate instance expr field for miguel.
741
742 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
743
744         * PointerArithmetic (Resolve): make sure we are not doing
745         pointer arith on void*. Also, make sure we are resolved
746         by not setting eclass until resolve.
747
748         All callers: Make sure that PointerArithmetic gets resolved.
749
750 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
751
752         * ArrayCreation (LookupType): If the type does not resolve 
753         to an array, give an error.
754
755 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
756
757         * statement.cs (Try.Resolve): Fixed bug #64222
758
759 2004-08-27  Martin Baulig  <martin@ximian.com>
760
761         * class.cs
762         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
763         crash here.     
764
765 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
766
767         * ecore.cs (Constantify): Get underlying type via
768         System.Enum.GetUnderlyingType to avoid StackOverflow on the
769         Windows in special cases.
770
771 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
772
773         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
774         for obtaining also private methods.
775         (GetRemoveMethod): Used GetRemoveMethod (true)
776         for obtaining also private methods.
777
778 2004-08-24  Martin Baulig  <martin@ximian.com>
779
780         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
781         MethodAttributes.HideBySig for operators.
782
783 2004-08-23  Martin Baulig  <martin@ximian.com>
784
785         Back to the old error reporting system :-)
786
787         * report.cs (Message): Removed.
788         (Report.MessageData, ErrorData, WarningData): Removed.
789         (Report.Error, Warning): Back to the old system.
790
791 2004-08-23  Martin Baulig  <martin@ximian.com>
792
793         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
794
795         * class.cs (TypeContainer.ParentContainer): New public virtual
796         method; replaces the explicit interface implementation.
797         (ClassPart.ParentContainer): Override.
798
799 2004-08-23  Martin Baulig  <martin@ximian.com>
800
801         * statement.cs (Switch): Added support for constant switches; see
802         #59428 or test-285.cs.
803
804 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
805
806         Fixed bug #62740.
807         * statement.cs (GetEnumeratorFilter): Removed useless
808         logic because C# specs is strict. GetEnumerator must be
809         public.
810
811 2004-08-22  Martin Baulig  <martin@ximian.com>
812
813         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
814         a switch and may break, reset the barrier.  Fixes #59867.
815
816 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
817
818         CLS-Compliance speed up (~5% for corlib)
819
820         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
821         New method. Tests container for CLS-Compliant names
822
823         * class.cs (TypeContainer.VerifyClsName): New method.
824         Checks whether container name is CLS Compliant.
825         (Constructor): Implements IMethodData.
826
827         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
828         low-case table for CLS Compliance test.
829         (MemberCache.VerifyClsParameterConflict): New method.
830         Checks method parameters for CS3006 error.
831
832         * enum.cs (EnumMember): Is derived from MemberCore.
833         (Enum.VerifyClsName): Optimized for better performance.
834
835 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
836
837         * report.cs: Renamed Error_T to Error and changed all
838         references.
839
840 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
841
842         * class.cs (TypeContainer.IndexerArrayList): New inner class
843         container for indexers.
844         (TypeContainer.DefaultIndexerName): New constant for default
845         indexer name. Replaced all "Item" with this constant.
846         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
847
848         * typemanager.cs (TypeManager.default_member_ctor): Cache here
849         DefaultMemberAttribute constructor.
850
851 2004-08-05  Martin Baulig  <martin@ximian.com>
852
853         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
854         Fix bug #59429.
855
856 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
857
858         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
859         multi platforms problem.
860
861         * compiler.csproj: Included shared files.
862
863 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
864
865         Fix bug 60333, 55971 in the more general way
866         * attribute.cs (Attribute.GetAttributeArgumentExpression):
867         Added arg_type argument for constant conversion.
868         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
869
870 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
871
872         Fix bug #59760
873         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
874         OperatorArrayList, MethodCoreArrayList for typecontainer
875         containers. Changed class member types to these new types.
876         (MethodArrayList.DefineMembers): Added test for CS0659.
877
878 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
879
880         * cfold.cs: Synchronize the folding with the code in expression.cs
881         Binary.DoNumericPromotions for uint operands.
882
883         * attribute.cs: Revert patch from Raja, it introduced a regression
884         while building Blam-1.2.1 (hard to isolate a test case).
885
886 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
887
888         Fix for #55382
889         * class.cs:
890         (TypeContainer.Define): Renamed to DefineContainerMembers because of
891         name collision.
892         (MethodCore.parent_method): New member. The method we're overriding
893         if this is an override method.
894         (MethodCore.CheckBase): Moved from Method class and made common.
895         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
896         private.
897         (MethodCore.CheckForDuplications): New abstract method. For custom
898         member duplication search in a container
899         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
900         method and its return type.
901         (Event.conflict_symbol): New member. Symbol with same name in the
902         parent class.
903
904         * decl.cs:
905         (MemberCache.FindMemberWithSameName): New method. The method
906         is looking for conflict with inherited symbols.
907
908 2004-08-04  Martin Baulig  <martin@ximian.com>
909
910         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
911
912         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
913
914 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
915
916         * report.cs (Message): New enum for better error, warning reference in
917         the code.
918         (MessageData): New inner abstract class. It generally handles printing of
919         error and warning messages.
920         Removed unused Error, Warning, Message methods.
921
922 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
923
924         Fix for cs0592-8.cs test
925         * attribute.cs
926         (Attributable.ValidAttributeTargets): Made public.
927         (Attribute.ExplicitTarget): New member for explicit target value.
928         (Attribute.CheckTargets): Now we translate explicit attribute
929         target to Target here.
930
931 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
932
933         * ecore.cs (MethodGroupExpr): new IsBase property.
934
935         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
936
937         * delegate.cs (DelegateCreation): store a MethodGroupExpr
938         rather than an instance expr.
939
940         (DelegateCreation.Emit): Use the method group rather than
941         the instance expression. Also, if you have base.Foo as the
942         method for a delegate, make sure to emit ldftn, not ldftnvirt.
943
944         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
945
946         (NewDelegate.DoResolve): Only check for the existance of Invoke
947         if the method is going to be needed. Use MethodGroupExpr.
948
949         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
950
951         * expression.cs: For pointer arith., make sure to use
952         the size of the type, not the size of the pointer to
953         the type.
954
955 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
956
957         Fix for #60722
958         * class.cs (Class): Added error CS0502 test.
959
960 2004-08-03  John Luke  <jluke@cfl.rr.com>
961             Raja R Harinath  <rharinath@novell.com>
962
963         Fix for #60997.
964         * attribute.cs (Attribute.complained_before): New flag.
965         (Attribute.ResolveType, Attribute.Resolve),
966         (Attribute.DefinePInvokeMethod): Set it.
967         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
968         
969 2004-08-03  Martin Baulig  <martin@ximian.com>
970
971         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
972         use a user-defined operator; we still need to do numeric
973         promotions in case one argument is a builtin type and the other
974         one has an implicit conversion to that type.  Fixes #62322.
975
976 2004-08-02  Martin Baulig  <martin@ximian.com>
977
978         * statement.cs (LocalInfo.Flags): Added `IsThis'.
979         (LocalInfo.IsThis): New public property.
980         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
981
982 2004-08-01  Martin Baulig  <martin@ximian.com>
983
984         * class.cs (TypeContainer.GetClassBases): Don't set the default
985         here since we may get called from GetPartialBases().
986         (TypeContainer.DefineType): If GetClassBases() didn't return a
987         parent, use the default one.
988
989 2004-07-30  Duncan Mak  <duncan@ximian.com>
990
991         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
992
993 2004-07-30  Martin Baulig  <martin@ximian.com>
994
995         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
996
997         * class.cs (SourceMethod): New public class, derive from the
998         symbol writer's ISourceMethod.
999         (Method): Use the new symbol writer API.
1000
1001         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
1002         as argument and use the new symbol writer.
1003
1004         * location.cs
1005         (SourceFile): Implement the symbol writer's ISourceFile.
1006         (Location.SymbolDocument): Removed.
1007         (Location.SourceFile): New public property.
1008
1009         * symbolwriter.cs: Use the new symbol writer API.
1010
1011 2004-07-30  Raja R Harinath  <rharinath@novell.com>
1012
1013         * Makefile (install-local): Remove.  Functionality moved to
1014         executable.make.
1015
1016 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
1017
1018         * Makefile: Install mcs.exe.config file together with mcs.exe.
1019         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
1020         correct runtime version.
1021         
1022 2004-07-25  Martin Baulig  <martin@ximian.com>
1023
1024         * class.cs
1025         (TypeContainer.RegisterOrder): Removed, this was unused.
1026         (TypeContainer, interface_order): Removed.
1027         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
1028         TypeContainer as argument since we can also be called with a
1029         `PartialContainer' for a partial class/struct/interface.
1030         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
1031         of checking whether we're an `Interface' - we could be a
1032         `PartialContainer'.
1033         (PartialContainer.Register): Override; call
1034         AddClass()/AddStruct()/AddInterface() on our parent.
1035
1036         * cs-parser.jay (interface_member_declaration): Add things to the
1037         `current_container', not the `current_class'.
1038
1039         * rootcontext.cs (RegisterOrder): The overloaded version which
1040         takes an `Interface' was unused, removed.
1041
1042         * typemanager.cs (TypeManager.LookupInterface): Return a
1043         `TypeContainer', not an `Interface'.
1044         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
1045         contain a `PartialContainer' for an interface, so check it's
1046         `Kind' to figure out what it is.
1047
1048 2004-07-25  Martin Baulig  <martin@ximian.com>
1049
1050         * class.cs (Class.DefaultTypeAttributes): New public constant.
1051         (Struct.DefaultTypeAttributes): Likewise.
1052         (Interface.DefaultTypeAttributes): Likewise.
1053         (PartialContainer.TypeAttr): Override this and add the
1054         DefaultTypeAttributes.
1055
1056 2004-07-25  Martin Baulig  <martin@ximian.com>
1057
1058         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
1059         we can just use the `Parent' field instead.
1060
1061 2004-07-25  Martin Baulig  <martin@ximian.com>
1062
1063         * class.cs (TypeContainer.Emit): Renamed to EmitType().
1064
1065 2004-07-25  Martin Baulig  <martin@ximian.com>
1066
1067         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
1068         our parts before defining any methods.
1069         (TypeContainer.VerifyImplements): Make this virtual.
1070         (ClassPart.VerifyImplements): Override and call VerifyImplements()
1071         on our PartialContainer.
1072
1073 2004-07-25  Martin Baulig  <martin@ximian.com>
1074
1075         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
1076
1077         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
1078         argument, we can just use the `Parent' field instead.
1079
1080         * class.cs
1081         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
1082         (MemberBase.DoDefine): Likewise.
1083
1084 2004-07-24  Martin Baulig  <martin@ximian.com>
1085
1086         * decl.cs (MemberCore.Parent): New public field.
1087         (DeclSpace.Parent): Moved to MemberCore.
1088
1089         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
1090         (MemberBase.ctor): Added TypeContainer argument, pass it to our
1091         parent's .ctor.
1092         (FieldBase, Field, Operator): Likewise.
1093         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
1094         (EventField, Event): Likewise.
1095
1096 2004-07-23  Martin Baulig  <martin@ximian.com>
1097
1098         * class.cs (PartialContainer): New public class.
1099         (ClassPart): New public class.
1100         (TypeContainer): Added support for partial classes.
1101         (TypeContainer.GetClassBases): Splitted some of the functionality
1102         out into GetNormalBases() and GetPartialBases().
1103
1104         * cs-tokenizer.cs (Token.PARTIAL): New token.
1105         (Tokenizer.consume_identifier): Added some hacks to recognize
1106         `partial', but only if it's immediately followed by `class',
1107         `struct' or `interface'.
1108
1109         * cs-parser.jay: Added support for partial clases.
1110
1111 2004-07-23  Martin Baulig  <martin@ximian.com>
1112
1113         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
1114         a `DeclSpace' and also made it readonly.
1115         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
1116         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
1117         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
1118
1119         * cs-parser.jay: Pass the `current_class', not the
1120         `current_container' (at the moment, this is still the same thing)
1121         to a new Method, Property, Event, Indexer or Constructor.
1122
1123 2004-07-23  Martin Baulig  <martin@ximian.com>
1124
1125         * cs-parser.jay (CSharpParser): Added a new `current_class' field
1126         and removed the `current_interface' one.
1127         (struct_declaration, class_declaration, interface_declaration):
1128         Set `current_class' to the newly created class/struct/interface;
1129         set their `Bases' and call Register() before parsing their body.
1130
1131 2004-07-23  Martin Baulig  <martin@ximian.com>
1132
1133         * class.cs (Kind): New public enum.
1134         (TypeContainer): Made this class abstract.
1135         (TypeContainer.Kind): New public readonly field.
1136         (TypeContainer.CheckDef): New public method; moved here from
1137         cs-parser.jay.
1138         (TypeContainer.Register): New public abstract method.
1139         (TypeContainer.GetPendingImplementations): New public abstract
1140         method.
1141         (TypeContainer.GetClassBases): Removed the `is_class' and
1142         `is_iface' parameters.
1143         (TypeContainer.DefineNestedTypes): Formerly known as
1144         DoDefineType().
1145         (ClassOrStruct): Made this class abstract.
1146
1147         * tree.cs (RootTypes): New public type. 
1148
1149 2004-07-20  Martin Baulig  <martin@ximian.com>
1150
1151         * tree.cs (Tree.RecordNamespace): Removed.
1152         (Tree.Namespaces): Removed.
1153
1154         * rootcontext.cs (RootContext.IsNamespace): Removed.
1155
1156         * cs-parser.jay (namespace_declaration): Just create a new
1157         NamespaceEntry here.
1158
1159 2004-07-20  Martin Baulig  <martin@ximian.com>
1160
1161         * statement.cs (ExceptionStatement): New abstract class.  This is
1162         now used as a base class for everyone who's using `finally'.
1163         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
1164         our local variables before using them.
1165
1166         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
1167         virtual method.  This is used by Yield.Resolve() to "steal" an
1168         outer block's `finally' clauses.
1169         (FlowBranchingException): The .ctor now takes an ExceptionStatement
1170         argument.
1171
1172         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
1173         version which takes an ExceptionStatement.  This version must be
1174         used to create exception branchings.
1175
1176         * iterator.cs
1177         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
1178         (Iterator.EmitMoveNext): Added exception support; protect the
1179         block with a `fault' clause, properly handle 'finally' clauses.
1180         (Iterator.EmitDispose): Run all the `finally' clauses here.
1181
1182 2004-07-20  Martin Baulig  <martin@ximian.com>
1183
1184         * iterator.cs: This is the first of a set of changes in the
1185         iterator code.  Match the spec more closely: if we're an
1186         IEnumerable, then GetEnumerator() must be called.  The first time
1187         GetEnumerator() is called, it returns the current instance; all
1188         subsequent invocations (if any) must create a copy.
1189
1190 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
1191
1192         * expression.cs: Resolve the constant expression before returning
1193         it. 
1194
1195 2004-07-19  Martin Baulig  <martin@ximian.com>
1196
1197         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
1198         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
1199         the return type of the new EmitContext.
1200
1201 2004-07-18  Martin Baulig  <martin@ximian.com>
1202
1203         * class.cs (Property.Define): Fix iterators.
1204
1205         * iterators.cs (Iterator.Define): Moved the
1206         `container.AddInterator (this)' call here from the .ctor; only do
1207         it if we resolved successfully.
1208
1209 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
1210
1211         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
1212         `true' for preprocessing directives that we parse.  The return
1213         value indicates whether we should return to regular tokenizing or
1214         not, not whether it was parsed successfully.
1215
1216         In the past if we were in: #if false ... #line #endif, we would
1217         resume parsing after `#line'.  See bug 61604.
1218
1219         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
1220         building: IsEnumType should return true only for enums, not for
1221         enums or System.Enum itself.  This fixes #61593.
1222
1223         Likely what happened is that corlib was wrong: mcs depended on
1224         this bug in some places.  The bug got fixed, we had to add the
1225         hack, which caused bug 61593.
1226
1227         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
1228         that was a workaround for the older conditions.
1229
1230 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
1231
1232         * assign.cs: IAssignMethod has a new interface, as documented
1233         inline. All assignment code now uses this new api.
1234
1235         * ecore.cs, expression.cs: All classes which implement
1236         IAssignMethod now use the new interface.
1237
1238         * expression.cs (Invocation): add a hack to EmitCall so that
1239         IndexerAccess can be the target of a compound assignment without
1240         evaluating its arguments twice.
1241
1242         * statement.cs: Handle changes in Invocation api.
1243
1244 2004-07-16  Martin Baulig  <martin@ximian.com>
1245
1246         * iterators.cs: Rewrote this.  We're now using one single Proxy
1247         class for both the IEnumerable and the IEnumerator interface and
1248         `Iterator' derives from Class so we can use the high-level API.
1249
1250         * class.cs (TypeContainer.AddIterator): New method.
1251         (TypeContainer.DoDefineType): New protected virtual method, which
1252         is called from DefineType().
1253         (TypeContainer.DoDefineMembers): Call DefineType() and
1254         DefineMembers() on all our iterators.
1255         (TypeContainer.Emit): Call Emit() on all our iterators.
1256         (TypeContainer.CloseType): Call CloseType() on all our iterators.
1257
1258         * codegen.cs (EmitContext.CurrentIterator): New public field.
1259
1260 2004-07-15  Martin Baulig  <martin@ximian.com>
1261
1262         * typemanager.cs
1263         (TypeManager.not_supported_exception_type): New type.   
1264
1265 2004-07-14  Martin Baulig  <martin@ximian.com>
1266
1267         * iterators.cs: Use real error numbers.
1268
1269 2004-07-14  Martin Baulig  <martin@ximian.com>
1270
1271         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
1272         requires this to be a System.Collection.IEnumerable and not a
1273         class implementing that interface.
1274         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
1275
1276 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
1277
1278         * class.cs: Fixed previous fix, it broke some error tests.
1279
1280 2004-07-12  Martin Baulig  <martin@ximian.com>
1281
1282         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
1283         Fixes #61293.
1284
1285 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
1286
1287         * assign.cs (LocalTemporary): Add new argument: is_address,If
1288         `is_address' is true, then the value that we store is the address
1289         to the real value, and not the value itself.
1290         
1291         * ecore.cs (PropertyExpr): use the new local temporary
1292         stuff to allow us to handle X.Y += z (where X is a struct)
1293
1294 2004-07-08  Martin Baulig  <martin@ximian.com>
1295
1296         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
1297         not always return, just like we're doing in Using.Resolve().
1298
1299 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
1300
1301         * cs-parser.jay (fixed_statement): flag this as Pinned.
1302
1303 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
1304
1305         * typemanager.cs (TypeManager): Removed MakePinned method, this
1306         mechanism is replaced with the .NET 2.x compatible mechanism of
1307         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
1308
1309         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
1310         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
1311         `IsFixed' property which has a different meaning.
1312
1313 2004-07-02  Raja R Harinath  <rharinath@novell.com>
1314
1315         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
1316         visible from inside a nested class, not just the names of the
1317         immediately enclosing class.
1318         Fix for bug #60730.
1319
1320 2004-06-24  Raja R Harinath  <rharinath@novell.com>
1321
1322         * expression.cs (BetterConversion): Remove buggy special-case
1323         handling of "implicit constant expression conversions".  At this
1324         point, we already know that the conversion is possible -- we're
1325         only checking to see which is better.
1326
1327 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1328
1329         * cs-parser.jay: Added error CS0210 test.
1330
1331 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1332
1333         * cs-parser.jay: Added error CS0134 test.
1334
1335 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1336
1337         Fix bug #52507
1338         * cs-parser.jay: Added error CS0145 test.
1339
1340 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1341
1342         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
1343
1344 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
1345         
1346         * expression.cs (StackAlloc.Resolve): The argument may not
1347         be a constant; deal with this case.
1348         
1349 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
1350
1351         * attribute.cs (IndexerName_GetIndexerName): Renamed to
1352         GetIndexerAttributeValue.
1353         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
1354
1355         * class.cs (Indexer.Define): Added error tests for CS0415,
1356         CS0609.
1357
1358 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
1359
1360         * attribute.cs (Attribute.Resolve): Keep field code in sync with
1361         property code.
1362
1363 2004-06-23  Martin Baulig  <martin@ximian.com>
1364
1365         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
1366         neither return nor throw, reset the barrier as well.  Fixes #60457.
1367
1368 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
1369
1370         * class.cs : EventAttributes is now set to None by default.
1371           This fixes bug #60459.
1372
1373 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1374
1375         Fix bug #60219
1376         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
1377         Don't throw exception but return null (it's sufficient now).
1378
1379 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1380
1381         * typemanager.cs (GetArgumentTypes): Faster implementation.
1382
1383 2004-06-18  Martin Baulig  <martin@ximian.com>
1384
1385         * attribute.cs (Attribute.Resolve): Check whether we're an
1386         EmptyCast which a Constant child.  Fixes #60333.
1387
1388 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
1389
1390         * statement.cs (EmitCollectionForeach): Account for the fact that
1391         not all valuetypes are in areas which we can take the address of.
1392         For these variables, we store to a temporary variable. Also, make
1393         sure that we dont emit a `callvirt' on a valuetype method.
1394
1395 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1396
1397         * expression.cs (StackAlloc.DoReSolve): Added test for
1398         negative parameter (CS0247).
1399
1400 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1401
1402         Fix bug #59792
1403         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
1404
1405 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1406
1407         Fix bug #59781
1408         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
1409         ulong.
1410
1411 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1412
1413         Fix bug #58254 & cs1555.cs, cs1556.cs
1414         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
1415
1416 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1417
1418         * cs-parser.jay: Added error CS1669 test for indexers.
1419
1420 2004-06-11  Martin Baulig  <martin@ximian.com>
1421
1422         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
1423         call this twice: for params and varargs methods.
1424
1425 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1426
1427         * class.cs:
1428         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
1429
1430 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1431
1432         * attribute.cs (Attribute.GetValidTargets): Made public.
1433
1434         * class.cs: 
1435         (AbstractPropertyEventMethod): New class for better code sharing.
1436         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
1437         CS1667 report.
1438         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
1439
1440 2004-06-11  Raja R Harinath  <rharinath@novell.com>
1441
1442         Fix bug #59477.
1443         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
1444         that the call to Resolve is part of a MemberAccess.
1445         (Expression.Resolve): Use it for SimpleName resolution.
1446         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
1447         Add 'intermediate' boolean argument.
1448         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
1449         error message when the SimpleName can be resolved ambiguously
1450         between an expression and a type.
1451         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
1452         public.
1453         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
1454         call on the left-side.
1455
1456 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1457
1458         * class.cs:
1459         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
1460
1461 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1462
1463         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
1464
1465 2004-06-11  Martin Baulig  <martin@ximian.com>
1466
1467         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
1468         varargs methods if applicable.
1469
1470 2004-06-11  Martin Baulig  <martin@ximian.com>
1471
1472         * expression.cs (Invocation.EmitCall): Don't use
1473         `method.CallingConvention == CallingConventions.VarArgs' since the
1474         method could also have `CallingConventions.HasThis'.
1475
1476 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1477
1478         * class.cs (Event.GetSignatureForError): Implemented.
1479         Fixed crash in error test cs3010.cs
1480
1481 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
1482
1483         * cs-tokenizer.cs: Change the way we track __arglist to be
1484         consistent with the other keywords.
1485
1486 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
1487
1488         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
1489         tomorrow.
1490
1491 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
1492
1493         * codegen.cs: Check that all referenced assemblies have a strongname
1494         before strongnaming the compiled assembly. If not report error CS1577.
1495         Fix bug #56563. Patch by Jackson Harper.
1496         * typemanager.cs: Added a method to return all referenced assemblies.
1497         Fix bug #56563. Patch by Jackson Harper.
1498
1499 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
1500
1501         * class.cs:
1502         (Method.ApplyAttributeBuilder): Moved and added conditional
1503         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
1504
1505         * delegate.cs:
1506         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
1507
1508 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
1509
1510         Fixed #59640
1511         * class.cs: (EventField.attribute_targets): Changed default target.
1512
1513 2004-06-08  Martin Baulig  <martin@ximian.com>
1514
1515         * expression.cs (Invocation.EmitCall): Enable varargs methods.
1516
1517 2004-06-08  Martin Baulig  <martin@ximian.com>
1518
1519         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
1520
1521 2004-06-07  Martin Baulig  <martin@ximian.com>
1522
1523         Added support for varargs methods.
1524
1525         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
1526         keyword.
1527
1528         * cs-parser.jay: Added support for `__arglist'.
1529
1530         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
1531
1532         * expression.cs (Argument.AType): Added `ArgList'.
1533         (Invocation): Added support for varargs methods.
1534         (ArglistAccess): New public class.
1535         (Arglist): New public class.
1536
1537         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
1538
1539         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
1540         a method's top-level block if the method has varargs.
1541
1542         * support.cs (ReflectionParameters, InternalParameters): Added
1543         support for varargs methods.    
1544
1545 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
1546
1547         * class.cs: Provide location in indexer error report.
1548
1549         * driver.cs: Use standard names.
1550
1551         * namespace.cs: Catch the use of using after a namespace has been
1552         declared also on using aliases.
1553
1554 2004-06-03  Raja R Harinath  <rharinath@novell.com>
1555
1556         Bug #50820.
1557         * typemanager.cs (closure_private_ok, closure_invocation_type)
1558         (closure_qualifier_type, closure_invocation_assembly)
1559         (FilterWithClosure): Move to ...
1560         (Closure): New internal nested class.
1561         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
1562         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
1563         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
1564         (MemberLookup, MemberLookupFailed): Use it.
1565         * expression.cs (New.DoResolve): Treat the lookup for the
1566         constructor as being qualified by the 'new'ed type.
1567         (Indexers.GetIndexersForTypeOrInterface): Update.
1568
1569 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
1570
1571         * attribute.cs
1572         (GetConditionalAttributeValue): New method. Returns
1573         condition of ConditionalAttribute.
1574         (SearchMulti): New method.  Returns all attributes of type 't'.
1575         Use it when attribute is AllowMultiple = true.
1576         (IsConditionalMethodExcluded): New method.
1577
1578         * class.cs
1579         (Method.IsExcluded): Implemented. Returns true if method has conditional
1580         attribute and the conditions is not defined (method is excluded).
1581         (IMethodData): Extended interface for ConditionalAttribute support.
1582         (PropertyMethod.IsExcluded): Implemented.
1583
1584         * decl.cs
1585         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
1586
1587         * expression.cs
1588         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
1589         on the method.
1590
1591 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
1592
1593         * expression.cs (ArrayCreationExpression): Make this just an
1594         `expression'. It can't be a statement, so the code here was
1595         dead.
1596
1597 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
1598
1599         Fixed #59072
1600         * typemanager.cs (GetFullNameSignature): New method for
1601         MethodBase types.
1602
1603 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
1604
1605         Fixed #56452
1606         * class.cs (MemberBase.GetSignatureForError): New virtual method.
1607         Use this method when MethodBuilder is null.
1608         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
1609         Added test for error CS0626 (MONO reports error for this situation).
1610         (IMethodData.GetSignatureForError): Extended interface.
1611
1612 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
1613
1614         * attribute.cs
1615         (AttributeTester.GetObsoleteAttribute): Returns instance of
1616         ObsoleteAttribute when type is obsolete.
1617
1618         * class.cs
1619         (TypeContainer.VerifyObsoleteAttribute): Override.
1620         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
1621         (MethodCode.VerifyObsoleteAttribute): Override.
1622         (MemberBase.VerifyObsoleteAttribute): Override.
1623
1624         * decl.cs
1625         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
1626         and report proper error.
1627
1628         *delegate.cs
1629         Delegate.VerifyObsoleteAttribute): Override.
1630
1631         * ecore.cs
1632         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
1633         and report proper error.
1634         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
1635
1636         * enum.cs
1637         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
1638         and enum member.
1639
1640         * expression.cs
1641         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
1642         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
1643         Added test for ObsoleteAttribute.
1644
1645         * statement.cs
1646         (Catch): Derived from Statement.
1647
1648 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
1649  
1650         Fixed bug #59071 & cs0160.cs
1651  
1652         * statement.cs (Try.Resolve): Check here whether order of catch
1653         clauses matches their dependencies.
1654
1655 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
1656
1657         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
1658         caused a regression: #59343.  Referencing nested classes from an
1659         assembly stopped working.
1660
1661 2004-05-31  Martin Baulig  <martin@ximian.com>
1662
1663         MCS is now frozen for beta 2.
1664
1665 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1666
1667         * convert.cs: add a trivial cache for overload operator resolution.
1668
1669 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1670
1671         * decl.cs: If possible, use lookuptypedirect here. We can only do
1672         this if there is no `.' after the namespace. Avoids using
1673         LookupType, which does lots of slow processing.
1674         (FindNestedType) New method, does what it says :-).
1675         * namespace.cs: use LookupTypeDirect.
1676         * rootcontext.cs: use membercache, if possible.
1677         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
1678
1679 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1680
1681         * expression.cs:
1682         According to the spec, 
1683
1684         In a member access of the form E.I, if E is a single identifier,
1685         and if the meaning of E as a simple-name (§7.5.2) is a constant,
1686         field, property, localvariable, or parameter with the same type as
1687         the meaning of E as a type-name (§3.8), then both possible
1688         meanings of E are permitted.
1689
1690         We did not check that E as a simple-name had the same type as E as
1691         a type name.
1692
1693         This trivial check gives us 5-7% on bootstrap time.
1694
1695 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1696
1697         * expression.cs (Invocation.OverloadResolve): Avoid the
1698         use of hashtables and boxing here by allocating on demand.
1699
1700 2004-05-30  Martin Baulig  <martin@ximian.com>
1701
1702         * rootcontext.cs (RootContext.LookupType): Don't cache things if
1703         we're doing a silent lookup.  Don't try to lookup nested types in
1704         TypeManager.object_type (thanks to Ben Maurer).
1705
1706 2004-05-30  Martin Baulig  <martin@ximian.com>
1707
1708         Committing a patch from Ben Maurer.
1709
1710         * rootcontext.cs (RootContext.LookupType): Cache negative results.
1711
1712 2004-05-29  Martin Baulig  <martin@ximian.com>
1713
1714         * class.cs (IMethodData.ShouldIgnore): New method.
1715
1716         * typemanager.cs (TypeManager.MethodFlags): Don't take a
1717         `Location' argument, we don't need it anywhere.  Use
1718         `IMethodData.ShouldIgnore ()' instead of
1719         `MethodData.GetMethodFlags ()'.
1720         (TypeManager.AddMethod): Removed.
1721         (TypeManager.AddMethod2): Renamed to AddMethod.
1722
1723 2004-05-29  Martin Baulig  <martin@ximian.com>
1724
1725         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
1726
1727         * convert.cs (Convert.ImplicitReferenceConversion): If we're
1728         converting from a class type S to an interface type and we already
1729         have an object on the stack, don't box it again.  Fixes #52578.
1730
1731 2004-05-29  Martin Baulig  <martin@ximian.com>
1732
1733         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
1734         Added support for `params' parameters.  Fixes #59267.
1735
1736 2004-05-29  Martin Baulig  <martin@ximian.com>
1737
1738         * literal.cs (NullPointer): Provide a private .ctor which sets
1739         `type' to TypeManager.object_type.  Fixes #59048.
1740
1741 2004-05-29  Martin Baulig  <martin@ximian.com>
1742
1743         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
1744         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
1745
1746         * ecore.cs (EventExpr.instance_expr): Make the field private.
1747
1748 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
1749
1750         Fixed bug #50080 & cs0214-2.cs
1751         * expression.cs (Cast.DoResolve): Check unsafe context here.
1752         
1753         * statement.cs (Resolve.DoResolve): Likewise.
1754
1755 2004-05-26  Martin Baulig  <martin@ximian.com>
1756
1757         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
1758
1759         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
1760         (RootContext.LookupType): Pass down the `silent' flag.
1761
1762 2004-05-25  Martin Baulig  <martin@ximian.com>
1763
1764         * expression.cs
1765         (MethodGroupExpr.IdenticalTypeName): New public property.
1766         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
1767         expression actually refers to a type.
1768
1769 2004-05-25  Martin Baulig  <martin@ximian.com>
1770
1771         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
1772         for #56176 and made it actually work.
1773
1774 2004-05-25  Martin Baulig  <martin@ximian.com>
1775
1776         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
1777         (FieldExpr, PropertyExpr): Override and implement
1778         CacheTemporaries.  Fixes #52279.
1779
1780 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
1781
1782         * location.cs: In the new compiler listing a file twice is a
1783         warning, not an error.
1784
1785 2004-05-24  Martin Baulig  <martin@ximian.com>
1786
1787         * enum.cs (Enum.DefineType): For the `BaseType' to be a
1788         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
1789
1790 2004-05-24  Martin Baulig  <martin@ximian.com>
1791
1792         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
1793         walking the `using' list.  Fixes #53921.
1794
1795 2004-05-24  Martin Baulig  <martin@ximian.com>
1796
1797         * const.cs (Const.LookupConstantValue): Added support for
1798         EmptyCast's; fixes #55251.
1799
1800 2004-05-24  Martin Baulig  <martin@ximian.com>
1801
1802         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
1803         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
1804         which does the CS0135 check.  The reason is that we first need to
1805         check whether the variable actually exists.
1806
1807 2004-05-24  Martin Baulig  <martin@ximian.com>
1808
1809         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
1810         than RootContext.LookupType() to find the explicit interface
1811         type.  Fixes #58584.
1812
1813 2004-05-24  Raja R Harinath  <rharinath@novell.com>
1814
1815         * Makefile: Simplify.  Use executable.make.
1816         * mcs.exe.sources: New file.  List of sources of mcs.exe.
1817
1818 2004-05-24  Anders Carlsson  <andersca@gnome.org>
1819
1820         * decl.cs:
1821         * enum.cs:
1822         Use the invariant culture when doing String.Compare for CLS case
1823         sensitivity.
1824         
1825 2004-05-23  Martin Baulig  <martin@ximian.com>
1826
1827         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
1828         don't have any dots.  Fixes #52622, added cs0246-8.cs.
1829
1830         * namespace.cs (NamespaceEntry.Lookup): Likewise.
1831         
1832 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
1833
1834         * class.cs (MemberBase.Define): Reuse MemberType member for 
1835         resolved type. Other methods can use it too.
1836
1837 2004-05-23  Martin Baulig  <martin@ximian.com>
1838
1839         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
1840         the variable also exists in the current block (otherwise, we need
1841         to report a CS0103).  Fixes #58670.
1842
1843 2004-05-23  Martin Baulig  <martin@ximian.com>
1844
1845         * flowanalysis.cs (Reachability.Reachable): Compute this
1846         on-the-fly rather than storing it as a field.
1847
1848 2004-05-23  Martin Baulig  <martin@ximian.com>
1849
1850         * flowanalysis.cs (Reachability.And): Manually compute the
1851         resulting `barrier' from the reachability.      
1852        
1853 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
1854
1855         Fix bug #57835
1856         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
1857         instance of ObsoleteAttribute when symbol is obsolete.
1858
1859         * class.cs
1860         (IMethodData): Extended interface for ObsoleteAttribute support.
1861
1862 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
1863
1864         * attribute.cs: Fix bug #55970
1865
1866 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
1867
1868         Fix bug #52705
1869         * attribute.cs
1870         (GetObsoleteAttribute): New method. Creates the instance of
1871         ObsoleteAttribute.
1872         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
1873         ObsoleteAttribute when member is obsolete.
1874         (AttributeTester.Report_ObsoleteMessage): Common method for
1875         Obsolete error/warning reporting.
1876
1877         * class.cs
1878         (TypeContainer.base_classs_type): New member for storing parent type.
1879
1880         * decl.cs
1881         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
1882         for this MemberCore.
1883
1884 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
1885
1886         * attribute.cs, const.cs: Fix bug #58590
1887
1888 2004-05-21  Martin Baulig  <martin@ximian.com>
1889
1890         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
1891         out parameters if the end of the method is unreachable.  Fixes
1892         #58098. 
1893
1894 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
1895
1896         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
1897         Hari was right, why extra method.
1898
1899 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
1900
1901         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
1902
1903 2004-05-20  Martin Baulig  <martin@ximian.com>
1904
1905         Merged this back from gmcs to keep the differences to a minumum.
1906
1907         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
1908         instead of a Declspace.
1909         (Attribute.ResolveType): Likewise.
1910         (Attributes.Search): Likewise.
1911         (Attributes.Contains): Likewise.
1912         (Attributes.GetClsCompliantAttribute): Likewise.
1913
1914         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
1915         argument.
1916         (MethodData.ApplyAttributes): Take an EmitContext instead of a
1917         DeclSpace.
1918
1919 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
1920
1921         Fix bug #58688 (MCS does not report error when the same attribute
1922         is assigned twice)
1923
1924         * attribute.cs (Attribute.Emit): Distinction between null and default.
1925
1926 2004-05-19  Raja R Harinath  <rharinath@novell.com>
1927
1928         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
1929         of a top-level attribute without an attribute target.
1930         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
1931         Make non-static.
1932         (Attribute.Conditional_GetConditionName), 
1933         (Attribute.Obsolete_GetObsoleteMessage): Update.
1934         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
1935         part of ScanForIndexerName.
1936         (Attribute.CanIgnoreInvalidAttribute): New function.
1937         (Attribute.ScanForIndexerName): Move to ...
1938         (Attributes.ScanForIndexerName): ... here.
1939         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
1940         (Attributes.Search): New internal variant that can choose not to
1941         complain if types aren't resolved.  The original signature now
1942         complains.
1943         (Attributes.GetClsCompliantAttribute): Use internal variant, with
1944         complaints suppressed.
1945         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
1946         only if it not useful.
1947         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
1948         top-level for attributes that are shared between the assembly
1949         and a top-level class.
1950         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
1951         * class.cs: Update to reflect changes.
1952         (DefineIndexers): Fuse loops.
1953         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
1954         a couple more variants of attribute names.
1955
1956 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
1957
1958         Fix bug #52585 (Implemented explicit attribute declaration)
1959
1960         * attribute.cs:
1961         (Attributable.ValidAttributeTargets): New abstract method. It gets
1962         list of valid attribute targets for explicit target declaration.
1963         (Attribute.Target): It holds target itself.
1964         (AttributeSection): Removed.
1965         (Attribute.CheckTargets): New method. It checks whether attribute
1966         target is valid for the current element.
1967
1968         * class.cs:
1969         (EventProperty): New class. For events that are declared like
1970         property (with add and remove accessors).
1971         (EventField): New class. For events that are declared like field.
1972         class.cs
1973
1974         * cs-parser.jay: Implemented explicit attribute target declaration.
1975
1976         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
1977         Override ValidAttributeTargets.
1978
1979         * parameter.cs:
1980         (ReturnParameter): Class for applying custom attributes on 
1981         the return type.
1982         (ParameterAtribute): New class. Class for applying custom
1983         attributes on the parameter type.
1984
1985 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
1986
1987         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
1988         definitions. 
1989
1990         (Method): Allow UNSAFE here.
1991
1992         * modifiers.cs: Support unsafe reporting.
1993
1994 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
1995
1996         * decl.cs: Fix bug #58478.
1997
1998 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1999
2000         * statement.cs: When checking for unreachable code on an EmptyStatement,
2001         set the location. Fixes bug #58488.
2002
2003 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
2004
2005         * driver.cs: Add -pkg handling.
2006
2007         From Gonzalo: UseShelLExecute=false
2008
2009 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
2010
2011         * attribute.cs:
2012         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
2013         for attribute.
2014         (Attribute.IsClsCompliaceRequired): Moved to base for better
2015         accesibility.
2016         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
2017         when attribute is AttributeUsageAttribute.
2018         (Attribute.GetValidTargets): Simplified.
2019         (Attribute.GetAttributeUsage): New method returns AttributeUsage
2020         attribute for this type.
2021         (Attribute.ApplyAttributes): Method renamed to Emit and make
2022         non-static.
2023         (GlobalAttributeSection): New class for special handling of global
2024         attributes (assembly, module).
2025         (AttributeSection.Emit): New method.
2026
2027         * class.cs: Implemented Attributable abstract methods.
2028         (MethodCore.LabelParameters): Moved to Parameter class.
2029         (Accessor): Is back simple class.
2030         (PropertyMethod): Implemented Attributable abstract class.
2031         (DelegateMethod): Implemented Attributable abstract class.
2032         (Event): New constructor for disctintion between normal Event
2033         and Event with accessors.
2034
2035         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
2036
2037         * codegen.cs, const.cs, decl.cs, delegate.cs:
2038         (CommonAssemblyModulClass): Implemented Attributable abstract class
2039         and simplified.
2040
2041         * enum.cs: Implement IAttributeSupport interface.
2042         (EnumMember): New class for emum members. Implemented Attributable
2043         abstract class
2044
2045         * parameter.cs:
2046         (ParameterBase): Is abstract.
2047         (ReturnParameter): New class for easier [return:] attribute handling.
2048
2049         * typemanager.cs: Removed builder_to_attr.
2050
2051 2004-05-11  Raja R Harinath  <rharinath@novell.com>
2052
2053         Fix bug #57151.
2054         * attribute.cs (Attribute.GetPositionalValue): New function.
2055         * class.cs (TypeContainer.VerifyMembers): New function.
2056         (TypeContainer.Emit): Use it.
2057         (ClassOrStruct): New base class for Class and Struct.
2058         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
2059         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
2060         class.
2061         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
2062         then each non-static field should have a FieldOffset attribute.
2063         Otherwise, none of the fields should have a FieldOffset attribute.
2064         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
2065         and FieldOffset attributes.
2066         * typemanager.cs (TypeManager.struct_layout_attribute_type)
2067         (TypeManager.field_offset_attribute_type): New core types.
2068         (TypeManager.InitCoreTypes): Initialize them.
2069
2070 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
2071
2072         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
2073         Return correct type.
2074         From bug #58270.
2075
2076 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
2077
2078         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
2079         be implicitly converted to ulong.
2080         
2081         * expression.cs: The logic for allowing operator &, | and ^ worked
2082         was wrong, it worked before because we did not report an error in
2083         an else branch.  Fixes 57895.
2084
2085         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
2086         allow volatile fields to be reference types.
2087
2088 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
2089
2090         * driver.cs: Add support for /debug-
2091
2092 2004-05-07  Raja R Harinath  <rharinath@novell.com>
2093
2094         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
2095         Add a 'complain' parameter to silence errors.
2096         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
2097         silently overlooked type-resolutions.
2098         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
2099         to reflect changes.
2100         (Attributes.Search): New function.
2101         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
2102         (Attributes.GetAttributeFullName): Remove hack.
2103         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
2104         Update to reflect changes.
2105         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2106         Use Attributes.Search instead of nested loops.
2107
2108 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
2109
2110         * decl.cs:
2111         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
2112         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
2113         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
2114
2115         * report.cs: (Report.Warning): Renamed to Warning_T because of
2116         parameter collision.
2117
2118 2004-05-05  Raja R Harinath  <rharinath@novell.com>
2119
2120         * expression.cs (MemberAccess.ResolveMemberAccess):
2121         Exit with non-zero status after Report.Error.
2122         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
2123         Likewise.
2124         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
2125
2126 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
2127
2128         * support.cs: Don't hang when the file is empty.
2129
2130 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
2131
2132         * support.cs: In SeekableStreamReader, compute the preamble size of the
2133           underlying stream. Position changes should take into account that initial
2134           count of bytes.
2135
2136 2004-05-03  Todd Berman  <tberman@sevenl.net>
2137
2138         * driver.cs: remove unused GetSysVersion function.
2139
2140 2004-05-03  Todd Berman  <tberman@sevenl.net>
2141
2142         * driver.cs: Remove the hack from saturday, as well as the hack
2143         from jackson (LoadAssemblyFromGac), also adds the CWD to the
2144         link_paths to get that bit proper.
2145
2146 2004-05-01  Todd Berman  <tberman@sevenl.net>
2147
2148         * driver.cs: Try a LoadFrom before a Load, this checks the current
2149         path. This is currently a bug in mono that is be fixed, however, this
2150         provides a workaround for now. This will be removed when the bug
2151         is fixed.
2152
2153 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
2154
2155         * CryptoConvert.cs: Updated to latest version. Fix issue with 
2156         incomplete key pairs (#57941).
2157
2158 2004-05-01  Todd Berman  <tberman@sevenl.net>
2159
2160         * driver.cs: Remove '.' from path_chars, now System.* loads properly
2161         from the GAC
2162
2163 2004-04-30  Jackson Harper  <jackson@ximian.com>
2164
2165         * codegen.cs: Open keys readonly.
2166         
2167 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2168
2169         * typemanager.cs: don't report cyclic struct layout when a struct
2170         contains 2 or more fields of the same type. Failed for Pango.AttrShape
2171         which has 2 Pango.Rectangle fields.
2172
2173 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2174
2175         * expression.cs: Handle IntPtr comparisons with IL code
2176         rather than a method call.
2177
2178 2004-04-29  Martin Baulig  <martin@ximian.com>
2179
2180         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
2181         the list of PropertyInfo's in class hierarchy and find the
2182         accessor.  Fixes #56013.
2183
2184 2004-04-29  Martin Baulig  <martin@ximian.com>
2185
2186         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
2187
2188 2004-04-29  Martin Baulig  <martin@ximian.com>
2189
2190         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
2191
2192         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
2193
2194 2004-04-29  Martin Baulig  <martin@ximian.com>
2195
2196         * class.cs (ConstructorInitializer.Resolve): Check whether the
2197         parent .ctor is accessible.  Fixes #52146.
2198
2199 2004-04-29  Martin Baulig  <martin@ximian.com>
2200
2201         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
2202
2203         * statement.cs (Using.EmitLocalVariableDecls): Use
2204         TypeManager.idisposable_type, not typeof (IDisposable).
2205         (Foreach.EmitCollectionForeach): Added support for valuetypes.
2206
2207 2004-04-29  Martin Baulig  <martin@ximian.com>
2208
2209         * class.cs (Event.Define): Don't emit the field and don't set
2210         RTSpecialName and SpecialName for events on interfaces.  Fixes
2211         #57703. 
2212
2213 2004-04-29  Raja R Harinath  <rharinath@novell.com>
2214
2215         Refactor Attribute.ApplyAttributes.
2216         * attribute.cs (Attributable): New base class for objects that can
2217         have Attributes applied on them.
2218         (Attribute): Make AttributeUsage fields public.
2219         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
2220         (Attribute.IsInternalCall): New property.
2221         (Attribute.UsageAttr): Convert to a public read-only property.
2222         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
2223         (Attribute.ResolveType, Attribute.Resolve)
2224         (Attribute.ScanForIndexerName): Update to reflect changes.
2225         (Attribute.CheckAttributeTarget): Re-format.
2226         (Attribute.ApplyAttributes): Refactor, to various
2227         Attributable.ApplyAttributeBuilder methods.
2228         * decl.cs (MemberCore): Make Attributable.
2229         * class.cs (Accessor): Make Attributable.
2230         (MethodData.ApplyAttributes): Use proper attribute types, not
2231         attribute names.
2232         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
2233         (TypeContainer.ApplyAttributeBuilder)
2234         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
2235         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
2236         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
2237         (Operator.ApplyAttributeBuilder): New factored-out methods.
2238         * const.cs (Const.ApplyAttributeBuilder): Likewise.
2239         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
2240         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
2241         * parameter.cs (ParameterBase): New Attributable base class
2242         that can also represent Return types.
2243         (Parameter): Update to the changes.
2244
2245 2004-04-29  Jackson Harper  <jackson@ximian.com>
2246
2247         * driver.cs: Prefer the corlib system version when looking for
2248         assemblies in the GAC. This is still a hack, but its a better hack
2249         now.
2250         
2251 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
2252
2253         * decl.cs, enum.cs: Improved error 3005 reporting.
2254   
2255         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
2256         (related_symbols): New private member for list of symbols
2257         related to reported error/warning.
2258         
2259         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
2260
2261 2004-04-29  Martin Baulig  <martin@ximian.com>
2262
2263         * ecore.cs (Expression.Constantify): If we're an enum and
2264         TypeManager.TypeToCoreType() doesn't give us another type, use
2265         t.UnderlyingSystemType.  Fixes #56178.  
2266
2267 2004-04-29  Martin Baulig  <martin@ximian.com>
2268
2269         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
2270         interfaces and for each interface, only add members directly
2271         declared in that interface.  Fixes #53255.
2272
2273 2004-04-28  Martin Baulig  <martin@ximian.com>
2274
2275         * expression.cs (ConditionalLogicalOperator): Use a temporary
2276         variable for `left' to avoid that we evaluate it more than once;
2277         bug #52588.
2278
2279 2004-04-28  Martin Baulig  <martin@ximian.com>
2280
2281         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
2282         `void[]' (CS1547).
2283
2284 2004-04-28  Martin Baulig  <martin@ximian.com>
2285
2286         * statement.cs (LocalInfo.Resolve): Check whether the type is not
2287         void (CS1547).
2288
2289         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
2290         whether the type is not void (CS1547).
2291
2292 2004-04-28  Martin Baulig  <martin@ximian.com>
2293
2294         * expression.cs (Unary.DoResolveLValue): Override this and report
2295         CS0131 for anything but Operator.Indirection.
2296
2297 2004-04-28  Martin Baulig  <martin@ximian.com>
2298
2299         Committing a patch from Ben Maurer; see bug #50820.
2300
2301         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
2302         check for classes.
2303
2304         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
2305         classes.        
2306
2307 2004-04-28  Martin Baulig  <martin@ximian.com>
2308
2309         Committing a patch from Ben Maurer; see bug #50820.
2310
2311         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
2312         check for classes.
2313
2314         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
2315         classes.        
2316
2317 2004-04-28  Martin Baulig  <martin@ximian.com>
2318
2319         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
2320         (Block.AddLabel): Call DoLookupLabel() to only search in the
2321         current block.
2322
2323 2004-04-28  Martin Baulig  <martin@ximian.com>
2324
2325         * cfold.cs (ConstantFold.BinaryFold): Added special support for
2326         comparing StringConstants and NullLiterals in Equality and Inequality.
2327
2328 2004-04-28  Jackson Harper  <jackson@ximian.com>
2329
2330         * driver.cs: Attempt to load referenced assemblies from the
2331         GAC. This is the quick and dirty version of this method that
2332         doesnt take into account versions and just takes the first
2333         canidate found. Will be good enough for now as we will not have more
2334         then one version installed into the GAC until I update this method.
2335
2336 2004-04-28  Martin Baulig  <martin@ximian.com>
2337
2338         * typemanager.cs (TypeManager.CheckStructCycles): New public
2339         static method to check for cycles in the struct layout.
2340
2341         * rootcontext.cs (RootContext.PopulateTypes): Call
2342         TypeManager.CheckStructCycles() for each TypeContainer.
2343         [Note: We only need to visit each type once.]
2344
2345 2004-04-28  Martin Baulig  <martin@ximian.com>
2346
2347         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
2348
2349         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
2350         success and added `out object value'.  Use a `bool resolved' field
2351         to check whether we've already been called rather than
2352         `ConstantValue != null' since this breaks for NullLiterals.
2353
2354 2004-04-28  Raja R Harinath  <rharinath@novell.com>
2355
2356         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
2357         setting of this flag, since the 'set' method may be non-public.
2358
2359 2004-04-28  Raja R Harinath  <rharinath@novell.com>
2360
2361         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
2362         check on current_vector.Block.
2363
2364 2004-04-27  Martin Baulig  <martin@ximian.com>
2365
2366         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
2367         a field initializer.  Fixes #56459.
2368
2369 2004-04-27  Martin Baulig  <martin@ximian.com>
2370
2371         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
2372         we're not attempting to use an indexer.  Fixes #52154.
2373
2374 2004-04-27  Martin Baulig  <martin@ximian.com>
2375
2376         * statement.cs (Return): Don't create a return label if we don't
2377         need it; reverts my change from January 20th.  Thanks to Ben
2378         Maurer for this.
2379
2380 2004-04-27  Martin Baulig  <martin@ximian.com>
2381
2382         According to the spec, `goto' can only leave a nested scope, but
2383         never enter it.
2384
2385         * statement.cs (Block.LookupLabel): Only lookup in the current
2386         block, don't recurse into parent or child blocks.
2387         (Block.AddLabel): Check in parent and child blocks, report
2388         CS0140/CS0158 if we find a duplicate.
2389         (Block): Removed this indexer for label lookups.
2390         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
2391         this already does the error reporting for us.
2392
2393         * flowanalysis.cs
2394         (FlowBranching.UsageVector.Block): New public variable; may be null.
2395         (FlowBranching.CreateSibling): Added `Block' argument.
2396         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
2397         label for the target of a `goto' and check whether we're not
2398         leaving a `finally'.
2399
2400 2004-04-27  Martin Baulig  <martin@ximian.com>
2401
2402         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2403         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
2404         just for returns).
2405
2406 2004-04-27  Martin Baulig  <martin@ximian.com>
2407
2408         * statement.cs (Block.AddLabel): Also check for implicit blocks
2409         and added a CS0158 check.
2410
2411 2004-04-27  Martin Baulig  <martin@ximian.com>
2412
2413         * flowanalysis.cs (FlowBranchingLoop): New class.
2414         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
2415         UsageVector's instead of an ArrayList.
2416         (FlowBranching.Label): Likewise.
2417         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
2418         (FlowBranching.AddBreakVector): New method.
2419
2420 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
2421
2422         * attribute.cs: Small regression fix: only convert the type if we
2423         the type is different, fixes System.Drawing build.
2424
2425 2004-04-27  Martin Baulig  <martin@ximian.com>
2426
2427         * attribute.cs (Attribute.Resolve): If we have a constant value
2428         for a named field or property, implicity convert it to the correct
2429         type.
2430
2431 2004-04-27  Raja R Harinath  <rharinath@novell.com>
2432
2433         * statement.cs (Block.Block): Implicit blocks share
2434         'child_variable_names' fields with parent blocks.
2435         (Block.AddChildVariableNames): Remove.
2436         (Block.AddVariable): Mark variable as "used by a child block" in
2437         every surrounding block.
2438         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
2439         been used in a child block, complain about violation of "Invariant
2440         meaning in blocks" rule.
2441         * cs-parser.jay (declare_local_variables): Don't use
2442         AddChildVariableNames.
2443         (foreach_statement): Don't create an implicit block: 'foreach'
2444         introduces a scope.
2445
2446 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
2447
2448         * convert.cs (ImplicitNumericConversion): 0 is also positive when
2449         converting from 0L to ulong.  Fixes 57522.
2450
2451 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
2452
2453         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
2454         derived class hides via 'new' keyword field from base class (test-242.cs).
2455         TODO: Handle this in the more general way.
2456         
2457         * class.cs (CheckBase): Ditto.
2458
2459 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
2460
2461         * decl.cs (caching_flags): New member for storing cached values
2462         as bit flags.
2463         (MemberCore.Flags): New enum where bit flags for caching_flags
2464         are defined.
2465         (MemberCore.cls_compliance): Moved to caching_flags.
2466         (DeclSpace.Created): Moved to caching_flags.
2467
2468         * class.cs: Use caching_flags instead of DeclSpace.Created
2469         
2470 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
2471
2472         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
2473         if we are only a derived class, not a nested class.
2474
2475         * typemanager.cs: Same as above, but do this at the MemberLookup
2476         level (used by field and methods, properties are handled in
2477         PropertyExpr).   Allow for the qualified access if we are a nested
2478         method. 
2479
2480 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
2481
2482         * class.cs: Refactoring.
2483         (IMethodData): New inteface; Holds links to parent members
2484         to avoid member duplication (reduced memory allocation).
2485         (Method): Implemented IMethodData interface.
2486         (PropertyBase): New inner classes for get/set methods.
2487         (PropertyBase.PropertyMethod): Implemented IMethodData interface
2488         (Event): New inner classes for add/remove methods.
2489         (Event.DelegateMethod): Implemented IMethodData interface.
2490
2491         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
2492         EmitContext (related to class.cs refactoring).
2493
2494 2004-04-21  Raja R Harinath  <rharinath@novell.com>
2495
2496         * delegate.cs (Delegate.VerifyApplicability): If the number of
2497         arguments are the same as the number of parameters, first try to
2498         verify applicability ignoring  any 'params' modifier on the last
2499         parameter.
2500         Fixes #56442.
2501
2502 2004-04-16  Raja R Harinath  <rharinath@novell.com>
2503
2504         * class.cs (TypeContainer.AddIndexer): Use
2505         'ExplicitInterfaceName' to determine if interface name was
2506         explicitly specified.  'InterfaceType' is not initialized at this time.
2507         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
2508         Indexers array is already in the required order.  Initialize
2509         'IndexerName' only if there are normal indexers.
2510         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
2511         (TypeContainer.Emit): Emit DefaultMember attribute only if
2512         IndexerName is initialized.
2513         Fixes #56300.
2514
2515 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
2516
2517         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
2518         Fixes #57007
2519
2520 2004-04-15  Raja R Harinath  <rharinath@novell.com>
2521
2522         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
2523         attributes.
2524         Fix for #56456.
2525
2526         * attribute.cs (Attribute.Resolve): Check for duplicate named
2527         attributes.
2528         Fix for #56463.
2529
2530 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
2531
2532         * iterators.cs (MarkYield): track whether we are in an exception,
2533         and generate code accordingly.  Use a temporary value to store the
2534         result for our state.
2535
2536         I had ignored a bit the interaction of try/catch with iterators
2537         since their behavior was not entirely obvious, but now it is
2538         possible to verify that our behavior is the same as MS .NET 2.0
2539
2540         Fixes 54814
2541
2542 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
2543
2544         * iterators.cs: Avoid creating temporaries if there is no work to
2545         do. 
2546
2547         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
2548         Enumerations, use TypeManager.EnumToUnderlying and call
2549         recursively. 
2550
2551         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
2552         bug #57013
2553
2554         (This.Emit): Use EmitContext.EmitThis to emit our
2555         instance variable.
2556
2557         (This.EmitAssign): Ditto.
2558
2559         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
2560         codepaths, we will move all the functionality into
2561         Mono.CSharp.This 
2562
2563         (FieldExpr.EmitAssign): Ditto.
2564
2565         This fixes several hidden bugs that I uncovered while doing a code
2566         review of this today.
2567
2568         * codegen.cs (EmitThis): reworked so the semantics are more clear
2569         and also support value types "this" instances.
2570
2571         * iterators.cs: Changed so that for iterators in value types, we
2572         do not pass the value type as a parameter.  
2573
2574         Initialization of the enumerator helpers is now done in the caller
2575         instead of passing the parameters to the constructors and having
2576         the constructor set the fields.
2577
2578         The fields have now `assembly' visibility instead of private.
2579
2580 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
2581
2582         * expression.cs (Argument.Resolve): Check if fields passed as ref
2583         or out are contained in a MarshalByRefObject.
2584
2585         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
2586         another compiler type.
2587
2588 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2589
2590         * class.cs (Indexer.Define): use the new name checking method.
2591         Also, return false on an error.
2592         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
2593         (is_identifier_[start/part]_character): make static.
2594
2595 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
2596
2597         * expression.cs (Binary.ResolveOperator): Do no append strings
2598         twice: since we can be invoked more than once (array evaluation)
2599         on the same concatenation, take care of this here.  Based on a fix
2600         from Ben (bug #56454)
2601
2602 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
2603
2604         * codegen.cs: Fix another case where CS1548 must be reported (when 
2605         delay-sign isn't specified and no private is available #56564). Fix
2606         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
2607         error when MCS is used on the MS runtime and we need to delay-sign 
2608         (which seems unsupported by AssemblyBuilder - see #56621).
2609
2610 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
2611
2612         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
2613         (TypeManager.ComputeNamespaces): Faster implementation for
2614         Microsoft runtime.
2615
2616         * compiler.csproj: Updated AssemblyName to mcs.
2617
2618 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
2619
2620         * rootcontext.cs: Add new types to the boot resolution.
2621
2622         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
2623         MulticastDelegate is not allowed.
2624
2625         * typemanager.cs: Add new types to lookup: System.TypedReference
2626         and ArgIterator.
2627
2628         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
2629         check for TypedReference or ArgIterator, they are not allowed. 
2630
2631         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
2632         makes us properly catch 1510 in some conditions (see bug 56016 for
2633         details). 
2634
2635 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
2636
2637         * CryptoConvert.cs: update from corlib version
2638         with endian fixes.
2639
2640 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
2641
2642         * class.cs (Indexer.Define): Check indexername declaration
2643
2644 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
2645
2646         * attribute.cs (IsClsCompliant): Fixed problem with handling
2647         all three states (compliant, not-compliant, undetected).
2648
2649 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
2650
2651         * attribute.cs (Attribute): Location is now public.
2652         (Resolve): Store resolved arguments (pos_values) in attribute class.
2653         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
2654         (GetClsCompliantAttributeValue): New method that gets
2655         CLSCompliantAttribute value.
2656         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
2657         if exists else null.
2658         (AttributeTester): New class for CLS-Compliant verification routines.
2659
2660         * class.cs (Emit): Add CLS-Compliant verification.
2661         (Method.GetSignatureForError): Implemented.
2662         (Constructor.GetSignatureForError): Implemented
2663         (Constructor.HasCompliantArgs): Returns if constructor has
2664         CLS-Compliant arguments.
2665         (Constructor.Emit): Override.
2666         (Construcor.IsIdentifierClsCompliant): New method; For constructors
2667         is needed to test only parameters.
2668         (FieldBase.GetSignatureForError): Implemented.
2669         (TypeContainer): New member for storing base interfaces.
2670         (TypeContainer.FindMembers): Search in base interfaces too.
2671
2672         * codegen.cs (GetClsComplianceAttribute): New method that gets
2673         assembly or module CLSCompliantAttribute value.
2674         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
2675         for assembly.
2676         (ModuleClass.Emit): Add error 3012 test.
2677
2678         * const.cs (Emit): Override and call base for CLS-Compliant tests.
2679
2680         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
2681         state for all decl types.
2682         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
2683         if CLS-Compliant tests are required.
2684         (IsClsCompliaceRequired): New method. Analyze whether code
2685         must be CLS-Compliant.
2686         (IsExposedFromAssembly): New method. Returns true when MemberCore
2687         is exposed from assembly.
2688         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
2689         value or gets cached value.
2690         (HasClsCompliantAttribute): New method. Returns true if MemberCore
2691         is explicitly marked with CLSCompliantAttribute.
2692         (IsIdentifierClsCompliant): New abstract method. This method is
2693         used to testing error 3005.
2694         (IsIdentifierAndParamClsCompliant): New method. Common helper method
2695         for identifier and parameters CLS-Compliant testing.
2696         (VerifyClsCompliance): New method. The main virtual method for
2697         CLS-Compliant verifications.
2698         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
2699         null. I don't know why is null (too many public members !).
2700         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
2701         and get value of first CLSCompliantAttribute that found.
2702
2703         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
2704         (VerifyClsCompliance): Override and add extra tests.
2705
2706         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
2707         clscheck- disable CLS-Compliant verification event if assembly is has
2708         CLSCompliantAttribute(true).
2709
2710         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
2711         ApllyAttribute is now called in emit section as in the other cases.
2712         Possible future Emit integration.
2713         (IsIdentifierClsCompliant): New override.
2714         (VerifyClsCompliance): New override.
2715         (GetEnumeratorName): Returns full enum name.
2716
2717         * parameter.cs (GetSignatureForError): Implemented.
2718
2719         * report.cs (WarningData): New struct for Warning message information.
2720         (LocationOfPreviousError): New method.
2721         (Warning): New method. Reports warning based on the warning table.
2722         (Error_T): New method. Reports error based on the error table.
2723
2724         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
2725         verifications are done here.
2726
2727         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
2728
2729         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
2730         CLSCompliantAttribute.
2731         (all_imported_types): New member holds all imported types from other
2732         assemblies.
2733         (LoadAllImportedTypes): New method fills static table with exported types
2734         from all referenced assemblies.
2735         (Modules): New property returns all assembly modules.
2736
2737 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
2738
2739         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
2740         throwing a parser error.
2741
2742         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
2743         which removes the hardcoded get_/set_ prefixes for properties, as
2744         IL allows for the properties to be named something else.  
2745
2746         Bug #56013
2747
2748         * expression.cs: Do not override operand before we know if it is
2749         non-null.  Fix 56207
2750
2751 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2752
2753         * typemanager.cs: support for pinned variables.
2754
2755 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2756
2757         * decl.cs, typemanager.cs: Avoid using an arraylist
2758         as a buffer if there is only one result set.
2759
2760 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2761
2762         * expression.cs: Make sure you cant call a static method
2763         with an instance expression, bug #56174.
2764
2765 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
2766
2767         * class.cs (IsDuplicateImplementation): Improve error reporting to
2768         flag 663 (method only differs in parameter modifier).
2769
2770         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
2771         in preprocessor directives.
2772
2773         * location.cs (LookupFile): Allow for the empty path.
2774
2775         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
2776         better approach for some of that patch, but its failing with the
2777         CharSet enumeration.  For now try/catch will do.
2778
2779         * typemanager.cs: Do not crash if a struct does not have fields.
2780         Fixes 56150.
2781
2782 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2783
2784         * expression.cs: cs0213, cant fix a fixed expression.
2785         fixes 50231.
2786
2787 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2788
2789         * cs-parser.jay: detect invalid embeded statements gracefully.
2790         bug #51113.
2791
2792 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2793
2794         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
2795         As a regex:
2796         s/
2797         the invocation type may not be a subclass of the tye of the item/
2798         The type of the item must be a subclass of the invocation item.
2799         /g
2800
2801         Fixes bug #50820.
2802
2803 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
2804
2805         * attribute.cs: Added methods to get a string and a bool from an
2806         attribute. Required to information from AssemblyKeyFileAttribute,
2807         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
2808         * codegen.cs: Modified AssemblyName creation to include support for
2809         strongnames. Catch additional exceptions to report them as CS1548.
2810         * compiler.csproj: Updated include CryptoConvert.cs.
2811         * compiler.csproj.user: Removed file - user specific configuration.
2812         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
2813         Mono.Security assembly. The original class is maintained and tested in
2814         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
2815         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
2816         like CSC 8.0 (C# v2) supports.
2817         * Makefile: Added CryptoConvert.cs to mcs sources.
2818         * rootcontext.cs: Added new options for strongnames.
2819
2820 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
2821
2822         * driver.cs: For --expect-error, report error code `2'
2823         if the program compiled with no errors, error code `1' if
2824         it compiled with an error other than the one expected.
2825
2826 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
2827
2828         * compiler.csproj: Updated for Visual Studio .NET 2003.
2829         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
2830         * compiler.sln: Updated for Visual Studio .NET 2003.
2831
2832 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
2833
2834         * expression.cs: Fix bug #47234. We basically need to apply the
2835         rule that we prefer the conversion of null to a reference type
2836         when faced with a conversion to 'object' (csc behaviour).
2837
2838 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2839
2840         * statement.cs: Shorter form for foreach, eliminates
2841         a local variable. r=Martin.
2842
2843 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2844
2845         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
2846         checks if we can use brtrue/brfalse to test for 0.
2847         * expression.cs: use the above in the test for using brtrue/brfalse.
2848         cleanup code a bit.
2849
2850 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2851
2852         * expression.cs: Rewrite string concat stuff. Benefits:
2853
2854         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
2855         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
2856         rather than a concat chain.
2857
2858         * typemanager.cs: Add lookups for more concat overloads.
2859
2860 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2861
2862         * expression.cs: Emit shorter il code for array init.
2863
2864         newarr
2865         dup
2866         // set 1
2867
2868         // set 2
2869
2870         newarr
2871         stloc.x
2872
2873         ldloc.x
2874         // set 1
2875
2876         ldloc.x
2877         // set 2
2878
2879 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
2880
2881         * statement.cs: Before, two switch blocks would be merged if the
2882         total size of the blocks (end_item - begin_item + 1) was less than
2883         two times the combined sizes of the blocks.
2884
2885         Now, it will only merge if after the merge at least half of the
2886         slots are filled.
2887
2888         fixes 55885.
2889
2890 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
2891
2892         * class.cs : csc build fix for GetMethods(). See bug #52503.
2893
2894 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
2895
2896         * expression.cs: Make sure fp comparisons work with NaN.
2897         This fixes bug #54303. Mig approved this patch a long
2898         time ago, but we were not able to test b/c the runtime
2899         had a related bug.
2900
2901 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
2902
2903         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
2904
2905 2004-03-19  Martin Baulig  <martin@ximian.com>
2906
2907         * class.cs (MemberCore.IsDuplicateImplementation): Report the
2908         error here and not in our caller.
2909
2910 2004-03-19  Martin Baulig  <martin@ximian.com>
2911
2912         * interface.cs: Completely killed this file.
2913         (Interface): We're now a TypeContainer and live in class.cs.
2914
2915         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
2916         argument; we're now also called for interfaces.
2917         (TypeContainer.DefineMembers): Allow this method being called
2918         multiple times.
2919         (TypeContainer.GetMethods): New public method; formerly known as
2920         Interface.GetMethod().  This is used by PendingImplementation.
2921         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
2922         it's now private and non-static.
2923         (Interface): Moved this here; it's now implemented similar to
2924         Class and Struct.
2925         (Method, Property, Event, Indexer): Added `bool is_interface'
2926         argument to their .ctor's.
2927         (MemberBase.IsInterface): New public field.
2928
2929         * cs-parser.jay: Create normal Method, Property, Event, Indexer
2930         instances instead of InterfaceMethod, InterfaceProperty, etc.
2931         (opt_interface_base): Removed; we now use `opt_class_base' instead.
2932         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
2933
2934 2004-03-19  Martin Baulig  <martin@ximian.com>
2935
2936         * class.cs (MethodCore.IsDuplicateImplementation): New private
2937         method which does the CS0111 checking.
2938         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
2939         Use IsDuplicateImplementation().
2940
2941 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
2942
2943         * decl.cs (FindMemberToOverride): New method to find the correct
2944         method or property to override in the base class.
2945         * class.cs
2946             - Make Method/Property use the above method to find the
2947               version in the base class.
2948             - Remove the InheritableMemberSignatureCompare as it is now
2949               dead code.
2950
2951         This patch makes large code bases much faster to compile, as it is
2952         O(n) rather than O(n^2) to do this validation.
2953
2954         Also, it fixes bug 52458 which is that nested classes are not
2955         taken into account when finding the base class member.
2956
2957         Reviewed/Approved by Martin.
2958
2959 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
2960
2961         * interface.cs: In all interface classes removed redundant
2962         member initialization.
2963
2964 2004-03-16  Martin Baulig  <martin@ximian.com>
2965
2966         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
2967
2968 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
2969
2970         * decl.cs (DefineTypeAndParents): New helper method to define a
2971         type's containers before the type itself is defined;  This is a
2972         bug exposed by the recent changes to Windows.Forms when an
2973         implemented interface was defined inside a class that had not been
2974         built yet.   
2975
2976         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
2977
2978         (Check): Loop correctly to report errors modifiers
2979         (UNSAFE was not in the loop, since it was the same as TOP).
2980
2981         * interface.cs: Every interface member now takes a ModFlags,
2982         instead of a "is_new" bool, which we set on the base MemberCore. 
2983
2984         Every place where we called "UnsafeOk" in the interface, now we
2985         call the proper member (InterfaceMethod.UnsafeOK) instead to get
2986         the unsafe settings from the member declaration instead of the
2987         container interface. 
2988
2989         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
2990
2991         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
2992         `set_indexer_name' to the pending bits (one per type).
2993
2994         We fixed a bug today that was picking the wrong method to
2995         override, since for properties the existing InterfaceMethod code
2996         basically ignored the method name.  Now we make sure that the
2997         method name is one of the valid indexer names.
2998
2999 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
3000  
3001         * support.cs (SeekableStreamReader): Keep track of stream byte
3002         positions and don't mix them with character offsets to the buffer.
3003
3004         Patch from Gustavo Giráldez
3005
3006 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
3007
3008         * interface.cs (InterfaceSetGetBase): Removed double member
3009         initialization, base class does it as well.
3010
3011 2004-03-13  Martin Baulig  <martin@ximian.com>
3012
3013         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
3014         when compiling corlib.
3015
3016 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
3017
3018         * convert.cs (ExplicitConversion): We were reporting an error on
3019         certain conversions (object_type source to a value type, when the
3020         expression was `null') before we had a chance to pass it through
3021         the user defined conversions.
3022
3023         * driver.cs: Replace / and \ in resource specifications to dots.
3024         Fixes 50752
3025
3026         * class.cs: Add check for duplicate operators.  Fixes 52477
3027
3028 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
3029
3030         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
3031         that are in the middle of the statements, not only at the end.
3032         Fixes #54987
3033
3034         * class.cs (TypeContainer.AddField): No longer set the
3035         `HaveStaticConstructor' flag, now we call it
3036         `UserDefineStaticConstructor' to diferentiate the slightly
3037         semantic difference.
3038
3039         The situation is that we were not adding BeforeFieldInit (from
3040         Modifiers.TypeAttr) to classes that could have it.
3041         BeforeFieldInit should be set to classes that have no static
3042         constructor. 
3043
3044         See:
3045
3046         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
3047
3048         And most importantly Zoltan's comment:
3049
3050         http://bugzilla.ximian.com/show_bug.cgi?id=44229
3051
3052         "I think beforefieldinit means 'it's ok to initialize the type sometime 
3053          before its static fields are used', i.e. initialization does not need
3054          to be triggered by the first access to the type. Setting this flag
3055          helps the JIT to compile better code, since it can run the static
3056          constructor at JIT time, and does not need to generate code to call it
3057          (possibly lots of times) at runtime. Unfortunately, mcs does not set
3058          this flag for lots of classes like String. 
3059          
3060          csc sets this flag if the type does not have an explicit static 
3061          constructor. The reasoning seems to be that if there are only static
3062          initalizers for a type, and no static constructor, then the programmer
3063          does not care when this initialization happens, so beforefieldinit
3064          can be used.
3065          
3066          This bug prevents the AOT compiler from being usable, since it 
3067          generates so many calls to mono_runtime_class_init that the AOT code
3068          is much slower than the JITted code. The JITted code is faster, 
3069          because it does not generate these calls if the vtable is type is
3070          already initialized, which is true in the majority of cases. But the
3071          AOT compiler can't do this."
3072
3073 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
3074
3075         * class.cs (MethodData.Emit): Refactor the code so symbolic
3076         information is generated for destructors;  For some reasons we
3077         were taking a code path that did not generate symbolic information
3078         before. 
3079
3080 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
3081
3082         * class.cs: Create a Constructor.CheckBase method that
3083         takes care of all validation type code. The method
3084         contains some code that was moved from Define.
3085
3086         It also includes new code that checks for duplicate ctors.
3087         This fixes bug #55148.
3088
3089 2004-03-09  Joshua Tauberer <tauberer@for.net>
3090
3091         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
3092         a { ... }-style array creation invokes EmitStaticInitializers
3093         which is not good for reference-type arrays.  String, decimal
3094         and now null constants (NullCast) are not counted toward
3095         static initializers.
3096
3097 2004-03-05  Martin Baulig  <martin@ximian.com>
3098
3099         * location.cs (SourceFile.HasLineDirective): New public field;
3100         specifies whether the file contains or is referenced by a "#line"
3101         directive.
3102         (Location.DefineSymbolDocuments): Ignore source files which
3103         either contain or are referenced by a "#line" directive.        
3104
3105 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
3106
3107         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
3108         direct access to our parent, so check the method inline there.
3109
3110 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
3111
3112         * expression.cs (Invocation.EmitCall): Miguel's last commit
3113         caused a regression. If you had:
3114
3115             T t = null;
3116             t.Foo ();
3117
3118         In Foo the implict this would be null.
3119
3120 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
3121
3122         * expression.cs (Invocation.EmitCall): If the method is not
3123         virtual, do not emit a CallVirt to it, use Call.
3124
3125         * typemanager.cs (GetFullNameSignature): Improve the method to
3126         cope with ".ctor" and replace it with the type name.
3127
3128         * class.cs (ConstructorInitializer.Resolve): Now the method takes
3129         as an argument the ConstructorBuilder where it is being defined,
3130         to catch the recursive constructor invocations.
3131
3132 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
3133
3134         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
3135         routines to check if a type is an enumerable/enumerator allow
3136         classes that implement the IEnumerable or IEnumerator interfaces.
3137
3138         * class.cs (Property, Operator): Implement IIteratorContainer, and
3139         implement SetYields.
3140
3141         (Property.Define): Do the block swapping for get_methods in the
3142         context of iterators.   We need to check if Properties also
3143         include indexers or not.
3144
3145         (Operator): Assign the Block before invoking the
3146         OperatorMethod.Define, so we can trigger the Iterator code
3147         replacement. 
3148
3149         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
3150         Property and Operator classes are not created when we parse the
3151         declarator but until we have the block completed, so we use a
3152         singleton SimpleIteratorContainer.Simple to flag whether the
3153         SetYields has been invoked.
3154
3155         We propagate this setting then to the Property or the Operator to
3156         allow the `yield' to function.
3157
3158 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
3159
3160         * codegen.cs: Implemented attribute support for modules.
3161         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
3162         Assembly/Module functionality.
3163
3164         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
3165         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
3166         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
3167
3168 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
3169
3170         * interface.cs (FindMembers): The operation is performed on all base
3171         interfaces and not only on the first. It is required for future CLS Compliance patch.
3172
3173 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
3174
3175         * statement.cs, codegen.cs:
3176         This patch deals with patterns such as:
3177
3178         public class List : IEnumerable {
3179
3180                 public MyEnumerator GetEnumerator () {
3181                         return new MyEnumerator(this);
3182                 }
3183
3184                 IEnumerator IEnumerable.GetEnumerator () {
3185                         ...
3186                 }
3187                 
3188                 public struct MyEnumerator : IEnumerator {
3189                         ...
3190                 }
3191         }
3192
3193         Before, there were a few things we did wrong:
3194         1) we would emit callvirt on a struct, which is illegal
3195         2) we emited ldarg when we needed to emit ldarga
3196         3) we would mistakenly call the interface methods on an enumerator
3197         type that derived from IEnumerator and was in another assembly. For example:
3198
3199         public class MyEnumerator : IEnumerator
3200
3201         Would have the interface methods called, even if there were public impls of the
3202         method. In a struct, this lead to invalid IL code.
3203
3204 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
3205
3206         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
3207           renamed to Emit.
3208
3209         * delegate.cs (Define): Fixed crash when delegate type is undefined.
3210
3211 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
3212
3213         * cs-parser.jay: Fix small regression: we were not testing V2
3214         compiler features correctly.
3215
3216         * interface.cs: If the emit context is null, then create one
3217
3218 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
3219
3220         * decl.cs (GetSignatureForError): New virtual method to get full name
3221           for error messages.
3222
3223         * attribute.cs (IAttributeSupport): New interface for attribute setting.
3224           Now it is possible to rewrite ApplyAttributes method to be less if/else.
3225
3226         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
3227           Duplicated members and code in these classes has been removed.
3228           Better encapsulation in these classes.
3229
3230 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
3231
3232         * assign.cs (Assign.DoResolve): When dealing with compound
3233         assignments, there is a new rule in ECMA C# 2.4 (might have been
3234         there before, but it is documented here) that states that in:
3235
3236         a op= b;
3237
3238         If b is of type int, and the `op' is a shift-operator, then the
3239         above is evaluated as:
3240
3241         a = (int) a op b 
3242
3243         * expression.cs (Binary.ResolveOperator): Instead of testing for
3244         int/uint/long/ulong, try to implicitly convert to any of those
3245         types and use that in pointer arithmetic.
3246
3247         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
3248         method to print information for from the type, not from the
3249         null-method we were given.
3250
3251 2004-02-01  Duncan Mak  <duncan@ximian.com>
3252
3253         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
3254         parsing for cmd, fixes bug #53694.
3255
3256 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
3257
3258         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
3259         in the member name duplication tests. Property and operator name duplication
3260         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
3261
3262 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
3263
3264         * interface.cs (PopulateMethod): Fixed crash when interface method
3265         returns not existing type (error test cs0246-3.cs).
3266
3267 2004-02-02  Ravi Pratap M <ravi@ximian.com>
3268
3269         * cs-parser.jay (interface_accessors): Re-write actions to also
3270         store attributes attached to get and set methods. Fix spelling
3271         while at it.
3272
3273         (inteface_property_declaration): Modify accordingly.
3274
3275         (InterfaceAccessorInfo): New helper class to store information to pass
3276         around between rules that use interface_accessors.
3277
3278         * interface.cs (Emit): Apply attributes on the get and set
3279         accessors of properties and indexers too.
3280
3281         * attribute.cs (ApplyAttributes): Modify accordingly to use the
3282         right MethodBuilder when applying attributes to the get and set accessors.
3283
3284 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
3285
3286         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
3287
3288 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
3289
3290         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
3291
3292 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
3293
3294         * cs-parser.jay: Remove YIELD token, instead use the new grammar
3295         changes that treat `yield' specially when present before `break'
3296         or `return' tokens.
3297
3298         * cs-tokenizer.cs: yield is no longer a keyword.
3299
3300 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
3301
3302         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
3303         setting for default constructors.
3304         For default constructors are almost every time set wrong Modifier. The
3305         generated IL code has been alright. But inside mcs this values was
3306         wrong and this was reason why several of my CLS Compliance tests
3307         failed.
3308
3309 2004-01-22  Martin Baulig  <martin@ximian.com>
3310
3311         * cs-parser.jay (namespace_or_type_name): Return an Expression,
3312         not a QualifiedIdentifier.  This is what `type_name_expression'
3313         was previously doing.
3314         (type_name_expression): Removed; the code is now in
3315         `namespace_or_type_name'.
3316         (qualified_identifier): Removed, use `namespace_or_type_name'
3317         instead.
3318         (QualifiedIdentifier): Removed this class.      
3319
3320 2004-01-22  Martin Baulig  <martin@ximian.com>
3321
3322         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
3323         not a string as alias name.
3324
3325 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
3326
3327         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
3328         #52730 bug, and instead compute correctly the need to use a
3329         temporary variable when requesting an address based on the
3330         static/instace modified of the field and the constructor.
3331  
3332 2004-01-21  Martin Baulig  <martin@ximian.com>
3333
3334         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
3335         class and namespace before looking up aliases.  Fixes #52517.
3336
3337 2004-01-21  Martin Baulig  <martin@ximian.com>
3338
3339         * flowanalysis.cs (UsageVector.Merge): Allow variables being
3340         assinged in a 'try'; fixes exception4.cs.
3341
3342 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3343         * class.cs : Implemented parameter-less constructor for TypeContainer
3344
3345         * decl.cs: Attributes are now stored here. New property OptAttributes
3346
3347         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
3348
3349         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
3350
3351 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3352
3353         * typemanager.cs (CSharpSignature): Now reports also inner class name.
3354           (CSharpSignature): New method for indexer and property signature.
3355
3356 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3357
3358         * pending.cs (IsVirtualFilter): Faster implementation.
3359
3360 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3361
3362         * typemanager.cs: Avoid inclusion of same assembly more than once.
3363
3364 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3365
3366         * cs-parser.jay: Fixed problem where the last assembly attribute
3367           has been applied also to following declaration (class, struct, etc.)
3368           
3369 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3370
3371         * class.cs: Added error CS0538, CS0539 reporting.
3372         Fixed crash on Microsoft runtime when field type is void.
3373
3374         * cs-parser.jay: Added error CS0537 reporting.
3375
3376         * pending.cs: Added error CS0535 reporting.
3377         Improved error report for errors CS0536, CS0534.
3378
3379 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
3380
3381         Merge a few bits from the Anonymous Method MCS tree.
3382
3383         * statement.cs (ToplevelBlock): New class for toplevel methods,
3384         will hold anonymous methods, lifted variables.
3385
3386         * cs-parser.jay: Create toplevel blocks for delegates and for
3387         regular blocks of code. 
3388
3389 2004-01-20  Martin Baulig  <martin@ximian.com>
3390
3391         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
3392         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
3393         and `NeedExplicitReturn'; added `IsLastStatement'.
3394         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
3395         have a `ReturnLabel' or we're not unreachable.
3396
3397         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
3398         child's reachability; don't just override ours with it.  Fixes
3399         #58058 (lluis's example).
3400         (FlowBranching): Added public InTryOrCatch(), InCatch(),
3401         InFinally(), InLoop(), InSwitch() and
3402         BreakCrossesTryCatchBoundary() methods.
3403
3404         * statement.cs (Return): Do all error checking in Resolve().
3405         Unless we are the last statement in a top-level block, always
3406         create a return label and jump to it.
3407         (Break, Continue): Do all error checking in Resolve(); also make
3408         sure we aren't leaving a `finally'.
3409         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
3410         statement in a top-level block.
3411         (Block.Flags): Added `IsDestructor'.
3412         (Block.IsDestructor): New public property.
3413
3414 2004-01-20  Martin Baulig  <martin@ximian.com>
3415
3416         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
3417
3418 2004-01-20  Martin Baulig  <martin@ximian.com>
3419
3420         * statement.cs (Statement.ResolveUnreachable): New public method.
3421         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
3422         (Block.Resolve): Resolve unreachable statements.
3423
3424 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3425
3426         * expression.cs: We need to fix the case where we do
3427         not have a temp variable here.
3428
3429         * assign.cs: Only expression compound assignments need
3430         temporary variables.
3431
3432 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3433
3434         * flowanalysis.cs: Reduce memory allocation in a few ways:
3435           - A block with no variables should not allocate a bit
3436             vector for itself.
3437           - A method with no out parameters does not need any tracking
3438             for assignment of the parameters, so we need not allocate
3439             any data for it.
3440           - The arrays:
3441                 public readonly Type[] VariableTypes;
3442                 public readonly string[] VariableNames;
3443             Are redundant. The data is already stored in the variable
3444             map, so we need not allocate another array for it.
3445           - We need to add alot of checks for if (params | locals) == null
3446             due to the first two changes.
3447
3448 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
3449
3450         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
3451         implement IMemoryLocation, we store a copy on a local variable and
3452         take the address of it.  Patch from Benjamin Jemlich
3453
3454         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
3455         to use a special "type_name_expression" rule which reduces the
3456         number of "QualifiedIdentifier" classes created, and instead
3457         directly creates MemberAccess expressions.
3458
3459 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
3460
3461         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
3462         that fixes #52853.  Null literal assignment to ValueType
3463
3464         * class.cs (MethodData.Emit): Instead of checking the name of the
3465         method to determine if its a destructor, create a new derived
3466         class from Method called Destructor, and test for that.  
3467
3468         * cs-parser.jay: Create a Destructor object instead of a Method.  
3469
3470         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
3471
3472         Fixes: 52933
3473
3474 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
3475
3476         * expression.cs (Binary.ResolveOperator): Perform an implicit
3477         conversion from MethodGroups to their delegate types on the
3478         Addition operation.
3479
3480         * delegate.cs: Introduce a new class DelegateCreation that is the
3481         base class for `NewDelegate' and `ImplicitDelegateCreation',
3482         factor some code in here.
3483
3484         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
3485         conversion from MethodGroups to compatible delegate types. 
3486
3487         * ecore.cs (Expression.Resolve): Do not flag error 654
3488         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
3489         we allow conversions from MethodGroups to delegate types now.
3490
3491         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
3492         assignments in v2 either.
3493
3494 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
3495
3496         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
3497         static read-only fields in ctors.
3498
3499         Applied patch from Benjamin Jemlich 
3500
3501         * expression.cs (UnaryMutator): Avoid leaking local variables. 
3502
3503 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
3504
3505         * cs-tokenizer.cs (IsCastToken): Allow the various native types
3506         here to return true, as they can be used like this:
3507
3508                 (XXX) int.MEMBER ()
3509
3510         Fixed 49836 and all the other dups
3511
3512 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
3513
3514         * driver.cs: Implement /win32res and /win32icon.
3515
3516 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
3517
3518         * cs-parser.jay: Add a rule to improve error handling for the
3519         common mistake of placing modifiers after the type.
3520
3521 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
3522
3523         * cs-parser.jay (interface_event_declaration): Catch
3524         initialization of events on interfaces, and report cs0068
3525
3526         * cs-parser.jay (interface_event_declaration): Catch
3527         initialization of events. 
3528
3529         * ecore.cs: Better report missing constructors.
3530
3531         * expression.cs (Binary.ResolveOperator): My previous bug fix had
3532         the error reporting done in the wrong place.  Fix.
3533
3534         * expression.cs (Binary.ResolveOperator): Catch the 
3535         operator + (E x, E y) error earlier, and later allow for implicit
3536         conversions in operator +/- (E e, U x) from U to the underlying
3537         type of E.
3538
3539         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
3540         52596, if the container class is abstract, the default constructor
3541         is protected otherwise its public (before, we were always public).
3542
3543         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
3544         fixed statement.
3545
3546         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
3547         Jemlich that fixes bug #52597, MCS was generating invalid code for
3548         idisposable structs.   Thanks to Ben for following up with this
3549         bug as well.
3550
3551 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
3552
3553         * driver.cs: Allow assemblies without code to be generated, fixes
3554         52230.
3555
3556 2004-01-07  Nick Drochak <ndrochak@gol.com>
3557
3558         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
3559
3560 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
3561
3562         * cs-parser.jay: Add rules to improve error reporting if fields or
3563         methods are declared at the namespace level (error 116)
3564
3565         * Add rules to catch event add/remove
3566
3567 2004-01-04  David Sheldon <dave-mono@earth.li>
3568
3569   * expression.cs: Added matching ")" to error message for 
3570   CS0077
3571
3572 2004-01-03 Todd Berman <tberman@gentoo.org>
3573
3574         * ecore.cs, attribute.cs:
3575         Applying fix from #52429.
3576
3577 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3578
3579         * ecore.cs, expression.cs, statement.cs:
3580         Total rewrite of how we handle branching. We
3581         now handle complex boolean expressions with fewer
3582         jumps. As well if (x == 0) no longer emits a ceq.
3583
3584         if (x is Foo) is much faster now, because we generate
3585         better code.
3586
3587         Overall, we get a pretty big improvement on our benchmark
3588         tests. The code we generate is smaller and more readable.
3589
3590         I did a full two-stage bootstrap. The patch was reviewed
3591         by Martin and Miguel.
3592
3593 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3594
3595         * cs-parser.jay: Make primary_expression not take a QI.
3596         we dont need this because the member_access rule covers
3597         us here. So we replace the rule with just IDENTIFIER.
3598
3599         This has two good effects. First, we remove a s/r conflict.
3600         Second, we allocate many fewer QualifiedIdentifier objects.
3601
3602 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3603
3604         * attribute.cs: Handle MarshalAs attributes as pseudo, and
3605         set the correct information via SRE. This prevents
3606         hanging on the MS runtime. Fixes #29374.
3607
3608 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3609
3610         * convert.cs: correctly handle conversions to value types
3611         from Enum and ValueType as unboxing conversions.
3612
3613         Fixes bug #52569. Patch by Benjamin Jemlich.
3614
3615 2004-01-02  Ravi Pratap  <ravi@ximian.com>
3616
3617         * expression.cs (BetterConversion): Prefer int -> uint
3618         over int -> ulong (csc's behaviour). This fixed bug #52046.
3619
3620 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
3621
3622         * decl.cs (MemberCache.FindMembers): now returns a
3623         MemberInfo [].
3624
3625         * typemanager.cs: In general, go with with ^^.
3626         (CopyNewMethods): take an IList.
3627         (RealMemberLookup): Only allocate an arraylist
3628         if we copy from two sets of methods.
3629
3630         This change basically does two things:
3631         1) Fewer array lists allocated due to CopyNewMethods.
3632         2) the explicit cast in MemberList costed ALOT.
3633
3634 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
3635
3636         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
3637         a hashtable to avoid needless string allocations when an identifier is
3638         used more than once (the common case).
3639
3640 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
3641
3642         * pending.cs: MS's TypeBuilder.GetInterfaces ()
3643         is broken, it will not return anything. So, we
3644         have to use the information we have in mcs to
3645         do the task.
3646
3647         * typemanager.cs: Add a cache for GetInterfaces,
3648         since this will now be used more often (due to ^^)
3649
3650         (GetExplicitInterfaces) New method that gets the
3651         declared, not effective, interfaces on a type
3652         builder (eg, if you have interface IFoo, interface
3653         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
3654         { IBar }.
3655
3656         This patch makes MCS able to bootstrap itself on
3657         Windows again.
3658
3659 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
3660
3661         * expression.cs: Remove the Nop's that Miguel put
3662         in by mistake.
3663
3664 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3665
3666         * report.cs, codegen.cs: Give the real stack trace to
3667         the error when an exception is thrown.
3668
3669 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3670
3671         * decl.cs: only allocate hashtables for ifaces if 
3672         it is an iface!
3673
3674 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3675
3676         * expression.cs: fix the error from cs0121-2.cs
3677         (a parent interface has two child interfaces that
3678         have a function with the same name and 0 params
3679         and the function is called through the parent).
3680
3681 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3682
3683         * class.cs, rootcontext.cs, typmanager.cs: do not
3684         leak pointers.
3685
3686 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3687
3688         * codegen.cs: remove stack for the ec flow branching.
3689         It is already a linked list, so no need.
3690
3691 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
3692
3693         * Makefile: Allow custom profiler here.
3694
3695 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
3696
3697         * typemanager.cs (LookupType):
3698           - Use a static char [], because split takes
3699             a param array for args, so it was allocating
3700             every time.
3701           - Do not store true in a hashtable, it boxes.
3702
3703 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
3704
3705         * flowanalysis.cs: bytify common enums.
3706
3707 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
3708
3709         * modifiers.cs: Add a new set of flags for the
3710         flags allowed on explicit interface impls.
3711         * cs-parser.jay: catch the use of modifiers in
3712         interfaces correctly.
3713         * class.cs: catch private void IFoo.Blah ().
3714
3715         All related to bug #50572.
3716
3717 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
3718
3719         * decl.cs: Rewrite the consistant accessability checking.
3720         Accessability is not linear, it must be implemented in
3721         a tableish way. Fixes #49704.
3722
3723 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
3724
3725         * expression.cs: Handle negation in a checked context.
3726         We must use subtraction from zero. Fixes #38674.
3727
3728 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3729
3730         * class.cs: Ignore static void main in DLLs.
3731         * rootcontext.cs: Handle the target type here,
3732         since we are have to access it from class.cs
3733         * driver.cs: account for the above.
3734
3735 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3736
3737         * report.cs: Give line numbers and files if available.
3738
3739 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
3740
3741         * driver.cs: Implement /addmodule.
3742
3743         * typemanager.cs:  Change 'modules' field so it now contains Modules not
3744         ModuleBuilders.
3745
3746 2003-12-20  Martin Baulig  <martin@ximian.com>
3747
3748         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
3749         (FieldBase.IsAssigned): Removed this field.
3750         (FieldBase.SetAssigned): New public method.
3751         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
3752
3753 2003-12-20  Martin Baulig  <martin@ximian.com>
3754
3755         * expression.cs (LocalVariableReference.DoResolve): Don't set
3756         `vi.Used' if we're called from DoResolveLValue().
3757
3758         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
3759         returns the usage vector it just merged into the current one -
3760         pass this one to UsageWarning().
3761         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
3762         of the `EmitContext', don't call this recursively on our children.
3763
3764 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
3765
3766         * driver.cs: Implement /target:module.
3767
3768 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
3769
3770         * support.cs (CharArrayHashtable): New helper class.
3771
3772         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
3773         char arrays, not strings, so we can avoid creating a string in
3774         consume_identifier if the identifier is a keyword.
3775
3776 2003-12-16  Martin Baulig  <martin@ximian.com>
3777
3778         * statement.cs (LocalInfo.Assigned): Removed this property.
3779         (LocalInfo.Flags): Removed `Assigned'.
3780         (LocalInfo.IsAssigned): New public method; takes the EmitContext
3781         and uses flow analysis.
3782         (Block.UsageWarning): Made this method private.
3783         (Block.Resolve): Call UsageWarning() if appropriate.
3784
3785         * expression.cs (LocalVariableReference.DoResolve): Always set
3786         LocalInfo.Used here.
3787
3788 2003-12-13  Martin Baulig  <martin@ximian.com>
3789
3790         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
3791         any value here; we're now using flow analysis to figure out
3792         whether a statement/block returns a value.
3793
3794 2003-12-13  Martin Baulig  <martin@ximian.com>
3795
3796         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
3797         working again.
3798         (FlowBranching.MergeFinally): Don't call
3799         `branching.CheckOutParameters()' here, this is called in
3800         MergeTopBlock().
3801         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
3802         when adding the `finally' vector.       
3803
3804 2003-12-13  Martin Baulig  <martin@ximian.com>
3805
3806         * flowanalysis.cs
3807         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
3808         actually work and also fix #48962.
3809
3810 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
3811
3812         * decl.cs: Do not check System.Object for nested types,
3813         since we know it does not have any. Big bang for buck:
3814
3815         BEFORE:
3816            Run 1:   8.35 seconds
3817            Run 2:   8.32 seconds
3818            corlib:  17.99 seconds
3819         AFTER:
3820            Run 1:   8.17 seconds
3821            Run 2:   8.17 seconds
3822            corlib:  17.39 seconds
3823
3824 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
3825
3826         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
3827         time we are returning 0 members, so we save alot here.
3828
3829 2003-12-11  Martin Baulig  <martin@ximian.com>
3830
3831         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
3832         `MergeChild()', also just take the `FlowBranching' as argument;
3833         call Merge() on it and return the result.
3834         (FlowBranching.Merge): We don't need to do anything if we just
3835         have one sibling.
3836
3837 2003-12-11  Martin Baulig  <martin@ximian.com>
3838
3839         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
3840         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
3841         Maurer for this idea.
3842
3843 2003-12-11  Martin Baulig  <martin@ximian.com>
3844
3845         * flowanalysis.cs (MergeResult): This class is now gone; we now
3846         use the `UsageVector' for this.  The reason for this is that if a
3847         branching just has one sibling, we don't need to "merge" them at
3848         all - that's the next step to do.
3849         (FlowBranching.Merge): We now return a `UsageVector' instead of a
3850         `MergeResult'.
3851
3852 2003-12-11  Martin Baulig  <martin@ximian.com>
3853
3854         Reworked flow analyis and made it more precise and bug-free.  The
3855         most important change is that we're now using a special `Reachability'
3856         class instead of having "magic" meanings of `FlowReturns'.  I'll
3857         do some more cleanups and optimizations and also add some more
3858         documentation this week.
3859
3860         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
3861         largely reworked this class.
3862         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
3863         the new `Reachability' class instead of having "magic" values here.
3864         (FlowBranching): We're now using an instance of `Reachability'
3865         instead of having separate `Returns', `Breaks' etc. fields.
3866
3867         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
3868         based on flow analysis; ignore the return value of block.Emit ().
3869
3870 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
3871
3872         * driver.cs typemanager.cs: Find the mono extensions to corlib even
3873         if they are private.
3874
3875 2003-12-09  Martin Baulig  <martin@ximian.com>
3876
3877         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
3878         call them directly on the UsageVector.
3879
3880 2003-12-09  Martin Baulig  <martin@ximian.com>
3881
3882         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
3883         Changed return type from `FlowReturns' to `Reachability'.
3884
3885 2003-12-09  Martin Baulig  <martin@ximian.com>
3886
3887         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
3888         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
3889         `Reachable' fields with a single `Reachability' one.
3890
3891 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
3892
3893         * class.cs (FindMembers): Remove foreach's.
3894
3895         Bootstrap times:
3896
3897         BEFORE
3898                 Run 1:   8.74 seconds
3899                 Run 2:   8.71 seconds
3900
3901         AFTER
3902                 Run 1:   8.64 seconds
3903                 Run 2:   8.58 seconds
3904
3905
3906 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
3907
3908         * cs-parser.jay:
3909         * gen-treedump.cs:
3910         * statement.cs:
3911         This patch does a few things:
3912                 1. EmptyStatement is now a singleton, so it is never reallocated.
3913                 2. All blah is EmptyStatement constructs have been changed to
3914                    blah == EmptyStatement.Value, which is much faster and valid
3915                    now that EmptyStatement is a singleton.
3916                 3. When resolving a block, rather than allocating a new array for
3917                    the non-empty statements, empty statements are replaced with
3918                    EmptyStatement.Value
3919                 4. Some recursive functions have been made non-recursive.
3920         Mainly the performance impact is from (3), however (1) and (2) are needed for
3921         this to work. (4) does not make a big difference in normal situations, however
3922         it makes the profile look saner.
3923
3924         Bootstrap times:
3925
3926         BEFORE
3927         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
3928         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
3929         Total memory allocated: 56397 KB
3930
3931         AFTER
3932         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
3933         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
3934         Total memory allocated: 55666 KB
3935
3936 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
3937
3938         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
3939         than the hashtable in a hashtable version
3940
3941         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
3942         we always end up concating a string. This results in a huge perf
3943         loss, because many strings have to be tracked by the GC. In this
3944         patch, we first use a hashtable that works with two keys, so that
3945         the strings do not need to be concat'ed.
3946
3947         Bootstrap times:
3948         BEFORE
3949                 Run 1:   8.74 seconds
3950                 Run 2:   8.71 seconds
3951
3952         AFTER
3953                 Run 1:   8.65 seconds
3954                 Run 2:   8.56 seconds
3955
3956 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
3957
3958         * Makefile: Add a new target `do-time' that does a quick and simple
3959         profile, leaving easy to parse output.
3960
3961 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
3962
3963         * codegen.cs (Init): Create the dynamic assembly with 
3964         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
3965
3966 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
3967
3968         * support.cs: Make the PtrHashtable use only one
3969         instance of its comparer.
3970
3971 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
3972
3973         * typemanager.cs: Fix lookup of GetNamespaces.
3974
3975 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
3976
3977         * expression.cs: Removed redundant line.
3978
3979         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
3980         ArrayLists, use for loops with bounds.  
3981
3982         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
3983         arraylist.
3984
3985         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
3986         arraylists, use for loop with bounds.
3987
3988         The above three changes give us a 0.071 second performance
3989         improvement out of 3.294 seconds down to 3.223.  On my machine
3990         the above changes reduced the memory usage by 1,387 KB during
3991         compiler bootstrap.
3992
3993         * cs-parser.jay (QualifiedIdentifier): New class used to represent
3994         QualifiedIdentifiers.  Before we created a new string through
3995         concatenation, and mostly later on, the result would be
3996         manipulated by DecomposeQI through string manipulation.
3997
3998         This reduced the compiler memory usage for bootstrapping from
3999         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
4000         compile times in 0.05 seconds.
4001
4002 2003-11-28  Dick Porter  <dick@ximian.com>
4003
4004         * support.cs: Do string compares with the Invariant culture.
4005
4006         * rootcontext.cs: 
4007         * gen-treedump.cs: 
4008         * expression.cs: 
4009         * driver.cs: 
4010         * decl.cs: 
4011         * codegen.cs: 
4012         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
4013         the comparison is done with the Invariant culture.
4014
4015 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
4016
4017         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
4018         GetEnumerator method.
4019
4020         (ProbeCollectionType): Iterate starting at the most specific type
4021         upwards looking for a GetEnumerator
4022
4023         * expression.cs: Shift count can be up to 31 for int/uint and 63
4024         for long/ulong.
4025
4026 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
4027
4028         * statement.cs (Block.LookupLabel): Also look for the label on the
4029         children blocks.  Use a hash table to keep track of visited
4030         nodes. 
4031
4032         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
4033         we actually did transform the other operand, otherwise fall back
4034         to the common codepath that casts to long.
4035
4036         * cs-tokenizer.cs: Use the same code pattern as the int case.
4037         Maybe I should do the parsing myself, and avoid depending on the
4038         Parse routines to get this done.
4039
4040 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
4041
4042         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
4043         which fixes bug 51347.  This time test it.
4044
4045         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
4046         attributes for example can not tell the difference between these.
4047         The difference was only a syntax feature of the language. 
4048
4049         * attribute.cs: Apply attributes to delegates.
4050
4051         * delegate.cs: Call the apply attributes method.
4052
4053 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
4054
4055         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
4056         comparing 0 vs Byte.MinValue, not the value
4057
4058         (ImplicitConversionRequired): When reporting a conversion error,
4059         use error 31 to print out the constant error instead of the
4060         simpler 29.
4061
4062         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
4063         which fixes bug 51347.
4064
4065 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
4066
4067         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
4068         which fixes the -warnaserror command line option.
4069
4070 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
4071
4072         * cfold.cs (DoNumericPromotions): During constant folding of
4073         additions on UIntConstant, special case intconstants with
4074         IntConstants like we do on the expression binary operator. 
4075
4076 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
4077
4078         * convert.cs (ImplicitReferenceConversion): We were missing a case
4079         (System.Enum are not value types or class types, so we need to
4080         classify them separatedly).
4081
4082         * driver.cs: We do not support error 2007.
4083
4084 2003-11-12 Jackson Harper <jackson@ximian.com>
4085
4086         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
4087         system directory. Also use the full file name so users can
4088         libraries names mscorlib-o-tron.dll in a non system dir.
4089
4090 2003-11-10  Martin Baulig  <martin@ximian.com>
4091
4092         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
4093         (TypeManager.InitCoreTypes): Initialize them here, but instead of
4094         calling `ResolveType()' on them, directly assign their `Type'.
4095
4096 2003-11-08  Martin Baulig  <martin@ximian.com>
4097
4098         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
4099         return value and the `out parent' parameter.
4100         (TypeContainer.DefineType): Moved the CS0644 check into
4101         GetClassBases().  Don't pass the interface types to the
4102         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
4103         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
4104
4105         * ecore.cs (TypeExpr.IsAttribute): New property.
4106         (TypeExpr.GetInterfaces): New method.
4107
4108         * interface.cs (Interface.GetInterfaceTypeByName): Return a
4109         TypeExpr instead of a Type.
4110         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
4111         (Interface.DefineType): Don't pass the interface types to the
4112         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
4113         them later and then call `TypeBulider.AddInterfaceImplementation()'.
4114
4115         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
4116         instead of a `Type[]'.
4117         (TypeManager.RegisterBuilder): Likewise.
4118         (TypeManager.AddUserInterface): Likewise.
4119         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
4120         `Type[]' and also return a `TypeExpr[]'.
4121         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
4122
4123 2003-11-08  Martin Baulig  <martin@ximian.com>
4124
4125         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
4126         Expression.     
4127
4128 2003-11-08  Martin Baulig  <martin@ximian.com>
4129
4130         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
4131         TypeManager.ResolveExpressionTypes().
4132
4133         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
4134         instead of an Expression.
4135         (TypeExpr): This is now an abstract base class for `TypeExpression'.
4136         (TypeExpression): New public class; formerly known as `TypeExpr'.
4137
4138         * expression.cs (ComposedCast): Derive from TypeExpr.
4139
4140         * typemanager.cs (TypeManager.system_*_expr): These are now
4141         TypExpr's instead of Expression's.
4142         (TypeManager.ResolveExpressionTypes): New public static function;
4143         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
4144         of them.        
4145
4146 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
4147
4148         * expression.cs (New.DoResolve): Do not dereference value that
4149         might be a null return.
4150
4151         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
4152         sure that the constant value has the right type.  Fixes an
4153         unreported bug, similar to 50425.
4154
4155         * const.cs (Const.LookupConstantValue): Call
4156         ImplicitStandardConversionExists before doing a conversion to
4157         avoid havng the TypeManager.ChangeType do conversions.
4158
4159         Reduced the number of casts used
4160
4161         (Const.ChangeType): New routine to enable reuse of the constant
4162         type changing code from statement.
4163
4164         * typemanager.cs (ChangeType): Move common initialization to
4165         static global variables.
4166
4167         Fixes #50425.
4168
4169         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
4170         every value type to go through, even if it was void.  Fix that. 
4171
4172         * cs-tokenizer.cs: Use is_identifier_start_character on the start
4173         character of the define, and the is_identifier_part_character for
4174         the rest of the string.
4175
4176 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
4177
4178         * expression.cs (UnaryMutator.EmitCode): When I updated
4179         LocalVariableReference.DoResolve, I overdid it, and dropped an
4180         optimization done on local variable references.
4181
4182 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
4183
4184         * ecore.cs: Convert the return from Ldlen into an int.
4185
4186 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
4187
4188         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
4189         the accessibility, this is a special case for toplevel non-public
4190         classes (internal for instance).
4191
4192 2003-10-20  Nick Drochak <ndrochak@gol.com>
4193
4194         * ecore.cs: Fix typo and build.  Needed another right paren.
4195
4196 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
4197
4198         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
4199         `internal' case regular and protected, but not allowing protected
4200         to be evaluated later.  Bug 49840
4201
4202 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
4203
4204         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
4205         to kb.Nlast, and not the kb.nFirst to isolate the switch
4206         statement.
4207
4208         Extract the underlying type, so enumerations of long/ulong are
4209         treated like long/ulong.
4210
4211 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
4212
4213         * expression.cs (New): Overload the meaning of RequestedType to
4214         track the possible creation of the NewDelegate type, since
4215         DoResolve is invoked more than once for new constructors on field
4216         initialization.
4217
4218         See bugs: #48800 and #37014
4219
4220         * cs-parser.jay (declare_local_constants): Take an arraylist
4221         instead of a single constant.
4222
4223         (local_constant_declaration): It should take a
4224         constant_declarators, not a constant_declarator.  Fixes 49487
4225
4226         * convert.cs: Fix error report.
4227
4228 2003-10-13 Jackson Harper <jackson@ximian.com>
4229
4230         * typemanager.cs (TypeToCoreType): Add float and double this fixes
4231         bug #49611
4232
4233 2003-10-09  Martin Baulig  <martin@ximian.com>
4234
4235         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
4236         to the .ctor.
4237         (MethodCore.DoDefineParameters): Removed the TypeContainer
4238         argument; use the DeclSpace which was passed to the .ctor instead.
4239         (MethodCore.CheckParameter): Take a DeclSpace instead of a
4240         TypeContainer; we only need a DeclSpace here.
4241
4242 2003-10-09  Martin Baulig  <martin@ximian.com>
4243
4244         * class.cs (MethodData): Added additional `DeclSpace ds' argument
4245         to the .ctor.
4246         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
4247         EmitContext's .ctor.    
4248
4249 2003-10-09  Martin Baulig  <martin@ximian.com>
4250
4251         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
4252         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
4253         AsAccessible(), moved them as well.
4254
4255         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
4256
4257 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
4258
4259         * cs-parser.jay : Renamed yyName to yyNames related to jay.
4260
4261 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
4262
4263         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
4264         generation for >=, as spotted by Paolo, bug 48679.  
4265         Patch from David Waite.
4266
4267         * cs-tokenizer.cs: Add handling for #pragma.
4268
4269         * cs-parser.jay: Allow for both yield and yield return in the
4270         syntax.  The anti-cobolization of C# fight will go on!
4271
4272         * class.cs (TypeBuilder.DefineType): Catch error condition here
4273         (Parent.DefineType erroring out and returning null).
4274
4275         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
4276         coping with enumerations variables, we were mistakenly processing
4277         them as a regular value type instead of built-in types.  Fixes the
4278         bug #48063
4279
4280         * typemanager.cs (IsBuiltinOrEnum): New method.
4281
4282 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
4283
4284         * cs-parser.jay: Upgrade: yield now needs the return clause.
4285
4286 2003-09-19  Martin Baulig  <martin@ximian.com>
4287
4288         * decl.cs (MemberCache.SetupCacheForInterface): Take a
4289         `MemberCache parent' argument.  Normally, an interface doesn't
4290         have a parent type except System.Object, but we use this in gmcs
4291         for generic type parameters.
4292
4293 2003-09-18  Martin Baulig  <martin@ximian.com>
4294
4295         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
4296         on `type.IsInterface'; don't check whether the type has a parent
4297         to determine whether it's an interface.
4298
4299 2003-09-15  Martin Baulig  <martin@ximian.com>
4300
4301         * class.cs (TypeContainer.DefineType): Added an error flag to
4302         avoid reporting duplicate CS0146's ("class definition is
4303         circular.").
4304
4305         * driver.cs (Driver.MainDriver): Abort if
4306         RootContext.ResolveTree() reported any errors.
4307
4308 2003-09-07  Martin Baulig  <martin@ximian.com>
4309
4310         * report.cs (Error, Warning): Added overloaded versions which take
4311         a `params object[] args' and call String.Format().
4312
4313 2003-09-07  Martin Baulig  <martin@ximian.com>
4314
4315         * decl.cs (DeclSpace..ctor): Don't call
4316         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
4317         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
4318         (DeclSpace.RecordDecl): New method.
4319
4320         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
4321
4322 2003-09-02  Ravi Pratap  <ravi@ximian.com>
4323
4324         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
4325         value attributes to be applied to ParameterBuilders.
4326
4327         * class.cs (MethodCore.LabelParameters): Make static and more
4328         generic so that it can be used from other places - like interface
4329         methods, for instance.
4330
4331         * interface.cs (Interface.Emit): Call LabelParameters before
4332         emitting attributes on the InterfaceMethod.
4333
4334 2003-08-26  Martin Baulig  <martin@ximian.com>
4335
4336         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
4337         resolving aliases; fixes #47927.
4338
4339 2003-08-26  Martin Baulig  <martin@ximian.com>
4340
4341         * statement.cs (Using.DoResolve): This is internally emitting a
4342         try/finally clause, so we need to set ec.NeedExplicitReturn if we
4343         do not always return.  Fixes #47681.
4344
4345 2003-08-26  Martin Baulig  <martin@ximian.com>
4346
4347         * decl.cs (MemberCore): Moved WarningNotHiding(),
4348         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
4349         into MemberBase.
4350         (AdditionResult): Make this nested in DeclSpace.
4351         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
4352         argument; call NamespaceEntry.Define() unless we're nested in a
4353         class or struct.
4354
4355         * namespace.cs (Namespace.DefineName): New public function.  This
4356         is called from DeclSpace's .ctor to add 
4357         (Namespace.Lookup): Include DeclSpaces in the lookup.
4358
4359         * class.cs (Operator): Derive from MemberBase, not MemberCore.
4360
4361         * const.cs (Const): Derive from MemberBase, not MemberCore.     
4362
4363 2003-08-25  Martin Baulig  <martin@ximian.com>
4364
4365         * convert.cs (Convert.ExplicitReferenceConversion): When
4366         converting from an interface type to a class, unbox if the target
4367         type is a struct type.  Fixes #47822.
4368
4369 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4370
4371         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
4372         #47854.
4373
4374 2003-08-22  Martin Baulig  <martin@ximian.com>
4375
4376         * class.cs (TypeManager.DefineType): When defining a nested type,
4377         call DefineType() on our parent; fixes #47801.
4378
4379 2003-08-22  Martin Baulig  <martin@ximian.com>
4380
4381         * class.cs (MethodData.Define): While checking if a method is an
4382         interface implementation, improve the test a bit more to fix #47654.
4383
4384 2003-08-22  Martin Baulig  <martin@ximian.com>
4385
4386         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
4387         correctly; fixes #47722.
4388
4389 2003-08-22  Martin Baulig  <martin@ximian.com>
4390
4391         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
4392         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
4393
4394         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
4395
4396 2003-08-22  Martin Baulig  <martin@ximian.com>
4397
4398         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
4399         can only be assigned in static constructors.  Fixes #47161.
4400
4401 2003-08-22  Martin Baulig  <martin@ximian.com>
4402
4403         Rewrote and improved the flow analysis code.
4404
4405         * flowbranching.cs (FlowBranching): Make this class abstract.
4406         (FlowBranching.CreateBranching): New static function to create a
4407         new flow branching.
4408         (FlowBranchingBlock, FlowBranchingException): New classes.
4409         (FlowBranching.UsageVector.Type): New public readonly field.
4410         (FlowBranching.UsageVector.Breaks): Removed the setter.
4411         (FlowBranching.UsageVector.Returns): Removed the setter.
4412         (FlowBranching.UsageVector): Added Break(), Return(),
4413         NeverReachable() and Throw() methods to modify the reachability.
4414         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
4415         done by FlowBranching.Merge().
4416         (FlowBranching.UsageVector.MergeChild): New method; merges the
4417         merge result into the current vector.
4418         (FlowBranching.Merge): New abstract method to merge a branching.
4419
4420 2003-08-12  Martin Baulig  <martin@ximian.com>
4421
4422         * expression.cs (Indirection.CacheTemporaries): Create the
4423         LocalTemporary with the pointer type, not its element type.
4424
4425 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
4426
4427         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
4428         token was a keyword or not.
4429
4430         Add `error' options where an IDENTIFIER was expected;  Provide
4431         CheckToken and CheckIdentifierToken convenience error reporting
4432         functions. 
4433
4434         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
4435
4436         * decl.cs: Rename `NamespaceEntry Namespace' public field into
4437         NameSpaceEntry NameSpaceEntry.
4438
4439         (LookupInterfaceOrClass): Avoid creating a full qualified name
4440         from namespace and name: avoid doing lookups when we know the
4441         namespace is non-existant.   Use new Tree.LookupByNamespace which
4442         looks up DeclSpaces based on their namespace, name pair.
4443
4444         * driver.cs: Provide a new `parser verbose' to display the
4445         exception thrown during parsing.  This is turned off by default
4446         now, so the output of a failure from mcs is more graceful.
4447
4448         * namespace.cs: Track all the namespaces defined in a hashtable
4449         for quick lookup.
4450
4451         (IsNamespace): New method
4452
4453 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
4454
4455         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
4456         we know that we need to concatenate (full typename can never be
4457         null). 
4458
4459         * class.cs: ditto.
4460
4461         * statement.cs: Use a bitfield;  Do not initialize to null things
4462         which are done by the constructor by default.
4463
4464         * cs-parser.jay: bug fix, parameter was 4, not 3.
4465
4466         * expression.cs: Just use the property;
4467
4468         * statement.cs: No need for GetVariableInfo method.
4469
4470 2003-08-08  Martin Baulig  <martin@ximian.com>
4471
4472         * flowanalysis.cs (FlowReturns): This is now nested in the
4473         `FlowBranching' class.
4474         (MyBitVector): Moved this here from statement.cs.
4475         (FlowBranching.SiblingType): New enum type.
4476         (FlowBranching.CreateSibling): Added `SiblingType' argument.
4477
4478 2003-08-07  Martin Baulig  <martin@ximian.com>
4479
4480         * flowanalysis.cs (FlowBranchingType): This is now nested in the
4481         `FlowBranching' class and called `BranchingType'.
4482
4483 2003-08-07  Martin Baulig  <martin@ximian.com>
4484
4485         * flowanalysis.cs: Moved all the control flow analysis code into
4486         its own file.
4487
4488 2003-08-07  Martin Baulig  <martin@ximian.com>
4489
4490         * assign.cs (Assign.DoResolve): `target' must either be an
4491         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
4492         #37319.
4493
4494 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
4495
4496         * expression.cs (BinaryMethod): This kind of expression is created by the
4497         Binary class if it determines that the operator has to be handled
4498         by a method.
4499
4500         (BinaryDelegate): This kind of expression is created if we are
4501         dealing with a + or - operator on delegates.
4502
4503         (Binary): remove method, argumetns, and DelegateOperator: when
4504         dealing with methods, 
4505
4506         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
4507
4508         * statement.cs (Block): use bitfields for the three extra booleans
4509         we had in use.   Remove unused topblock parameter.
4510
4511         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
4512
4513         * assign.cs: Drop extra unneeded tests.
4514
4515 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
4516
4517         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
4518
4519         * statement.cs (Foreach): Use VariableStorage instead of
4520         LocalBuilders.   
4521
4522         * codegen.cs (VariableStorage): New class used by clients that
4523         require a variable stored: locals or fields for variables that
4524         need to live across yield.
4525
4526         Maybe provide a convenience api for EmitThis+EmitLoad?
4527
4528         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
4529         these bad boys.
4530
4531 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
4532
4533         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
4534         RemapParameterLValue): New methods that are used to turn a
4535         precomputed FieldInfo into an expression like this:
4536
4537                 instance.FieldInfo
4538
4539         The idea is to use this instead of making LocalVariableReference
4540         have more than one meaning.
4541
4542         * cs-parser.jay: Add error production to BASE.
4543
4544         * ecore.cs: Deal with TypeManager.GetField returning null, which
4545         is now a valid return value.
4546
4547         (FieldExprNoAddress): New expression for Fields whose address can
4548         not be taken.
4549
4550         * expression.cs (LocalVariableReference): During the resolve
4551         phases, create new expressions if we are in a remapping context.
4552         Remove code that dealt with remapping here.
4553
4554         (ParameterReference): same.
4555
4556         (ProxyInstance): New expression, like the `This' expression, but
4557         it is born fully resolved.  We know what we are doing, so remove
4558         the errors that are targeted to user-provided uses of `this'.
4559
4560         * statement.cs (Foreach): our variable is now stored as an
4561         Expression;  During resolution, follow the protocol, dont just
4562         assume it will return this.
4563
4564 2003-08-06  Martin Baulig  <martin@ximian.com>
4565
4566         * support.cs (SeekableStreamReader.cs): New public class.
4567
4568         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
4569         SeekableStreamReader instead of the normal StreamReader.
4570
4571 2003-08-04  Martin Baulig  <martin@ximian.com>
4572
4573         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
4574         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
4575         deambiguate casts and delegate invocations.
4576         (parenthesized_expression): Use the new tokens to ensure this is
4577         not a cast of method invocation.
4578
4579         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
4580         when reading a `)' and Deambiguate_CloseParens () was previously
4581         called.
4582
4583         * expression.cs (ParenthesizedExpression): New class.  This is
4584         just used for the CS0075 test.
4585         (Binary.DoResolve): Check for CS0075.   
4586
4587 2003-07-29  Ravi Pratap  <ravi@ximian.com>
4588
4589         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
4590         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
4591         reference comparison.
4592
4593         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
4594         examine the ReturnType for equality - this is necessary in the
4595         cases of implicit and explicit operators whose signature also
4596         includes the return type.
4597
4598 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
4599
4600         * namespace.cs: Cache the result of the namespace computation,
4601         instead of computing it every time.
4602
4603 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
4604
4605         * decl.cs: Use a global arraylist that we reuse over invocations
4606         to avoid excesive memory consumption.  Reduces memory usage on an
4607         mcs compile by one meg (45 average).
4608
4609         * typemanager.cs (LookupTypeReflection): In .NET pointers are
4610         private, work around that.
4611
4612 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
4613
4614         * literal.cs (IntLiteral): Define Zero and One static literals. 
4615
4616         * cs-parser.jay (integer_literal): use static literals to reduce
4617         memory usage for the most used literals (0, 1 and -1).  211kb
4618         reduced in memory usage.
4619
4620         Replace all calls to `new ArrayList' with `new
4621         ArrayList(4)' which is a good average number for most allocations,
4622         and also requires only 16 bytes of memory for its buffer by
4623         default. 
4624
4625         This reduced MCS memory usage in seven megabytes for the RSS after
4626         bootstrapping.
4627
4628 2003-07-28  Ravi Pratap  <ravi@ximian.com>
4629
4630         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
4631         handle params methods the correct way by forming only one
4632         applicable set with params and normal methods in them. Earlier we
4633         were looking at params methods only if we found no normal methods
4634         which was not the correct thing to do.
4635
4636         (Invocation.BetterFunction): Take separate arguments indicating
4637         when candidate and the best method are params methods in their
4638         expanded form.
4639
4640         This fixes bugs #43367 and #46199.
4641
4642         * attribute.cs: Documentation updates.
4643
4644         (CheckAttribute): Rename to CheckAttributeTarget.
4645         (GetValidPlaces): Rename to GetValidTargets.
4646
4647         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
4648         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
4649
4650         Fixes bug #44468.
4651
4652 2003-07-28  Martin Baulig  <martin@ximian.com>
4653
4654         * class.cs (TypeContainer.DefineMembers): Use the base type's full
4655         name when looking up the base class of a nested class.  Fixes #46977.
4656
4657 2003-07-26  Martin Baulig  <martin@ximian.com>
4658
4659         * expression.cs (Indexers.Indexer): New nested struct; contains
4660         getter, setter and the indexer's type.
4661         (Indexers.Properties): This is now an ArrayList of
4662         Indexers.Indexer's.
4663         (IndexerAccess.DoResolveLValue): Correctly set the type if the
4664         indexer doesn't have any getters.
4665
4666         * assign.cs (Assign.DoResolve): Also do the implicit conversions
4667         for embedded property and indexer assignments.
4668
4669 2003-07-26  Martin Baulig  <martin@ximian.com>
4670
4671         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
4672         preprocessor directive is not the first non-whitespace character
4673         on a line.
4674
4675 2003-07-26  Martin Baulig  <martin@ximian.com>
4676
4677         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
4678         namespace parsing, follow the spec more closely.
4679
4680         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
4681         NamespaceEntry.Lookup().
4682
4683 2003-07-25  Martin Baulig  <martin@ximian.com>
4684
4685         * MethodCore.cs (OverridesSomething): New public field; it's set
4686         from TypeContainer.DefineMembers if this method overrides
4687         something (which doesn't need to be a method).  Fix #39462.
4688
4689 2003-07-25  Ravi Pratap  <ravi@ximian.com>
4690
4691         * typemanager.cs (GetMembers): Ensure that the list of members is
4692         reversed. This keeps things in sync.
4693
4694         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
4695         find an AttributeUsage attribute.
4696
4697         * expression.cs (Invocation.OverloadResolve): Perform the check
4698         which disallows Invoke to be directly called on a Delegate.
4699
4700         (Error_InvokeOnDelegate): Report error cs1533.
4701
4702 2003-07-25  Martin Baulig  <martin@ximian.com>
4703
4704         * expression.cs (Indexers.GetIndexersForType): Only look in the
4705         interface hierarchy if the requested type is already an
4706         interface.  Fixes #46788 while keeping #46502 fixed.
4707
4708 2003-07-25  Martin Baulig  <martin@ximian.com>
4709
4710         * class.cs (TypeContainer.DefineMembers): Check whether all
4711         readonly fields have been assigned and report warning CS0649 if
4712         not.
4713
4714         * statement.cs (LocalInfo.IsFixed): Always return true if this is
4715         a valuetype.
4716
4717 2003-07-24  Ravi Pratap  <ravi@ximian.com>
4718
4719         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
4720         returned from GetMethods to make things consistent with the
4721         assumptions MCS makes about ordering of methods.
4722
4723         This should comprehensively fix bug #45127 and it does :-)
4724
4725         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
4726         ordering is actually reverse.
4727
4728         * Clean up some debug messages I left lying around.
4729
4730         * interface.cs (Populate*): Get rid of code which emits attributes
4731         since the stage in which we emit attributes is the 'Emit' stage,
4732         not the define stage.
4733
4734         (Emit): Move attribute emission for interface members here.
4735
4736 2003-07-22  Ravi Pratap  <ravi@ximian.com>
4737
4738         * expression.cs (Invocation.OverloadResolve): Follow the spec more
4739         closely: we eliminate methods in base types when we have an
4740         applicable method in a top-level type.
4741
4742         Please see section 14.5.5.1 for an exact description of what goes
4743         on. 
4744
4745         This fixes bug #45127 and a host of other related to corlib compilation.
4746
4747         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
4748         array is the method corresponding to the top-level type (this is
4749         because of the changes made to icall.c) so we change this
4750         accordingly.
4751
4752         (MethodGroupExpr.Name): This too.
4753
4754         * typemanager.cs (GetElementType): New method which does the right
4755         thing when compiling corlib. 
4756
4757         * everywhere: Make use of the above in the relevant places.
4758
4759 2003-07-22  Martin Baulig  <martin@ximian.com>
4760
4761         * cs-parser.jay (invocation_expression): Moved
4762         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
4763         `cast_expression', but create a InvocationOrCast which later
4764         resolves to either an Invocation or a Cast.
4765
4766         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
4767         method; call this before EmitStatement() to make sure that this
4768         expression can be used as a statement.
4769
4770         * expression.cs (InvocationOrCast): New class; resolves to either
4771         an Invocation or a Cast.
4772
4773         * statement.cs (StatementExpression): Call ResolveStatement() on
4774         the ExpressionStatement before emitting it.
4775
4776 2003-07-21  Martin Baulig  <martin@ximian.com>
4777
4778         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
4779         `ref' and `out' attributes match; fixes #46220.
4780         (MemberAccess.ResolveMemberAccess): You can't reference a type
4781         through an expression; fixes #33180.
4782         (Indexers.GetIndexersForType): Don't return the indexers from
4783         interfaces the class implements; fixes #46502.
4784
4785 2003-07-21  Martin Baulig  <martin@ximian.com>
4786
4787         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
4788         CS0661 checks; fixes bug #30442.
4789
4790 2003-07-21  Martin Baulig  <martin@ximian.com>
4791
4792         * decl.cs (AdditionResult): Added `Error'.
4793
4794         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
4795
4796         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
4797         makes cs0031.cs actually work.
4798
4799 2003-07-20  Martin Baulig  <martin@ximian.com>
4800
4801         * namespace.cs: Fixed that bug which caused a crash when compiling
4802         the debugger's GUI.
4803
4804 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
4805
4806         * typemanager.cs (LookupTypeReflection): Never expose types which
4807         are NotPublic, NestedPrivate, NestedAssembly, or
4808         NestedFamANDAssem.  We used to return these, and later do a check
4809         that would report a meaningful error, but the problem is that we
4810         would not get the real match, if there was a name override.
4811
4812 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
4813
4814         * namespace.cs (Namespace, Name): Do not compute the namespace
4815         name dynamically, compute it in the constructor.  This reduced
4816         memory usage by 1697 KB.
4817
4818         * driver.cs: Use --pause to pause at the end.
4819
4820 2003-07-17  Peter Williams  <peter@newton.cx>
4821
4822         * Makefile: Change the name of the test target so that it doesn't
4823         conflict with the recursive test target.
4824
4825 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
4826
4827         * expression.cs (LocalVariableReference.Emit, EmitAssign,
4828         AddressOf): Do not use EmitThis, that was wrong, use the actual
4829         this pointer.
4830
4831 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
4832
4833         * class.cs (MethodData.Define): While checking if a method is an
4834         interface implementation, improve the test: If we are not public
4835         (use new test here: use the computed MethodAttributes directly,
4836         instead of the parsed modifier flags) check if the `implementing'
4837         method comes from an interface or not.
4838
4839         * pending.cs (VerifyPendingMethods): Slightly better error
4840         message.
4841
4842         * makefile: add test target that does the mcs bootstrap.
4843
4844 2003-07-16  Ravi Pratap  <ravi@ximian.com>
4845
4846         * interface.cs (Define): Do nothing here since there are no
4847         members to populate etc. Move the attribute emission out of here
4848         since this was just totally the wrong place to put it. Attribute
4849         application happens during the 'Emit' phase, not in the 'Define'
4850         phase.
4851
4852         (Emit): Add this method and move the attribute emission here
4853
4854         * rootcontext.cs (EmitCode): Call the Emit method on interface
4855         types too.
4856
4857 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
4858
4859         * expression.cs (OverloadResolve): Report error only if Location
4860         is not 'Null' which means that there was a probe going on.
4861
4862 2003-07-14  Martin Baulig  <martin@ximian.com>
4863
4864         * expression.cs (ConditionalLogicalOperator): New public class to
4865         implement user defined conditional logical operators.
4866         This is section 14.11.2 in the spec and bug #40505.
4867
4868 2003-07-14  Martin Baulig  <martin@ximian.com>
4869
4870         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
4871
4872 2003-07-14  Martin Baulig  <martin@ximian.com>
4873
4874         * codegen.cs (EmitContext.InFixedInitializer): New public field.
4875
4876         * ecore.cs (IVariable.VerifyFixed): New interface method.
4877
4878         * expression.cs (Unary.ResolveOperator): When resolving the `&'
4879         operator, check whether the variable is actually fixed.  Fixes bug
4880         #36055.  Set a variable definitely assigned when taking its
4881         address as required by the spec.
4882
4883         * statement.cs (LocalInfo.IsFixed): New field.
4884         (LocalInfo.MakePinned): Set `IsFixed' to true.
4885
4886 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
4887
4888         * attribute.cs (Attribute.Resolve): While doing a Member lookup
4889         for .ctors, ensure that we only ask for members declared in the
4890         attribute type (BindingFlags.DeclaredOnly).
4891
4892         Fixes bug #43632.
4893
4894         * expression.cs (Error_WrongNumArguments): Report error 1501
4895         correctly the way CSC does.
4896
4897 2003-07-13  Martin Baulig  <martin@ximian.com>
4898
4899         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
4900         lookup on the fully qualified name, to make things like "X.X" work
4901         where "X.X" is a fully qualified type name, but we also have a
4902         namespace "X" in the using list.  Fixes #41975.
4903
4904 2003-07-13  Martin Baulig  <martin@ximian.com>
4905
4906         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
4907         function. If we're a CompoundAssign, we need to create an embedded
4908         CompoundAssign, not an embedded Assign.
4909         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
4910         Fixes #45854.
4911
4912 2003-07-13  Martin Baulig  <martin@ximian.com>
4913
4914         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
4915         work to fix bug #46088.
4916
4917 2003-07-13  Ravi Pratap <ravi@ximian.com>
4918
4919         * class.cs (Operator.Emit): Do not emit attributes here - it is
4920         taken care of by the Method class that we delegate too. This takes
4921         care of bug #45876.
4922
4923 2003-07-10  Martin Baulig  <martin@ximian.com>
4924
4925         * expression.cs (TypeOfVoid): New class.
4926         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
4927
4928 2003-07-10  Martin Baulig  <martin@ximian.com>
4929
4930         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
4931         bug #35957.
4932
4933 2003-07-10  Martin Baulig  <martin@ximian.com>
4934
4935         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
4936         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
4937
4938         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
4939
4940         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
4941
4942 2003-07-10  Martin Baulig  <martin@ximian.com>
4943
4944         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
4945         of decimal.  Fixes #42850.
4946
4947         NOTE: I also fixed the created byte blob, but this doesn't work on
4948         the MS runtime and csc never produces any byte blobs for decimal
4949         arrays.
4950
4951 2003-07-10  Martin Baulig  <martin@ximian.com>
4952
4953         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
4954         structs; fixes #32068.
4955         (Block.AddChildVariableNames): Fixed #44302.
4956
4957 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4958
4959         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
4960
4961 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
4962
4963         * attribute.cs: And this test is onger needed.
4964
4965 2003-07-08  Martin Baulig  <martin@ximian.com>
4966
4967         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
4968         inaccessible types.  Fixes #36313.
4969
4970         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
4971
4972         * namespace.cs (NamespaceEntry): Create implicit entries for all
4973         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
4974         implicit entries for N1.N2 and N1.
4975
4976 2003-07-08  Martin Baulig  <martin@ximian.com>
4977
4978         Rewrote the handling of namespaces to fix a lot of the issues
4979         wrt. `using' aliases etc.
4980
4981         * namespace.cs (Namespace): Splitted this class into a
4982         per-assembly `Namespace' and a per-file `NamespaceEntry'.
4983
4984         * typemanager.cs (TypeManager.IsNamespace): Removed.
4985         (TypeManager.ComputeNamespaces): Only compute namespaces from
4986         loaded assemblies here, not the namespaces from the assembly we're
4987         currently compiling.
4988
4989 2003-07-08  Martin Baulig  <martin@ximian.com>
4990
4991         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
4992
4993 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
4994
4995         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
4996         already fixed it.  
4997
4998         I thought about the memory savings here, but LookupTypeReflection
4999         is used under already very constrained scenarios.  Compiling
5000         corlib or mcs only exposes one hit, so it would not really reduce
5001         any memory consumption.
5002
5003 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5004
5005         * typemanager.cs: fixes bug #45889 by only adding public types from
5006         other assemblies to the list of known types.
5007
5008 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
5009
5010         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
5011         on the type we resolved.
5012
5013 2003-07-05  Martin Baulig  <martin@ximian.com>
5014
5015         * pending.cs (PendingImplementation.ParentImplements): Don't
5016         create the proxy if the parent is abstract.
5017
5018         * class.cs (TypeContainer.DefineIndexers): Process explicit
5019         interface implementations first.  Fixes #37714.
5020
5021 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
5022
5023         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
5024         defined recursively;  but since we modify the input parameters
5025         (left is set to `this' temporarily), we reset this value if the
5026         left_is_explicit is false, which gives the original semantics to
5027         the code.  
5028
5029         * literal.cs (NullPointer): new class used to represent a null
5030         literal in a pointer context.
5031
5032         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
5033         type is a pointer, use a NullPointer object instead of a
5034         NullLiteral.   Closes 43687
5035
5036         (ExplicitConversion): Convert pointer values using
5037         the conv opcode to the proper type.
5038
5039         * ecore.cs (New): change ValueTypeVariable property into a method,
5040         that returns whether the valuetype is suitable for being used.
5041
5042         * expression.cs (Binary.DoNumericPromotions): Only return if we
5043         the int constant was a valid uint, and we can return both left and
5044         right as uints.  If not, we continue processing, to trigger the
5045         type conversion.  This fixes 39018.
5046
5047         * statement.cs (Block.EmitMeta): During constant resolution, set
5048         the CurrentBlock property on the emitcontext, so that we resolve
5049         constants propertly.
5050
5051 2003-07-02  Martin Baulig  <martin@ximian.com>
5052
5053         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
5054         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
5055
5056         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
5057         than emitting it here.
5058
5059         * statement.cs: Fixed some more flow analysis bugs.
5060
5061 2003-07-02  Martin Baulig  <martin@ximian.com>
5062
5063         * class.cs (MethodData.Define): When implementing interface
5064         methods, set Final unless we're Virtual.
5065
5066         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
5067         check work for interface methods.
5068
5069 2003-07-01  Martin Baulig  <martin@ximian.com>
5070
5071         * ecore.cs (EmitContext.This): Replaced this property with a
5072         GetThis() method which takes a Location argument.  This ensures
5073         that we get the correct error location for a CS0188.
5074
5075 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
5076
5077         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
5078         ImplicitStandardConversion.
5079
5080         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
5081
5082 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
5083
5084         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
5085         optimization.
5086
5087 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
5088
5089         * class.cs (Constructor.Define): Turn off initlocals for unsafe
5090         constructors.
5091
5092         (MethodData.Define): Turn off initlocals for unsafe methods.
5093
5094 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
5095
5096         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
5097         complete;  Fixes #37521.
5098
5099         * delegate.cs: Use Modifiers.TypeAttr to compute the
5100         TypeAttributes, instead of rolling our own.  This makes the flags
5101         correct for the delegates.
5102
5103 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
5104
5105         * class.cs (Constructor.Define): Set the private flag for static
5106         constructors as well.
5107
5108         * cs-parser.jay (statement_expression): Set the return value to
5109         null, to avoid a crash when we catch an error.
5110
5111 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
5112
5113         * cs-parser.jay: Applied patch from Jackson that adds support for
5114         extern and unsafe modifiers to destructor declarations.
5115
5116         * expression.cs: Report error 21 if the user is trying to index a
5117         System.Array.
5118
5119         * driver.cs: Add an error message, suggested by the bug report.
5120
5121         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
5122         if we do not have a ": this ()" constructor initializer.  Fixes 45149
5123
5124 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
5125
5126         * namespace.cs: Add some information to reduce FAQs.
5127
5128 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
5129
5130         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
5131         underlying enumeration types.  Fixes #43915.
5132
5133         * expression.cs: Treat ushort/short as legal values to be used in
5134         bitwise operations.
5135
5136 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
5137
5138         * delegate.cs: transfer custom attributes for paramenters from
5139         the delegate declaration to Invoke and BeginInvoke.
5140
5141 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
5142
5143         * attribute.cs: handle custom marshalers and emit marshal info
5144         for fields, too.
5145
5146 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
5147
5148         * makefile.gnu: Added anonymous.cs to the compiler sources.
5149
5150 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
5151
5152         * iterators.cs: Change the name of the proxy class to include two
5153         underscores.
5154
5155         * cs-parser.jay: Update grammar to include anonymous methods.
5156
5157         * anonymous.cs: new file.
5158
5159 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
5160
5161         * class.cs (Field.Define): Add missing test for pointers and
5162         safety. 
5163
5164 2003-05-27  Ravi Pratap  <ravi@ximian.com>
5165
5166         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
5167         we use the stobj opcode.
5168
5169         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
5170         since it wasn't the correct fix. 
5171
5172         It still is puzzling that we are required to use stobj for IntPtr
5173         which seems to be a ValueType.
5174
5175 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
5176
5177         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
5178         during regular simple name resolution.   Now, the trick is that
5179         instead of returning for processing the simplename, we do a
5180         TypeManager.LookupType (ie, a rooted lookup as opposed to a
5181         contextual lookup type).   If a match is found, return that, if
5182         not, return for further composition.
5183
5184         This fixes long-standing 30485.
5185
5186         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
5187         using the address to initialize an object, do an Stobj instead of
5188         using the regular Stelem.
5189
5190         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
5191         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
5192         Because if we are a BaseIndexerAccess that value will be true.
5193         Fixes 43643.
5194
5195         * statement.cs (GotoCase.Resolve): Return after reporting an
5196         error, do not attempt to continue. 
5197
5198         * expression.cs (PointerArithmetic.Emit): If our operand is a
5199         long, convert our constants to match the operand before
5200         multiplying.  Convert to I type before adding.   Fixes 43670.
5201
5202 2003-05-14  Ravi Pratap  <ravi@ximian.com>
5203
5204         * enum.cs (ImplicitConversionExists) : Rename to
5205         ImplicitEnumConversionExists to remove ambiguity. 
5206
5207         * ecore.cs (NullCast): New type of cast expression class which
5208         basically is very similar to EmptyCast with the difference being
5209         it still is a constant since it is used only to cast a null to
5210         something else
5211         (eg. (string) null)
5212
5213         * convert.cs (ImplicitReferenceConversion): When casting a null
5214         literal, we return a NullCast.
5215
5216         * literal.cs (NullLiteralTyped): Remove - I don't see why this
5217         should be around anymore.
5218
5219         The renaming (reported was slightly wrong). Corrections:
5220
5221         ConvertImplicitStandard -> ImplicitConversionStandard
5222         ConvertExplicitStandard -> ExplicitConversionStandard
5223
5224         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
5225         before passing them in !
5226
5227         * convert.cs (ImplicitConversionStandard): When comparing for
5228         equal expr and target types, ensure that expr is not a
5229         NullLiteral.
5230
5231         In general, we must not be checking (expr_type ==
5232         target_type) in the top level conversion methods
5233         (ImplicitConversion, ExplicitConversion etc). This checking is
5234         done in the methods that they delegate to.
5235
5236 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
5237
5238         * convert.cs: Move Error_CannotConvertType,
5239         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
5240         ImplicitNumericConversion, ImplicitConversionExists,
5241         ImplicitUserConversionExists, StandardConversionExists,
5242         FindMostEncompassedType, FindMostSpecificSource,
5243         FindMostSpecificTarget, ImplicitUserConversion,
5244         ExplicitUserConversion, GetConversionOperators,
5245         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
5246         TryImplicitIntConversion, Error_CannotConvertImplicit,
5247         ConvertImplicitRequired, ConvertNumericExplicit,
5248         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
5249         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
5250         its own file.
5251
5252         Perform the following renames:
5253
5254         StandardConversionExists -> ImplicitStandardConversionExists
5255         ConvertImplicit -> ImplicitConversion
5256         ConvertImplicitStandard -> ImplicitStandardConversion
5257         TryImplicitIntConversion -> ImplicitIntConversion
5258         ConvertImplicitRequired -> ImplicitConversionRequired
5259         ConvertNumericExplicit -> ExplicitNumericConversion
5260         ConvertReferenceExplicit -> ExplicitReferenceConversion
5261         ConvertExplicit -> ExplicitConversion
5262         ConvertExplicitStandard -> ExplicitStandardConversion
5263
5264 2003-05-19  Martin Baulig  <martin@ximian.com>
5265
5266         * statement.cs (TypeInfo.StructInfo): Made this type protected.
5267         (TypeInfo): Added support for structs having structs as fields.
5268
5269         * ecore.cs (FieldExpr): Implement IVariable.
5270         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
5271         VariableInfo for the field.
5272
5273 2003-05-18  Martin Baulig  <martin@ximian.com>
5274
5275         * expression.cs (This.DoResolve): Report a CS0027 if we're
5276         emitting a field initializer.
5277
5278 2003-05-18  Martin Baulig  <martin@ximian.com>
5279
5280         * expression.cs (This.ResolveBase): New public function.
5281         (This.DoResolve): Check for CS0188.
5282
5283         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
5284         This.Resolve().
5285
5286         * ecore.cs (MethodGroupExpr.DoResolve): Set the
5287         `instance_expression' to null if we don't have any non-static
5288         methods.
5289
5290 2003-05-18  Martin Baulig  <martin@ximian.com>
5291
5292         Reworked the way how local variables and parameters are handled by
5293         the flow analysis code.
5294
5295         * statement.cs (TypeInfo, VariableMap): New public classes.
5296         (VariableInfo): New public class.  This is now responsible for
5297         checking whether a variable has been assigned.  It is used for
5298         parameters and local variables.
5299         (Block.EmitMeta): Take the InternalParameters as argument; compute
5300         the layout of the flow vectors here.
5301         (Block.LocalMap, Block.ParameterMap): New public properties.
5302         (FlowBranching): The .ctor doesn't get the InternalParameters
5303         anymore since Block.EmitMeta() now computes the layout of the flow
5304         vector.
5305         (MyStructInfo): This class is now known as `StructInfo' and nested
5306         in `TypeInfo'; we don't access this directly anymore.
5307
5308         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
5309         property and removed IsAssigned(), IsFieldAssigned(),
5310         SetAssigned() and SetFieldAssigned(); we now call them on the
5311         VariableInfo so we don't need to duplicate this code everywhere.
5312
5313         * expression.cs (ParameterReference): Added `Block block' argument
5314         to the .ctor.
5315         (LocalVariableReference, ParameterReference, This): The new
5316         VariableInfo class is now responsible for all the definite
5317         assignment stuff.
5318
5319         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
5320         IsParameterAssigned, SetParameterAssigned): Removed.
5321
5322 2003-05-18  Martin Baulig  <martin@ximian.com>
5323
5324         * typemanager.cs (InitCoreTypes): Try calling
5325         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
5326         the 3-args-version.  Corlib now also needs our `void_type'.
5327         (GetMethod): Added overloaded version which takes an optional
5328         `bool report_errors' to allow lookups of optional methods.
5329
5330 2003-05-12  Martin Baulig  <martin@ximian.com>
5331
5332         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
5333         only used for locals and not for parameters.
5334
5335 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
5336
5337         * support.cs (InternalParameters.ParameterType): Return the
5338         ExternalType of the parameter.
5339
5340         * parameter.cs (Parameter.ExternalType): drop the two arguments,
5341         they were unused.
5342
5343 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
5344
5345         * class.cs (MethodData.Define): Do not set the `newslot' on
5346         interface members, if they are also flagged as "override".
5347
5348         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
5349         better code for ++i and i++.  This only works for static fields
5350         and local variables.
5351
5352         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
5353         want to pull the DeclSpace out of the builder_to_declspace instead
5354         of the TypeBuilder (like in TypeContainer.FindMembers).
5355
5356         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
5357         instead of LookupTypeContainer.  Fixes the crash on .NET for
5358         looking up interface members.
5359
5360         * const.cs: Create our own emit context during the Definition
5361         stage, so that constants are evaluated in the proper context, when
5362         a recursive definition happens.
5363
5364 2003-05-11  Martin Baulig  <martin@ximian.com>
5365
5366         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
5367         new block for a switch section.
5368         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
5369         the adding/lookup in the switch block.  Fixes #39828.
5370
5371 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
5372
5373         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
5374         functionality: I needed to convert the data after I had performed
5375         the add/sub operation into the operands type size.
5376
5377         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
5378         pass the type for the box operation, otherwise the resulting
5379         object would have been of type object.
5380
5381         (BoxedCast): Add constructor to specify the type to box as.
5382
5383 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
5384
5385         * iterators.cs: I was reusing the `count' variable inadvertently,
5386         take steps to not allow this to happen.
5387
5388 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
5389
5390         * attribute.cs (Attribute.Resolve): Params attributes are encoded
5391         by creating an array at the point where the params starts and
5392         putting all those arguments there, then adjusting the size of the
5393         array.
5394
5395 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
5396
5397         * expression.cs (New.AddressOf): Implement interface
5398         IMemoryLocation.  This is used when the `new' operator is used in
5399         the context of an invocation to a method on a value type.
5400
5401         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
5402         example. 
5403
5404         * namespace.cs: Also check the using aliases here.
5405
5406         * driver.cs: Move the test for using validity after the types have
5407         been entered, so we do a single pass that also includes the using
5408         aliases. 
5409
5410         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
5411         in the regular case.   CreateSiblingForFinally is doing extra
5412         error checking.
5413
5414         * attribute.cs (GetAttributeArgumentExpression): Store the result
5415         on an out value, and use the return value to indicate failure
5416         instead of using null (which is a valid return for Constant.GetValue).
5417
5418         * statement.cs: Perform the analysis flow for the increment
5419         portion after the statement, because this will be the real flow of
5420         execution.  Fixes #42385
5421
5422         * codegen.cs (EmitContext.EmitArgument,
5423         EmitContext.EmitStoreArgument): New helper functions when the
5424         RemapToProxy flag is set.
5425
5426         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
5427         function.
5428
5429         Add support for remapping parameters. 
5430
5431         * iterators.cs: Propagate parameter values;  Store parameter
5432         values in the proxy classes.
5433
5434 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
5435
5436         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
5437         need a proxy reference;  I do not know what I was thinking
5438
5439         * cs-parser.jay (constructor_initializer): catch another error,
5440         and display nice message.
5441
5442         (field_declaration): catch void field declaration
5443         to flag a better error. 
5444
5445         * class.cs (MemberBase.CheckBase): Report an error instead of a
5446         warning if a new protected member is declared in a struct. 
5447         (Field.Define): catch the error of readonly/volatile.
5448
5449         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
5450
5451         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
5452         volatile variable is taken
5453
5454 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
5455
5456         * statement.cs (Fixed.Resolve): Report an error if we are not in
5457         an unsafe context.
5458
5459 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
5460
5461         * typemanager.cs: reuse the code that handles type clashes for
5462         delegates and enumerations.
5463
5464         * class.cs (Report28): Always report.
5465
5466         * expression.cs (EncodeAsAttribute): Allow nulls here.
5467
5468 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
5469
5470         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
5471         the functionality for testing whether an expression is valid for
5472         an attribute here.  Also handle the case of arrays of elements
5473         being stored. 
5474
5475         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
5476         encoding a linear array into an array of objects that are suitable
5477         to be passed to an CustomAttributeBuilder.
5478
5479         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
5480
5481         * ecore.cs: (FieldExpr): Handle field remapping here.
5482
5483         * iteratators.cs: Pass the instance variable (if the method is an
5484         instance method) to the constructors, so we can access the field
5485         variables on the class.
5486
5487         TODO: Test this with structs.  I think the THIS variable on
5488         structs might have to be a pointer, and not a refenrece
5489
5490 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
5491
5492         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
5493         local variables to fields in a proxy class.
5494
5495         * iterators.cs (PopulateProxy): Rename our internal fields to
5496         <XXX>.  
5497         Create a <THIS> field if we are an instance method, so we can
5498         reference our parent container variables.
5499         (MapVariable): Called back from the EmitContext code to enter a
5500         new variable to field mapping into the proxy class (we just create
5501         a FieldBuilder).
5502
5503         * expression.cs
5504         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
5505         for using the remapped locals to fields.
5506
5507         I placed the code here, because that gives the same semantics to
5508         local variables, and only changes the Emit code.
5509
5510         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
5511         statements inside iterators.
5512         (VariableInfo): Add a FieldBuilder for the cases when we are
5513         remapping local variables to fields in a proxy class
5514
5515         * ecore.cs (SimpleNameResolve): Avoid testing two times for
5516         current_block != null.
5517
5518         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
5519         not cope with strings, as it has been moved to the
5520         TableSwitchEmit.  Fixed bug in switch generation.
5521
5522         * expression.cs (New.DoResolve): Provide more context for the user
5523         when reporting an error.
5524
5525         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
5526         pointers. 
5527
5528         * expression.cs (MemberAccess.DoResolve): When we get a type back,
5529         check the permissions for it.  Note than in a type-resolution
5530         context the check was already present in DeclSpace.ResolveType,
5531         but was missing from the MemberAccess.
5532
5533         (ArrayCreation.CheckIndices): warn if the user has
5534         more nested levels of expressions, but there are no more
5535         dimensions specified.  Avoids crash on bug 41906.
5536
5537 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
5538
5539         * statement.cs (Block): replace Implicit bool, for a generic
5540         flags.   
5541         New flag: `Unchecked'.  This is used during the EmitMeta phase
5542         (which is out-of-line with the regular Resolve/Emit process for a
5543         statement, as this is done ahead of time, but still gets a chance
5544         to call constant resolve).
5545
5546         (Block.Flags): new enum for adding a new flag.
5547
5548         (Block.EmitMeta): track the state of unchecked.
5549
5550         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
5551         to enable constant resolution to work there as well.
5552
5553 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
5554
5555         * typemanager.cs (ienumerable_type): Also look up
5556         System.Collections.IEnumerable. 
5557
5558 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
5559
5560         TODO: Test more than one conditional per method.
5561
5562         * class.cs (Indexer.Define): Report the location where the user is
5563         referencing the unsupported feature.
5564
5565         (MethodData): Overload the use of `conditionals' to
5566         minimize the creation of needless ArrayLists.   This saves roughly
5567         212kb on my machine.
5568
5569         (Method): Implement the new IIteratorContainer interface.
5570         (Method.SetYields): Implement the method by setting the ModFlags
5571         to contain METHOD_YIELDS.
5572
5573         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
5574         which just got set to null.
5575
5576         * iterators.cs: New file.
5577
5578         (Yield, YieldBreak): New statements.
5579
5580         * statement.cs (Return.Resolve): Flag an error if we are used in
5581         an iterator method.
5582
5583         * codegen.cs (InIterator): New flag set if the code is being
5584         compiled in an iterator method.
5585
5586         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
5587         internal modifier, and we just use it to avoid adding extra
5588         fields, as this is seldom used.  
5589
5590         * cs-parser.jay: Add yield_statement (yield and yield break).
5591
5592         * driver.cs: New flag -v2 to turn on version 2 features. 
5593
5594         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
5595         hashtable when v2 is enabled.
5596
5597 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
5598
5599         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
5600         there is already a namespace defined with this name.
5601
5602         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
5603         people upgraded their corlibs.
5604
5605         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
5606         always use fully qualified types, no need to use the compiler
5607         front end.
5608
5609         (TypeManager.IsNamespace): Use binarysearch.
5610
5611         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
5612         AddDelegate): I did not quite use the new IsValid API properly: I
5613         have to pass the short-name and the fullname.  I was passing only
5614         the basename instead of the fullname sometimes. 
5615
5616         (TypeContainer.DefineType): call NamespaceClash.
5617
5618         * interface.cs (Interface.DefineType): use NamespaceClash before
5619         defining the type.
5620
5621         * delegate.cs (Delegate.DefineType): use NamespaceClash before
5622         defining the type.
5623
5624         * enum.cs: (Enum.DefineType): use NamespaceClash before
5625         defining the type.
5626
5627         * typemanager.cs (: 3-line patch that gives us some tasty 11%
5628         speed increase.  First, use the negative_hits cache when we get a
5629         negative.  Second, add the type with its full original name
5630         instead of the new . and + encoded name (reflection uses + to
5631         separate type from a nested type).  Use LookupTypeReflection
5632         directly which bypasses the type->name hashtable (that we already
5633         know does not contain the type.
5634
5635         * decl.cs (DeclSpace.ResolveTypeExpr): track the
5636         location/container type. 
5637
5638         * driver.cs: When passing utf8, use directly the UTF8Encoding.
5639
5640 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
5641
5642         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
5643
5644         * delegate.cs (NewDelegate.Resolve): Test whether an instance
5645         method is being referenced in the method group from a static
5646         context, and report error 120 if so.
5647
5648         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
5649         Error118. 
5650
5651         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
5652         is created, we create the A namespace).
5653
5654         * cs-parser.jay: A namespace also introduces a DeclarationFound.
5655         Fixes #41591
5656
5657 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
5658
5659         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
5660         invocation to ModuleBuilder.GetType with the same values will
5661         return a new type instance, so we need to cache its return
5662         values. 
5663
5664         * expression.cs (Binary.ResolveOperator): Only allow the compare
5665         operators on enums if they are of the same type.
5666
5667         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
5668         types of ValueType on their own case.  Before we were giving them
5669         the same treatment as objects.
5670
5671         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
5672         fullname.  Short name is used to compare against container name.
5673         Fullname is used to check against defined namespace names.
5674
5675         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
5676         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
5677
5678         (Method.CheckBase): Call parent.
5679         (MemberBase.CheckBase): Check for protected members on sealed
5680         classes.
5681         (PropertyBase.CheckBase): Call parent.
5682         (Field.Define): Call parent.
5683
5684         * report.cs: Negative error codes are now mapped to 8000 - code,
5685         so that the display is render more nicely.
5686
5687         * typemanager.cs: Do not use try/catch, instead report a regular
5688         error. 
5689
5690         (GetPointerType, GetReferenceType): These methods provide
5691         mechanisms to obtain the T* and T& from a T.  We had the code
5692         previously scattered around the code base, and it also used
5693         TypeManager.LookupType that would go through plenty of caches.
5694         This one goes directly to the type source.
5695
5696         In some places we did the Type.GetType followed by
5697         ModuleBuilder.GetType, but not in others, so this unifies the
5698         processing as well.
5699
5700         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
5701         statements now that we have namespace information.
5702
5703         * typemanager.cs (IsNamespace): New method, returns whether the
5704         string presented is a namespace or not.
5705
5706         (ComputeNamespaces): New public entry point, computes the list of
5707         available namespaces, using the GetNamespaces API call in Mono, or
5708         the slower version in MS.NET.   
5709
5710         Now before we start the semantic analysis phase, we have a
5711         complete list of namespaces including everything that the user has
5712         provided.
5713
5714         Deleted old code to cache namespaces in .nsc files.
5715
5716 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
5717
5718         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
5719         class/struct location definition Location for the implicit
5720         constructor location.
5721
5722         (Operator.Define): Use the location of the operator for the
5723         implicit Method definition.
5724
5725         (Constructor.Emit): use the constructor location for the implicit
5726         base initializer constructor.
5727
5728         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
5729         and the Expression class now contains two new methods:
5730
5731         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
5732         isolate type lookup from the rest of the resolution process.
5733
5734         Since we use Expressions to hold type definitions due to the way
5735         we parse the input we have historically overloaded Resolve to
5736         perform the Type lookups if a special flag is passed.  Now this is
5737         eliminated and two methods take their place. 
5738
5739         The differences in the two methods between xStep and xTerminal is
5740         that xStep is involved in our current lookup system that uses
5741         SimpleNames to compose a name, while xTerminal is used just to
5742         catch the case where the simplename lookup failed.
5743
5744 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
5745
5746         * expression.cs (ResolveMemberAccess): Remove redundant code.
5747         TypeExpr expressions are always born fully resolved.
5748
5749         * interface.cs (PopulateMethod): Do not lookup the types twice.
5750         We were doing it once during SemanticAnalysis and once during
5751         PopulateMethod.
5752
5753         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
5754         in local variable type definitions, were being returned as a
5755         SimpleName (we decomposed everything into a string), that is
5756         because primary_expression was being used instead of a type in the
5757         grammar (reduce/reduce conflicts).
5758
5759         The part that was wrong is that we converted the expression into a
5760         string (an oversimplification in one hand, compounded with primary
5761         expressions doing string concatenation).
5762
5763         So things like:
5764
5765         A.B.C [] x;
5766
5767         Would return "A.B.C[]" as a SimpleName.  This stopped things like
5768         using clauses from working on this particular context.  And a type
5769         was being matched directly against "A.B.C[]".
5770
5771         We now use the correct approach, and allow for ComposedCast to be
5772         part of the unary expression.  So the "A.B.C []" become a composed
5773         cast of "A.B.C" (as a nested group of MemberAccess with a
5774         SimpleName at the end) plus the rank composition "[]". 
5775
5776         Also fixes 35567
5777
5778 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
5779
5780         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
5781         for the access level checking.
5782
5783         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
5784         `TypeContainer container', because I kept getting confused when I
5785         was debugging this code.
5786
5787         * expression.cs (Indexers): Instead of tracking getters/setters,
5788         we now track them in parallel.  We create one arraylist less, but
5789         most importantly it is possible now for the LValue code to find a
5790         matching get for a set.
5791
5792         (IndexerAccess.DoResolveLValue): Update the code.
5793         GetIndexersForType has been modified already to extract all the
5794         indexers from a type.  The code assumed it did not.
5795
5796         Also make the code set the correct return type for the indexer.
5797         This was fixed a long time ago for properties, but was missing for
5798         indexers.  It used to be void_type.
5799
5800         (Binary.Emit): Test first for doubles instead of
5801         floats, as they are more common.
5802
5803         (Binary.EmitBranchable): Use the .un version of the branch opcodes
5804         when dealing with floats and the <=, >= operators.  This fixes bug
5805         #39314 
5806
5807         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
5808         to load the array value by emitting a load on the foreach variable
5809         type.  This was incorrect.  
5810
5811         We now emit the code to load an element using the the array
5812         variable type, and then we emit the conversion operator.
5813
5814         Fixed #40176
5815
5816 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
5817
5818         * attribute.cs: Avoid allocation of ArrayLists in the common case.
5819
5820 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
5821
5822         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
5823         test for protection before we test for signatures. 
5824
5825         (MethodSignature.ToString): implement.
5826
5827         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
5828         to the case where we reduced into a LongConstant.
5829
5830         * decl.cs (CheckAccessLevel): If the type is an array, we can not
5831         depend on whether the information is acurrate, because the
5832         Microsoft runtime will always claim that the array type is public,
5833         regardless of the real state.
5834
5835         If the type is a pointer, another problem happens: the type is
5836         reported as non-public in Microsoft.  
5837
5838         In both cases we have to call CheckAccessLevel recursively with
5839         the underlying type as the argument to be tested.
5840
5841 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
5842
5843         * assign.cs (Assign.Emit): If we are dealing with a compound
5844         assignment expression, we should use the code path that stores the
5845         intermediate result in a temporary value.  This fixes #40903.
5846
5847         *expression.cs (Indirection.ToString): Provide ToString method for
5848         debugging. 
5849
5850 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
5851
5852         * class.cs: Null out fields holding references to Block objects so
5853         they can be garbage collected.
5854
5855         * expression.cs (OverloadResolve): Remove unused local.
5856
5857 2003-04-07  Martin Baulig  <martin@ximian.com>
5858
5859         * codegen.cs (EmitContext.CurrentFile): New public field.
5860         (EmitContext.Mark): Use the CurrentFile to check whether the
5861         location is in the correct file.
5862         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
5863
5864 2003-04-07  Martin Baulig  <martin@ximian.com>
5865
5866         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
5867
5868         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
5869         location.  [FIXME: The location argument which gets passed to this
5870         method is sometimes wrong!]
5871
5872 2003-04-07  Nick Drochak <ndrochak@gol.com>
5873
5874         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
5875
5876 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
5877
5878         * expression.cs (Indirection.EmitAssign): We were using the
5879         temporary, but returning immediately instead of continuing the
5880         EmitAssing flow.
5881
5882 2003-04-06  Martin Baulig  <martin@ximian.com>
5883
5884         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
5885         if it's a nested child, but also deriving from the outer class.
5886         See test 190.cs.
5887
5888         * typemanager.cs (IsNestedChildOf): Make this work if it's a
5889         nested child, but also deriving from the outer class.  See
5890         test-190.cs.
5891         (FilterWithClosure): We may access private members of the outer
5892         class if we're a nested child and deriving from the outer class.
5893         (RealMemberLookup): Only set `closure_private_ok' if the
5894         `original_bf' contained BindingFlags.NonPublic.
5895
5896 2003-04-05  Martin Baulig  <martin@ximian.com>
5897
5898         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
5899
5900 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
5901
5902         * class.cs (Event.Define): Do not allow abstract events to have
5903         initializers. 
5904
5905 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
5906
5907         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
5908         block in event declarations.
5909
5910         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
5911         value type, get its address.
5912
5913         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
5914         leaving a class on the stack instead of a boolean value (int
5915         0/1).  Change the code so we compare against null, and then the
5916         result against zero.
5917
5918         * class.cs (TypeContainer.GetClassBases): We were checking for the
5919         parent class being sealed too late.
5920
5921         * expression.cs (Binary.Emit): For <= and >= when dealing with
5922         floating point values, use cgt.un and clt.un instead of cgt and
5923         clt alone.
5924
5925 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
5926
5927         * statement.cs: Apply the same optimization as MS: skip the 
5928         GetEnumerator returning an IEnumerator, and use the one returning a 
5929         CharEnumerator instead. This allows us to avoid the try-finally block 
5930         and the boxing.
5931
5932 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
5933
5934         * cs-parser.jay: Attributes cannot be applied to
5935                          namespaces. Fixes #40473
5936
5937 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5938
5939         * class.cs:
5940         (Add*): check if the name is valid using the full name for constants,
5941         fields, properties and events.
5942
5943 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
5944
5945         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
5946         char constants to be part of the enumeration.
5947
5948         * expression.cs (Conditional.DoResolve): Add support for operator
5949         true. Implements the missing functionality from 14.12
5950
5951         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
5952         operator true/false as required by the spec.
5953
5954         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
5955         implicit conversion to boolean.
5956
5957         * statement.cs (Statement.ResolveBoolean): A boolean expression is
5958         also one where the type implements `operator true'. 
5959
5960         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
5961         get an expression that will invoke operator true based on an
5962         expression.  
5963
5964         (GetConversionOperators): Removed the hack that called op_True
5965         here.  
5966
5967         (Expression.ResolveBoolean): Move this from Statement.
5968
5969 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
5970
5971         * ecore.cs (FieldExpr): do not allow initialization of initonly
5972         fields on derived classes
5973
5974 2003-03-13  Martin Baulig  <martin@ximian.com>
5975
5976         * statement.cs (Block.Emit): Call ig.BeginScope() and
5977         ig.EndScope() when compiling with debugging info; call
5978         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
5979
5980 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
5981
5982         * expression.cs (Indexers): Do not construct immediately, allow
5983         for new members to be appended as we go.  Fixes 38143
5984
5985 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5986
5987         * expression.cs: save/restore context when resolving an unchecked
5988         expression.
5989
5990 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
5991
5992         * cfold.cs: Catch division by zero in modulus operator during
5993         constant folding.
5994
5995 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
5996
5997         * interface.cs (Interface.DefineMembers): Avoid defining members
5998         twice. 
5999
6000 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
6001
6002         * driver.cs: handle the +/- options for -noconfig
6003
6004         * statement.cs (Unckeched.Resolve): Also track the state of
6005         unchecked in the Resolve phase.
6006
6007 2003-02-27  Martin Baulig  <martin@ximian.com>
6008
6009         * ecore.cs (Expression.MemberLookup): Don't create a
6010         MethodGroupExpr for something which is not a method.  Fixes #38291.
6011
6012 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
6013
6014         * class.cs (MemberBase.CheckParameters): Also check that the type
6015         is unmanaged if it is a pointer.
6016
6017         * expression.cs (SizeOf.Resolve): Add location information.
6018
6019         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
6020         a managed type is declared.
6021
6022         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
6023         parameter modifiers as well.  Fixes bug 38606
6024
6025         * class.cs: Very sad.  Am backing out the speed up changes
6026         introduced by the ArrayList -> Array in the TypeContainer, as they
6027         were not actually that much faster, and introduced a bug (no error
6028         reports on duplicated methods).
6029
6030         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
6031         source first, this will guarantee that we have a valid expression
6032         before calling in lower levels functions that will require a
6033         resolved object.  Then use this original_source in the
6034         target.ResolveLValue instead of the original source that was
6035         passed to us.
6036
6037         Another change.  Use target.Resolve instead of LValueResolve.
6038         Although we are resolving for LValues, we will let the Assign code
6039         take care of that (it will be called again from Resolve).  This
6040         basically allows code like this:
6041
6042         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
6043         class Y { void A (X x) { x [0] += o; }
6044
6045         The problem was that the indexer was trying to resolve for
6046         set_Item (idx, object o) and never finding one.  The real set_Item
6047         was set_Item (idx, X).  By delaying the process we get the right
6048         semantics. 
6049
6050         Fixes bug 36505
6051
6052 2003-02-23  Martin Baulig  <martin@ximian.com>
6053
6054         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
6055         while calling DoEmit ().
6056
6057         * codegen.cs (EmitContext.Mark): Don't mark locations in other
6058         source files; if you use the #line directive inside a method, the
6059         compiler stops emitting line numbers for the debugger until it
6060         reaches the end of the method or another #line directive which
6061         restores the original file.
6062
6063 2003-02-23  Martin Baulig  <martin@ximian.com>
6064
6065         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
6066
6067 2003-02-23  Martin Baulig  <martin@ximian.com>
6068
6069         * statement.cs (Block.AddChildVariableNames): We need to call this
6070         recursively, not just for our immediate children.
6071
6072 2003-02-23  Martin Baulig  <martin@ximian.com>
6073
6074         * class.cs (Event.Define): Always make the field private, like csc does.
6075
6076         * typemanager.cs (TypeManager.RealMemberLookup): Make events
6077         actually work, fixes bug #37521.
6078
6079 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
6080
6081         * delegate.cs: When creating the various temporary "Parameters"
6082         classes, make sure that we call the ComputeAndDefineParameterTypes
6083         on those new parameters (just like we do with the formal ones), to
6084         allow them to be resolved in the context of the DeclSpace.
6085
6086         This fixes the bug that Dick observed in Bugzilla #38530.
6087
6088 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
6089
6090         * expression.cs (ResolveMemberAccess): When resolving a constant,
6091         do not attempt to pull a constant if the value was not able to
6092         generate a valid constant.
6093
6094         * const.cs (LookupConstantValue): Do not report more errors than required.
6095
6096 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6097
6098         * expression.cs: fixes bug #38328.
6099
6100 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
6101
6102         * class.cs: Changed all the various members that can be part of a
6103         class from being an ArrayList to be an Array of the right type.
6104         During the DefineType type_list, interface_list, delegate_list and
6105         enum_list are turned into types, interfaces, delegates and enums
6106         arrays.  
6107
6108         And during the member population, indexer_list, event_list,
6109         constant_list, field_list, instance_constructor_list, method_list,
6110         operator_list and property_list are turned into their real arrays.
6111
6112         Although we could probably perform this operation earlier, for
6113         good error reporting we need to keep the lists and remove the
6114         lists for longer than required.
6115
6116         This optimization was triggered by Paolo profiling the compiler
6117         speed on the output of `gen-sample-program.pl' perl script. 
6118
6119         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
6120         not crash in methods like MemberLookupFailed that use this field.  
6121
6122         This problem arises when the compiler fails to resolve a type
6123         during interface type definition for example.
6124
6125 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
6126
6127         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
6128         inherit from System.Object, so we have to stop at null, not only
6129         when reaching System.Object.
6130
6131 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
6132
6133         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
6134         DeclaredOnly because the parent indexer might have had a different
6135         name, but did not loop until the top of the hierarchy was reached.
6136
6137         The problem this one fixes is 35492: when a class implemented an
6138         indexer from an interface, we were getting the interface method
6139         (which was abstract) and we were flagging an error (can not invoke
6140         abstract method).
6141
6142         This also keeps bug 33089 functioning, and test-148 functioning.
6143
6144         * typemanager.cs (IsSpecialMethod): The correct way of figuring
6145         out if a method is special is to see if it is declared in a
6146         property or event, or whether it is one of the predefined operator
6147         names.   This should fix correctly #36804.
6148
6149 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
6150
6151         The goal here is to remove the dependency on EmptyCast.Peel ().
6152         Killing it completely.
6153
6154         The problem is that currently in a number of places where
6155         constants are expected, we have to "probe" for an EmptyCast, and
6156         Peel, which is not the correct thing to do, as this will be
6157         repetitive and will likely lead to errors. 
6158
6159         The idea is to remove any EmptyCasts that are used in casts that
6160         can be reduced to constants, so we only have to cope with
6161         constants. 
6162
6163         This bug hunt was triggered by Bug 37363 and the desire to remove
6164         the duplicate pattern where we were "peeling" emptycasts to check
6165         whether they were constants.  Now constants will always be
6166         constants.
6167
6168         * ecore.cs: Use an enumconstant here instead of wrapping with
6169         EmptyCast.  
6170
6171         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
6172         throwing me off.  By handling this we can get rid of a few hacks.
6173
6174         * statement.cs (Switch): Removed Peel() code.
6175
6176 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
6177
6178         * class.cs: Location information for error 508
6179
6180         * expression.cs (New.DoResolve): Add a guard against double
6181         resolution of an expression.  
6182
6183         The New DoResolve might be called twice when initializing field
6184         expressions (see EmitFieldInitializers, the call to
6185         GetInitializerExpression will perform a resolve on the expression,
6186         and later the assign will trigger another resolution
6187
6188         This leads to bugs (#37014)
6189
6190         * delegate.cs: The signature for EndInvoke should contain any ref
6191         or out parameters as well.  We were not doing this in the past. 
6192
6193         * class.cs (Field.Define): Do not overwrite the type definition
6194         inside the `volatile' group.  Turns out that volatile enumerations
6195         were changing the type here to perform a validity test, which
6196         broke conversions. 
6197
6198 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
6199
6200         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
6201         and structs, we do not want to load the instance variable
6202
6203         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
6204         enum_type has to be handled like an object reference (implicit
6205         conversions exists from this to object), but the regular IsClass
6206         and IsValueType tests will never return true for this one.
6207
6208         Also we use TypeManager.IsValueType instead of type.IsValueType,
6209         just for consistency with the rest of the code (this is only
6210         needed if we ever use the construct exposed by test-180.cs inside
6211         corlib, which we dont today).
6212
6213 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
6214
6215         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
6216         just InternalCall.
6217
6218 2003-02-09  Martin Baulig  <martin@ximian.com>
6219
6220         * namespace.cs (Namespace..ctor): Added SourceFile argument.
6221         (Namespace.DefineNamespaces): New static public method; this is
6222         called when we're compiling with debugging to add all namespaces
6223         to the symbol file.
6224
6225         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
6226         pass it to the Namespace's .ctor.
6227
6228         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
6229         and MethodBase arguments; pass the namespace ID to the symwriter;
6230         pass the MethodBase instead of the token to the symwriter.
6231         (SymbolWriter.DefineNamespace): New method to add a namespace to
6232         the symbol file.
6233
6234 2003-02-09  Martin Baulig  <martin@ximian.com>
6235
6236         * symbolwriter.cs: New file.  This is a wrapper around
6237         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
6238         methods here in near future.
6239
6240 2003-02-09  Martin Baulig  <martin@ximian.com>
6241
6242         * codegen.cs (EmitContext.Mark): Just pass the arguments to
6243         ILGenerator.MarkSequencePoint() which are actually used by the
6244         symbol writer.
6245
6246 2003-02-09  Martin Baulig  <martin@ximian.com>
6247
6248         * location.cs (SourceFile): New public sealed class.  This
6249         contains the name and an index which is used in the location's token.
6250         (Location): Reserve an appropriate number of bits in the token for
6251         the source file instead of walking over that list, this gives us a
6252         really huge performance improvement when compiling with debugging.
6253
6254         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
6255         `SourceFile' argument instead of a string.
6256         (Driver.ProcessFile): Add all the files via Location.AddFile(),
6257         but don't parse/tokenize here, we need to generate the list of all
6258         source files before we do that.
6259         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
6260         the files.
6261
6262         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
6263         instead of a string.
6264
6265         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
6266         of a string.
6267
6268 2003-02-09  Martin Baulig  <martin@ximian.com>
6269
6270         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
6271         filename on `#line default'.
6272
6273 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
6274
6275         * statement.cs: don't clear the pinned var when the fixed statement
6276         returns from the method (fixes bug#37752).
6277
6278 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
6279
6280         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
6281         to IsValueType.
6282
6283 2003-02-07  Martin Baulig  <martin@ximian.com>
6284
6285         * driver.cs: Removed the `--debug-args' command line argument.
6286
6287         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
6288         automatically by the AsssemblyBuilder.
6289         (CodeGen.InitializeSymbolWriter): We don't need to call any
6290         initialization function on the symbol writer anymore.  This method
6291         doesn't take any arguments.
6292
6293 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
6294
6295         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
6296         from referenced assemblies as well.
6297
6298 2003-02-02  Martin Baulig  <martin@ximian.com>
6299
6300         * class.cs (MethodData.Emit): Generate debugging info for external methods.
6301
6302 2003-02-02  Martin Baulig  <martin@ximian.com>
6303
6304         * class.cs (Constructor.Emit): Open the symbol writer before
6305         emitting the constructor initializer.
6306         (ConstructorInitializer.Emit): Call ec.Mark() to allow
6307         single-stepping through constructor initializers.
6308
6309 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
6310
6311         * class.cs: Handle error 549: do not allow virtual methods in
6312         sealed classes. 
6313
6314 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
6315
6316         * decl.cs: Check access levels when resolving types
6317
6318 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
6319
6320         * statement.cs: Add parameters and locals set in catch blocks that might 
6321         return to set vector
6322
6323 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
6324
6325         * class.cs (Operator): Set the SpecialName flags for operators.
6326
6327         * expression.cs (Invocation.DoResolve): Only block calls to
6328         accessors and operators on SpecialName methods.
6329
6330         (Cast.TryReduce): Handle conversions from char constants.
6331
6332
6333 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
6334
6335         * statement.cs: small memory and time optimization in FlowBranching.
6336
6337 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
6338
6339         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
6340         problem that the last fix but in the other sid (Set).
6341
6342         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
6343         access when there is no indexer in the hierarchy.
6344
6345 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
6346
6347         * class.cs: Combine some if statements.
6348
6349 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6350
6351         * driver.cs: fixed bug #37187.
6352
6353 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
6354
6355         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
6356         any indexer, it's needed to build a list with all the indexers in the
6357         hierarchy (AllGetters), else we have problems. Fixes #35653.
6358
6359 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
6360
6361         * class.cs (MethodData.Define): It is wrong for an interface
6362         implementation to be static in both cases: explicit and implicit.
6363         We were only handling this in one case.
6364
6365         Improve the if situation there to not have negations.
6366
6367         * class.cs (Field.Define): Turns out that we do not need to check
6368         the unsafe bit on field definition, only on usage.  Remove the test.
6369
6370 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6371
6372         * driver.cs: use assembly.Location instead of Codebase (the latest
6373         patch made mcs fail when using MS assemblies).
6374
6375 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
6376
6377         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
6378         get the path to *corlib.dll.
6379
6380 2003-01-21  Nick Drochak <ndrochak@gol.com>
6381
6382         * cs-tokenizer.cs:
6383         * pending.cs:
6384         * typemanager.cs: Remove compiler warnings
6385
6386 2003-01-20  Duncan Mak  <duncan@ximian.com>
6387
6388         * AssemblyInfo.cs: Bump the version number to 0.19.
6389
6390 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6391
6392         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
6393
6394 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
6395
6396         * class.cs (Constructor::Emit): Emit debugging info for constructors.
6397
6398 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
6399
6400         * cs-parser.jay: Small fix: we were not comparing the constructor
6401         name correctly.   Thanks to Zoltan for the initial pointer.
6402
6403 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
6404
6405         * cs-tokenizer.cs: Set file name when specified with #line
6406
6407 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
6408
6409         * cs-parser.jay: Only perform the constructor checks here if we
6410         are named like the class;  This will help provider a better
6411         error.  The constructor path is taken when a type definition is
6412         not found, but most likely the user forgot to add the type, so
6413         report that rather than the constructor error.
6414
6415 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
6416
6417         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
6418         allocations.
6419
6420 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
6421
6422         * cs-parser.jay: Add cleanup call.
6423
6424 2003-01-13  Duncan Mak  <duncan@ximian.com>
6425
6426         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
6427         consistent with other methods.
6428
6429 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
6430
6431         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
6432
6433 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
6434
6435         * attribute.cs: only set GuidAttr to true when we have a
6436         GuidAttribute.
6437
6438 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6439
6440         * ecore.cs:
6441         * expression.cs:
6442         * typemanager.cs: fixes to allow mcs compile corlib with the new
6443         Type.IsSubclassOf fix.
6444
6445 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
6446
6447         * expression.cs (LocalVariableReference.DoResolve): Classify a
6448         constant as a value, not as a variable.   Also, set the type for
6449         the variable.
6450
6451         * cs-parser.jay (fixed_statement): take a type instead of a
6452         pointer_type, so we can produce a better error message later.
6453
6454         * statement.cs (Fixed.Resolve): Flag types that are not pointers
6455         as an error.  
6456
6457         (For.DoEmit): Make inifinite loops have a
6458         non-conditional branch back.
6459
6460         (Fixed.DoEmit): First populate the pinned variables, then emit the
6461         statement, then clear the variables.  Before I was emitting the
6462         code once for each fixed piece.
6463
6464
6465 2003-01-08  Martin Baulig  <martin@ximian.com>
6466
6467         * statement.cs (FlowBranching.MergeChild): A break in a
6468         SWITCH_SECTION does not leave a loop.  Fixes #36155.
6469
6470 2003-01-08  Martin Baulig  <martin@ximian.com>
6471
6472         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
6473         lives in the same number space than `param_map'.  Fixes #36154.
6474
6475 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
6476
6477         * cs-parser.jay (constructor_declaration): Set the
6478         Constructor.ModFlags before probing for it.  This makes the
6479         compiler report 514, 515 and 132 (the code was there, but got
6480         broken). 
6481
6482         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
6483         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
6484         (GotoCase.Resolve): Set `Returns' to ALWAYS.
6485
6486 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
6487
6488         * enum.cs: create the enum static fields using the enum type.
6489
6490 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
6491
6492         * class.cs: don't try to create the ParamBuilder for the return
6493         type if it's not needed (and handle it breaking for the ms runtime
6494         anyway).
6495
6496 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
6497
6498         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
6499
6500 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
6501
6502         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
6503         the command.   This showed up while compiling the JANET source
6504         code, which used \r as its only newline separator.
6505
6506 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
6507
6508         * class.cs (Method.Define): If we are an operator (because it
6509         reuses our code), then set the SpecialName and HideBySig.  #36128
6510
6511 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
6512
6513         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
6514         exception, report error 120 `object reference required'.
6515
6516         * driver.cs: Add --pause option, used during to measure the size
6517         of the process as it goes with --timestamp.
6518
6519         * expression.cs (Invocation.DoResolve): Do not allow methods with
6520         SpecialName to be invoked.
6521
6522 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
6523
6524         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
6525         number before adding it.
6526
6527 2002-12-21  Ravi Pratap  <ravi@ximian.com>
6528
6529         * ecore.cs (StandardImplicitConversion): When in an unsafe
6530         context, we allow conversion between void * to any other pointer
6531         type. This fixes bug #35973.
6532
6533 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
6534
6535         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
6536         is not thrown when extensionless outputs are used 
6537
6538 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6539
6540         * rootcontext.cs: fixed compilation of corlib.
6541
6542 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
6543
6544         * attribute.cs (Attributes.Contains): Add new method.
6545
6546         * class.cs (MethodCore.LabelParameters): if the parameter is an
6547         `out' parameter, check that no attribute `[In]' has been passed.
6548
6549         * enum.cs: Handle the `value__' name in an enumeration.
6550
6551 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
6552
6553         * decl.cs: Added special case to allow overrides on "protected
6554         internal" methods
6555
6556 2002-12-18  Ravi Pratap  <ravi@ximian.com>
6557
6558         * attribute.cs (Attributes.AddAttributeSection): Rename to this
6559         since it makes much more sense.
6560
6561         (Attributes.ctor): Don't require a Location parameter.
6562
6563         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
6564
6565         * attribute.cs (ApplyAttributes): Remove extra Location parameters
6566         since we already have that information per attribute.
6567
6568         * everywhere : make appropriate changes.
6569
6570         * class.cs (LabelParameters): Write the code which actually
6571         applies attributes to the return type. We can't do this on the MS
6572         .NET runtime so we flag a warning in the case an exception is
6573         thrown.
6574
6575 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
6576
6577         * const.cs: Handle implicit null conversions here too.
6578
6579 2002-12-17  Ravi Pratap  <ravi@ximian.com>
6580
6581         * class.cs (MethodCore.LabelParameters): Remove the extra
6582         Type [] parameter since it is completely unnecessary. Instead
6583         pass in the method's attributes so that we can extract
6584         the "return" attribute.
6585
6586 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
6587
6588         * cs-parser.jay (parse): Use Report.Error to flag errors instead
6589         of ignoring it and letting the compile continue.
6590
6591         * typemanager.cs (ChangeType): use an extra argument to return an
6592         error condition instead of throwing an exception.
6593
6594 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
6595
6596         * expression.cs (Unary.TryReduce): mimic the code for the regular
6597         code path.  Perform an implicit cast in the cases where we can
6598         implicitly convert to one of the integral types, and then reduce
6599         based on that constant.   This fixes bug #35483.
6600
6601 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6602
6603         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
6604
6605 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6606
6607         * namespace.cs: fixed bug #35489.
6608
6609 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
6610
6611         * class.cs: Remove some dead code.
6612
6613         * cs-parser.jay: Estimate the number of methods needed
6614         (RootContext.MethodCount);
6615
6616         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
6617         numbers instead of StringBuilders.
6618
6619         * support.cs (PtrHashtable): Add constructor with initial size;
6620         We can now reduce reallocations of the method table.
6621
6622 2002-12-10  Ravi Pratap  <ravi@ximian.com>
6623
6624         * attribute.cs (ApplyAttributes): Keep track of the emitted
6625         attributes on a per-target basis. This fixes bug #35413.
6626
6627 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
6628
6629         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
6630         default to the Windows 1252 encoding.
6631
6632         (UnixParseOption): Support version, thanks to Alp for the missing
6633         pointer. 
6634
6635         * AssemblyInfo.cs: Add nice assembly information.
6636
6637         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
6638         (bug 35169).
6639
6640         * cs-parser.jay: Allow a trailing comma before the close bracked
6641         in the attribute_section production.
6642
6643         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
6644         address of the instance was being taken, I will take this out,
6645         because we take the address of the object immediately here.
6646
6647 2002-12-09  Ravi Pratap  <ravi@ximian.com>
6648
6649         * typemanager.cs (AreMultipleAllowed): Take care of the most
6650         obvious case where attribute type is not in the current assembly -
6651         stupid me ;-)
6652
6653 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
6654
6655         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
6656         definitions, instead of doing that afterwards.  
6657
6658         Also we use a nice little hack, depending on the constructor, we
6659         know if we are a "composed" name or a simple name.  Hence, we
6660         avoid the IndexOf test, and we avoid 
6661
6662         * codegen.cs: Add code to assist in a bug reporter to track down
6663         the source of a compiler crash. 
6664
6665 2002-12-07  Ravi Pratap  <ravi@ximian.com>
6666
6667         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
6668         types have been emitted for a given element and flag an error
6669         if something which does not have AllowMultiple set is used more
6670         than once.
6671
6672         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
6673         attribute types and their corresponding AllowMultiple properties
6674
6675         (AreMultipleAllowed): Check the property for a given type.
6676
6677         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
6678         property in the case we have a TypeContainer.
6679
6680         (Attributes.AddAttribute): Detect duplicates and just skip on
6681         adding them. This trivial fix catches a pretty gross error in our
6682         attribute emission - global attributes were being emitted twice!
6683
6684         Bugzilla bug #33187 is now fixed.
6685
6686 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
6687
6688         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
6689         instead of pp_and).
6690
6691         * expression.cs (Binary.ResolveOperator): I can only use the
6692         Concat (string, string, string) and Concat (string, string,
6693         string, string) if the child is actually a concatenation of
6694         strings. 
6695
6696 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
6697
6698         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
6699         context where we need a 2-character lookahead.
6700
6701         * pending.cs (PendingImplementation): Rework so we can keep track
6702         of interface types all the time, and flag those which were
6703         implemented by parents as optional.
6704
6705 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
6706
6707         * expression.cs (Binary.ResolveOperator): Use
6708         String.Concat(string,string,string) or
6709         String.Concat(string,string,string,string) when possible. 
6710
6711         * typemanager: More helper methods.
6712
6713
6714 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
6715
6716         * pending.cs: remove the bogus return from GetMissingInterfaces()
6717         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
6718
6719 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6720
6721         * namespace.cs: avoid duplicated 'using xxx' being added to
6722         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
6723         when we get more than one 'using' statement for the same namespace.
6724         Report a CS0105 warning for it.
6725
6726 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
6727
6728         * cs-tokenizer.cs (consume_identifier): use read directly, instead
6729         of calling getChar/putback, uses internal knowledge of it.    
6730
6731         (xtoken): Reorder tokenizer so most common patterns are checked
6732         first.  This reduces the compilation time in another 5% (from 8.11s
6733         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
6734
6735         The parsing time is 22% of the compilation in mcs, and from that
6736         64% is spent on the tokenization process.  
6737
6738         I tried using a binary search for keywords, but this is slower
6739         than the hashtable.  Another option would be to do a couple of
6740         things:
6741
6742                 * Not use a StringBuilder, instead use an array of chars,
6743                   with a set value.  Notice that this way we could catch
6744                   the 645 error without having to do it *afterwards*.
6745
6746                 * We could write a hand-parser to avoid the hashtable
6747                   compares altogether.
6748
6749         The identifier consumption process takes 37% of the tokenization
6750         time.  Another 15% is spent on is_number.  56% of the time spent
6751         on is_number is spent on Int64.Parse:
6752
6753                 * We could probably choose based on the string length to
6754                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
6755                   computations. 
6756
6757         Another 3% is spend on wrapping `xtoken' in the `token' function.
6758
6759         Handle 0xa0 as whitespace (#34752)
6760
6761 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
6762
6763         * typemanager.cs (IsCLRType): New routine to tell whether a type
6764         is one of the builtin types.  
6765
6766         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
6767         typecode in more places instead of doing pointer comparissions.
6768         We could leverage some knowledge about the way the typecodes are
6769         laid out.
6770
6771         New code to cache namespaces in assemblies, it is currently not
6772         invoked, to be used soon.
6773
6774         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
6775
6776         * expression.cs (Binary.ResolveOperator): specially handle
6777         strings, and do not perform user-defined operator overloading for
6778         built-in types.
6779
6780 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
6781
6782         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
6783         internalcall as it is a pretty simple operation;  Avoid whenever
6784         possible to call Char.IsLetter.
6785
6786         (consume_identifier): Cut by half the number of
6787         hashtable calls by merging the is_keyword and GetKeyword behavior.
6788
6789         Do not short-circuit, because if we do, we
6790         report errors (ie, #if false && true would produce an invalid
6791         directive error);
6792
6793
6794 2002-11-24  Martin Baulig  <martin@ximian.com>
6795
6796         * expression.cs (Cast.TryReduce): If we're in checked syntax,
6797         check constant ranges and report a CS0221.  Fixes #33186.
6798
6799 2002-11-24  Martin Baulig  <martin@ximian.com>
6800
6801         * cs-parser.jay: Make this work for uninitialized variable
6802         declarations in the `for' initializer.  Fixes #32416.
6803
6804 2002-11-24  Martin Baulig  <martin@ximian.com>
6805
6806         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
6807         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
6808
6809 2002-11-24  Martin Baulig  <martin@ximian.com>
6810
6811         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
6812         argument; if true, we also check for user-defined conversions.
6813         This is only needed if both arguments are of a user-defined type.
6814         Fixes #30443, added test-175.cs.
6815         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
6816
6817         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
6818
6819 2002-11-24  Martin Baulig  <martin@ximian.com>
6820
6821         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
6822         function to get the store opcode.
6823         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
6824         only emit the Ldelema if the store opcode is Stobj.  You must run
6825         both test-34 and test-167 to test this.  Fixes #34529.
6826
6827 2002-11-23  Martin Baulig  <martin@ximian.com>
6828
6829         * ecore.cs (Expression.MemberLookup): Added additional
6830         `qualifier_type' argument which is used when we're being called
6831         from MemberAccess.DoResolve() and null if we're called from a
6832         SimpleName lookup.
6833         (Expression.MemberLookupFailed): New method to report errors; this
6834         does the CS1540 check and reports the correct error message.
6835
6836         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
6837         argument for the CS1540 check and redone the way how we're dealing
6838         with private members.  See the comment in the source code for details.
6839         (FilterWithClosure): Reverted this back to revision 1.197; renamed
6840         `closure_start_type' to `closure_qualifier_type' and check whether
6841         it's not null.  It was not this filter being broken, it was just
6842         being called with the wrong arguments.
6843
6844         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
6845         and pass it the correct `qualifier_type'; this also does the error
6846         handling for us.
6847
6848 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
6849
6850         * expression.cs (Invocation.EmitParams): If the we are dealing
6851         with a non-built-in value type, load its address as well.
6852
6853         (ArrayCreation): Use a a pretty constant instead
6854         of the hardcoded value 2.   Use 6 instead of 2 for the number of
6855         static initializers.  
6856
6857         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
6858         because they are not really value types, just glorified integers. 
6859
6860         * driver.cs: Do not append .exe, the CSC compiler does not do it.
6861
6862         * ecore.cs: Remove redundant code for enumerations, make them use
6863         the same code path as everything else, fixes the casting issue
6864         with enumerations in Windows.Forms.
6865
6866         * attribute.cs: Do only cast to string if it is a string, the
6867         validation happens later.
6868
6869         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
6870         people upgrade their corlibs.
6871
6872         * ecore.cs: Oops, enumerations were not following the entire code path
6873
6874 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
6875
6876         * typemanager.cs (FilterWithClosure): Commented out the test for
6877         1540 in typemanager.cs, as it has problems when accessing
6878         protected methods from a parent class (see test-174.cs). 
6879
6880         * attribute.cs (Attribute.ValidateGuid): new method.
6881         (Attribute.Resolve): Use above.
6882
6883 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
6884
6885         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
6886
6887         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
6888         handling for enumerations, as we only needed the TypeContainer
6889         functionality to begin with (this is required for the fix below to
6890         work for enums that reference constants in a container class for
6891         example). 
6892
6893         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
6894
6895         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
6896         a valid TypeBuilder to perform lookups on.o
6897
6898         * class.cs (InheritableMemberSignatureCompare): Use true in the
6899         call to GetGetMethod and GetSetMethod, because we are comparing
6900         the signature, and we need to get the methods *even* if they are
6901         private. 
6902
6903         (PropertyBase.CheckBase): ditto.
6904
6905         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
6906         GotoCase.Resolve): Use Peel on EmpytCasts.
6907
6908         * ecore.cs (EmptyCast): drop child, add Peel method.
6909
6910 2002-11-17  Martin Baulig  <martin@ximian.com>
6911
6912         * ecore.cs (EmptyCast.Child): New public property.
6913
6914         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
6915         label resolved to an EmptyCast.  Fixes #34162.
6916         (GotoCase.Resolve): Likewise.
6917         (Block.EmitMeta): Likewise.
6918
6919 2002-11-17  Martin Baulig  <martin@ximian.com>
6920
6921         * expression.cs (Invocation.BetterConversion): Prefer int over
6922         uint; short over ushort; long over ulong for integer literals.
6923         Use ImplicitConversionExists instead of StandardConversionExists
6924         since we also need to check for user-defined implicit conversions.
6925         Fixes #34165.  Added test-173.cs.
6926
6927 2002-11-16  Martin Baulig  <martin@ximian.com>
6928
6929         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
6930         with the `true' and `false' literals.  Fixes #33151.
6931
6932 2002-11-16  Martin Baulig  <martin@ximian.com>
6933
6934         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
6935         October 22nd; don't do the cs1540 check for static members.
6936
6937         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
6938         now using our own filter here and doing the cs1540 check again.
6939
6940 2002-11-16  Martin Baulig  <martin@ximian.com>
6941
6942         * support.cs (InternalParameters): Don't crash if we don't have
6943         any fixed parameters.  Fixes #33532.
6944
6945 2002-11-16  Martin Baulig  <martin@ximian.com>
6946
6947         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
6948         when looking up static methods to make this work on Windows.
6949         Fixes #33773.
6950
6951 2002-11-16  Martin Baulig  <martin@ximian.com>
6952
6953         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
6954         a setter rather than using PropertyInfo.CanWrite.
6955
6956 2002-11-15  Nick Drochak  <ndrochak@gol.com>
6957
6958         * class.cs: Allow acces to block member by subclasses. Fixes build
6959         breaker.
6960
6961 2002-11-14  Martin Baulig  <martin@ximian.com>
6962
6963         * class.cs (Constructor.Emit): Added the extern/block check.
6964         Fixes bug #33678.
6965
6966 2002-11-14  Martin Baulig  <martin@ximian.com>
6967
6968         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
6969         iteration while looking for indexers, this is needed because the
6970         indexer may have a different name in our base classes.  Fixed the
6971         error reporting (no indexers at all, not get accessor, no
6972         overloaded match).  Fixes bug #33089.
6973         (IndexerAccess.DoResolveLValue): Likewise.
6974
6975 2002-11-14  Martin Baulig  <martin@ximian.com>
6976
6977         * class.cs (PropertyBase.CheckBase): Make this work for multiple
6978         indexers.  Fixes the first part of bug #33089.
6979         (MethodSignature.InheritableMemberSignatureCompare): Added support
6980         for properties.
6981
6982 2002-11-13  Ravi Pratap  <ravi@ximian.com>
6983
6984         * attribute.cs (Attribute.Resolve): Catch the
6985         NullReferenceException and report it since it isn't supposed to
6986         happen. 
6987
6988 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
6989
6990         * expression.cs (Binary.EmitBranchable): Also handle the cases for
6991         LogicalOr and LogicalAnd that can benefit from recursively
6992         handling EmitBranchable.  The code now should be nice for Paolo.
6993
6994 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
6995
6996         * typemanager.cs (LookupType): Added a negative-hit hashtable for
6997         the Type lookups, as we perform quite a number of lookups on
6998         non-Types.  This can be removed once we can deterministically tell
6999         whether we have a type or a namespace in advance.
7000
7001         But this might require special hacks from our corlib.
7002
7003         * TODO: updated.
7004
7005         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
7006         and double which avoids a conversion from an integer to a double.
7007
7008         * expression.cs: tiny optimization, avoid calling IsConstant,
7009         because it effectively performs the lookup twice.
7010
7011 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
7012
7013         But a bogus return here to keep the semantics of the old code
7014         until the Mono runtime is fixed.
7015
7016         * pending.cs (GetMissingInterfaces): New method used to remove all
7017         the interfaces that are already implemented by our parent
7018         classes from the list of pending methods. 
7019
7020         * interface.cs: Add checks for calls after ResolveTypeExpr.
7021
7022 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
7023
7024         * class.cs (Class.Emit): Report warning 67: event not used if the
7025         warning level is beyond 3.
7026
7027         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
7028         being a NullLiteral.
7029
7030         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
7031         specifiers. 
7032
7033         * class.cs (TypeContainer.GetClassBases): Cover a missing code
7034         path that might fail if a type can not be resolved.
7035
7036         * expression.cs (Binary.Emit): Emit unsigned versions of the
7037         operators. 
7038
7039         * driver.cs: use error 5.
7040
7041 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
7042
7043         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
7044
7045 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
7046
7047         * cs-parser.jay (switch_section): A beautiful patch from Martin
7048         Baulig that fixed 33094.
7049
7050 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
7051
7052         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
7053         Check whether the base is abstract and report an error if so.
7054
7055         * expression.cs (IndexerAccess.DoResolveLValue,
7056         IndexerAccess.DoResolve): ditto. 
7057
7058         (Invocation.DoResolve): ditto.
7059
7060         (Invocation.FullMethodDesc): Improve the report string.
7061
7062         * statement.cs (Block): Eliminate IsVariableDefined as it is
7063         basically just a wrapper for GetVariableInfo.
7064
7065         * ecore.cs (SimpleName): Use new 
7066
7067         * support.cs (ReflectionParamter.ParameterType): We unwrap the
7068         type, as we return the actual parameter ref/unref state on a
7069         different call.
7070
7071 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
7072
7073         * support.cs: Return proper flags REF/OUT fixing the previous
7074         commit.  
7075
7076         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
7077         not used to mean `ref' but `ref or out' in ParameterReference
7078
7079         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
7080         full type signature instead of calling TypeManger.CSharpName
7081         ourselves. 
7082
7083         * support.cs (InternalParameters.ParameterDesc): Do not compare
7084         directly to the modflags, because REF/OUT will actually be bitsets
7085         if set. 
7086
7087         * delegate.cs (VerifyMethod): Check also the modifiers.
7088
7089         * cs-tokenizer.cs: Fix bug where floating point values with an
7090         exponent where a sign was missing was ignored.
7091
7092         * driver.cs: Allow multiple assemblies to be specified in a single
7093         /r: argument
7094
7095 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
7096
7097         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
7098         because identifiers after a parenthesis would end up in this kind
7099         of production, and we needed to desamiguate it for having casts
7100         like:
7101
7102                 (UserDefinedType *) xxx
7103
7104 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
7105
7106         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
7107         we should set on the Bindingflags.NonPublic, but not turn on
7108         private_ok.  private_ok controls whether a Private member is
7109         returned (this is chekced on the filter routine), while the
7110         BindingFlags.NonPublic just controls whether private/protected
7111         will be allowed.   This fixes the problem part of the problem of
7112         private properties being allowed to be used in derived classes.
7113
7114         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
7115         so we can call the children DoResolveLValue method (this will
7116         properly signal errors on lvalue assignments to base properties)
7117
7118         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
7119         getter are null, and we have a property info, we know that this
7120         happened because the lookup failed, so we report an error 122 for
7121         protection level violation.
7122
7123         We also silently return if setter and getter are null in the
7124         resolve functions, this condition only happens if we have flagged
7125         the error before.  This is the other half of the problem. 
7126
7127         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
7128         not have accessibility information, that is why we were returning
7129         true in the filter function in typemanager.cs.
7130
7131         To properly report 122 (property is inaccessible because of its
7132         protection level) correctly, we report this error in ResolveAccess
7133         by failing if both the setter and the getter are lacking (ie, the
7134         lookup failed). 
7135
7136         DoResolve and DoLResolve have been modified to check for both
7137         setter/getter being null and returning silently, the reason being
7138         that I did not want to put the knowledge about this error in upper
7139         layers, like:
7140
7141         int old = Report.Errors;
7142         x = new PropertyExpr (...);
7143         if (old != Report.Errors)
7144                 return null;
7145         else
7146                 return x;
7147
7148         So the property expr is returned, but it is invalid, so the error
7149         will be flagged during the resolve process. 
7150
7151         * class.cs: Remove InheritablePropertySignatureCompare from the
7152         class, as we no longer depend on the property signature to compute
7153         whether it is possible to implement a method or not.
7154
7155         The reason is that calling PropertyInfo.GetGetMethod will return
7156         null (in .NET, in Mono it works, and we should change this), in
7157         cases where the Get Method does not exist in that particular
7158         class.
7159
7160         So this code:
7161
7162         class X { public virtual int A { get { return 1; } } }
7163         class Y : X { }
7164         class Z : Y { public override int A { get { return 2; } } }
7165
7166         Would fail in Z because the parent (Y) would not have the property
7167         defined.  So we avoid this completely now (because the alternative
7168         fix was ugly and slow), and we now depend exclusively on the
7169         method names.
7170
7171         (PropertyBase.CheckBase): Use a method-base mechanism to find our
7172         reference method, instead of using the property.
7173
7174         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
7175         routines are gone now.
7176
7177         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
7178         names, they were incorrectly named.
7179
7180         * cs-tokenizer.cs: Return are more gentle token on failure. 
7181
7182         * pending.cs (PendingImplementation.InterfaceMethod): This routine
7183         had an out-of-sync index variable, which caused it to remove from
7184         the list of pending methods the wrong method sometimes.
7185
7186 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
7187
7188         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
7189         CanWrite, because those refer to this particular instance of the
7190         property, and do not take into account the fact that we can
7191         override single members of a property.
7192
7193         Constructor requires an EmitContext.  The resolution process does
7194         not happen here, but we need to compute the accessors before,
7195         because the resolution does not always happen for properties.
7196
7197         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
7198         subclass, before we did not update this flag, but we did update
7199         bindingflags. 
7200
7201         (GetAccessors): Drop this routine, as it did not work in the
7202         presence of partially overwritten set/get methods. 
7203
7204         Notice that this broke the cs1540 detection, but that will require
7205         more thinking. 
7206
7207 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7208
7209         * class.cs:
7210         * codegen.cs:
7211         * driver.cs: issue a warning instead of an error if we don't support
7212         debugging for the platform. Also ignore a couple of errors that may
7213         arise when trying to write the symbols. Undo my previous patch.
7214
7215 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7216
7217         * driver.cs: ignore /debug switch except for Unix platforms.
7218
7219 2002-10-23  Nick Drochak  <ndrochak@gol.com>
7220
7221         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
7222
7223 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
7224
7225         * driver.cs: Do not make mcs-debug conditional, so we do not break
7226         builds that use it.
7227
7228         * statement.cs (UsageVector.MergeChildren): I would like Martin to
7229         review this patch.  But basically after all the children variables
7230         have been merged, the value of "Breaks" was not being set to
7231         new_breaks for Switch blocks.  I think that it should be set after
7232         it has executed.  Currently I set this to the value of new_breaks,
7233         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
7234         conservative, but I do not understand this code very well.
7235
7236         I did not break anything in the build, so that is good ;-)
7237
7238         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
7239
7240 2002-10-20  Mark Crichton  <crichton@gimp.org>
7241
7242         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
7243
7244 2002-10-20  Nick Drochak  <ndrochak@gol.com>
7245
7246         * cfold.cs: Fixed compile blocker.
7247
7248 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
7249
7250         * driver.cs: I was chekcing the key, not the file.
7251
7252 2002-10-19  Ravi Pratap  <ravi@ximian.com>
7253
7254         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
7255         message that we were generating - we just need to silently return
7256         a null.
7257
7258 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
7259
7260         * class.cs (Event.Define): Change my previous commit, as this
7261         breaks the debugger.  This is a temporary hack, as it seems like
7262         the compiler is generating events incorrectly to begin with.
7263
7264         * expression.cs (Binary.ResolveOperator): Added support for 
7265         "U operator - (E x, E y)"
7266
7267         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
7268         y)".
7269
7270         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
7271         init-only variables, but this path did not take into account that
7272         there might be also instance readonly variables.  Correct this
7273         problem. 
7274
7275         This fixes bug 32253
7276
7277         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
7278         delegates as well.
7279
7280         * driver.cs: Change the extension for modules to `netmodule'
7281
7282         * cs-parser.jay: Improved slightly the location tracking for
7283         the debugger symbols.
7284
7285         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
7286         modifiers that were specified instead of the hardcoded value
7287         (FamAndAssem).  This was basically ignoring the static modifier,
7288         and others.  Fixes 32429.
7289
7290         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
7291         fixed a bug in the process (32476)
7292
7293         * expression.cs (ArrayAccess.EmitAssign): Patch from
7294         hwang_rob@yahoo.ca that fixes bug 31834.3
7295
7296 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
7297
7298         * driver.cs: Make the module extension .netmodule.
7299
7300 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
7301
7302         * driver.cs: Report an error if the resource file is not found
7303         instead of crashing.
7304
7305         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
7306         false, like Emit does.
7307
7308 2002-10-16  Nick Drochak  <ndrochak@gol.com>
7309
7310         * typemanager.cs: Remove unused private member.  Also reported mcs
7311         bug to report this as a warning like csc.
7312
7313 2002-10-15  Martin Baulig  <martin@gnome.org>
7314
7315         * statement.cs (Statement.Emit): Made this a virtual method; emits
7316         the line number info and calls DoEmit().
7317         (Statement.DoEmit): New protected abstract method, formerly knows
7318         as Statement.Emit().
7319
7320         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
7321
7322 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
7323
7324         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
7325         have fixed a remaining problem: not every AddXXXX was adding a
7326         fully qualified name.  
7327
7328         Now everyone registers a fully qualified name in the DeclSpace as
7329         being defined instead of the partial name.  
7330
7331         Downsides: we are slower than we need to be due to the excess
7332         copies and the names being registered this way.  
7333
7334         The reason for this is that we currently depend (on the corlib
7335         bootstrap for instance) that types are fully qualified, because
7336         we dump all the types in the namespace, and we should really have
7337         types inserted into the proper namespace, so we can only store the
7338         basenames in the defined_names array.
7339
7340 2002-10-10  Martin Baulig  <martin@gnome.org>
7341
7342         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
7343         from bug #31834, see the bug report for a testcase which is
7344         miscompiled.
7345
7346 2002-10-10  Martin Baulig  <martin@gnome.org>
7347
7348         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
7349         flow analysis code for this.
7350
7351         * statement.cs (Do, While, For): Tell the flow analysis code about
7352         infinite loops.
7353         (FlowBranching.UsageVector): Added support for infinite loops.
7354         (Block.Resolve): Moved the dead code elimination here and use flow
7355         analysis to do it.
7356
7357 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
7358
7359         * class.cs (Field.Define): Catch cycles on struct type
7360         definitions. 
7361
7362         * typemanager.cs (IsUnmanagedtype): Do not recursively check
7363         fields if the fields are static.  We only need to check instance
7364         fields. 
7365
7366         * expression.cs (As.DoResolve): Test for reference type.
7367
7368         * statement.cs (Using.ResolveExpression): Use
7369         ConvertImplicitRequired, not ConvertImplicit which reports an
7370         error on failture
7371         (Using.ResolveLocalVariableDecls): ditto.
7372
7373         * expression.cs (Binary.ResolveOperator): Report errors in a few
7374         places where we had to.
7375
7376         * typemanager.cs (IsUnmanagedtype): Finish implementation.
7377
7378 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
7379
7380         * expression.cs: Use StoreFromPtr instead of extracting the type
7381         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
7382
7383         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
7384         an enumeration value to a System.Enum, but System.Enum is not a
7385         value type, but an class type, so we need to box.
7386
7387         (Expression.ConvertExplicit): One codepath could return
7388         errors but not flag them.  Fix this.  Fixes #31853
7389
7390         * parameter.cs (Resolve): Do not allow void as a parameter type.
7391
7392 2002-10-06  Martin Baulig  <martin@gnome.org>
7393
7394         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
7395         if it's a class type and not a struct.  Fixes #31815.
7396
7397 2002-10-06  Martin Baulig  <martin@gnome.org>
7398
7399         * statement.cs: Reworked the flow analysis code a bit to make it
7400         usable for dead code elimination.
7401
7402 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7403
7404         * cs-parser.jay: allow empty source files. Fixes bug #31781.
7405
7406 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
7407
7408         * expression.cs (ComposedCast.DoResolveType): A quick workaround
7409         to fix the test 165, will investigate deeper.
7410
7411 2002-10-04  Martin Baulig  <martin@gnome.org>
7412
7413         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
7414         finally blocks actually work.
7415         (Try.Resolve): We don't need to create a sibling for `finally' if
7416         there is no finally block.
7417
7418 2002-10-04  Martin Baulig  <martin@gnome.org>
7419
7420         * class.cs (Constructor.Define): The default accessibility for a
7421         non-default constructor is private, not public.
7422
7423 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
7424
7425         * class.cs (Constructor): Make AllowedModifiers public, add
7426         EXTERN.
7427
7428         * cs-parser.jay: Perform the modifiers test here, as the
7429         constructor for the Constructor class usually receives a zero
7430         because of the way we create it (first we create, later we
7431         customize, and we were never checking the modifiers).
7432
7433         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
7434         is a version of LookupTypeReflection that includes the type-name
7435         cache.  This can be used as a fast path for functions that know
7436         the fully qualified name and are only calling into *.GetType() to
7437         obtain a composed type.
7438
7439         This is also used by TypeManager.LookupType during its type
7440         composition.
7441
7442         (LookupType): We now also track the real type name, as sometimes
7443         we can get a quey for the real type name from things like
7444         ComposedCast.  This fixes bug 31422.
7445
7446         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
7447         complete type fullname, it does not have to go through the type
7448         resolution system to obtain the composed version of the type (for
7449         obtaining arrays or pointers).
7450
7451         (Conditional.Emit): Use the EmitBoolExpression to
7452         generate nicer code, as requested by Paolo.
7453
7454         (ArrayCreation.CheckIndices): Use the patch from
7455         hwang_rob@yahoo.ca to validate the array initializers. 
7456
7457 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
7458
7459         * class.cs (ConstructorInitializer.Emit): simplify code by using
7460         Invocation.EmitCall, and at the same time, fix the bugs in calling
7461         parent constructors that took variable arguments. 
7462
7463         * ecore.cs (Expression.ConvertNumericExplicit,
7464         Expression.ImplicitNumericConversion): Remove the code that
7465         manually wrapped decimal (InternalTypeConstructor call is now gone
7466         as well).
7467
7468         * expression.cs (Cast.TryReduce): Also handle decimal types when
7469         trying to perform a constant fold on the type.
7470
7471         * typemanager.cs (IsUnmanagedtype): Partially implemented.
7472
7473         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
7474         that only turned off an error report, and did nothing else. 
7475
7476 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
7477
7478         * driver.cs: Handle and ignore /fullpaths
7479
7480 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
7481
7482         * expression.cs (Binary.ResolveOperator): Catch the case where
7483         DoNumericPromotions returns true, 
7484
7485         (Binary.DoNumericPromotions): Simplify the code, and the tests.
7486
7487 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
7488
7489         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
7490         report error 70.
7491
7492 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
7493
7494         * ecore.cs (ConvertNumericExplicit): It is not enough that the
7495         conversion exists, but it is also required that the conversion be
7496         performed.  This manifested in "(Type64Enum) 2".  
7497
7498         * class.cs (TypeManager.AddMethod): The fix is not to change
7499         AddEnum, because that one was using a fully qualified name (every
7500         DeclSpace derivative does), but to change the AddMethod routine
7501         that was using an un-namespaced name.  This now correctly reports
7502         the duplicated name.
7503
7504         Revert patch until I can properly fix it.  The issue
7505         is that we have a shared Type space across all namespaces
7506         currently, which is wrong.
7507
7508         Options include making the Namespace a DeclSpace, and merge
7509         current_namespace/current_container in the parser.
7510
7511 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
7512
7513         * cs-parser.jay: Improve error reporting when we get a different
7514         kind of expression in local_variable_type and
7515         local_variable_pointer_type. 
7516
7517         Propagate this to avoid missleading errors being reported.
7518
7519         * ecore.cs (ImplicitReferenceConversion): treat
7520         TypeManager.value_type as a target just like object_type.   As
7521         code like this:
7522
7523         ValueType v = 1;
7524
7525         Is valid, and needs to result in the int 1 being boxed before it
7526         is assigned to the value type v.
7527
7528         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
7529         to validate the enumeration name.
7530
7531         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
7532         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
7533         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
7534
7535         * ecore.cs (TryImplicitIntConversion): When doing an
7536         implicit-enumeration-conversion, check if the type is 64-bits and
7537         perform a conversion before passing to EnumConstant.
7538
7539 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
7540
7541         * decl.cs (Error_AmbiguousTypeReference); New routine used to
7542         report ambiguous type references.  Unlike the MS version, we
7543         report what the ambiguity is.   Innovation at work ;-)
7544
7545         (DeclSpace.FindType): Require a location argument to
7546         display when we display an ambiguous error.
7547
7548         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
7549
7550         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
7551
7552         * expression.cs (EmitDynamicInitializers): Apply patch from
7553         hwang_rob@yahoo.ca that fixes the order in which we emit our
7554         initializers. 
7555
7556 2002-09-21  Martin Baulig  <martin@gnome.org>
7557
7558         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
7559         delegate takes no arguments.
7560
7561 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
7562
7563         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
7564         from integers.
7565
7566         * expression.cs: Extract the underlying type.
7567
7568         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
7569
7570         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
7571
7572 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
7573
7574         * class.cs (TypeContainer.DefineType): We can not use the nice
7575         PackingSize with the size set to 1 DefineType method, because it
7576         will not allow us to define the interfaces that the struct
7577         implements.
7578
7579         This completes the fixing of bug 27287
7580
7581         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
7582         means also structs.  This fixes part of the problem. 
7583         (Expresion.ImplicitReferenceConversionExists): ditto.
7584
7585         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
7586         error if there were no errors reported during the type lookup
7587         process, to avoid duplicates or redundant errors.  Without this
7588         you would get an ambiguous errors plus a type not found.  We have
7589         beaten the user enough with the first error.  
7590
7591         (DeclSparce.FindType): Emit a warning if we have an ambiguous
7592         reference. 
7593
7594         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
7595         during the resolution process, stop the lookup, this avoids
7596         repeated error reports (same error twice).
7597
7598         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
7599
7600         * typemanager.cs (LookupType): Redo the type lookup code to match
7601         the needs of System.Reflection.  
7602
7603         The issue is that System.Reflection requires references to nested
7604         types to begin with a "+" sign instead of a dot.  So toplevel
7605         types look like: "NameSpace.TopLevelClass", and nested ones look
7606         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
7607         levels. 
7608
7609 2002-09-19  Martin Baulig  <martin@gnome.org>
7610
7611         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
7612         says that a method always returns or always throws an exception,
7613         don't report the CS0161.
7614
7615         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
7616         set `Returns = new_returns'.
7617
7618 2002-09-19  Martin Baulig  <martin@gnome.org>
7619
7620         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
7621         to an enum constant, check for a CS0176.
7622
7623 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
7624
7625         * class.cs (TypeContainer.CheckPairedOperators): Now we check
7626         for operators that must be in pairs and report errors.
7627
7628         * ecore.cs (SimpleName.DoResolveType): During the initial type
7629         resolution process, when we define types recursively, we must
7630         check first for types in our current scope before we perform
7631         lookups in the enclosing scopes.
7632
7633         * expression.cs (MakeByteBlob): Handle Decimal blobs.
7634
7635         (Invocation.VerifyArgumentsCompat): Call
7636         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
7637         I thought we were supposed to always call this, but there are a
7638         few places in the code where we dont do it.
7639
7640 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
7641
7642         * driver.cs: Add support in -linkres and -resource to specify the
7643         name of the identifier.
7644
7645 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
7646
7647         * ecore.cs (StandardConversionExists): Sync with the conversion
7648         code: allow anything-* to void* conversions.
7649
7650         (FindMostSpecificSource): Use an Expression argument
7651         instead of a Type, because we might be handed over a Literal which
7652         gets a few more implicit conversions that plain types do not.  So
7653         this information was being lost.
7654
7655         Also, we drop the temporary type-holder expression when not
7656         required.
7657
7658 2002-09-17  Martin Baulig  <martin@gnome.org>
7659
7660         * class.cs (PropertyBase.CheckBase): Don't check the base class if
7661         this is an explicit interface implementation.
7662
7663 2002-09-17  Martin Baulig  <martin@gnome.org>
7664
7665         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
7666         different `IndexerName' attributes.
7667
7668         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
7669         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
7670         virtual CommonResolve().
7671
7672 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
7673
7674         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
7675         and convert that to the UnderlyingType.
7676
7677         * statement.cs (Foreach.Resolve): Indexers are just like variables
7678         or PropertyAccesses.
7679
7680         * cs-tokenizer.cs (consume_string): Track line numbers and columns
7681         inside quoted strings, we were not doing this before.
7682
7683 2002-09-16  Martin Baulig  <martin@gnome.org>
7684
7685         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
7686         resolve it.  This is needed for the definite assignment check of the
7687         instance expression, fixes bug #29846.
7688         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
7689
7690 2002-09-16  Nick Drochak  <ndrochak@gol.com>
7691
7692         * parameter.cs: Fix compile error.  Cannot reference static member
7693         from an instance object.  Is this an mcs bug?
7694
7695 2002-09-14  Martin Baulig  <martin@gnome.org>
7696
7697         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
7698         multiple times.  Fixes bug #30295, added test-166.cs.
7699
7700 2002-09-14  Martin Baulig  <martin@gnome.org>
7701
7702         * statement.cs (Block.Emit): Don't emit unreachable code.
7703         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
7704         `break' statements.
7705         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
7706
7707 2002-09-14  Martin Baulig  <martin@gnome.org>
7708
7709         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
7710         is set.
7711
7712 2002-09-14  Martin Baulig  <martin@gnome.org>
7713
7714         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
7715         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
7716         be false on the ms runtime.
7717
7718 2002-09-13  Martin Baulig  <martin@gnome.org>
7719
7720         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
7721         the CS0038 error message.
7722
7723 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
7724
7725         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
7726         constant inside, return it.
7727
7728 2002-09-12  Martin Baulig  <martin@gnome.org>
7729
7730         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
7731         implicit conversion can be done between enum types.
7732
7733         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
7734         check whether an implicit conversion to the current enum's UnderlyingType
7735         exists and report an error if not.
7736
7737         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
7738         without debugging support.
7739
7740         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
7741         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
7742
7743 2002-09-12  Martin Baulig  <martin@gnome.org>
7744
7745         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
7746
7747         * ecore.cs (IMemberExpr.DeclaringType): New property.
7748         (SimpleName.SimpleNameResolve): Check whether we're accessing a
7749         nonstatic member of an outer type (CS0038).
7750
7751 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
7752
7753         * driver.cs: Activate the using-error detector at warning level
7754         4 (at least for MS-compatible APIs).
7755
7756         * namespace.cs (VerifyUsing): Small buglett fix.
7757
7758         * pending.cs (PendingImplementation): pass the container pointer. 
7759
7760         * interface.cs (GetMethods): Allow for recursive definition.  Long
7761         term, I would like to move every type to support recursive
7762         definitions, not the current ordering mechanism that we have right
7763         now.
7764
7765         The situation is this: Attributes are handled before interfaces,
7766         so we can apply attributes to interfaces.  But some attributes
7767         implement interfaces, we will now handle the simple cases
7768         (recursive definitions will just get an error).  
7769
7770         * parameter.cs: Only invalidate types at the end if we fail to
7771         lookup all types.  
7772
7773 2002-09-09  Martin Baulig  <martin@gnome.org>
7774
7775         * ecore.cs (PropertyExpr.Emit): Also check for
7776         TypeManager.system_int_array_get_length so this'll also work when
7777         compiling corlib.  Fixes #30003.
7778
7779 2002-09-09  Martin Baulig  <martin@gnome.org>
7780
7781         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
7782         and throw an exception if we can't get the type's size.  Fixed #30040,
7783         added test-165.cs.
7784
7785 2002-09-09  Martin Baulig  <martin@gnome.org>
7786
7787         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
7788
7789         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
7790         context.  Fixes bug #30027.
7791
7792         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
7793         virtual functions.  Fixes bug #30043, added test-164.cs.
7794
7795 2002-09-08  Ravi Pratap  <ravi@ximian.com>
7796
7797         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
7798
7799 2002-09-08  Nick Drochak  <ndrochak@gol.com>
7800
7801         * driver.cs: Use an object to get the windows codepage since it's not a
7802         static property.
7803
7804 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
7805
7806         * statement.cs (For.Emit): for infinite loops (test == null)
7807         return whether there is a break inside, not always "true".
7808
7809         * namespace.cs (UsingEntry): New struct to hold the name of the
7810         using definition, the location where it is defined, and whether it
7811         has been used in a successful type lookup.
7812
7813         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
7814         strings.
7815
7816         * decl.cs: ditto.
7817
7818 2002-09-06  Ravi Pratap  <ravi@ximian.com>
7819
7820         * attribute.cs : Fix incorrect code which relied on catching
7821         a NullReferenceException to detect a null being passed in
7822         where an object was expected.
7823
7824 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
7825
7826         * statement.cs (Try): flag the catch variable as assigned
7827
7828         * expression.cs (Cast): Simplified by using ResolveType instead of
7829         manually resolving.
7830
7831         * statement.cs (Catch): Fix bug by using ResolveType.
7832
7833 2002-09-06  Ravi Pratap  <ravi@ximian.com>
7834
7835         * expression.cs (BetterConversion): Special case for when we have
7836         a NullLiteral as the argument and we have to choose between string
7837         and object types - we choose string the way csc does.
7838
7839         * attribute.cs (Attribute.Resolve): Catch the
7840         NullReferenceException and report error #182 since the Mono
7841         runtime no more has the bug and having this exception raised means
7842         we tried to select a constructor which takes an object and is
7843         passed a null.
7844
7845 2002-09-05  Ravi Pratap  <ravi@ximian.com>
7846
7847         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
7848         message (1502, 1503) when we can't locate a method after overload
7849         resolution. This is much more informative and closes the bug
7850         Miguel reported.
7851
7852         * interface.cs (PopulateMethod): Return if there are no argument
7853         types. Fixes a NullReferenceException bug.
7854
7855         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
7856         expressions too. Previously we were checking only in one place for
7857         positional arguments leaving out named arguments.
7858
7859         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
7860         type to the enum type is not allowed. Remove code corresponding to
7861         that.
7862
7863         (ConvertNumericExplicit): Allow explicit conversions from
7864         the underlying type to enum type. This precisely follows the spec
7865         and closes a bug filed by Gonzalo.
7866
7867 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7868
7869         * compiler.csproj:
7870         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
7871
7872 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
7873
7874         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
7875         it was important that we stored the right value after the
7876         reduction in `converted'.
7877
7878 2002-09-04  Martin Baulig  <martin@gnome.org>
7879
7880         * location.cs (Location.SymbolDocument): Use full pathnames for the
7881         source files.
7882
7883 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
7884
7885         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
7886         of the expression resolve mechanism, because that will catch the
7887         SimpleName error failures.
7888
7889         (Conditional): If we can not resolve the
7890         expression, return, do not crash.
7891
7892 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7893
7894         * cs-tokenizer.cs:
7895         (location): display token name instead of its number.
7896
7897 2002-08-28  Martin Baulig  <martin@gnome.org>
7898
7899         * expression.cs (Binary.ResolveOperator): Don't silently return
7900         but return an error if an operator cannot be applied between two
7901         enum types.
7902
7903 2002-08-28  Martin Baulig  <martin@gnome.org>
7904
7905         * class.cs (Constructor.Define): Set the permission attributes
7906         correctly instead of making all constructors public.
7907
7908 2002-08-28  Martin Baulig  <martin@gnome.org>
7909
7910         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
7911         for private members before reporting a CS0103; if we find anything,
7912         it's a CS0122.
7913
7914 2002-08-28  Martin Baulig  <martin@gnome.org>
7915
7916         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
7917         to check whether `closure_start_type == closure_invocation_type',
7918         we also need to check whether `m.DeclaringType == closure_invocation_type'
7919         before bypassing the permission checks.  We might be accessing
7920         protected/private members from the base class.
7921         (TypeManager.RealMemberLookup): Only set private_ok if private
7922         members were requested via BindingFlags.NonPublic.
7923
7924         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
7925
7926         * expression.cs (MemberAccess.ResolveMemberAccess): Set
7927         MethodGroupExpr.IsExplicitImpl if appropriate.
7928         (Invocation.DoResolve): Don't report the CS0120 for explicit
7929         interface implementations.
7930
7931 2002-08-27  Martin Baulig  <martin@gnome.org>
7932
7933         * expression.cs (Invocation.DoResolve): If this is a static
7934         method and we don't have an InstanceExpression, we must report
7935         a CS0120.
7936
7937 2002-08-25  Martin Baulig  <martin@gnome.org>
7938
7939         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
7940         `==' between a valuetype and an object.
7941
7942 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
7943
7944         * ecore.cs (TypeExpr): Provide a ToString method.
7945
7946 2002-08-24  Martin Baulig  <martin@gnome.org>
7947
7948         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
7949         now called proggie.dbg and it's a binary file.
7950
7951 2002-08-23  Martin Baulig  <martin@gnome.org>
7952
7953         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
7954
7955 2002-08-23  Martin Baulig  <martin@gnome.org>
7956
7957         * struct.cs (MyStructInfo.ctor): Make this work with empty
7958         structs; it's not allowed to use foreach() on null.
7959
7960 2002-08-23  Martin Baulig  <martin@gnome.org>
7961
7962         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
7963         writer the full pathname of the generated assembly.
7964
7965 2002-08-23  Martin Baulig  <martin@gnome.org>
7966
7967         * statements.cs (FlowBranching.UsageVector.MergeChildren):
7968         A `finally' block never returns or breaks; improved handling of
7969         unreachable code.
7970
7971 2002-08-23  Martin Baulig  <martin@gnome.org>
7972
7973         * statement.cs (Throw.Resolve): Allow `throw null'.
7974
7975 2002-08-23  Martin Baulig  <martin@gnome.org>
7976
7977         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
7978         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
7979         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
7980         MemberLookup would return a wrong event if this is an explicit
7981         interface implementation and the class has an event with the same
7982         name.
7983
7984 2002-08-23  Martin Baulig  <martin@gnome.org>
7985
7986         * statement.cs (Block.AddChildVariableNames): New public method.
7987         (Block.AddChildVariableName): Likewise.
7988         (Block.IsVariableNameUsedInChildBlock): Likewise.
7989         (Block.AddVariable): Check whether a variable name has already
7990         been used in a child block.
7991
7992         * cs-parser.jay (declare_local_variables): Mark all variable names
7993         from the current block as being used in a child block in the
7994         implicit block.
7995
7996 2002-08-23  Martin Baulig  <martin@gnome.org>
7997
7998         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
7999         find the symbol writer.
8000
8001         * driver.cs: csc also allows the arguments to /define being
8002         separated by commas, not only by semicolons.
8003
8004 2002-08-23  Martin Baulig  <martin@gnome.org>
8005
8006         * interface.cs (Interface.GetMembers): Added static check for events.
8007
8008 2002-08-15  Martin Baulig  <martin@gnome.org>
8009
8010         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
8011         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
8012
8013         * ecore.cs (Expression.MemberLookup): Added documentation and explained
8014         why the MethodData.EmitDestructor() change was necessary.
8015
8016 2002-08-20  Martin Baulig  <martin@gnome.org>
8017
8018         * class.cs (TypeContainer.FindMembers): Added static check for events.
8019
8020         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
8021
8022         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
8023         use Type.GetEvents(), not Type.FindMembers().
8024
8025 2002-08-20  Martin Baulig  <martin@gnome.org>
8026
8027         * decl.cs (MemberCache): Added a special method cache which will
8028         be used for method-only searched.  This ensures that a method
8029         search will return a MethodInfo with the correct ReflectedType for
8030         inherited methods.      
8031
8032 2002-08-20  Martin Baulig  <martin@gnome.org>
8033
8034         * decl.cs (DeclSpace.FindMembers): Made this public.
8035
8036 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8037
8038         * delegate.cs: fixed build on windows.
8039         [FIXME:  Filed as bug #29150: MCS must report these errors.]
8040
8041 2002-08-19  Ravi Pratap  <ravi@ximian.com>
8042
8043         * ecore.cs (StandardConversionExists): Return a false
8044         if we are trying to convert the void type to anything else
8045         since that is not allowed.
8046
8047         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
8048         we flag error 70 in the event an event is trying to be accessed
8049         directly from outside the declaring type.
8050
8051 2002-08-20  Martin Baulig  <martin@gnome.org>
8052
8053         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
8054         MemberCache from typemanager.cs to decl.cs.
8055
8056 2002-08-19  Martin Baulig  <martin@gnome.org>
8057
8058         * class.cs (TypeContainer): Implement IMemberContainer.
8059         (TypeContainer.DefineMembers): Create the MemberCache.
8060         (TypeContainer.FindMembers): Do better BindingFlags checking; only
8061         return public members if BindingFlags.Public was given, check
8062         whether members are static.
8063
8064 2002-08-16  Martin Baulig  <martin@gnome.org>
8065
8066         * decl.cs (DeclSpace.Define): Splitted this in Define and
8067         DefineMembers.  DefineMembers is called first and initializes the
8068         MemberCache.
8069
8070         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
8071         DefineMembers() on all our DeclSpaces.
8072
8073         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
8074         but call DefineMembers() on all nested interfaces.  We call their
8075         Define() in our new Define() function.
8076
8077         * interface.cs (Interface): Implement IMemberContainer.
8078         (Interface.Define): Moved all code except the attribute stuf to
8079         DefineMembers().
8080         (Interface.DefineMembers): Initialize the member cache.
8081
8082         * typemanager.cs (IMemberFinder): Removed this interface, we don't
8083         need this anymore since we can use MemberCache.FindMembers directly.
8084
8085 2002-08-19  Martin Baulig  <martin@gnome.org>
8086
8087         * typemanager.cs (MemberCache): When creating the cache for an
8088         interface type, add all inherited members.
8089         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
8090         to `out bool used_cache' and documented it.
8091         (TypeManager.MemberLookup): If we already used the cache in the first
8092         iteration, we don't need to do the interfaces check.
8093
8094 2002-08-19  Martin Baulig  <martin@gnome.org>
8095
8096         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
8097         here from IMemberFinder and don't implement this interface anymore.
8098         (DeclSpace.MemberCache): Moved here from IMemberFinder.
8099
8100         * typemanager.cs (IMemberFinder): This interface is now only used by
8101         classes which actually support the member cache.
8102         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
8103         since we only put DeclSpaces into this Hashtable.
8104         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
8105         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
8106
8107 2002-08-16  Martin Baulig  <martin@gnome.org>
8108
8109         * typemanager.cs (ICachingMemberFinder): Removed.
8110         (IMemberFinder.MemberCache): New property.
8111         (TypeManager.FindMembers): Merged this with RealFindMembers().
8112         This function will never be called from TypeManager.MemberLookup()
8113         so we can't use the cache here, just the IMemberFinder.
8114         (TypeManager.MemberLookup_FindMembers): Check whether the
8115         IMemberFinder has a MemberCache and call the cache's FindMembers
8116         function.
8117         (MemberCache): Rewrote larger parts of this yet another time and
8118         cleaned it up a bit.
8119
8120 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
8121
8122         * driver.cs (LoadArgs): Support quoting.
8123
8124         (Usage): Show the CSC-like command line arguments.
8125
8126         Improved a few error messages.
8127
8128 2002-08-15  Martin Baulig  <martin@gnome.org>
8129
8130         * typemanager.cs (IMemberContainer.Type): New property.
8131         (IMemberContainer.IsInterface): New property.
8132
8133         The following changes are conditional to BROKEN_RUNTIME, which is
8134         defined at the top of the file.
8135
8136         * typemanager.cs (MemberCache.MemberCache): Don't add the base
8137         class'es members, but add all members from TypeHandle.ObjectType
8138         if we're an interface.
8139         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
8140         is the current type.
8141         (MemberCache.CacheEntry.Container): Removed this field.
8142         (TypeHandle.GetMembers): Include inherited members.
8143
8144 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8145
8146         * typemanager.cs: fixed compilation and added a comment on a field that
8147         is never used.
8148
8149 2002-08-15  Martin Baulig  <martin@gnome.org>
8150
8151         * class.cs (ConstructorInitializer.Resolve): In the
8152         Expression.MemberLookup call, use the queried_type as
8153         invocation_type.
8154
8155         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
8156         declared' attribute, it's always true.
8157         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
8158         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
8159         temporary wrapper for FindMembers which tells MemberLookup whether
8160         members from the base classes are included in the return value.
8161         This will go away soon.
8162         (TypeManager.MemberLookup): Use this temporary hack here; once the
8163         new MemberCache is completed, we don't need to do the DeclaredOnly
8164         looping here anymore since the MemberCache will take care of this.
8165         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
8166         (MemberCache): When creating the MemberCache for a class, get
8167         members from the current class and all its base classes.
8168         (MemberCache.CacheEntry.Container): New field.  This is a
8169         temporary hack until the Mono runtime is fixed to distinguish
8170         between ReflectedType and DeclaringType.  It allows us to use MCS
8171         with both the MS runtime and the unfixed Mono runtime without
8172         problems and without accecting performance.
8173         (MemberCache.SearchMembers): The DeclaredOnly looping from
8174         TypeManager.MemberLookup is now done here.      
8175
8176 2002-08-14  Martin Baulig  <martin@gnome.org>
8177
8178         * statement.cs (MyStructInfo.MyStructInfo): Don't call
8179         Type.GetFields on dynamic types but get the fields from the
8180         corresponding TypeContainer.
8181         (MyStructInfo.GetStructInfo): Added check for enum types.
8182
8183         * typemanager.cs (MemberList.IsSynchronized): Implemented.
8184         (MemberList.SyncRoot): Implemented.
8185         (TypeManager.FilterWithClosure): No need to check permissions if
8186         closure_start_type == closure_invocation_type, don't crash if
8187         closure_invocation_type is null.
8188
8189 2002-08-13  Martin Baulig  <martin@gnome.org>
8190
8191         Rewrote TypeContainer.FindMembers to use a member cache.  This
8192         gives us a speed increase of about 35% for the self-hosting MCS
8193         build and of about 15-20% for the class libs (both on GNU/Linux).
8194
8195         * report.cs (Timer): New class to get enhanced profiling.  This
8196         whole class is "TIMER" conditional since it remarkably slows down
8197         compilation speed.
8198
8199         * class.cs (MemberList): New class.  This is an IList wrapper
8200         which we're now using instead of passing MemberInfo[]'s around to
8201         avoid copying this array unnecessarily.
8202         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
8203         (ICachingMemberFinder, IMemberContainer): New interface.
8204         (TypeManager.FilterWithClosure): If `criteria' is null, the name
8205         has already been checked, otherwise use it for the name comparision.
8206         (TypeManager.FindMembers): Renamed to RealMemberFinder and
8207         provided wrapper which tries to use ICachingMemberFinder.FindMembers
8208         if possible.  Returns a MemberList, not a MemberInfo [].
8209         (TypeHandle): New class, implements IMemberContainer.  We create
8210         one instance of this class per type, it contains a MemberCache
8211         which is used to do the member lookups.
8212         (MemberCache): New class.  Each instance of this class contains
8213         all members of a type and a name-based hash table.
8214         (MemberCache.FindMembers): This is our new member lookup
8215         function.  First, it looks up all members of the requested name in
8216         the hash table.  Then, it walks this list and sorts out all
8217         applicable members and returns them.
8218
8219 2002-08-13  Martin Baulig  <martin@gnome.org>
8220
8221         In addition to a nice code cleanup, this gives us a performance
8222         increase of about 1.4% on GNU/Linux - not much, but it's already
8223         half a second for the self-hosting MCS compilation.
8224
8225         * typemanager.cs (IMemberFinder): New interface.  It is used by
8226         TypeManager.FindMembers to call FindMembers on a TypeContainer,
8227         Enum, Delegate or Interface.
8228         (TypeManager.finder_to_member_finder): New PtrHashtable.
8229         (TypeManager.finder_to_container): Removed.
8230         (TypeManager.finder_to_delegate): Removed.
8231         (TypeManager.finder_to_interface): Removed.
8232         (TypeManager.finder_to_enum): Removed.
8233
8234         * interface.cs (Interface): Implement IMemberFinder.
8235
8236         * delegate.cs (Delegate): Implement IMemberFinder.
8237
8238         * enum.cs (Enum): Implement IMemberFinder.
8239
8240         * class.cs (TypeContainer): Implement IMemberFinder.
8241
8242 2002-08-12  Martin Baulig  <martin@gnome.org>
8243
8244         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
8245
8246 2002-08-12  Martin Baulig  <martin@gnome.org>
8247
8248         * ecore.cs (ITypeExpression): New interface for expressions which
8249         resolve to a type.
8250         (TypeExpression): Renamed to TypeLookupExpression.
8251         (Expression.DoResolve): If we're doing a types-only lookup, the
8252         expression must implement the ITypeExpression interface and we
8253         call DoResolveType() on it.
8254         (SimpleName): Implement the new ITypeExpression interface.
8255         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
8256         hack, the situation that we're only looking up types can't happen
8257         anymore when this method is called.  Moved the type lookup code to
8258         DoResolveType() and call it.
8259         (SimpleName.DoResolveType): This ITypeExpression interface method
8260         is now doing the types-only lookup.
8261         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
8262         (ResolveFlags): Added MaskExprClass.
8263
8264         * expression.cs (MemberAccess): Implement the ITypeExpression
8265         interface.
8266         (MemberAccess.DoResolve): Added support for a types-only lookup
8267         when we're called via ITypeExpression.DoResolveType().
8268         (ComposedCast): Implement the ITypeExpression interface.
8269
8270         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
8271         Expression.Resolve() with ResolveFlags.Type instead.
8272
8273 2002-08-12  Martin Baulig  <martin@gnome.org>
8274
8275         * interface.cs (Interface.Define): Apply attributes.
8276
8277         * attribute.cs (Attribute.ApplyAttributes): Added support for
8278         interface attributes.
8279
8280 2002-08-11  Martin Baulig  <martin@gnome.org>
8281
8282         * statement.cs (Block.Emit): Only check the "this" variable if we
8283         do not always throw an exception.
8284
8285         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
8286         whether the property has a set accessor.
8287
8288 2002-08-11  Martin Baulig  <martin@gnome.org>
8289
8290         Added control flow analysis support for structs.
8291
8292         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
8293         with control flow analysis turned off.
8294         (IVariable): New interface.
8295         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
8296         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
8297         (FieldExpr.DoResolve): Resolve the instance expression with flow
8298         analysis turned off and do the definite assignment check after the
8299         resolving when we know what the expression will resolve to.
8300
8301         * expression.cs (LocalVariableReference, ParameterReference):
8302         Implement the new IVariable interface, only call the flow analysis
8303         code if ec.DoFlowAnalysis is true.
8304         (This): Added constructor which takes a Block argument.  Implement
8305         the new IVariable interface.
8306         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
8307         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
8308         This does the definite assignment checks for struct members.
8309
8310         * class.cs (Constructor.Emit): If this is a non-static `struct'
8311         constructor which doesn't have any initializer, call
8312         Block.AddThisVariable() to tell the flow analysis code that all
8313         struct elements must be initialized before control returns from
8314         the constructor.
8315
8316         * statement.cs (MyStructInfo): New public class.
8317         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
8318         argument to this indexer.  If non-zero, check an individual struct
8319         member, not the whole struct.
8320         (FlowBranching.CheckOutParameters): Check struct members.
8321         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
8322         overloaded versions of these methods which take an additional
8323         `int field_idx' argument to check struct members.
8324         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
8325         overloaded versions of these methods which take an additional
8326         `string field_name' argument to check struct member.s
8327         (VariableInfo): Implement the IVariable interface.
8328         (VariableInfo.StructInfo): New public property.  Returns the
8329         MyStructInfo instance of the variable if it's a struct or null.
8330         (Block.AddThisVariable): New public method.  This is called from
8331         Constructor.Emit() for non-static `struct' constructor which do
8332         not have any initializer.  It creates a special variable for the
8333         "this" instance variable which will be checked by the flow
8334         analysis code to ensure that all of the struct's fields are
8335         initialized before control returns from the constructor.
8336         (UsageVector): Added support for struct members.  If a
8337         variable/parameter is a struct with N members, we reserve a slot
8338         in the usage vector for each member.  A struct is considered fully
8339         initialized if either the struct itself (slot 0) or all its
8340         members are initialized.
8341
8342 2002-08-08  Martin Baulig  <martin@gnome.org>
8343
8344         * driver.cs (Driver.MainDriver): Only report an error CS5001
8345         if there were no compilation errors.
8346
8347         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
8348         `UnsafeContext' property to determine whether the parent is in
8349         unsafe context rather than checking the parent's ModFlags:
8350         classes nested in an unsafe class are unsafe as well.
8351
8352 2002-08-08  Martin Baulig  <martin@gnome.org>
8353
8354         * statement.cs (UsageVector.MergeChildren): Distinguish between
8355         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
8356         we return.  Added test17() and test18() to test-154.cs.
8357
8358 2002-08-08  Martin Baulig  <martin@gnome.org>
8359
8360         * typemanager.cs (TypeManager.FilterWithClosure): If we have
8361         Family access, make sure the invoking type isn't a subclass of the
8362         queried type (that'd be a CS1540).
8363
8364         * ecore.cs (Expression.MemberLookup): Added overloaded version of
8365         this method which takes an additional `Type invocation_type'.
8366
8367         * expression.cs (BaseAccess.DoResolve): Use the base type as
8368         invocation and query type.
8369         (MemberAccess.DoResolve): If the lookup failed and we're about to
8370         report a CS0122, try a lookup with the ec.ContainerType - if this
8371         succeeds, we must report a CS1540.
8372
8373 2002-08-08  Martin Baulig  <martin@gnome.org>
8374
8375         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
8376         (MethodGroupExpr): Implement the IMemberExpr interface.
8377
8378         * expression (MemberAccess.ResolveMemberAccess): No need to have
8379         any special code for MethodGroupExprs anymore, they're now
8380         IMemberExprs.   
8381
8382 2002-08-08  Martin Baulig  <martin@gnome.org>
8383
8384         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
8385         Family, FamANDAssem and FamORAssem permissions.
8386         (TypeManager.IsSubclassOrNestedChildOf): New public method.
8387
8388 2002-08-08  Martin Baulig  <martin@gnome.org>
8389
8390         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
8391         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
8392         or loop block.
8393
8394 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
8395
8396         * driver.cs: implemented /resource option to embed managed resources.
8397
8398 2002-08-07  Martin Baulig  <martin@gnome.org>
8399
8400         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
8401         (FieldBase.HasFieldInitializer): New public property.
8402         (FieldBase.GetInitializerExpression): New public method.  Resolves and
8403         returns the field initializer and makes sure it is only resolved once.
8404         (TypeContainer.EmitFieldInitializers): Call
8405         FieldBase.GetInitializerExpression to get the initializer, this ensures
8406         that it isn't resolved multiple times.
8407
8408         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
8409         the resolving process (SimpleName/MemberLookup) that we're currently
8410         emitting a field initializer (which must not access any instance members,
8411         this is an error CS0236).
8412
8413         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
8414         argument, if the `IsFieldInitializer' flag is set, we must report and
8415         error CS0236 and not an error CS0120.   
8416
8417 2002-08-07  Martin Baulig  <martin@gnome.org>
8418
8419         * ecore.cs (IMemberExpr): New public interface.
8420         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
8421         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
8422         if the expression is an IMemberExpr.
8423
8424         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
8425         to be null, implicitly default to `this' if we're non-static in
8426         this case.  Simplified the code a lot by using the new IMemberExpr
8427         interface.  Also fixed bug #28176 here.
8428
8429 2002-08-06  Martin Baulig  <martin@gnome.org>
8430
8431         * cs-parser.jay (SimpleLookup): Removed.  We need to create
8432         ParameterReferences during semantic analysis so that we can do a
8433         type-only search when resolving Cast, TypeOf and SizeOf.
8434         (block): Pass the `current_local_parameters' to the Block's
8435         constructor.
8436
8437         * class.cs (ConstructorInitializer): Added `Parameters parameters'
8438         argument to the constructor.
8439         (ConstructorInitializer.Resolve): Create a temporary implicit
8440         block with the parameters.
8441
8442         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
8443         references here if we aren't doing a type-only search.
8444
8445         * statement.cs (Block): Added constructor which takes a
8446         `Parameters parameters' argument.
8447         (Block.Parameters): New public property.
8448
8449         * support.cs (InternalParameters.Parameters): Renamed `parameters'
8450         to `Parameters' and made it public readonly.
8451
8452 2002-08-06  Martin Baulig  <martin@gnome.org>
8453
8454         * ecore.cs (Expression.Warning): Made this public as well.
8455
8456         * report.cs (Report.Debug): Print the contents of collections.
8457
8458 2002-08-06  Martin Baulig  <martin@gnome.org>
8459
8460         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
8461         used to tell Resolve() which kinds of expressions it may return.
8462         (Expression.Resolve): Added overloaded version of this method which
8463         takes a `ResolveFlags flags' argument.  This can be used to tell
8464         Resolve() which kinds of expressions it may return.  Reports a
8465         CS0118 on error.
8466         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
8467         ResolveFlags.SimpleName.
8468         (Expression.Error118): Added overloaded version of this method which
8469         takes a `ResolveFlags flags' argument.  It uses the flags to determine
8470         which kinds of expressions are allowed.
8471
8472         * expression.cs (Argument.ResolveMethodGroup): New public method.
8473         Resolves an argument, but allows a MethodGroup to be returned.
8474         This is used when invoking a delegate.
8475
8476         * TODO: Updated a bit.
8477
8478 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8479
8480         Fixed compilation with csc.
8481
8482         * ecore.cs: Expression.Error made public. Is this correct? Should
8483         Warning be made public too?
8484
8485         * expression.cs: use ea.Location instead of ea.loc.
8486         [FIXME:  Filed as bug #28607: MCS must report these errors.]
8487
8488 2002-08-06  Martin Baulig  <martin@gnome.org>
8489
8490         * ecore.cs (Expression.loc): Moved the location here instead of
8491         duplicating it in all derived classes.
8492         (Expression.Location): New public property.
8493         (Expression.Error, Expression.Warning): Made them non-static and
8494         removed the location argument.
8495         (Expression.Warning): Added overloaded version which takes an
8496         `int level' argument.
8497         (Expression.Error118): Make this non-static and removed the
8498         expression and location arguments.
8499         (TypeExpr): Added location argument to the constructor.
8500
8501         * expression.cs (StaticCallExpr): Added location argument to
8502         the constructor.
8503         (Indirection, PointerArithmetic): Likewise.
8504         (CheckedExpr, UnCheckedExpr): Likewise.
8505         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
8506         (StringPtr): Likewise.
8507
8508
8509 2002-08-05  Martin Baulig  <martin@gnome.org>
8510
8511         * expression.cs (BaseAccess.DoResolve): Actually report errors.
8512
8513         * assign.cs (Assign.DoResolve): Check whether the source
8514         expression is a value or variable.
8515
8516         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
8517         while resolving the corresponding blocks.
8518
8519         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
8520         an error, don't silently return null.
8521
8522         * statement.cs (Block.AddVariable): Do the error reporting here
8523         and distinguish between CS0128 and CS0136.
8524         (Block.DoResolve): Report all unused labels (warning CS0164).
8525         (LabeledStatement): Pass the location to the constructor.
8526         (LabeledStatement.HasBeenReferenced): New property.
8527         (LabeledStatement.Resolve): Set it to true here.
8528
8529         * statement.cs (Return.Emit): Return success even after reporting
8530         a type mismatch error (CS0126 or CS0127), this is what csc does and
8531         it avoids confusing the users with any consecutive errors.
8532
8533 2002-08-05  Martin Baulig  <martin@gnome.org>
8534
8535         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
8536
8537         * const.cs (Const.LookupConstantValue): Catch circular definitions.
8538
8539         * expression.cs (MemberAccess.DoResolve): Silently return if an
8540         error has already been reported.
8541
8542         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
8543         error has already been reported.
8544
8545 2002-08-05  Martin Baulig  <martin@gnome.org>
8546
8547         * statement.cs (UsageVector): Only initialize the `parameters'
8548         vector if we actually have any "out" parameters.
8549
8550 2002-08-05  Martin Baulig  <martin@gnome.org>
8551
8552         * expression.cs (Binary.ResolveOperator): When combining delegates,
8553         they must have the same type.
8554
8555 2002-08-05  Martin Baulig  <martin@gnome.org>
8556
8557         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
8558         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
8559         work with the ms runtime and we also don't need it: if we're a
8560         PropertyBuilder and not in the `indexer_arguments' hash, then we
8561         are a property and not an indexer.
8562
8563         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
8564         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
8565         since the latter one doesn't work with the ms runtime.
8566
8567 2002-08-03  Martin Baulig  <martin@gnome.org>
8568
8569         Fixed bugs #27998 and #22735.
8570
8571         * class.cs (Method.IsOperator): New public field.
8572         (Method.CheckBase): Report CS0111 if there's already a method
8573         with the same parameters in the current class.  Report CS0508 when
8574         attempting to change the return type of an inherited method.
8575         (MethodData.Emit): Report CS0179 if a method doesn't have a body
8576         and it's not marked abstract or extern.
8577         (PropertyBase): New abstract base class for Property and Indexer.
8578         (PropertyBase.CheckBase): Moved here from Property and made it work
8579         for indexers.
8580         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
8581         the same so we can reuse it there.
8582         (Property, Indexer): Derive from PropertyBase.
8583         (MethodSignature.inheritable_property_signature_filter): New delegate
8584         to find properties and indexers.
8585
8586         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
8587         argument and improved error reporting.
8588
8589         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
8590         EmptyReadOnlyParameters and made it a property.
8591
8592         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
8593         version of this method which takes a `PropertyInfo indexer'.
8594         (TypeManager.RegisterIndexer): New method.
8595
8596         * class.cs: Added myself as author of this file :-)
8597
8598 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8599
8600         * class.cs: fixed compilation on windoze.
8601
8602 2002-08-03  Martin Baulig  <martin@gnome.org>
8603
8604         * interface.cs (Interface.GetInterfaceBases): Check whether all
8605         base interfaces are at least as accessible than the current one.
8606
8607         * class.cs (TypeContainer.GetClassBases): Check whether base types
8608         are at least as accessible than the current type.
8609         (TypeContainer.AsAccessible): Implemented and made non-static.
8610         (MemberBase.CheckParameters): Report errors if the accessibility
8611         checks fail.
8612
8613         * delegate.cs (Delegate.Delegate): The default visibility is
8614         internal for top-level types and private for nested types.
8615         (Delegate.Define): Report errors if the accessibility checks fail.
8616
8617         * enum.cs (Enum.Enum): The default visibility is internal for
8618         top-level types and private for nested types.
8619         (Enum.DefineType): Compute the correct visibility.
8620
8621         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
8622         function which takes a `bool is_toplevel' instead of a TypeContainer.
8623
8624         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
8625         builtin type.
8626
8627 2002-08-02  Martin Baulig  <martin@gnome.org>
8628
8629         * expression.cs (LocalVariableReferenc): Added constructor which
8630         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
8631         (LocalVariableReference.IsReadOnly): New property.
8632         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
8633         variable is readonly, use our own readonly flag to do this; you can
8634         use the new constructor to get a writable reference to a read-only
8635         variable.
8636
8637         * cs-parser.jay (foreach_statement, using_statement): Get a writable
8638         reference to the local variable.
8639
8640 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
8641
8642         * rootcontext.cs (ResolveCore): Also include System.Exception
8643
8644         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
8645         we reach an EmptyStatement.
8646
8647         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
8648         is also fine.
8649
8650         * expression.cs (Binary.ResolveOperator): Check error result in
8651         two places.
8652
8653         use brtrue/brfalse directly and avoid compares to null.
8654
8655 2002-08-02  Martin Baulig  <martin@gnome.org>
8656
8657         * class.cs (TypeContainer.Define): Define all nested interfaces here.
8658         Fixes bug #28407, added test-155.cs.
8659
8660 2002-08-01  Martin Baulig  <martin@gnome.org>
8661
8662         * class.cs (Event.EmitDefaultMethod): Make this work with static
8663         events.  Fixes #28311, added verify-3.cs.
8664
8665 2002-08-01  Martin Baulig  <martin@gnome.org>
8666
8667         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
8668         `is_disposable' fields.
8669         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
8670         `hm.is_disposable' if we're using the collection pattern.
8671         (Foreach.EmitCollectionForeach): Use the correct type for the
8672         enumerator's local variable, only emit the try/finally block if
8673         necessary (fixes #27713).
8674
8675 2002-08-01  Martin Baulig  <martin@gnome.org>
8676
8677         * ecore.cs (Expression.report118): Renamed to Error118 and made
8678         it public static.
8679
8680         * statement.cs (Throw.Resolve): Check whether the expression is of
8681         the correct type (CS0118) and whether the type derives from
8682         System.Exception (CS0155).
8683         (Catch.Resolve): New method.  Do the type lookup here and check
8684         whether it derives from System.Exception (CS0155).
8685         (Catch.CatchType, Catch.IsGeneral): New public properties.
8686
8687         * typemanager.cs (TypeManager.exception_type): Added.
8688
8689 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
8690
8691         * driver.cs: Updated About function.
8692
8693 2002-07-31  Martin Baulig  <martin@gnome.org>
8694
8695         Implemented Control Flow Analysis.
8696
8697         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
8698         (EmitContext.CurrentBranching): Added.
8699         (EmitContext.StartFlowBranching): Added.
8700         (EmitContext.EndFlowBranching): Added.
8701         (EmitContext.KillFlowBranching): Added.
8702         (EmitContext.IsVariableAssigned): Added.
8703         (EmitContext.SetVariableAssigned): Added.
8704         (EmitContext.IsParameterAssigned): Added.
8705         (EmitContext.SetParameterAssigned): Added.
8706         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
8707         Added control flow analysis stuff here.
8708
8709         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
8710         resolve the expression as lvalue.
8711         (LocalVariableReference.DoResolve): Check whether the variable has
8712         already been assigned.
8713         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
8714         the parameter as assigned here.
8715         (ParameterReference.DoResolve): Check whether the parameter has already
8716         been assigned.
8717         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
8718         expression as lvalue.
8719
8720         * statement.cs (FlowBranching): New class for the flow analysis code.
8721         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
8722         (LabeledStatement.IsDefined): New public property.
8723         (LabeledStatement.AddUsageVector): New public method to tell flow
8724         analyis that the label may be reached via a forward jump.
8725         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
8726         flow analysis.
8727         (VariableInfo.Number): New public field.  This is used by flow analysis
8728         to number all locals of a block.
8729         (Block.CountVariables): New public property.  This is the number of
8730         local variables in this block (including the locals from all parent
8731         blocks).
8732         (Block.EmitMeta): Number all the variables.
8733
8734         * statement.cs: Added flow analysis support to all classes.
8735
8736 2002-07-31  Martin Baulig  <martin@gnome.org>
8737
8738         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
8739         To get debugging messages, compile mcs with /define:MCS_DEBUG and
8740         then use this argument.
8741
8742         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
8743
8744         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
8745         use this to specify /define options.
8746
8747 2002-07-29  Martin Baulig  <martin@gnome.org>
8748
8749         * statement.cs (Fixed): Moved all code that does variable lookups
8750         and resolvings from Emit to Resolve.
8751
8752         * statement.cs (For): Moved all code that does variable lookups
8753         and resolvings from Emit to Resolve.
8754
8755         * statement.cs (Using): Moved all code that does variable lookups
8756         and resolvings from Emit to Resolve.
8757
8758 2002-07-29  Martin Baulig  <martin@gnome.org>
8759
8760         * attribute.cs (Attribute.Resolve): Explicitly catch a
8761         System.NullReferenceException when creating the
8762         CustromAttributeBuilder and report a different warning message.
8763
8764 2002-07-29  Martin Baulig  <martin@gnome.org>
8765
8766         * support.cs (ParameterData.ParameterName): Added method to
8767         get the name of a parameter.
8768
8769         * typemanager.cs (TypeManager.IsValueType): New public method.
8770
8771 2002-07-29  Martin Baulig  <martin@gnome.org>
8772
8773         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
8774         is a flag which specifies that it's either ref or out.
8775         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
8776         the out parameter to `out Parameter.Modifier mod', also set the
8777         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
8778
8779         * support.cs (InternalParameters.ParameterModifier): Distinguish
8780         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
8781         Parameter.Modifier.ISBYREF flag if it's either ref or out.
8782
8783         * expression.cs (Argument.GetParameterModifier): Distinguish
8784         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
8785         Parameter.Modifier.ISBYREF flag if it's either ref or out.
8786
8787 2002-07-29  Martin Baulig  <martin@gnome.org>
8788
8789         * expression.cs (ParameterReference.ParameterReference): Added
8790         `Location loc' argument to the constructor.
8791
8792         * cs-parser.jay: Pass location to ParameterReference.
8793
8794 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
8795
8796         * statement.cs (Try): Initialize the location.
8797
8798         * cs-parser.jay: pass location to Try.
8799
8800         * expression.cs (Unary.Reduce): Change the prototype to return
8801         whether a constant fold could be performed or not.  The result is
8802         returned in an out parameters.  In the case of Indirection and
8803         AddressOf, we want to perform the full tests.
8804
8805 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
8806
8807         * statement.cs (Statement.Emit): Flag dead code.
8808
8809 2002-07-27  Andrew Birkett  <andy@nobugs.org>
8810
8811         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
8812
8813 2002-07-27  Martin Baulig  <martin@gnome.org>
8814
8815         * class.cs (MethodData.Define): Put back call to
8816         TypeManager.AddMethod(), accidentally commented this out.
8817
8818         * report.cs (Debug): New public method to print debugging information,
8819         this is `[Conditional ("DEBUG")]'.
8820
8821 2002-07-26  Martin Baulig  <martin@gnome.org>
8822
8823         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
8824         (switch_statement): Push the current_block to the switch_stack and
8825         pop it again when we're done with the switch.
8826         (switch_section): The new block is a child of the current_block.
8827         Fixes bug #24007, added test-152.cs.
8828
8829 2002-07-27  Martin Baulig  <martin@gnome.org>
8830
8831         * expression.cs (Invocation.EmitArguments): When calling a varargs
8832         function with only its fixed arguments, we need to pass an empty
8833         array.
8834
8835 2002-07-27  Martin Baulig  <martin@gnome.org>
8836
8837         Mono 0.13 has been released.
8838
8839 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
8840
8841         * driver.cs: Rename --resource to --linkres, because that is what
8842         we do currently, we dont support --resource yet.
8843
8844         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
8845
8846 2002-07-25  Martin Baulig  <martin@gnome.org>
8847
8848         * class.cs (MethodData): New public class.  This is a `method builder'
8849         class for a method or one accessor of a Property/Indexer/Event.
8850         (MethodData.GetMethodFlags): Moved here from MemberBase.
8851         (MethodData.ApplyAttributes): Likewise.
8852         (MethodData.ApplyObsoleteAttribute): Likewise.
8853         (MethodData.ApplyConditionalAttribute): Likewise.
8854         (MethodData.ApplyDllImportAttribute): Likewise.
8855         (MethodData.CheckAbstractAndExternal): Likewise.
8856         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
8857         (MethodData.Emit): Formerly known as Method.Emit().
8858         (MemberBase): Moved everything which was specific to a single
8859         accessor/method to MethodData.
8860         (Method): Create a new MethodData and call Define() and Emit() on it.
8861         (Property, Indexer, Event): Create a new MethodData objects for each
8862         accessor and call Define() and Emit() on them.
8863
8864 2002-07-25  Martin Baulig  <martin@gnome.org>
8865
8866         Made MethodCore derive from MemberBase to reuse the code from there.
8867         MemberBase now also checks for attributes.
8868
8869         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
8870         (MemberBase.GetMethodFlags): Moved here from class Method and marked
8871         as virtual.
8872         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
8873         `CallingConventions cc' and `Attributes opt_attrs' arguments.
8874         (MemberBase.ApplyAttributes): New virtual method; applies the
8875         attributes to a method or accessor.
8876         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
8877         (MemberBase.ApplyConditionalAttribute): Likewise.
8878         (MemberBase.ApplyDllImportAttribute): Likewise.
8879         (MemberBase.CheckAbstractAndExternal): Likewise.
8880         (MethodCore.ParameterTypes): This is now a property instead of a
8881         method, it's initialized from DoDefineParameters().
8882         (MethodCore.ParameterInfo): Removed the set accessor.
8883         (MethodCore.DoDefineParameters): New protected virtual method to
8884         initialize ParameterTypes and ParameterInfo.
8885         (Method.GetReturnType): We can now simply return the MemberType.
8886         (Method.GetMethodFlags): Override the MemberBase version and add
8887         the conditional flags.
8888         (Method.CheckBase): Moved some code from Define() here, call
8889         DoDefineParameters() here.
8890         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
8891         here to avoid some larger code duplication.
8892         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
8893         ensure that abstract and external accessors don't declare a body.
8894
8895         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
8896         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
8897         lookup in the attribute's parent classes, so we need to abort as soon
8898         as we found the first match.
8899         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
8900         the attribute has no arguments.
8901
8902         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
8903         of a Method.
8904
8905 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8906
8907         * cs-parser.jay: reverted previous patch.
8908
8909 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8910
8911         * cs-parser.jay: fixed bug #22119.
8912
8913 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8914
8915         * attribute.cs: fixed compilation. The error was:
8916         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
8917         be assigned to before control leaves the current method."
8918         [FIXME:  Filed as bug #28186: MCS must report this error.]
8919
8920 2002-07-25  Martin Baulig  <martin@gnome.org>
8921
8922         * attribute.cs (Attribute.Conditional_GetConditionName): New static
8923         method to pull the condition name ouf of a Conditional attribute.
8924         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
8925         the obsolete message and error flag out of an Obsolete attribute.
8926
8927         * class.cs (Method.GetMethodFlags): New public method to get the
8928         TypeManager.MethodFlags for this method.
8929         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
8930         private methods.
8931         (Method.Define): Get and apply the Obsolete and Conditional attributes;
8932         if we're overriding a virtual function, set the new private variable
8933         `parent_method'; call the new TypeManager.AddMethod().
8934
8935         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
8936         the MethodBuilder and the Method in a PtrHashtable.
8937         (TypeManager.builder_to_method): Added for this purpose.
8938         (TypeManager.MethodFlags): Added IsObsoleteError.
8939         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
8940         Obsolete and Conditional arguments in MethodBuilders.  If we discover
8941         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
8942         the message from the attribute.
8943
8944 2002-07-24  Martin Baulig  <martin@gnome.org>
8945
8946         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
8947         preprocessor directives, ensure that the argument to #define/#undef is
8948         exactly one identifier and that it's actually an identifier.
8949
8950         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
8951         did not work ....
8952
8953 2002-07-24  Martin Baulig  <martin@gnome.org>
8954
8955         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
8956         initialize it to TypeManager.object_type in the constructor.
8957         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
8958         of the `hm.get_current' method if we're using the collection pattern.
8959         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
8960         for the explicit conversion to make it work when we're using the collection
8961         pattern and the `Current' property has a different return type than `object'.
8962         Fixes #27713.
8963
8964 2002-07-24  Martin Baulig  <martin@gnome.org>
8965
8966         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
8967         does not match, but don't report any errors.  This method is called in
8968         order for all methods in a MethodGroupExpr until a matching method is
8969         found, so we don't want to bail out if the first method doesn't match.
8970         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
8971         matches, report the 123.  Fixes #28070.
8972
8973 2002-07-24  Martin Baulig  <martin@gnome.org>
8974
8975         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
8976         TypeManager.TypeToCoreType() to the top of the method so the
8977         following equality checks will work.  Fixes #28107.
8978
8979 2002-07-24  Martin Baulig  <martin@gnome.org>
8980
8981         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
8982         operand is of type uint, and the other operand is of type sbyte,
8983         short or int, the operands are converted to type long." -
8984         Actually do what this comment already told us.  Fixes bug #28106,
8985         added test-150.cs.
8986
8987 2002-07-24  Martin Baulig  <martin@gnome.org>
8988
8989         * class.cs (MethodBase): New abstract class.  This is now a base
8990         class for Property, Indexer and Event to avoid some code duplication
8991         in their Define() and DefineMethods() methods.
8992         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
8993         generic methods for Define() and DefineMethods().
8994         (FieldBase): Derive from MemberBase, not MemberCore.
8995         (Property): Derive from MemberBase, not MemberCore.
8996         (Property.DefineMethod): Moved all the code from this method to the
8997         new MethodBase.DefineAccessor(), just call it with appropriate
8998         argumetnts.
8999         (Property.Define): Call the new Property.DoDefine(), this does some
9000         sanity checks and we don't need to duplicate the code everywhere.
9001         (Event): Derive from MemberBase, not MemberCore.
9002         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
9003         accessors, this will also make them work with interface events.
9004         (Indexer): Derive from MemberBase, not MemberCore.
9005         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
9006         (Indexer.Define): Use the new MethodBase functions.
9007
9008         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
9009         argument to the constructor.
9010         (Interface.FindMembers): Added support for interface events.
9011         (Interface.PopluateEvent): Implemented.
9012
9013         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
9014
9015 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
9016
9017         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
9018         but this is required to check for a method name being the same as
9019         the containing class.  
9020
9021         Handle this now.
9022
9023 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9024
9025         * interface.cs: initialize variable.
9026
9027 2002-07-23  Martin Baulig  <martin@gnome.org>
9028
9029         Implemented the IndexerName attribute in interfaces.
9030
9031         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
9032         name if this is an explicit interface implementation.
9033         (Indexer.InterfaceIndexerName): New public variable.  If we're
9034         implementing an interface indexer, this is the IndexerName in that
9035         interface.  Otherwise, it's the IndexerName.
9036         (Indexer.DefineMethod): If we're implementing interface indexer,
9037         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
9038         and Pending.ImplementIndexer methods.
9039         (Indexer.Define): Also define the PropertyBuilder if we're
9040         implementing an interface indexer and this is neither an explicit
9041         interface implementation nor do the IndexerName match the one in
9042         the interface.
9043
9044         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
9045         If a method is defined here, then we always need to create a proxy
9046         for it.  This is used when implementing interface indexers.
9047         (Pending.IsInterfaceIndexer): New public method.
9048         (Pending.ImplementIndexer): New public method.
9049         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
9050         This is used when implementing interface indexers to define a proxy
9051         if necessary.
9052         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
9053         define a proxy if necessary.
9054
9055         * interface.cs (Interface.IndexerName): New public variable.
9056         (Interface.PopulateIndexer): Set the IndexerName.
9057         (Interface.DefineIndexers): New private method.  Populate all the
9058         indexers and make sure their IndexerNames match.
9059
9060         * typemanager.cs (IndexerPropertyName): Added support for interface
9061         indexers.
9062
9063 2002-07-22  Martin Baulig  <martin@gnome.org>
9064
9065         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
9066         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
9067         ret if HasReturnLabel.
9068         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
9069         variables.
9070
9071         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
9072         and set the ec.LoopBeginTryCatchLevel.
9073         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
9074         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
9075         the current ec.TryCatchLevel, the branch goes out of an exception
9076         block.  In this case, we need to use Leave and not Br.
9077
9078 2002-07-22  Martin Baulig  <martin@gnome.org>
9079
9080         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
9081         block unless the block does not always return or it is contained in
9082         another try { ... } catch { ... } block.  Fixes bug #26506.
9083         Added verify-1.cs to the test suite.
9084
9085 2002-07-22  Martin Baulig  <martin@gnome.org>
9086
9087         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
9088         then we do not always return.  Fixes bug #24985.
9089
9090 2002-07-22  Martin Baulig  <martin@gnome.org>
9091
9092         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
9093         lookup on a per-class level; ie. walk up the class hierarchy until we
9094         found at least one applicable method, then choose the best among them.
9095         Fixes bug #24463 and test-29.cs.
9096
9097 2002-07-22  Martin Baulig  <martin@gnome.org>
9098
9099         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
9100         return types of the methods.  The return type is not part of the
9101         signature and we must not check it to make the `new' modifier work.
9102         Fixes bug #27999, also added test-147.cs.
9103         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
9104
9105         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
9106         on the method's return type.
9107
9108 2002-07-21  Martin Baulig  <martin@gnome.org>
9109
9110         * assign.cs: Make this work if the rightmost source is a constant and
9111         we need to do an implicit type conversion.  Also adding a few more tests
9112         to test-38.cs which should have caught this.
9113
9114         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
9115         target in the makefile for this.  The makefile.gnu is primarily intended
9116         for end-users who don't want to debug the compiler.
9117
9118 2002-07-21  Martin Baulig  <martin@gnome.org>
9119
9120         * assign.cs: Improved the Assign class so it can now handle embedded
9121         assignments (X = Y = Z = something).  As a side-effect this'll now also
9122         consume less local variables.  test-38.cs now passes with MCS, added
9123         a few new test cases to that test.
9124
9125 2002-07-20  Martin Baulig  <martin@gnome.org>
9126
9127         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
9128         instructions.  Fixes bug #27977, also added test-146.cs.
9129
9130 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9131
9132         * cs-tokenizer.cs: fixed getHex ().
9133
9134 2002-07-19  Martin Baulig  <martin@gnome.org>
9135
9136         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
9137         not Type.GetType() to lookup the array type.  This is needed when
9138         we're constructing an array of a user-defined type.
9139         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
9140         single-dimensional arrays, but also for single-dimensial arrays of
9141         type decimal.
9142
9143 2002-07-19  Martin Baulig  <martin@gnome.org>
9144
9145         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
9146         this function is called, it's not allowed to share LocalBuilders
9147         among ILGenerators.
9148
9149 2002-07-19  Martin Baulig  <martin@gnome.org>
9150
9151         * expression.cs (Argument.Resolve): Report an error 118 when trying
9152         to pass a type as argument.
9153
9154 2002-07-18  Martin Baulig  <martin@gnome.org>
9155
9156         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
9157         Conv_R_Un for the signed `long' type.
9158
9159 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
9160
9161         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
9162         `expr' for the temporary result, as that will fail if we do
9163         multiple resolves on the same expression.
9164
9165 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
9166
9167         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
9168         ec.TypeContainer for looking up aliases. 
9169
9170         * class.cs (TypeContainer): Remove LookupAlias from here.
9171
9172         * decl.cs (DeclSpace); Move here.
9173
9174 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
9175
9176         * class.cs (FindMembers): Only call filter if the constructor
9177         bulider is not null.
9178
9179         Also handle delegates in `NestedTypes' now.  Now we will perform
9180         type lookups using the standard resolution process.  This also
9181         fixes a bug.
9182
9183         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
9184         This uses Expressions (the limited kind that can be parsed by the
9185         tree) instead of strings.
9186
9187         * expression.cs (ComposedCast.ToString): Implement, used to flag
9188         errors since now we have to render expressions.
9189
9190         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
9191         FormArrayType. 
9192
9193         * ecore.cs (SimpleName.ToString): ditto.
9194
9195         * cs-parser.jay: Instead of using strings to assemble types, use
9196         Expressions to assemble the type (using SimpleName, ComposedCast,
9197         MemberAccess).  This should fix the type lookups in declarations,
9198         because we were using a different code path for this.
9199
9200         * statement.cs (Block.Resolve): Continue processing statements
9201         even when there is an error.
9202
9203 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
9204
9205         * class.cs (Event.Define): Also remove the `remove' method from
9206         the list of pending items.
9207
9208         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
9209         generate more compact code. 
9210
9211 2002-07-17  Martin Baulig  <martin@gnome.org>
9212
9213         * const.cs (Const.LookupConstantValue): Add support for constant
9214         `unchecked' and `checked' expressions.
9215         Also adding test case test-140.cs for this.
9216
9217 2002-07-17  Martin Baulig  <martin@gnome.org>
9218
9219         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
9220         check whether mi.ReturnType implements the IEnumerator interface; the
9221         `==' and the IsAssignableFrom() will fail in this situation.
9222
9223 2002-07-16  Ravi Pratap  <ravi@ximian.com>
9224
9225         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
9226         here too.
9227
9228 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9229
9230         * expression.cs: fixed bug #27811.
9231
9232 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
9233
9234         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
9235         Molaro: when we are a ref, the value already contains a pointer
9236         value, do not take the address of it.
9237
9238 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
9239         * removed mb-parser.jay and mb-tokenizer.cs
9240
9241 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
9242
9243         * expression.cs: check against the building corlib void type.
9244
9245 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
9246
9247         * ecore.cs: fix for valuetype static readonly fields: when 
9248         initializing them, we need their address, not the address of a copy.
9249
9250 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
9251
9252         * typemanager.cs: register also enum_type in corlib.
9253
9254 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
9255
9256         * class.cs: allow calling this (but not base) initializers in structs.
9257
9258 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
9259
9260         * ecore.cs: make sure we compare against the building base types
9261         in GetTypeSize ().
9262
9263 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
9264
9265         * typemanager.cs: fix TypeToCoreType() to handle void and object
9266         (corlib gets no more typerefs after this change).
9267
9268 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
9269
9270         * expression.cs (ArrayCreation.EmitArrayArguments): use
9271         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
9272
9273         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
9274         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
9275         array indexes, the runtime actually forbids them.
9276
9277         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
9278         for array arguments here.
9279
9280         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
9281         instead of the default for ValueTypes.
9282
9283         (New.DoEmit): Use IsValueType instead of
9284         IsSubclassOf (value_type)
9285         (New.DoResolve): ditto.
9286         (Invocation.EmitCall): ditto.
9287
9288         * assign.cs (Assign): ditto.
9289
9290         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
9291         Statements *are* currently doing part of their resolution during
9292         Emit.  
9293
9294         Expressions do always resolve during resolve, but statements are
9295         only required to propagate resolution to their children.
9296
9297 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
9298
9299         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
9300
9301         (LoadAssembly): Do not add the dll if it is already specified
9302
9303         (MainDriver): Add the System directory to the link path at the end,
9304         after all the other -L arguments. 
9305
9306         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
9307         wrong opcode for loading bytes and bools (ldelem.i1 instead of
9308         ldelem.u1) and using the opposite for sbytes.
9309
9310         This fixes Digger, and we can finally run it.
9311
9312         * driver.cs (UnixParseOption): Move the option parsing here.  
9313         (CSCParseOption): Implement CSC-like parsing of options.
9314
9315         We now support both modes of operation, the old Unix way, and the
9316         new CSC-like way.  This should help those who wanted to make cross
9317         platform makefiles.
9318
9319         The only thing broken is that /r:, /reference: and /lib: are not
9320         implemented, because I want to make those have the same semantics
9321         as the CSC compiler has, and kill once and for all the confussion
9322         around this.   Will be doing this tomorrow.
9323
9324         * statement.cs (Unsafe.Resolve): The state is checked during
9325         resolve, not emit, so we have to set the flags for IsUnsfe here.
9326
9327 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9328
9329         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
9330         not catch the Error_ObjectRefRequired in SimpleName (as it is
9331         possible to have a class/instance variable name that later gets
9332         deambiguated), we have to check this here.      
9333
9334 2002-07-10  Ravi Pratap  <ravi@ximian.com>
9335
9336         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
9337         make static and put into Expression.
9338
9339         (Event.Define): Register the private field of the event with the 
9340         TypeManager so that GetFieldFromEvent can get at it.
9341
9342         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
9343         keep track of the private field associated with an event which
9344         has no accessors.
9345
9346         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
9347         private field.
9348
9349         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
9350
9351 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9352
9353         * expression.cs (Binary.EmitBranchable): this routine emits the
9354         Binary expression in a branchable context.  This basically means:
9355         we need to branch somewhere, not just get the value on the stack.
9356
9357         This works together with Statement.EmitBoolExpression.
9358
9359         * statement.cs (Statement.EmitBoolExpression): Use
9360         EmitBranchable. 
9361
9362 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
9363
9364         * statement.cs (For): Reduce the number of jumps in loops.
9365
9366         (For): Implement loop inversion for the For statement.
9367
9368         (Break): We can be breaking out of a Try/Catch controlled section
9369         (foreach might have an implicit try/catch clause), so we need to
9370         use Leave instead of Br.
9371
9372         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
9373         now).  If the instace expression supports IMemoryLocation, we use
9374         the AddressOf method from the IMemoryLocation to extract the
9375         address instead of emitting the instance.
9376
9377         This showed up with `This', as we were emitting the instance
9378         always (Emit) instead of the Address of This.  Particularly
9379         interesting when This is a value type, as we dont want the Emit
9380         effect (which was to load the object).
9381
9382 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
9383
9384         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
9385
9386         * statement.cs (Checked): Set the CheckedState during the resolve
9387         process too, as the ConvCast operations track the checked state on
9388         the resolve process, and not emit.
9389
9390         * cs-parser.jay (namespace_member_declaration): Flag that we have
9391         found a declaration when we do.  This is used to flag error 1529
9392
9393         * driver.cs: Report ok when we display the help only.
9394
9395 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
9396
9397         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
9398
9399 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
9400
9401         * cs-tokenizer.cs (define): We also have to track locally the
9402         defines.  AllDefines is just used for the Conditional Attribute,
9403         but we also need the local defines for the current source code. 
9404
9405 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
9406
9407         * statement.cs (While, For, Do): These loops can exit through a
9408         Break statement, use this information to tell whether the
9409         statement is the last piece of code.
9410
9411         (Break): Flag that we break.
9412
9413         * codegen.cs (EmitContexts): New `Breaks' state variable.
9414
9415 2002-07-03  Martin Baulig  <martin@gnome.org>
9416
9417         * class.cs (TypeContainer.MethodModifiersValid): Allow override
9418         modifiers in method declarations in structs.  Otherwise, you won't
9419         be able to override things like Object.Equals().
9420
9421 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
9422
9423         * class.cs (Method, Property, Indexer): Do not allow the public
9424         modifier to be used in explicit interface implementations.
9425
9426         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
9427         override modifiers in method declarations in structs
9428
9429 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
9430
9431         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
9432         integer or real overflow, report an error
9433
9434 2002-07-02  Martin Baulig  <martin@gnome.org>
9435
9436         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
9437         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
9438         to tell the runtime about our newly created System.Object and
9439         System.ValueType types.
9440
9441 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
9442
9443         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
9444         struct instead of Ldarg/Starg.
9445
9446 2002-07-02  Martin Baulig  <martin@gnome.org>
9447
9448         * expression.cs (Indirection.Indirection): Call
9449         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
9450
9451 2002-07-02  Martin Baulig  <martin@gnome.org>
9452
9453         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
9454         ValueType, call TypeManager.TypeToCoreType() on it.
9455         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
9456         the OpCodes.Newarr argument.
9457
9458 2002-07-02  Martin Baulig  <martin@gnome.org>
9459
9460         * expression.cs (Invocation.EmitCall): When compiling corlib,
9461         replace all calls to the system's System.Array type to calls to
9462         the newly created one.
9463
9464         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
9465         System.Array methods.
9466         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
9467         from the system's System.Array type which must be replaced.
9468
9469 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
9470
9471         * typemanager.cs: load unverifiable_code_ctor so we can build
9472         corlib using the correct type. Avoid using GetTypeCode() with
9473         TypeBuilders.
9474         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
9475         TypeManager.object_type to allow building corlib.
9476
9477 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
9478
9479         * ecore.cs: handle System.Enum separately in LoadFromPtr().
9480
9481 2002-07-01  Martin Baulig  <martin@gnome.org>
9482
9483         * class.cs: Make the last change actually work, we need to check
9484         whether `ifaces != null' to avoid a crash.
9485
9486 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
9487
9488         * class.cs: when we build structs without fields that implement
9489         interfaces, we need to add the interfaces separately, since there is
9490         no API to both set the size and add the interfaces at type creation
9491         time.
9492
9493 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
9494
9495         * expression.cs: the dimension arguments to the array constructors
9496         need to be converted if they are a long.
9497
9498 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
9499
9500         * class.cs: don't emit ldarg.0 if there is no parent constructor
9501         (fixes showstopper for corlib).
9502
9503 2002-06-29  Martin Baulig  <martin@gnome.org>
9504
9505         MCS now compiles corlib on GNU/Linux :-)
9506
9507         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
9508         ie. check for MethodImplOptions.InternalCall.
9509
9510         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
9511         and TypeManager.attribute_type are null, so we must explicitly check
9512         whether parent is not null to find out whether it's an attribute type.
9513         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
9514         and SetBuilder, not only if the property is neither abstract nor external.
9515         This is necessary to set the MethodImplOptions on the accessor methods.
9516         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
9517         SetBuilder, see Property.Emit().
9518
9519         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
9520         populate "System.Object", "System.ValueType" and "System.Attribute" since
9521         they've already been populated from BootCorlib_PopulateCoreTypes().
9522
9523 2002-06-29  Martin Baulig  <martin@gnome.org>
9524
9525         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
9526         is the NullLiteral, we also need to make sure that target_type is not
9527         an enum type.   
9528
9529 2002-06-29  Martin Baulig  <martin@gnome.org>
9530
9531         * rootcontext.cs (RootContext.ResolveCore): We must initialize
9532         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
9533         before calling BootstrapCorlib_ResolveDelegate ().
9534
9535 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9536
9537         * statement.cs: fixed build-breaker. All tests passed ok.
9538
9539 2002-06-27  Martin Baulig  <martin@gnome.org>
9540
9541         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
9542         for System.Decimal when compiling corlib.
9543
9544 2002-06-27  Martin Baulig  <martin@gnome.org>
9545
9546         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
9547         switch blocks which contain nothing but a default clause.
9548
9549 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
9550
9551        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
9552
9553 2002-06-27  Martin Baulig  <martin@gnome.org>
9554
9555         * ecore.cs (PropertyExpr.PropertyExpr): Call
9556         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
9557
9558         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
9559         is already a TypeBuilder.
9560
9561 2002-06-27  Martin Baulig  <martin@gnome.org>
9562
9563         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
9564         `target_type == TypeManager.array_type', not IsAssignableFrom() in
9565         the "from an array-type to System.Array" case.  This makes it work
9566         when compiling corlib.
9567
9568 2002-06-27  Martin Baulig  <martin@gnome.org>
9569
9570         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
9571         non-static PropertyExpr, set its InstanceExpression.  This makes
9572         the `ICollection.Count' property work in System/Array.cs.
9573
9574 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
9575
9576         * driver.cs: Made error handling more consistent.  Errors now
9577         tracked by Report class, so many methods which used to return int
9578         now return void.  Main() now prints success/failure and 
9579         errors/warnings message.
9580
9581         Renamed '--probe' compiler argument to '--expect-error'.  Removed
9582         the magic number return values (123 and 124).  Now, if the
9583         expected error occurs, the compiler exits with success (exit value
9584         0).  If the compilation completes without seeing that particular
9585         error, the compiler exits with failure (exit value 1).  The
9586         makefile in mcs/errors has been changed to handle the new behaviour.
9587
9588         * report.cs: Made 'expected error' number a property and renamed
9589         it from 'Probe' to 'ExpectedError'.
9590
9591         * genericparser.cs: Removed error handling support, since it is
9592         now all done by Report class.
9593
9594         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
9595         class, so parse() no longer returns an int.
9596
9597         * namespace.cs: Use Report.Error instead of GenericParser.error
9598
9599 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
9600
9601         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
9602         TypeContainer.AddOperator): At the front of the list put the
9603         explicit implementations, so they get resolved/defined first. 
9604
9605 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
9606
9607         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
9608         interface type is implemented by this TypeContainer.  Used during
9609         explicit interface implementation.
9610
9611         (Property.Define, Indexer.Define, Method.Define): Validate that
9612         the given interface in the explicit implementation is one of the
9613         base classes for the containing type.
9614
9615         Also if we are explicitly implementing an interface, but there is
9616         no match in the pending implementation table, report an error.
9617
9618         (Property.Define): Only define the property if we are
9619         not explicitly implementing a property from an interface.  Use the
9620         correct name also for those properties (the same CSC uses,
9621         although that is really not needed).
9622
9623         (Property.Emit): Do not emit attributes for explicitly implemented
9624         properties, as there is no TypeBuilder.
9625
9626         (Indexer.Emit): ditto.
9627
9628         Hiding then means that we do not really *implement* a pending
9629         implementation, which makes code fail.
9630
9631 2002-06-22  Martin Baulig  <martin@gnome.org>
9632
9633         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
9634         the return value of Object.GetType().  [FIXME: we need to do this whenever
9635         we get a type back from the reflection library].
9636
9637 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
9638
9639         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
9640
9641 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
9642
9643         * attribute.cs: Return null if we can not look up the type.
9644
9645         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
9646         the interface types found.
9647
9648         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
9649         interface types found.
9650
9651         * typemanager.cs (GetInterfaces): Make this routine returns alll
9652         the interfaces and work around the lame differences between
9653         System.Type and System.Reflection.Emit.TypeBuilder in the results
9654         result for GetInterfaces.
9655
9656         (ExpandInterfaces): Given an array of interface types, expand and
9657         eliminate repeated ocurrences of an interface.  This expands in
9658         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
9659         be IA, IB, IC.
9660
9661 2002-06-21  Martin Baulig  <martin@gnome.org>
9662
9663         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
9664         on System.Enum.
9665
9666 2002-06-21  Martin Baulig  <martin@gnome.org>
9667
9668         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
9669         and called with one of the core types, return the corresponding typebuilder for
9670         that type.
9671
9672         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
9673         element type.
9674
9675 2002-06-21  Martin Baulig  <martin@gnome.org>
9676
9677         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
9678         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
9679         (Expression.ConvertReferenceExplicit): Likewise.
9680
9681         * expression.cs (ElementAccess.DoResolve): Likewise.
9682         (ElementAccess.DoResolveLValue): Likewise.
9683
9684 2002-06-10  Martin Baulig  <martin@gnome.org>
9685
9686         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
9687         add the "value" parameter to the parameter list.
9688
9689         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
9690         to our caller.
9691
9692 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
9693
9694         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
9695         the argument to an int, uint, long or ulong, per the spec.  Also
9696         catch negative constants in array creation.
9697
9698 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
9699
9700         * class.cs: do not allow the same interface to appear twice in
9701         the definition list.
9702
9703 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
9704
9705         * ecore.cs: don't use ldlen with System.Array.
9706
9707 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
9708
9709         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
9710
9711 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
9712
9713         * modifiers.cs: produce correct field attributes for protected
9714         internal. Easy fix so miguel can work on ther harder stuff:-)
9715
9716 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
9717
9718         * pending.cs: New file.  Move the code from class.cs here.
9719         Support clearning the pending flag for all methods (when not doing
9720         explicit interface implementation).
9721
9722 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
9723
9724         * rootcontext.cs: added a couple more types needed to bootstrap.
9725
9726 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
9727
9728         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
9729         constructor in the type, instead of any constructor in the type
9730         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
9731         a bug in the Mono runtime when applying the params attribute). 
9732
9733 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
9734         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
9735
9736 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
9737
9738         * expression.cs (Unary.ResolveOperator): Use TypeManager
9739         to resolve the type.
9740
9741 2002-06-13  Ravi Pratap  <ravi@ximian.com>
9742
9743         * cs-parser.jay (enum_member_declaration): Pass in the attributes
9744         attached.
9745
9746         * enum.cs (AddEnumMember): Add support to store the attributes associated 
9747         with each member too.
9748
9749         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
9750         field builders too - this takes care of the enum member case.
9751
9752 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
9753
9754         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
9755         address-of operator on both value types and pointers.
9756
9757 2002-06-10  Martin Baulig  <martin@gnome.org>
9758
9759         * interface.cs (Interface.PopulateIndexer): Add the indexer's
9760         PropertyBuilder to the `property_builders' list.
9761
9762         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
9763         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
9764         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
9765         find any indexers which are inherited from an interface.
9766
9767 2002-06-09  Martin Baulig  <martin@gnome.org>
9768
9769         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
9770         the same type as the constant if necessary.  There's also a test-130.cs
9771         for this.
9772
9773         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
9774
9775         * typemanager.cs (TypeManager.ChangeType): Previously known as
9776         Enum.ChangeEnumType().
9777
9778 2002-06-09  Martin Baulig  <martin@gnome.org>
9779
9780         * expression.cs (Cast.TryReduce): Added support for consts.
9781
9782 2002-06-08  Ravi Pratap  <ravi@ximian.com>
9783
9784         * class.cs (Accessor): Hold attributes information so we can pass
9785         it along.
9786
9787         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
9788         Modify to pass in attributes attached to the methods.
9789
9790         (add_accessor_declaration, remove_accessor_declaration): Ditto.
9791
9792         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
9793         to handle the Accessor kind :-)
9794
9795         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
9796
9797 2002-06-08  Martin Baulig  <martin@gnome.org>
9798
9799         * expression.cs (Unary.TryReduceNegative): Added support for
9800         ULongConstants.
9801
9802 2002-06-08  Martin Baulig  <martin@gnome.org>
9803
9804         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
9805         name can't be found in the `defined_names' - the caller will do a
9806         MemberLookup in this case and thus find methods in System.Enum
9807         such as Enum.IsDefined().
9808
9809 2002-06-08  Martin Baulig  <martin@gnome.org>
9810
9811         * enum.cs (Enum.ChangeEnumType): This is a custom version of
9812         Convert.ChangeType() which works with TypeBuilder created types.
9813         (Enum.LookupEnumValue, Enum.Define): Use it here.
9814
9815         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
9816         `TypeBuilder.BaseType != null' check.
9817         (TypeContainer.FindMembers): Only lookup parent members if we
9818         actually have a parent.
9819         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
9820         (ConstructorInitializer.Resolve): Likewise.
9821
9822         * interface.cs (Interface.FindMembers): Added
9823         `TypeBuilder.BaseType != null' check.
9824
9825         * rootcontext.cs (RootContext.ResolveCore): Added
9826         "System.Runtime.CompilerServices.IndexerNameAttribute" to
9827         classes_second_stage.
9828
9829         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
9830         debug_type and trace_type when compiling with --nostdlib.       
9831
9832 2002-06-07  Martin Baulig  <martin@gnome.org>
9833
9834         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
9835         (AddField): Set it to true when adding a non-static field.
9836         (DefineType): Use `have_nonstatic_fields' to find out whether we
9837         have non-static fields, not `Fields != null'.
9838
9839 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
9840
9841         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
9842         dereferencing a null on the static-field code path)
9843
9844 2002-05-30  Martin Baulig  <martin@gnome.org>
9845
9846         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
9847         to take command line arguments.  Use reflection to call the new
9848         custom `Initialize' function on the symbol writer and pass it the
9849         command line arguments.
9850
9851         * driver.cs (--debug-args): New command line argument to pass command
9852         line arguments to the symbol writer.
9853
9854 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
9855
9856         * assign.cs (DoResolve): Forgot to do the implicit conversion to
9857         the target type for indexers and properties.  Thanks to Joe for
9858         catching this.
9859
9860 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
9861
9862         * typemanager.cs (MethodFlags): returns the method flags
9863         (Obsolete/ShouldIgnore) that control warning emission and whether
9864         the invocation should be made, or ignored. 
9865
9866         * expression.cs (Invocation.Emit): Remove previous hack, we should
9867         not do this on matching a base type, we should do this based on an attribute
9868
9869         Only emit calls to System.Diagnostics.Debug and
9870         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
9871         on the command line.
9872
9873         * rootcontext.cs: Global settings for tracing and debugging.
9874
9875         * cs-tokenizer.cs (define): New utility function to track
9876         defines.   Set the global settings for TRACE and DEBUG if found.
9877
9878 2002-05-25  Ravi Pratap  <ravi@ximian.com>
9879
9880         * interface.cs (Populate*): Pass in the TypeContainer as well as
9881         the DeclSpace as parameters so that we can create EmitContexts and
9882         then use that to apply attributes etc.
9883
9884         (PopulateMethod, PopulateEvent, PopulateProperty)
9885         (PopulateIndexer): Apply attributes everywhere.
9886
9887         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
9888         etc.
9889
9890         (ApplyAttributes): Update accordingly.
9891
9892         We now apply interface attributes for all members too.
9893
9894 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
9895
9896         * class.cs (Indexer.Define); Correctly check if we are explicit
9897         implementation (instead of checking the Name for a ".", we
9898         directly look up if the InterfaceType was specified).
9899
9900         Delay the creation of the PropertyBuilder.
9901
9902         Only create the PropertyBuilder if we are not an explicit
9903         interface implementation.   This means that explicit interface
9904         implementation members do not participate in regular function
9905         lookups, and hence fixes another major ambiguity problem in
9906         overload resolution (that was the visible effect).
9907
9908         (DefineMethod): Return whether we are doing an interface
9909         implementation. 
9910
9911         * typemanager.cs: Temporary hack until we get attributes in
9912         interfaces (Ravi is working on that) and we get IndexerName
9913         support in interfaces.
9914
9915         * interface.cs: Register the indexers as properties.
9916
9917         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
9918         warning, I have verified that this is a bug in the .NET runtime
9919         (JavaScript suffers of the same problem).
9920
9921         * typemanager.cs (MemberLookup): When looking up members for
9922         interfaces, the parent of an interface is the implicit
9923         System.Object (so we succeed in searches of Object methods in an
9924         interface method invocation.  Example:  IEnumerable x;  x.ToString
9925         ()) 
9926
9927 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
9928
9929         * class.cs (Event): Events should also register if they do
9930         implement the methods that an interface requires.
9931
9932         * typemanager.cs (MemberLookup); use the new GetInterfaces
9933         method. 
9934
9935         (GetInterfaces): The code used to lookup interfaces for a type is
9936         used in more than one place, factor it here. 
9937
9938         * driver.cs: Track the errors at the bottom of the file, we kept
9939         on going.
9940
9941         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
9942         instance if the method we are calling is static!
9943
9944 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
9945
9946         * attribute.cs (ApplyAttributes): Make this function filter out
9947         the IndexerName attribute (as that attribute in reality is never
9948         applied) and return the string constant for the IndexerName
9949         attribute. 
9950
9951         * class.cs (TypeContainer.Emit): Validate that all the indexers
9952         have the same IndexerName attribute, and if so, set the
9953         DefaultName attribute on the class. 
9954
9955         * typemanager.cs: The return value might contain other stuff (not
9956         only methods).  For instance, consider a method with an "Item"
9957         property and an Item method.
9958
9959         * class.cs: If there is a problem with the parameter types,
9960         return. 
9961
9962 2002-05-24  Ravi Pratap  <ravi@ximian.com>
9963
9964         * ecore.cs (ImplicitConversionExists): Wrapper function which also
9965         looks at user defined conversion after making a call to 
9966         StandardConversionExists - we need this for overload resolution.
9967
9968         * expression.cs : Update accordingly the various method calls.
9969
9970         This fixes 2 bugs filed against implicit user defined conversions 
9971
9972 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
9973
9974         * statement.cs: Track the result of the assignment.
9975
9976 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
9977
9978         * expression.cs (MemberAccess): Improved error reporting for
9979         inaccessible members.
9980
9981 2002-05-22  Martin Baulig  <martin@gnome.org>
9982
9983         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
9984         itself with debugging support.
9985
9986 2002-05-22  Martin Baulig  <martin@gnome.org>
9987
9988         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
9989         Removed, this isn't needed anymore.
9990
9991 2002-05-20  Martin Baulig  <martin@gnome.org>
9992
9993         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
9994         be underlying type for an enum.
9995
9996 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
9997
9998         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
9999         that splits out the loading of just the core types.
10000
10001         * rootcontext.cs (ResolveCore): Split the struct resolution in
10002         two, so we can load the enumeration underlying types before any
10003         enums are used.
10004
10005         * expression.cs (Is): Bandaid until we fix properly Switch (see
10006         bug #24985 for details).
10007
10008         * typemanager.cs (ImplementsInterface): The hashtable will contain
10009         a null if there are no interfaces implemented.
10010
10011 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
10012
10013         * cs-parser.jay (indexer_declarator): It is fine to have array
10014         parameters
10015
10016 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
10017
10018         * typemanager.cs: (RegisterBuilder): New function used to register
10019         TypeBuilders that implement interfaces.  Since
10020         TypeBuilder.GetInterfaces (as usual) does not work with lame
10021         Reflection.Emit. 
10022         (AddUserType): register interfaces.
10023
10024         (ImplementsInterface): Use the builder_to_ifaces hash if we are
10025         dealing with TypeBuilder.  Also, arrays are showing up as
10026         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
10027         methods can not be invoked on them!
10028
10029         * ecore.cs (ExplicitReferenceConversionExists): Made public.
10030         (ImplicitReferenceConversionExists): Split out from
10031         StandardConversionExists. 
10032
10033         * expression.cs (As): We were only implementing one of the three
10034         cases for the as operator.  We now implement them all.
10035         (Is): Implement the various other cases for Is as well.
10036
10037         * typemanager.cs (CACHE): New define used to control if we want or
10038         not the FindMembers cache.  Seems to have a negative impact on
10039         performance currently
10040
10041         (MemberLookup): Nested types have full acess to
10042         enclosing type members
10043
10044         Remove code that coped with instance/static returns for events, we
10045         now catch this in RealFindMembers.
10046
10047         (RealFindMembers): only perform static lookup if the instance
10048         lookup did not return a type or an event.  
10049
10050 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
10051
10052         * assign.cs (CompoundAssign): We pass more semantic information
10053         now to Compound Assignments than we did before: now we have all
10054         the information at hand, and now we resolve the target *before* we
10055         do the expression expansion, which allows the "CacheValue" method
10056         to have the effect we intended (before, a [x] += 1 would generate
10057         two differen ArrayAccess expressions from the ElementAccess,
10058         during the resolution process).
10059
10060         (CompoundAssign.DoResolve): Resolve target and original_source here.
10061
10062 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
10063
10064         * expression.cs (ArrayAccess): dropped debugging information. 
10065
10066         * typemanager.cs: Small bug fix: I was always returning i_members,
10067         instead of one of i_members or s_members (depending on which had
10068         the content).
10069
10070         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
10071         method is invoked before any code generation takes place, and it
10072         is a mechanism to inform that the expression will be invoked more
10073         than once, and that the method should use temporary values to
10074         avoid having side effects
10075
10076         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
10077
10078         * ecore.cs (Expression.CacheTemporaries): Provide empty default
10079         implementation.
10080
10081         * expression.cs (Indirection, ArrayAccess): Add support for
10082         CacheTemporaries in these two bad boys. 
10083
10084         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
10085         ldobj or ldind_ref.  
10086         (StoreFromPtr): Handle stobj as well.
10087
10088         * expression.cs (UnaryMutator): Share more code.
10089
10090         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
10091         down: I was not tracking the Filter function as well, which
10092         was affecting the results of the cache.
10093
10094 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
10095
10096         * attribute.cs: Remove the hack to handle the CharSet property on
10097         StructLayouts. 
10098
10099 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
10100
10101         * attribute.cs (DoResolve): More uglyness, we now only try to
10102         resolve the attribute partially, to extract the CharSet
10103         information (only if we are a StructLayout attribute).  Otherwise 
10104
10105         (GetExtraTypeInfo): Add some code to conditionally kill in the
10106         future this.   I am more and more convinced that the .NET
10107         framework has special code to handle the attribute setting on
10108         certain elements.
10109
10110         * expression.cs (IsParamsMethodApplicable): Revert my previous
10111         foreach change here, it was wrong.
10112
10113 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
10114
10115         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
10116         (pp_expr): do not abort on unknown input, just return.
10117         (eval): abort if there are pending chars.
10118
10119         * attribute.cs (Attribute.Resolve): Positional parameters are
10120         optional.  Deal with that case.
10121
10122         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
10123         the Ansi/Unicode/Auto information for the type.
10124
10125         (TypeContainer.DefineType): instantiate the EmitContext here, as
10126         we will be using it during the type definition (to resolve
10127         attributes) and during the emit phase.
10128
10129         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
10130         to pull type information out of the attributes
10131
10132         (Attribute.Resolve): track the constructor builder, and allow for
10133         multiple invocations (structs and classes will use this).
10134
10135         * ecore.cs (MemberLookupFinal): new version with all the
10136         parameters customizable.
10137
10138         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
10139         constructors.  Return if the result value is null (as the error
10140         would have been flagged already by MemberLookupFinal)
10141
10142         Do not allow instances of abstract classes or interfaces to be
10143         created.
10144
10145         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
10146         We have to compare the assembly property here when dealing with
10147         FamANDAssem and Assembly access modifiers, because we might be
10148         creating an assembly from *modules* (that means that we are not
10149         getting TypeBuilders for types defined in other modules that are
10150         part of this assembly).
10151
10152         (Method.Emit): If the method is marked abstract and has a body,
10153         emit an error. 
10154
10155         (TypeContainer.DefineMembers): If both the defined member and the
10156         parent name match are methods, then do not emit any warnings: let
10157         the Method.Define routine take care of flagging warnings.  But if
10158         there is a mismatch (method overrides something else, or method is
10159         overriwritten by something, then emit warning).
10160
10161         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
10162         set to null, this means `do not check for the return type on the
10163         signature'. 
10164
10165         (Method.Define): set the return type for the method signature to
10166         null, so that we get methods with the same name and parameters and
10167         different return types.  This is used to flag warning 114 (you are
10168         hiding a method, and you probably want to use the new/override
10169         keywords instead).
10170
10171         * typemanager.cs (MemberLookup): Implemented proper access
10172         control, closing a long standing set of bug reports.  The problem
10173         was that the Framework only has two bits: Public and NonPublic,
10174         and NonPublic includes private and protected methods, but we need
10175         to enforce the FamANDAssem, FamOrAssem and Family. 
10176
10177 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
10178
10179         * statement.cs (GotoCase): Return true: Ammounts to giving up
10180         knowledge on whether we return or not, and letting the other case
10181         be responsible for it.
10182
10183 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
10184
10185         * driver.cs: Do not load directories for each file processed, only
10186         do it if there is a pattern.
10187
10188         * ecore.cs: Report readonly assigns here as well, as we might have
10189         been resolved only by MemberAccess.
10190
10191         (SimpleName.SimpleNameResolve): Also be useful for LValue
10192         resolution.   We need this to propagate assign to local readonly variables
10193
10194         * typemanager.cs: Use a ptrhashtable for the criteria, because we
10195         do not want to reuse potential criteria memory.
10196
10197         * class.cs (MyEventBuilder): Set reflected_type;
10198
10199         * ecore.cs (Constantify): Added support for constifying bools.
10200
10201         (RootContext.LookupType): Added a cache for values looked up in
10202         the declaration space.
10203
10204         * typemanager.cs (FindMembers): Now is a front-end to
10205         RealFindMembers, and provides a two-level hashtable-based cache to
10206         the request.  
10207
10208         15% performance improvement: from 22.5 to 19.2 seconds.
10209
10210         * expression.cs (IsParamsMethodApplicable): use foreach.
10211         (Invocation.DoResolve): ditto.
10212         (New.DoResolve): ditto.
10213         (ArrayCreation.DoResolve): ditto.
10214
10215         * ecore.cs (FindMostEncompassingType): use foreach.
10216
10217         * delegate.cs (NewDelegate.DoResolve): Use foreach
10218
10219         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
10220         (RemoveMethods): use foreach.
10221
10222         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
10223         nested foreach statements instead of for, and also break out of
10224         the inner loop once a match is found.
10225
10226         (Invocation.OverloadResolve): Use foreach, simplify the code. 
10227
10228 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
10229
10230         * cfold.cs (BinaryFold): During an enumeration evaluation context,
10231         we actually unwrap the expression to allow for extra information
10232         to be extracted. 
10233
10234         * expression.cs: Use Shr_Un on unsigned operations. 
10235
10236 2002-05-08  Ravi Pratap  <ravi@ximian.com>
10237
10238         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
10239         applicable operators was not being considered correctly. This closes
10240         the bug Miguel reported.
10241
10242 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
10243
10244         * attribute.cs: check that the type derives from System.Attribute
10245         and report the correct error in that case (moved the duplicate code to
10246         its own method, too).
10247
10248 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
10249
10250         * attribute.cs: lookup attribute type name as the spec says: first the
10251         bare attribute name and then name + "Attribute" (nant compiles with
10252         mcs after this fix).
10253
10254 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
10255
10256         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
10257         Because of the way we parse things, we should try to see if a
10258         UIntConstant can fit in an integer.
10259
10260 2002-05-07  Ravi Pratap  <ravi@ximian.com>
10261
10262         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
10263         when we are in an explicit context.
10264
10265         (ConvertReferenceExplicit): When converting from Iface type S to Class
10266         T make sure the rules are implemented as an OR.
10267
10268         * parameter.cs (ParameterType): Make it a property for now although the
10269         purpose really isn't anything immediate.
10270
10271         * expression.cs (Is*Applicable): Do better checking on the parameter type
10272         of a ref/out parameter. The ones from the system assemblies are already 
10273         marked with the correct type so we don't need to do any correction.
10274
10275         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
10276         the object type is standard too so include that.
10277
10278 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10279
10280         * ecore.cs (StandardConversionExists): Augment with missing code:
10281         deal with IntConstant, LongConstants and Enumerations.
10282
10283         * assign.cs: Report the error, instead of failing silently
10284
10285         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
10286         typecontainer that they are declared, because the
10287         typecontainer/namespace will have the list of using clauses that
10288         need to be applied.
10289
10290         Assembly Attributes were escaping the normal registration
10291         mechanism. 
10292
10293         (EmitCode): Apply attributes within an EmitContext that represents
10294         the container they were declared on.
10295
10296         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
10297
10298 2002-05-06  Ravi Pratap  <ravi@ximian.com>
10299
10300         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
10301         Revamp completely - make much cleaner as we now operate only
10302         on a set of Types.
10303
10304         (FindMostSpecificSource, FindMostSpecificTarget): New methods
10305         to implement the logic detailed in the spec more correctly.
10306
10307         (UserDefinedConversion): Update accordingly.
10308
10309 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10310
10311         * statement.cs: Return flow analysis information up.
10312
10313         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
10314         and the default.
10315
10316         (token): Do not consume an extra character before calling
10317         decimal_digits.
10318
10319 2002-05-06  Piers Haken <piersh@friskit.com>
10320
10321         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
10322
10323 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10324
10325         * class.cs (Constructor.Emit): Set the IsStatic flag in the
10326         EmitContext during the instance constructor initializer
10327         resolution, to stop access to instance variables.
10328
10329         This is mandated by the spec, last paragraph of the `constructor
10330         initializers' section. 
10331
10332 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
10333
10334         * cs-parser.jay, class.cs (Accessor): new class used to represent
10335         an accessor (get or set).  In the past we used `null' to represent
10336         a missing accessor.  But this is ambiguous because there was no
10337         way to tell in abstract indexers/properties if one of them was
10338         specified.
10339
10340         Now there is a way of addressing that.
10341
10342         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
10343         instead of FindMembers.
10344
10345         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
10346         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
10347
10348         * attribute.cs: Treat indexers and properties as the same in terms
10349         of applying attributes
10350
10351         * ecore.cs (FindMostEncompassedType): Use statically initialized
10352         EmptyExpressions()s like we do elsewhere to avoid creating useless
10353         objects (and we take this out of the tight loop).
10354
10355         (GetConversionOperators): Move the code to extract the actual
10356         operators to a separate routine to clean things up.
10357
10358 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
10359
10360         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
10361         events are always registered FieldBuilders.
10362
10363         * class.cs (FieldBase): New class shared by Fields 
10364
10365         * delegate.cs: If we are a toplevel delegate, use our full name.
10366         If we are a nested delegate, then only use our tail name.
10367
10368 2002-05-02  Ravi Pratap  <ravi@ximian.com>
10369
10370         * expression.cs (IsApplicable): Ensure that we add the "&" to
10371         ref/out types before comparing it with the type of the argument.
10372
10373         (IsParamsMethodApplicable): Ditto.
10374
10375         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
10376         silly me ;-)
10377
10378         * delegate.cs : Handle the case when we have more than one applicable
10379         method. Flag an error only when we finish checking all.
10380
10381 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
10382
10383         * expression.cs: Add support for boolean static initializers.
10384
10385 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
10386
10387         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
10388
10389         * parameter.cs (ComputeParameterTypes,
10390         ComputeAndDefineParameterTypes): Better error handling: now we
10391         clear the `types' cache if we fail during any of the type lookups.
10392         We also return the status code correctly to our caller
10393
10394         * delegate.cs: If we fail to define a delegate, abort the extra
10395         steps. 
10396
10397         * expression.cs (Binary.ResolveOperator): for
10398         operator==(object,object) and operator !=(object, object) we also
10399         have to verify that there is an implicit conversion from one to
10400         the other.
10401
10402         (ArrayAccess.DoResolve): Array Access can operate on
10403         non-variables. 
10404
10405 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
10406
10407         * assign.cs (CompoundAssign): A new class used as a "flag" that
10408         the assignment actually is happening as part of a compound
10409         assignment operator.
10410
10411         During compound assignment, a few new rules exist to enable things
10412         like:
10413
10414         byte b |= 1 + 2
10415
10416         From the spec:
10417
10418         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
10419         to the type of x) if y is implicitly convertible to the type of x,
10420         and the operator is a builtin operator and the return type of the
10421         operator is explicitly convertible to the type of x. 
10422
10423         * rootcontext.cs: Reset warning level to 2.  4 catches various
10424         "interesting" features in mcs, we must clean this up at some
10425         point, but currently am trying to kill other bugs ;-)
10426
10427         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
10428         in container classes as well.  
10429
10430         * expression.cs (Binary.ResolveOperator): Handle string case
10431         before anything else (as operator overloading does emit an error
10432         before doing anything else).
10433
10434         This code could go away when we move to a table driven model, but
10435         i could not come up with a good plan last night.
10436
10437 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
10438
10439         * typemanager.cs (CSharpName): reimplementation using regex.
10440         * class.cs: added null check for fields in Emit
10441         * rootcontext.cs: set warninglevel to 4
10442
10443 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
10444
10445         * typemanager.cs (CSharpName): reimplemented with Lupus
10446         suggestion.
10447
10448 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
10449
10450         * statement.cs (If): correclty implement Resolve, because we were
10451         not catching sem errors in there.  The same process is needed
10452         everywhere else. 
10453         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
10454
10455
10456         (Statement.Warning_DeadCodeFound): Factorize code.
10457         (While): Report dead code here too.
10458
10459         (Statement): Added Resolve virtual method to allow
10460         for resolution split from the emit code.
10461
10462 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
10463
10464         * statement.cs (EmitBoolExpression): No longer try to resolve the
10465         expression here.    
10466         (MakeBoolean): New utility function that resolve, implicitly
10467         converts to boolean and tags the expression. 
10468
10469
10470         (If, Do): Implement dead code elimination.
10471         (While): Implement loop inversion
10472
10473         (Do, While, For, If): Resolve the expression prior to calling our
10474         code generation.
10475
10476 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
10477
10478         * class.cs:
10479           - added method Report28 (warning: program has more than one entry point)
10480           - added method IsEntryPoint, implements paragraph 10.1 of the spec
10481           - modified method Method.Define, the part at the end of the method
10482
10483         * rootcontext.cs: added static public Location EntryPointLocation;
10484           
10485         * ../errors/cs0028.cs : Add test case for the above warning.              
10486
10487         * typemanager.cs:
10488           - modified method CSharpName to allow arrays of primitive type to
10489             be printed nicely (e.g. instead of System.Int32[][] it now prints
10490             int[][])
10491           - added method CSharpSignature: returns the signature of a method
10492             in string format to be used in reporting errors, warnings, etc.
10493
10494         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
10495         with String.Empty.
10496
10497 2002-04-26  Ravi Pratap  <ravi@ximian.com>
10498
10499         * delegate.cs (Define): Fix extremely silly bug where I was
10500         setting the type of the 'object' parameter of the BeginInvoke
10501         method to System.IAsyncResult instead of System.Object ;-)
10502
10503 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
10504
10505         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
10506         here. 
10507
10508         (Constructor.Emit): return if we fail to initialize the
10509         constructor.  Another door closed!  
10510
10511         * expression.cs (New.DoResolve): Improve error message (from -6 to
10512         1501).  Use DeclaredOnly lookup to find the exact constructor.
10513
10514         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
10515         loop.  This is useful.
10516
10517         * cs-parser.jay: Adjust the default parameters so that destructors
10518         have the proper signature.
10519
10520 2002-04-26  Martin Baulig  <martin@gnome.org>
10521
10522         * driver.cs (LoadAssembly): If `assembly' contains any characters
10523         which are only valid in path names and not in assembly names
10524         (currently slash, backslash and point), use Assembly.LoadFrom ()
10525         instead of Assembly.Load () on the `assembly' (before iteration
10526         over the link_paths).
10527
10528 2002-04-26  Martin Baulig  <martin@gnome.org>
10529
10530         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
10531
10532 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
10533
10534         * class.cs (Property): use the new typemanager.MemberLookup
10535
10536         (TypeContainer.MemberLookup): Implement using the
10537         TypeManager.MemberLookup now. 
10538
10539         * typemanager.cs: Make MemberLookup a function of the TypeManager,
10540         and return MemberInfos, so that these can be used without an
10541         EmitContext (what we had before).
10542
10543 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
10544
10545         * expression.cs: Fix the case where the argument to params if the
10546         type of the params.  I omitted handling this before.   Fixed
10547
10548 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
10549
10550         * driver.cs: Call BootCorlib_PopulateCoreType
10551
10552         * class.cs (Property.CheckBase): Check for properties only, not
10553         for all members. 
10554
10555         * interface.cs: Temporary hack: try/catch around the
10556         CustomAttributeBuilder, because I am getting an exception that I
10557         do not understand.
10558
10559         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
10560         types whose definitions are required to be there (attributes are
10561         defined before standard types).
10562
10563         Compute definitions as we boot the various types, as they are used
10564         immediately (value_type class will need object_type, but if we do
10565         not initialize object_type, we will pass a null, which will let
10566         the runtime pick the System.Object from the existing corlib, which
10567         is not what we want).
10568
10569 2002-04-22  Patrik Torstensson <totte@labs2.com>
10570
10571         * cs-tokenizer.cs: fixed a number of trim() issues.
10572
10573 2002-04-22  Ravi Pratap  <ravi@ximian.com>
10574
10575         * expression.cs (Argument.Type): Ensure that we return the correct
10576         type when we have out or ref parameters [in which case we 
10577         append a "&"].
10578
10579 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
10580
10581         * class.cs (Property, Indexer): Allow extern modifier in there. 
10582
10583         * typemanager.cs (InitBaseTypes): Initializes object_type and
10584         value_type, since those will be used early on during the bootstrap
10585         process to compile corlib.
10586
10587         (InitCoreTypes): Move code from here to InitBaseTypes.
10588
10589 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
10590
10591         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
10592         single-dimension arrays as using the ldlen opcode.  
10593
10594         Daniel Lewis discovered this optimization.  
10595
10596         * typemanager.cs: Add signature for System.Array::get_Length
10597
10598 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10599
10600         * statement.cs: report the error when the foreach does not apply to an
10601         array nor a collection.
10602
10603 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
10604
10605         * expression.cs: Add implicit conversions to the operator ~.
10606
10607         * constant.cs (DecimalConstant.Emit): Emit decimal value.
10608
10609         * typemanager.cs: Locate the decimal constructor.
10610
10611 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10612
10613         * attribute.cs: use the new property of TypeOf.
10614         * expression.cs: added 'get' property around typearg.
10615
10616         These changes fix a build breaker reported by NickD. Is this the
10617         correct way to fix?  If not, please, revert my changes and make it
10618         work :-).
10619
10620 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
10621
10622         * attribute.cs: Add support for typeof in attribute invocations.
10623         I am not sure that this is right though.
10624
10625 2002-04-14  Duncan Mak  <duncan@ximian.com>
10626
10627         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
10628         Binary.Operator.Division case.
10629
10630 2002-04-13  Ravi Pratap  <ravi@ximian.com>
10631
10632         * class.cs (DefineType): Ensure that we do a proper check on
10633         attribute types and also register it with the TypeManager.
10634
10635         (TypeContainer.Targets): The default for attribute types is
10636         AttributeTargets.All.
10637
10638         * attribute.cs (ApplyAttributes): Registering the attribute type
10639         is done elsewhere, not when we discover we have a Usage attribute.
10640
10641 2002-04-12  Ravi Pratap  <ravi@ximian.com>
10642
10643         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
10644         and get rid of is_delegate parameter.
10645
10646         * everywhere : update.
10647
10648 2002-04-12  Ravi Pratap  <ravi@ximian.com>
10649
10650         * cs-parser.jay (compilation_unit): Revamp completely to use
10651         some new ideas that I got from Rhys' grammar to solve the problems
10652         with assembly level attributes.
10653
10654         (outer_declaration): New grammar production.
10655
10656         (attribute_sections): Add.
10657
10658         (opt_attributes): Base on attribute_sections
10659
10660         (namespace_declaration): Allow opt_attributes to tackle the case
10661         when we have assembly level attributes - we are clever in this
10662         regard now ;-)
10663
10664         * attribute.cs (ApplyAttributes): Do not worry about assembly 
10665         attributes in the non-global context.
10666
10667         * rootcontext.cs (AddGlobalAttributes): Go back to using this
10668         instead of SetGlobalAttributes.
10669
10670         * class.cs, rootcontext.cs : Ensure we define and generate 
10671         attribute types before anything else.
10672
10673         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
10674         and flag the new error -20 for the case when the attribute type
10675         does not have valid targets specified. csc does not catch this.
10676
10677         * ../errors/errors.txt : update for error # -20
10678
10679 2002-04-11  Ravi Pratap  <ravi@ximian.com>
10680
10681         * support.cs (InternalParameters.ParameterModifier): Do some null
10682         checking and return sane values.
10683
10684         * class.cs (Method.Define): If we are a PInvoke method, ensure
10685         that we are static and extern. Report error # 601
10686
10687         * ../errors/cs0601.cs : Add test case for the above error.
10688
10689 2002-04-07  Ravi Pratap  <ravi@ximian.com>
10690
10691         * rootcontext.cs (attribute_types): We need to keep type of
10692         all attribute types separately and emit code for them first.
10693
10694         (RegisterAttribute) : Implement.
10695
10696         * class.cs (DefineType): Check if the current Type is a custom
10697         attribute type and register it accordingly.
10698
10699         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
10700         adding the first attribute twice and rename to
10701
10702         (SetGlobalAttributes): this.
10703
10704         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
10705         lookups.
10706
10707         * attribute.cs (ApplyAttributes): Take an additional argument telling us
10708         if we are processing global arguments. Hmm, I am unsure of this.
10709
10710 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10711
10712         * expression.cs: added static array of strings to avoid calling
10713         Enum.ToString () for Operator in Binary. Significant recover of
10714         performance.
10715
10716 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
10717
10718         * class.cs (FindMembers): Allow the Builders of the various
10719         members to be null.  If they are skip them.  This only happens
10720         during the PInvoke declaration.
10721
10722 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
10723
10724         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
10725         failure, so we do not keep going afterwards.
10726
10727         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
10728         wanted to pass `false' as the `is_delegate' argument.  If this is
10729         the case, why not use delegate_type == null to mean `is_delegate =
10730         false' and anything else as is_delegate = true.
10731
10732 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
10733
10734         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
10735         code for the section, not the beginning of the tests.
10736
10737 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
10738
10739         * cfold.cs: Handle operator + (Enum x, Underlying x) 
10740
10741         * expression.cs (Binary): same.  Warn about errors where we have
10742         Enum/Enum in operator + as well.
10743
10744 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
10745
10746         * statement.cs:
10747                 - added support for switch(bool)
10748                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
10749                 - add TableSwitchEmit() to handle table-based switch statements
10750
10751 2002-04-05  Ravi Pratap  <ravi@ximian.com>
10752
10753         * expression.cs (Invocation.OverloadResolve): Factor out code which
10754         does parameter compatibility checking with arguments so that we can 
10755         re-use the code even from Delegate.VerifyApplicability
10756
10757         (VerifyArgumentsCompat): Move above code here.
10758
10759         * delegate.cs (VerifyApplicability): Get rid of duplicate code
10760         and instead make a call to the above method.
10761
10762 2002-03-31  Ravi Pratap  <ravi@ximian.com>
10763
10764         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
10765         We use it to keep track of classes which are attribute types.
10766
10767 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
10768
10769         * delegate.cs (Delegate.Define): Correctly define the types in the
10770         presence of fixed and array parameters.
10771
10772         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
10773         doing FindMembers.
10774
10775         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
10776         include NonPublic after the first iteration.
10777
10778         * class.cs (Indexer.CheckBase): Only check if both parents are
10779         non-null. 
10780
10781         * cs-parser.jay (accessor_body): If empty, set to null.
10782
10783         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
10784         same code path here to resolve constants names that we did have in
10785         MemberAccess.DoResolve.  There is too much code duplicated here.
10786
10787 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
10788
10789         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
10790
10791         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
10792         to MakeUnionSet.
10793
10794         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
10795         tokens, numbers and strings.
10796
10797         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
10798         parenthesis.
10799
10800         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
10801         asyncronous parameters and the regular parameters.  
10802
10803         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
10804         specify the target directory.
10805
10806         * expression.cs: (This.DoResolve): Simplify
10807         (As.Emit): Optimize, do not generate IsInst if the expression is
10808         always of the given type.
10809
10810         (Is.DoResolve): Bug fix, we were reporting both always/never for
10811         the is expression.
10812
10813         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
10814         creating too many unnecessary arrays.
10815
10816 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
10817
10818         * class.cs (EmitFieldInitializer): Use Assign expression to assign
10819         fields instead of rolling our own initializer.   Takes care of all
10820         implicit conversions, and drops unnecessary static checks/argument.
10821
10822 2002-03-31  Dick Porter  <dick@ximian.com>
10823
10824         * driver.cs: use the GetDirectories() return values properly, and
10825         use "/" as path separator.
10826
10827 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
10828
10829         * expression.cs (Unary): Optimize - - expr into expr.
10830         (Binary): Optimize a + (-b) into a -b.
10831
10832         * codegen.cs (CodeGen): Made all methods static.
10833
10834 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
10835
10836         * rootcontext.cs: 
10837
10838         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
10839         TypeBuilder property.
10840
10841         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
10842         instead. 
10843
10844         * tree.cs: Removed the various RecordXXXX, and replaced with a
10845         single RecordDecl.  Removed all the accessor methods, and just
10846         left a single access point Type 
10847
10848         * enum.cs: Rename DefineEnum to DefineType.
10849
10850         * decl.cs: New abstract method `DefineType' used to unify the
10851         Defines for Enumerations, Interfaces, TypeContainers and
10852         Delegates.
10853
10854         (FindType): Moved LookupInterfaceOrClass here.  Moved the
10855         LookupBaseClasses method that used to live in class.cs and
10856         interface.cs here, and renamed to FindType.
10857
10858         * delegate.cs: Implement DefineType.  Take advantage of the
10859         refactored pattern for locating the parent builder without taking
10860         the parent_builder argument (which we know does not work if we are
10861         nested, and triggering a toplevel definition).
10862
10863 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
10864
10865         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
10866         accessibility of a member has changed during override and report
10867         an error if so.
10868
10869         * class.cs (Method.Define, Property.Define): Only complain on
10870         overrides if the method is private, any other accessibility is
10871         fine (and since we just checked the permission is the same, we are
10872         good to go).
10873
10874         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
10875         and elif are processed always.  The other pre-processing
10876         directives are only processed if we are "taking" the path
10877
10878 2002-03-29  Martin Baulig  <martin@gnome.org>
10879
10880         * class.cs (Method.Emit): Only emit symbolic debugging info if the
10881         current location is not Null.
10882
10883         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
10884         a separate method so we can profile it.
10885
10886         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
10887         `span.Seconds' are just seconds, but no minutes or hours.
10888         (MainDriver): Profile the CodeGen.SaveSymbols calls.
10889
10890 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
10891
10892         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
10893         Remove the gratuitous set of Final:
10894
10895                                 // If an interface implementation, then we can set Final.
10896                                 if (((flags & MethodAttributes.Abstract) == 0) &&
10897                                     implementing.DeclaringType.IsInterface)
10898                                         flags |= MethodAttributes.Final;
10899
10900         I do not know what I was smoking when I used that.
10901
10902
10903         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
10904         step into fixing the name resolution issues for delegates and
10905         unifying the toplevel name resolution.
10906
10907 2002-03-28  Martin Baulig  <martin@gnome.org>
10908
10909         * class.cs (Method.Emit): If we have a symbol writer, call its
10910         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
10911         tell it about the current method.
10912
10913         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
10914         writer that we're going to emit the first byte of IL code for a new
10915         statement (a new source line).
10916         (EmitContext.EmitTopBlock): If we have a symbol writer, call
10917         EmitContext.Mark() before emitting any code.
10918
10919         * location.cs (SymbolDocument): Return null when we're Null.
10920
10921         * statement.cs (Statement): Moved the `Location loc' variable here.
10922         (Statement.EmitBoolExpression): If we have a symbol writer, call
10923         ec.Mark() before emitting any code to tell it that we're at the
10924         beginning of a new statement.
10925         (StatementExpression): Added `Location' argument to the constructor.
10926         (Block): Added public readonly variable `StartLocation' and public
10927         variable `EndLocation'.  The latter is to be set using SetEndLocation().
10928         (Block): Added constructor which takes a start and end location.
10929         (Block.SetEndLocation): New method. This sets the end location.
10930         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
10931         local variables we create.
10932         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
10933         each statement and do also mark the begin and end of the block.
10934
10935         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
10936         tell it the current lexer.Location, use Location.Null for the end of the
10937         block.
10938         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
10939         current block, set its end location using SetEndLocation().
10940         (statement_expression): StatementExpression constructor now takes the
10941         lexer.Location as additional argument.
10942         (for_statement, declare_local_variables): Likewise.
10943         (declare_local_variables): When creating a new implicit block, use the
10944         new Block constructor and pass it the lexer.Location.
10945
10946 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
10947
10948         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
10949         members also on the parent interfaces recursively.
10950
10951 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
10952
10953         * report.cs: Use new formats, since Gonzalo finished the missing
10954         bits. 
10955
10956         * expression.cs (Binary.ResolveOperator): added missing operator|
10957         operator& and operator^ for bool/bool.
10958
10959         * cs-parser.jay: CheckDef now takes a Location argument that is
10960         used to report errors more precisly (instead of reporting the end
10961         of a definition, we try to track something which is a lot closer
10962         to the source of the problem).
10963
10964         * cs-tokenizer.cs: Track global token use, so we can properly flag
10965         the use of #define/#undef after the first token has been seen.
10966
10967         Also, rename the reportXXXX to Error_DescriptiveName
10968
10969         * decl.cs (DeclSpace.IsTopLevel): Move property here from
10970         TypeContainer, so that Enum and Interface can use this too.
10971
10972         * class.cs (TypeContainer.LookupInterfaceOrClass,
10973         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
10974         `builder' argument.  Typically this was used to pass the parent
10975         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
10976         the definition).  
10977
10978         The problem is that a nested class could trigger the definition of
10979         a toplevel class, and the builder would be obviously wrong in that
10980         case. 
10981
10982         So we drop this argument, and we compute dynamically the
10983         TypeBuilder/ModuleBuilder (the correct information was available
10984         to us anyways from DeclSpace.Parent)
10985
10986         * interface.cs (Interface.DefineInterface): Drop builder
10987         parameter cleanup like class.cs
10988
10989         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
10990         like class.cs
10991
10992         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
10993         values. 
10994
10995         (Try.Emit): Propagate the returns value from the statement.
10996
10997         (Return.Emit): Even if we are leavning 
10998
10999         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
11000
11001         * modifiers.cs: Fix the computation of MethodAttributes flags.
11002
11003 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
11004
11005         * driver.cs: allow compilation of files that start with '/'.
11006         Add a default case when checking the argument of --target.
11007
11008 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
11009
11010         * interface.cs: Implement the same search algorithm for types in
11011         the interface code.
11012
11013         * delegate.cs: Do not allow multiple definition.
11014
11015         * Recovered ChangeLog that got accidentally amputated
11016
11017         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
11018
11019         * rootcontext.cs: Load manually enum to allow core classes to
11020         contain enumerations.
11021
11022         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
11023         Update to new static methods in TypeManager.
11024
11025         * typemanager.cs (GetMethod, GetConstructor): Use our
11026         implementation of FindMembers to find the members, since during
11027         corlib compilation, the types are TypeBuilders and GetMethod and
11028         GetConstructor do not work.
11029
11030         Make all methods in TypeManager static.
11031
11032         (InitCodeHelpers): Split the functionality from
11033         the InitCodeTypes function.
11034
11035         * driver.cs: Call InitCodeHelpers after we have populated the
11036         types. 
11037
11038         * cs-parser.jay (delegate_declaration): we did not used to compute
11039         the delegate name correctly for void delegates.
11040
11041 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
11042
11043         * rootcontext.cs (RootContext): Init the interface_resolve_order
11044         and type_container_resolve_order always.
11045
11046         (ResolveCore, BootstrapCorlib_ResolveClass,
11047         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
11048         compiler when compiling with --nostdlib
11049
11050         * class.cs (TypeContainer.DefineType): Check that our parent is
11051         not null.  This test is most important when we are bootstraping
11052         the core types.
11053
11054         * codegen.cs: Split out the symbol writing code.
11055
11056 2002-03-25  Martin Baulig  <martin@gnome.org>
11057
11058         * driver.cs (-g): Made -g an alias for --debug.
11059
11060 2002-03-24  Martin Baulig  <martin@gnome.org>
11061
11062         * codegen.cs (SymbolWriter): New public variable. Returns the
11063         current symbol writer.
11064         (CodeGen): Added `bool want_debugging_support' argument to the
11065          constructor. If true, tell the ModuleBuild that we want debugging
11066         support and ask it for the ISymbolWriter.
11067         (Save): If we have a symbol writer, call it's Close() method after
11068         saving the assembly.
11069
11070         * driver.c (--debug): New command line argument to create a
11071         debugger information file.
11072
11073         * location.cs (SymbolDocument): New public property. Returns an
11074         ISymbolDocumentWriter object for the current source file or null
11075         if we don't have a symbol writer.
11076
11077 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
11078
11079         * driver.cs (LoadAssembly): Correctly return when all the paths
11080         have been tried and not before.
11081
11082         * statement.cs (Switch.Emit): return the actual coverage for this
11083         statement (returns/not-returns)
11084
11085         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
11086         switch of the statement if we are the last switch section.  That
11087         kills two problems: try/catch problems (we used to emit an empty
11088         nop at the end) and switch statements where all branches would
11089         return. 
11090
11091 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
11092
11093         * driver.cs: Add default assemblies (the equivalent to the
11094         Microsoft CSC.RSP file)
11095
11096         * cs-tokenizer.cs: When updating `cols and setting it to zero,
11097         also update tokens_seen and set it to false.
11098
11099         * driver.cs: Implement --recurse for Mike.
11100
11101         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
11102         correctly splitting out the paths.
11103
11104 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
11105
11106         * interface.cs (Interface.PopulateProperty): Instead of using
11107         `parent' as the declaration space for the set parameters, use
11108         `this' 
11109
11110         * support.cs (InternalParameters): InternalParameters constructor
11111         takes a DeclSpace instead of a TypeContainer.
11112
11113         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
11114         types are being initialized, load the address of it before calling
11115         the function.  
11116
11117         (New): Provide a mechanism to disable the generation of local
11118         value type temporaries when the caller will be providing us with
11119         an address to store it.
11120
11121         (ArrayCreation.EmitDynamicInitializers): Use it.
11122
11123 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
11124
11125         * expression.cs (Invocation.EmitArguments): Only probe for array
11126         property if there is more than one argument.  Sorry about that.
11127
11128         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
11129         empty param arrays.
11130
11131         * class.cs (Method.LabelParameters): Fix incorrect code path that
11132         prevented the `ParamArrayAttribute' from being applied to the
11133         params attribute.
11134
11135 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
11136
11137         * support.cs (ReflectionParameters): Correctly compute whether the
11138         last argument is a params array.  Fixes the problem with
11139         string.Split ('a')
11140
11141         * typemanager.cs: Make the assemblies array always be non-null
11142         (empty, but non-null)
11143
11144         * tree.cs (RecordDecl): New function that abstracts the recording
11145         of names.  This reports error 101, and provides a pointer to the
11146         previous declaration.  Fixes a crash in the compiler.
11147
11148         * cs-parser.jay (constructor_declaration): Update to new grammar,
11149         and provide a constructor_body that can be empty.
11150
11151 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
11152
11153         * driver.cs: Add support for --resources.
11154
11155         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
11156         Make all types for the various array helper methods be integer.
11157
11158         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
11159         CheckState to ConvCast.
11160
11161         (ConvCast): Now it takes a `checked' state argument, to avoid
11162         depending on the emit context for the conversion, and just using
11163         the resolve time setting.
11164
11165         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
11166         instead of Invocation.EmitArguments.  We do not emit the original
11167         arguments, instead we emit those which have been converted to
11168         unsigned int expressions.
11169
11170         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
11171
11172         * codegen.cs: ditto.
11173
11174         * expression.cs (LocalVariableReference): Drop the use of the
11175         Store function that depended on the variable index.
11176
11177         * statement.cs (VariableInfo): Drop the `Idx' property from this
11178         class, as this is not taking into account the indexes for
11179         temporaries tat we generate during the execution, getting the
11180         indexes wrong.
11181
11182         * class.cs: First emit class initializers, then call the parent
11183         constructor. 
11184
11185         * expression.cs (Binary): Fix opcode emision.
11186         (UnaryMutator.EmitCode): Support checked code generation
11187
11188         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
11189         matches for events for both the Static and Instance scans,
11190         pointing to the same element.   Fix that.
11191
11192 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
11193
11194         * rootcontext.cs (ResolveTree): Always set the
11195         interface_resolve_order, because nested interfaces will be calling
11196         into us.
11197
11198         * class.cs (GetInterfaceOrClass): Track the same resolution
11199         process used by TypeManager.LookupType.  This fixes the nested
11200         type lookups in class declarations (separate path from
11201         LookupType). 
11202
11203         (TypeContainer.DefineType): Also define nested interfaces.
11204         (TypeContainer.RegisterOrder): New public function used to
11205         register the order in which child interfaces need to be closed.
11206
11207         Nested interfaces need to be closed after their parents have been
11208         created. 
11209
11210         * interface.cs (InterfaceAttr): Put all the logic for computing
11211         the interface attribute here. 
11212
11213         (DefineInterface): Register our interface order with the
11214         RootContext or with the TypeContainer depending on the case.
11215
11216 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11217
11218         * cs-parser.jay: rework foreach statement to work with the new
11219         changes to the policy on SimpleNames.
11220
11221         * report.cs: support Stacktrace on warnings as well.
11222
11223         * makefile: drop --unsafe and /unsafe from the compile.
11224
11225 2002-03-13  Ravi Pratap  <ravi@ximian.com>
11226
11227         * ecore.cs (StandardConversionExists): Modify to take an Expression
11228         as the first parameter. Ensure we do null -> reference type conversion
11229         checking.
11230
11231         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
11232         temporary Expression objects.
11233
11234 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
11235
11236         * interface.cs: workaround bug in method overloading resolution
11237         (there is already a bugzilla bug for it).
11238
11239 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11240
11241         We could also solve this problem by having a separate path for
11242         performing type lookups, instead of DoResolve, we could have a
11243         ResolveType entry point, and only participating pieces of the
11244         production (simplename, deref, array) would implement this. 
11245
11246         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
11247         signal SimpleName to only resolve type names and not attempt to
11248         resolve anything else.
11249
11250         * expression.cs (Cast): Set the flag.
11251
11252         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
11253
11254         * class.cs: Only report 108 if there is no `new' modifier.
11255
11256         * cs-parser.jay: rework foreach statement to work with the new
11257         changes to the policy on SimpleNames.
11258
11259         * report.cs: support Stacktrace on warnings as well.
11260
11261         * makefile: drop --unsafe and /unsafe from the compile.
11262
11263 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
11264
11265         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11266         lookups here, instead of doing that at parse time.  This means
11267         that our grammar will not introduce `LocalVariableReferences' as
11268         expressions at this point.  That solves the problem of code like
11269         this:
11270
11271         class X {
11272            static void Main ()
11273            { int X = 1;
11274             { X x = null }}}
11275
11276         This is only half the fix.  The full fix requires parameters to
11277         also be handled in this way.
11278
11279         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
11280         makes the use more obvious of the DeclSpace.  The
11281         ec.TypeContainer.TypeBuilder is now only used to pull the
11282         TypeBuilder for it.
11283
11284         My theory is that I can get rid of the TypeBuilder completely from
11285         the EmitContext, and have typecasts where it is used (from
11286         DeclSpace to where it matters).  
11287
11288         The only pending problem is that the code that implements Aliases
11289         is on TypeContainer, and probably should go in DeclSpace.
11290
11291         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11292         lookups here, instead of doing that at parse time.  This means
11293         that our grammar will not introduce `LocalVariableReferences' as
11294         expressions at this point.  That solves the problem of code like
11295         this:
11296
11297         class X {
11298            static void Main ()
11299            { int X = 1;
11300             { X x = null }}}
11301
11302         This is only half the fix.  The full fix requires parameters to
11303         also be handled in this way.
11304
11305         * class.cs (Property.DefineMethod): When implementing an interface
11306         method, set newslot, when implementing an abstract method, do not
11307         set the flag (before we tried never setting it, or always setting
11308         it, which is the difference).
11309         (Indexer.DefineMethod): same.
11310         (Method.DefineMethod): same.
11311
11312         * ecore.cs: Only set the status used flag if we get back a Field.
11313
11314         * attribute.cs: Temporary hack, so Paolo can keep working.
11315
11316 2002-03-08  Ravi Pratap  <ravi@ximian.com>
11317
11318         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
11319         the unmanaged type in the case we have a MarshalAs attribute.
11320
11321         (Resolve): Handle the case when we are parsing the special MarshalAs
11322         attribute [we need to store the unmanaged type to use later]
11323
11324         * typemanager.cs (marshal_as_attr_type): Built in type for the 
11325         MarshalAs Attribute.
11326
11327         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
11328         on parameters and accordingly set the marshalling info.
11329
11330 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
11331
11332         * class.cs: Optimizing slightly by removing redundant code after
11333         we switched to the `NoTypes' return value.
11334         (Property.DefineMethod): use NoTypes here too.
11335
11336         This fixes the bug I introduced in my last batch of changes.
11337
11338 2002-03-05  Ravi Pratap  <ravi@ximian.com>
11339
11340         * tree.cs (RecordEnum): Add. We now keep track of enums too.
11341
11342         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
11343         Enums since those are types too. 
11344
11345         * cs-parser.jay (enum_declaration): Record enums as we parse them.
11346
11347         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
11348         thanks to a call during the lookup process.
11349
11350 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
11351
11352         * statement.cs (Foreach): Lots of work to accomodate a particular
11353         kind of foreach statement that I had not kept in mind.  It is
11354         possible to have foreachs on classes that provide a GetEnumerator
11355         method that return objects that implement the "pattern" for using
11356         a foreach, there is no need to support GetEnumerator
11357         specifically. 
11358
11359         This is needed to compile nant.
11360
11361         * decl.cs: Only report 114 if the member is not `Finalize' and if
11362         the warning level is at least 2.
11363
11364         * class.cs: Moved the compare function from Method to
11365         MethodSignature. 
11366
11367         (MethodSignature.InheritableMemberSignatureCompare): Add new
11368         filter function that is used to extract inheritable methods from a
11369         class. 
11370
11371         (Method.Define): Use the new `inheritable_method_signature_filter'
11372         delegate
11373
11374         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
11375         command. 
11376
11377 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
11378
11379         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
11380
11381         * cs-parser.jay: Add opt_semicolon to the interface declaration.
11382
11383         * expression.cs: Pass location information to
11384         ConvertImplicitStandard. 
11385
11386         * class.cs: Added debugging code to track return values from
11387         interfaces. 
11388
11389 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
11390
11391         * expression.cs (Is.DoResolve): If either side of the `is' is an
11392         interface, do not flag the warning.
11393
11394         * ecore.cs (ImplicitReferenceConversion): We need a separate test
11395         for interfaces
11396
11397         * report.cs: Allow for --fatal to be used with --probe.
11398
11399         * typemanager.cs (NoTypes): Move the definition for the empty Type
11400         array here. 
11401
11402         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
11403         properties. 
11404         (TypeContainer.DefineProxy): New function used to proxy to parent
11405         implementations when implementing interfaces.
11406         (TypeContainer.ParentImplements): used to lookup if our parent
11407         implements a public function that is required by an interface.
11408         (TypeContainer.VerifyPendingMethods): Hook this up.
11409
11410         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
11411         `modules' and `assemblies' arraylists into arrays.  We only grow
11412         these are the very early start up of the program, so this improves
11413         the speedof LookupType (nicely measured).
11414
11415         * expression.cs (MakeByteBlob): Replaced unsafe code with
11416         BitConverter, as suggested by Paolo.
11417
11418         * cfold.cs (ConstantFold.Binary): Special case: perform constant
11419         folding of string concatenation, but if either side is a string,
11420         and the other is not, then return null, and let the runtime use
11421         the concatenation on the string plus the object (using
11422         `Object.ToString'). 
11423
11424 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
11425
11426         Constant Folding has been implemented now.
11427
11428         * expression.cs (Unary.Reduce): Do not throw an exception, catch
11429         the error instead on types that are not supported in one's
11430         complement. 
11431
11432         * constant.cs (Constant and all children): New set of functions to
11433         perform implict and explicit conversions.
11434
11435         * ecore.cs (EnumConstant): Implement the new functions to perform
11436         conversion by proxying to the child expression.
11437
11438         * codegen.cs: (ConstantCheckState): Constant evaluation has its
11439         own separate setting that can not be turned off from the command
11440         line using --unchecked or --checked and is only controlled using
11441         the checked/unchecked statements and expressions.  This setting is
11442         used by the constant folder to flag errors.
11443
11444         * expression.cs (CheckedExpr, UncheckedExpr): Set the
11445         ConstantCheckState as well.   
11446
11447         During Resolve, they also have to flag the state, because the
11448         constant folder runs completely in the Resolve phase.
11449
11450         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
11451         well.
11452
11453 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
11454
11455         * cfold.cs: New file, this file contains the constant folder.
11456
11457         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
11458         argument to track whether we are using the resulting address to
11459         load or store a value and provide better error messages. 
11460
11461         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
11462         new AddressOf arguments.
11463
11464         * statement.cs (Foreach.EmitCollectionForeach): Update
11465
11466         * expression.cs (Argument.Emit): Call AddressOf with proper
11467         arguments to track usage.
11468
11469         (New.DoEmit): Call AddressOf with new arguments.
11470
11471         (Unary.Emit): Adjust AddressOf call.
11472
11473 2002-03-01  Ravi Pratap  <ravi@ximian.com>
11474
11475         * cs-parser.jay (member_access): Change the case for pre-defined types
11476         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
11477         this suggestion.
11478
11479         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
11480         a method body.
11481
11482         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
11483         essentially like methods and apply attributes like MethodImplOptions to them too.
11484
11485         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
11486         not being null.
11487
11488         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
11489         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
11490         is the DeclSpace.
11491
11492         * Update code everywhere accordingly.
11493
11494         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
11495
11496         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
11497
11498 2002-02-28  Ravi Pratap  <ravi@ximian.com>
11499
11500         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
11501         try performing lookups against those instead of jumping straight into using
11502         the 'using' clauses.
11503
11504         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
11505
11506         (LookupType): Perform lookups in implicit parents too.
11507
11508         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
11509         sequence as RootContext.LookupType. 
11510
11511         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
11512         the various cases of namespace lookups into this method.
11513
11514 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
11515
11516         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
11517         in positional arguments)
11518
11519         * class.cs (Operator): Update the AllowedModifiers to contain
11520         extern. 
11521
11522         * cs-parser.jay: Update operator declaration to allow for the
11523         operator body to be empty.
11524
11525         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
11526         values. 
11527
11528 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
11529
11530         * class.cs (Method.Emit): Label parameters.
11531
11532         * driver.cs: Return 1 or 0 as the program exit code.
11533
11534 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
11535
11536         * expression.cs: Special case the `null' object when trying to
11537         auto-compute the type, as anything can be explicitly converted to
11538         that. 
11539
11540         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
11541         spotting this Paolo.
11542
11543         (Expression.ImplicitNumericConversion): Perform comparissions of
11544         the type using the underlying type in the case of an enumeration
11545         rather than using the enumeration type for the compare.
11546
11547         Cope with the underlying == type case, which is not possible to
11548         catch before. 
11549
11550         (Expression.ConvertNumericExplicit): Perform comparissions of
11551         the type using the underlying type in the case of an enumeration
11552         rather than using the enumeration type for the compare.
11553
11554         * driver.cs: If the user does not supply an extension, assume .exe
11555
11556         * cs-parser.jay (if_statement): Rewrote so that we can track the
11557         location for the if statement.
11558
11559         * expression.cs (Binary.ConstantFold): Only concat strings when
11560         the operation is "+", not everything ;-)
11561
11562         * statement.cs (Statement.EmitBoolExpression): Take a location
11563         argument. 
11564         (If, While, Do): Track location.
11565
11566         * expression.cs (Binary.ResolveOperator): In the object + string
11567         case, I was missing a call to ConvertImplicit
11568
11569 2002-02-25  Ravi Pratap  <ravi@ximian.com>
11570
11571         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
11572         Location arguments. Ensure we use RootContext.LookupType to do our work
11573         and not try to do a direct Type.GetType and ModuleBuilder.GetType
11574
11575         * interface.cs (PopulateMethod): Handle the type of the parameter being
11576         null gracefully.
11577
11578         * expression.cs (Invocation.BetterFunction): Handle the case when we 
11579         have a params method with no fixed arguments and a call is made with no
11580         arguments.
11581
11582 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
11583
11584         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
11585         the verbatim-string-literal
11586
11587         * support.cs (InternalParameters.ParameterModifier): handle null
11588         fixed parameters.
11589         (InternalParameters.ParameterType): ditto.
11590
11591         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
11592         duplicating the name of the variable parameter.
11593         (GetParameterByName): Fix bug where we were not looking up array
11594         paramters if they were the only present (thanks Paolo!).
11595         (GetParameterInfo): We only have an empty set of types if both
11596         fixed and array are set to null.
11597         (GetParameterInfo-idx): Handle FixedParameter == null
11598
11599         * cs-parser.jay: Handle the case where there is no catch
11600         statements (missing null test).
11601
11602 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
11603
11604         * driver.cs (MainDriver): Be conservative on our command line
11605         handling.
11606
11607         Catch DirectoryNotFoundException when calling GetFiles.
11608
11609         (SplitPathAndPattern): Used to split the input specification into
11610         a path and a pattern that we can feed to Directory.GetFiles.
11611
11612 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
11613
11614         * statement.cs (Fixed): Implement the last case of the Fixed
11615         statement (string handling).
11616
11617         * expression.cs (StringPtr): New class used to return a char * to
11618         a string;  Used by the Fixed statement.
11619
11620         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
11621
11622         * expression.cs (Binary.ResolveOperator): Remove redundant
11623         MemberLookup pn parent type.
11624         Optimize union call, we do not need a union if the types are the same.
11625         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
11626         type.
11627
11628         Specialize the use of MemberLookup everywhere, instead of using
11629         the default settings. 
11630
11631         (StackAlloc): Implement stackalloc keyword.
11632
11633         * cs-parser.jay: Add rule to parse stackalloc.
11634
11635         * driver.cs: Handle /h, /help, /?
11636
11637         * expression.cs (MakeByteBlob): Removed the hacks we had in place
11638         before we supported unsafe code.
11639
11640         * makefile: add --unsafe to the self compilation of mcs.
11641
11642 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
11643
11644         * expression.cs (PointerArithmetic): New class that is used to
11645         perform pointer arithmetic.
11646         (Binary.Resolve): Handle pointer arithmetic
11647         Handle pointer comparission.
11648         (ArrayPtr): Utility expression class that is used to take the
11649         address of an array.
11650
11651         (ElementAccess): Implement array access for pointers
11652
11653         * statement.cs (Fixed): Implement fixed statement for arrays, we
11654         are missing one more case before we are done.
11655
11656         * expression.cs (Indirection): Implement EmitAssign and set the
11657         ExprClass to Variable.  This allows pointer dereferences to be
11658         treated as variables, and to have values assigned to them.
11659
11660         * ecore.cs (Expression.StoreFromPtr): New utility function to
11661         store values dereferencing.
11662
11663 2002-02-20  Ravi Pratap  <ravi@ximian.com>
11664
11665         * expression.cs (Binary.ResolveOperator): Ensure that we are
11666         not trying to operate on a void type - this fixes the reported
11667         bug.
11668
11669         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
11670         the parent implementation is sealed.
11671
11672         * ../errors/cs0239.cs : Add.
11673
11674         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
11675
11676         * typemanager.cs (unverifiable_code_type): Corresponds to 
11677         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
11678         which have unsafe code in them.
11679
11680         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
11681         unsafe context.
11682
11683 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
11684
11685         * cs-tokenizer.cs: Add support for @"litreal strings"
11686
11687         Make tokenizer accept pre-processor directives
11688         on any column (remove the old C-like limitation). 
11689
11690         * rootcontext.cs (EmitCode): Emit any global attributes.
11691         (AddGlobalAttributes): Used to keep track of assembly attributes. 
11692
11693         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
11694
11695         * cs-parser.jay: Add support for global attributes.  
11696
11697 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
11698
11699         * expression.cs (Indirection): New helper class.  Unary will
11700         create Indirection classes to be able to implement the
11701         IMemoryLocation interface on it.
11702
11703 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
11704
11705         * cs-parser.jay (fixed_statement): reference the right statement.
11706
11707         * statement.cs (Fixed.Emit): Finish implementing the fixed
11708         statement for the &x case.
11709
11710 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
11711
11712         * class.cs (Property.Define, Method.Define): Remove newslot when
11713         `implementing'.  
11714
11715         * modifiers.cs: My use of NewSlot when `Abstract' was set was
11716         wrong.  NewSlot should only be used if the `new' keyword is present.
11717
11718         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
11719         locating our system dir.  Sorry about this.
11720
11721 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
11722
11723         * driver.cs (GetSystemDir): Compute correctly the location of our
11724         system assemblies.  I was using the compiler directory instead of
11725         the library directory.
11726
11727 2002-02-13  Ravi Pratap  <ravi@ximian.com>
11728
11729         * expression.cs (BetterFunction): Put back in what Miguel commented out
11730         since it is the correct fix. The problem is elsewhere ;-)
11731
11732         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
11733         parameters of the parms method are themselves compatible or not !
11734
11735         (StandardConversionExists): Fix very dangerous bug where we were forgetting
11736         to check that a class implements an interface before saying that an implicit
11737         conversion was allowed. Use ImplementsInterface to do the checking.
11738
11739 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
11740
11741         * class.cs (Method.Define): Track whether we are an explicit
11742         implementation or not.  And only call DefineMethodOverride if we
11743         are an explicit implementation.
11744
11745         (Property.DefineMethod): Ditto.
11746
11747 2002-02-11  Ravi Pratap  <ravi@ximian.com>
11748
11749         * expression.cs (BetterFunction): Catch hideous bug which was
11750          preventing us from detecting ambiguous calls due to implicit casts i.e
11751         cs0121.
11752
11753 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
11754
11755         * support.cs (Pair): Remove un-needed method.  I figured why I was
11756         getting the error in cs-parser.jay, the variable in a foreach loop
11757         is readonly, and the compiler does not really treat this as a variable.
11758
11759         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
11760         instead of EQUALS in grammar.  
11761
11762         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
11763
11764         * expression.cs (Unary.DoResolve): Check whether the argument is
11765         managed or not.
11766
11767 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
11768
11769         * support.cs: Api for Pair to set a value.  Despite the fact that
11770         the variables are public the MS C# compiler refuses to compile
11771         code that accesses the field if the variable is part of a foreach
11772         statement. 
11773
11774         * statement.cs (Fixed): Begin implementation of the fixed
11775         statement.
11776
11777         (Block.AddVariable): Return the VariableInfo on success and null
11778         on failure instead of true/false. 
11779
11780         * cs-parser.jay (foreach): Catch errors on variables already
11781         defined (we were ignoring this value before) and properly unwind
11782         the block hierarchy
11783
11784         (fixed_statement): grammar for the fixed statement.
11785
11786 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
11787
11788         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
11789         pointer types to be incretemented.
11790
11791         (SizeOf): Implement.
11792
11793         * cs-parser.jay (pointer_member_access): Implement
11794         expr->IDENTIFIER production.
11795
11796         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
11797         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
11798         on safe contexts.
11799
11800         (Unary): Implement indirection.
11801
11802         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
11803         use in non-unsafe context).
11804
11805         (SimpleName.DoResolve): Check for pointers in field access on safe
11806         contexts. 
11807
11808         (Expression.LoadFromPtr): Factor the load-indirect code in this
11809         function.  This was duplicated in UnboxCast and ParameterReference
11810
11811 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
11812
11813         * expression.cs (ComposedCast): report an error if a pointer cast
11814         is used in a safe region.
11815
11816         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
11817         pointer type casts in unsafe context.
11818
11819         * codegen.cs (EmitContext): Set up IsUnsafe.
11820
11821         * cs-parser.jay (non_expression_type): Add productions for pointer
11822         casts. 
11823
11824         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
11825         code.  We should not use force into static mode if the method is
11826         not virtual.  Fixes bug in MIS
11827
11828         * statement.cs (Do.Emit, While.Emit, For.Emit,
11829         Statement.EmitBoolExpression): Add support to Do and While to
11830         propagate infinite loop as `I do return' semantics.
11831
11832         Improve the For case to also test for boolean constants.
11833
11834         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
11835         to the list of attributes we can add.
11836
11837         Remove `EmitContext' argument.
11838
11839         * class.cs (Method.Define): Apply parameter attributes.
11840         (Constructor.Define): Apply parameter attributes.
11841         (MethodCore.LabelParameters): Move here the core of labeling
11842         parameters. 
11843
11844         * support.cs (ReflectionParameters.ParameterModifier,
11845         InternalParameters.ParameterModifier): Use IsByRef on the type and
11846         only return the OUT bit for these parameters instead of in/out/ref
11847         flags.
11848
11849         This is because I miss-understood things.  The ParameterInfo.IsIn
11850         and IsOut represent whether the parameter has the [In] and [Out]
11851         attributes set.  
11852
11853 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
11854
11855         * ecore.cs (FieldExpr.Emit): Release temporaries.
11856
11857         * assign.cs (LocalTemporary.Release): new function.
11858
11859         * codegen.cs (EmitContext.GetTemporaryStorage,
11860         EmitContext.FreeTemporaryStorage): Rework the way we deal with
11861         temporary storage.  Now we can "put back" localbuilders when we
11862         are done with them
11863
11864 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
11865
11866         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
11867         need to make a copy of the variable to generate verifiable code.
11868
11869 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
11870
11871         * driver.cs: Compute dynamically the system directory.
11872
11873         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
11874         Slower, but more generally useful.  Used by the abstract
11875         registering implementation. 
11876
11877         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
11878         the rules for the special rule on Type/instances.  First check if
11879         we have the same name, and if so, try that special static path
11880         rather than the instance path.
11881
11882 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
11883
11884         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
11885         for, while and if.
11886
11887         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
11888         Enum, ValueType, Delegate or Array for non-corlib compiles.
11889
11890         * cs-tokenizer.cs: Catch long identifiers (645)
11891
11892         * typemanager.cs (IndexerPropetyName): Ravi never tested this
11893         piece of code.
11894
11895         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
11896         fix, we were returning too early, so we were not registering
11897         pending methods from abstract classes.
11898
11899         Do not register pending methods if the class is abstract.
11900
11901         * expression.cs (Conditional.DoResolve): Report circular implicit
11902         conversions when we neecd to compute it for conditional
11903         expressions. 
11904
11905         (Is.DoResolve): If the expression is always of the provided type,
11906         flag warning 183.  If the expression can not ever be of the
11907         provided type flag warning 184.
11908
11909         * class.cs: Catch 169 as well.
11910
11911         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
11912         read. 
11913
11914 2002-01-18  Nick Drochak  <ndrochak@gol.com>
11915
11916         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
11917
11918 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
11919
11920         * interface.cs: (PopulateMethod): Check for pointers being defined
11921         only if the unsafe context is active.
11922         (PopulateProperty): ditto.
11923         (PopulateIndexer): ditto.
11924
11925         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
11926         specified.  If pointers are present, make sure that they are
11927         present in an unsafe context.
11928         (Constructor, Constructor.Define): ditto.
11929         (Field, Field.Define): ditto.
11930         (Property, Property.Define): ditto.
11931         (Event, Event.Define): ditto.
11932
11933         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
11934         hashtable if there are classes or structs defined.
11935
11936         * expression.cs (LocalVariableReference.DoResolve): Simplify this
11937         code, as the constant resolution moved.
11938
11939         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
11940         the metadata, so we can flag error 133. 
11941
11942         * decl.cs (MemberCore.UnsafeOK): New function to test that a
11943         pointer is being declared in an unsafe context.
11944
11945 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
11946
11947         * modifiers.cs (Modifiers.Check): Require a Location argument.
11948         Report error 227 for Unsafe use.
11949
11950         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
11951
11952         * statement.cs (For.Emit): If the test is null, then report that
11953         we do `return', as we wont reach anything afterwards.
11954
11955         (Switch.SwitchGoverningType): Track the expression that matched
11956         the conversion.
11957
11958         * driver.cs: Allow negative numbers as an error code to flag.
11959
11960         * cs-parser.jay: Handle 1551.
11961
11962         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
11963
11964 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
11965
11966         * cs-parser.jay: Report 1518 (type declaration can only contain
11967         class, struct, interface, enum or delegate)
11968
11969         (switch_label): Report 1523 (keywords `case' or `default' must
11970         preced code)
11971
11972         (opt_switch_sections): Report 1522 (empty switch)
11973
11974         * driver.cs: Report 1515 (response file specified multiple times)
11975         Report 1516 (Source file specified multiple times).
11976
11977         * expression.cs (Argument.Resolve): Signal 1510
11978
11979         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
11980         access not allowed in static code)
11981
11982 2002-01-11  Ravi Pratap  <ravi@ximian.com>
11983
11984         * typemanager.cs (IsPointerType): Utility method which we are going
11985         to need a lot.
11986
11987         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
11988         the object type, so we take care of that.
11989
11990         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
11991
11992         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
11993         added to non-params parameters :-)
11994
11995         * typemanager.cs (CSharpName): Include 'void' type too. 
11996
11997         (void_ptr_type): Include in the set of core types.
11998
11999         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
12000         duplicating code.
12001
12002         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
12003         an unsafe context.
12004
12005         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
12006         completely forgotten about it.
12007
12008 2002-01-10  Ravi Pratap  <ravi@ximian.com>
12009
12010         * cs-parser.jay (pointer_type): Add. This begins our implementation
12011         of parsing rules for unsafe code.
12012
12013         (unsafe_statement): Implement.
12014
12015         (embedded_statement): Modify to include the above.
12016
12017         * statement.cs (Unsafe): Implement new class for unsafe blocks.
12018
12019         * codegen.cs (EmitContext.InUnsafe): Add. This determines
12020         if the current context is an unsafe one.
12021
12022         * cs-parser.jay (local_variable_pointer_type): Since local variable types
12023         are handled differently, we need separate rules for them.
12024
12025         (local_variable_declaration): Update to use local_variable_pointer_type
12026         to allow variable declarations of unmanaged pointer types.
12027
12028         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
12029         in unsafe contexts.
12030
12031         * ../errors/cs0214.cs : Add.
12032
12033 2002-01-16  Nick Drochak  <ndrochak@gol.com>
12034
12035         * makefile: remove 'response' file when cleaning.
12036
12037 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
12038
12039         * cs-parser.jay: Report 1524.
12040
12041 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
12042
12043         * typemanager.cs (RegisterMethod): drop checking if we have
12044         registered this from here
12045
12046 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
12047
12048         * class.cs (Method.EmitDestructor): Implement calling our base
12049         destructor. 
12050
12051         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
12052         value of InFinally.
12053
12054         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
12055         this routine and will wrap the call in a try/catch block.  Deal
12056         with the case.
12057
12058 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
12059
12060         * ecore.cs (Expression.MemberLookup): instead of taking a
12061         parameter `same_type' that was used to tell whether we could
12062         access private members we compute our containing type from the
12063         EmitContext.
12064
12065         (FieldExpr): Added partial support for volatile fields.  This does
12066         not work for volatile fields exposed from assemblies, as I can not
12067         figure out how to extract the modreq from it.
12068
12069         Updated all the source files to use this.
12070
12071         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
12072         because it is referenced by MemberLookup very often. 
12073
12074 2002-01-09  Ravi Pratap  <ravi@ximian.com>
12075
12076         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
12077         TypeBuilder.GetCustomAttributes to retrieve what we need.
12078
12079         Get rid of redundant default_member_attr_type as this is the same as
12080         default_member_type which already exists.
12081
12082         * interface.cs, attribute.cs : Update accordingly.
12083
12084 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
12085
12086         * typemanager.cs: Enable IndexerPropertyName again.  It does not
12087         work for TYpeBuilders though.  Ravi, can you please fix this?
12088
12089         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
12090
12091         * expression.cs (Argument.Emit): Handle the case of ref objects
12092         being passed to ref functions;  
12093
12094         (ParameterReference.EmitLoad): Loads the content of the pointer
12095         without dereferencing.
12096
12097 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
12098
12099         * cs-tokenizer.cs: Implemented the pre-processing expressions.
12100
12101 2002-01-08  Ravi Pratap  <ravi@ximian.com>
12102
12103         * class.cs (Indexer.DefineMethod): Incorporate the interface
12104         type in the name of the method if we are doing explicit interface
12105         implementation.
12106
12107         * expression.cs (ConversionExists): Remove as it is completely obsolete.
12108
12109         (BetterConversion): Fix extremely trivial bug where we were referring to
12110         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
12111         again !
12112
12113         * ../errors/bug16.cs : Add although we have fixed it.
12114
12115 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
12116
12117         * expression.cs (BaseIndexer): Begin implementation.
12118
12119         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
12120
12121         * cs-parser.jay (indexer_declarator): Use qualified_identifier
12122         production directly to remove a shift/reduce, and implement
12123         explicit interface implementation.
12124
12125         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
12126         after a floating point suffix.
12127
12128         * expression.cs (DoNumericPromotions): Improved the conversion for
12129         uint/uint.  If we have a constant, we avoid doing a typecast to a
12130         larger type.
12131
12132         * class.cs (Indexer): Implement explicit interface implementation
12133         for indexers.
12134
12135 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
12136
12137         * class.cs: make the default instance constructor public and hidebysig.
12138
12139 2001-01-03  Ravi Pratap  <ravi@ximian.com>
12140
12141         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
12142         so we can call it from elsewhere.
12143
12144         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
12145         we emit it internally if the class has a defined indexer; otherwise the user
12146         emits it by decorating the class definition with the DefaultMemberAttribute.
12147
12148         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
12149         attribute is not used on a type which defines an indexer.
12150
12151         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
12152         character when we skip whitespace.
12153
12154         * ../errors/cs0646.cs : Add.
12155
12156 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
12157
12158         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
12159         again. 
12160
12161         * makefile: Add practical target `mcs3.exe' which builds the third
12162         generation compiler. 
12163
12164         * expression.cs (New): Fix structures constructor calling.
12165
12166         * class.cs (Property, Method, Indexer): Emit Final flag on the
12167         method if we are an interface implementation and we are not
12168         abstract. 
12169
12170         * ecore.cs (PropertyExpr): New public field `IsBase', tells
12171         whether this property is referencing a `base' method.
12172
12173         * expression.cs (Invocation.EmitCall): take an extra argument:
12174         is_base, this is used to determine whether the `call' or
12175         `callvirt' opcode should be used.
12176
12177
12178         * delegate.cs: update EmitCall.
12179
12180         * class.cs (Method.Define): Set NewSlot for the cases where we are
12181         not implementing an interface method.
12182
12183         (Property.Define): ditto.
12184
12185 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
12186
12187         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
12188         'r'.  Allows mcs to parse itself fully.
12189
12190 2002-01-02  Ravi Pratap  <ravi@ximian.com>
12191
12192         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
12193         of the number of initializers that require the InitializeArray method.
12194
12195         (CheckIndices): Store the Expression in all cases - not the plain value. Also
12196         update the above field where necessary.
12197
12198         (MakeByteBlob): Update accordingly.
12199
12200         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
12201         greater than 2.
12202
12203         (EmitDynamicInitializers): Update in accordance with the new optimization.
12204
12205         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
12206         same OpCode applies.
12207
12208         * cs-parser.jay : Fix some glaring errors I introduced.
12209
12210 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
12211
12212         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
12213         so that we can check for name clashes there too.
12214
12215         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
12216         for interface indexers.
12217
12218         * interfaces.cs (Define): Emit the default member attribute.
12219
12220         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
12221         variable was being referred to while setting the value ;-)
12222
12223 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
12224
12225         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
12226         byte-by-byte information when we know the data is zero.
12227
12228         Make the block always a multiple of 4, because
12229         DefineInitializedData has a bug.
12230
12231         * assign.cs: Fix, we should assign from the temporary, not from
12232         the source. 
12233
12234         * expression.cs (MakeByteBlob): Fix my incorrect code.
12235
12236 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
12237
12238         * typemanager.cs (EnumToUnderlying): This function is used to get
12239         the underlying type from an enumeration, because it does not
12240         always work. 
12241
12242         * constant.cs: Use the I4_S form for values between -128 and 127.
12243
12244         * statement.cs (Block.LookupLabel): Looks up a label.
12245         (Block): Drop support for labeled blocks.
12246
12247         (LabeledStatement): New kind of statement that represents a label
12248         only.
12249
12250         (Goto): Finally implement this bad boy.
12251
12252         * cs-parser.jay: Update to reflect new mechanism to implement
12253         labels.
12254
12255 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
12256
12257         * codegen.cs (EmitContext.This): a codegen property that keeps the
12258         a single instance of this instead of creating many different this
12259         instances. 
12260
12261         * delegate.cs (Delegate.DoResolve): Update to use the property;
12262
12263         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
12264
12265         * expression.cs (BaseAccess.DoResolve): Ditto.
12266
12267 2001-12-29  Ravi Pratap  <ravi@ximian.com>
12268
12269         * typemanager.cs (methodimpl_attr_type): Add to hold the type
12270         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
12271
12272         (InitCoreTypes): Update accordingly.
12273
12274         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
12275         so we can quickly store the state.
12276
12277         (ApplyAttributes): Set the correct implementation flags
12278         for InternalCall methods.
12279
12280 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
12281
12282         * expression.cs (EmitCall): if a method is not virtual, then do
12283         not use callvirt on it.
12284
12285         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
12286         user defined stuff) requires the use of stobj, which takes an
12287         address on the stack instead of an array and an index.  So emit
12288         the Ldelema operation for it.
12289
12290         (EmitStoreOpcode): Use stobj for valuetypes.
12291
12292         (UnaryMutator.EmitCode): Use the right 1 value depending on
12293         whether we are dealing with int64/uint64, float or doubles.
12294
12295         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
12296         constructors that I implemented last night.
12297
12298         (Constructor.IsDefault): Fix to work properly for static
12299         constructors.
12300
12301         * cs-parser.jay (CheckDef): report method signature errors.
12302         Update error number 103 to be 132.
12303
12304         * decl.cs: New AdditionResult enumeration value: MethodExists.
12305         Although we do this check for methods later on in the semantic
12306         analysis, catching repeated default constructors is so easy that
12307         we catch these here. 
12308
12309         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
12310         promotions code.
12311
12312         (ParameterReference.EmitAssign, Emit): handle
12313         bools as bytes.
12314
12315         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
12316         (ArrayAccess.EmitStoreOpcode): ditto.
12317
12318         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
12319
12320         * expression.cs (MakeByteBlob): Complete all the missing types
12321         (uint, short, ushort, byte, sbyte)
12322
12323         * class.cs: Only init instance field initializers on instance
12324         constructors. 
12325
12326         Rename `constructors' to instance_constructors. 
12327
12328         (TypeContainer.AddConstructor): Only add constructors to the list
12329         if it is not static.
12330
12331         Make sure that we handle default_static_constructor independently
12332         everywhere where we handle instance_constructors
12333
12334 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
12335
12336         * class.cs: Do not lookup or create a base initializer for a
12337         static constructor.
12338
12339         (ConstructorInitializer.Resolve): use the proper type to lookup
12340         for constructors.
12341
12342         * cs-parser.jay: Report error 1585 (modifiers between type and name).
12343
12344         * enum.cs, interface.cs: Remove CloseType, this is taken care by
12345         in DeclSpace. 
12346
12347         * decl.cs: CloseType is now an virtual method, the default
12348         implementation just closes this type.
12349
12350 2001-12-28  Ravi Pratap  <ravi@ximian.com>
12351
12352         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
12353         to PreserveSig by default. Also emit HideBySig on such methods.
12354
12355         Basically, set the defaults to standard values.
12356
12357         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
12358         argument, if candidate is better, it can't be worse than the best !
12359
12360         (Invocation): Re-write bits to differentiate between methods being
12361         applicable in their expanded form and their normal form - for params
12362         methods of course.
12363
12364         Get rid of use_standard everywhere as only standard conversions are allowed
12365         in overload resolution. 
12366
12367         More spec conformance.
12368
12369 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
12370
12371         * driver.cs: Add --timestamp, to see where the compiler spends
12372         most of its time.
12373
12374         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
12375         `this' in static code.
12376
12377         (SimpleName.DoResolve): Implement in terms of a helper function
12378         that allows static-references to be passed upstream to
12379         MemberAccess.
12380
12381         (Expression.ResolveWithSimpleName): Resolve specially simple
12382         names when called by MemberAccess to implement the special
12383         semantics. 
12384
12385         (Expression.ImplicitReferenceConversion): Handle conversions from
12386         Null to reference types before others, as Null's type is
12387         System.Object. 
12388
12389         * expression.cs (Invocation.EmitCall): Handle the special case of
12390         calling methods declared on a reference type from a ValueType
12391         (Base classes System.Object and System.Enum)
12392
12393         (MemberAccess.Resolve): Only perform lookups on Enumerations if
12394         the left hand side is a TypeExpr, not on every enumeration. 
12395
12396         (Binary.Resolve): If types are reference types, then do a cast to
12397         object on operators != and == of both arguments.
12398
12399         * typemanager.cs (FindMembers): Extract instance and static
12400         members if requested.
12401
12402         * interface.cs (PopulateProperty): Use void_type instead of null
12403         as the return type for the setter method.
12404
12405         (PopulateIndexer): ditto.
12406
12407 2001-12-27  Ravi Pratap  <ravi@ximian.com>
12408
12409         * support.cs (ReflectionParameters): Fix minor bug where we
12410         were examining the wrong parameter for the ParamArray attribute.
12411
12412         Cope with requests for the type of the parameter at position
12413         greater than the params parameter's. We now return the element
12414         type of the params array as that makes more sense.
12415
12416         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
12417         accordingly as we no longer have to extract the element type
12418         ourselves.
12419
12420         (Invocation.OverloadResolve): Update.
12421
12422 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
12423
12424         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
12425         against IEnumerator, test whether the return value is a descendant
12426         of the IEnumerator interface.
12427
12428         * class.cs (Indexer.Define): Use an auxiliary method to implement
12429         the other bits of the method definition.  Begin support for
12430         explicit interface implementation.
12431
12432         (Property.DefineMethod): Use TypeManager.void_type instead of null
12433         for an empty return value.
12434
12435 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
12436
12437         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
12438         dealing with a FieldExpr which is composed of a FieldBuilder, in
12439         the code path we did extract the constant, but we should have
12440         obtained the underlying value to be able to cast it (otherwise we
12441         end up in an infinite loop, this is what Ravi was running into).
12442
12443         (ArrayCreation.UpdateIndices): Arrays might be empty.
12444
12445         (MemberAccess.ResolveMemberAccess): Add support for section
12446         14.5.4.1 that deals with the special case of E.I when E is a type
12447         and something else, that I can be a reference to a static member.
12448
12449         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
12450         handle a particular array type to create byte blobs, it is just
12451         something we dont generate byteblobs for.
12452
12453         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
12454         arguments. 
12455
12456         * location.cs (Push): remove the key from the hashtable that we
12457         are about to add.   This happens for empty files.
12458
12459         * driver.cs: Dispose files after we have parsed them.
12460
12461         (tokenize): new function that only runs the tokenizer on its
12462         input, for speed testing.
12463
12464 2001-12-26  Ravi Pratap  <ravi@ximian.com>
12465
12466         * class.cs (Event.Define): Define the private field only if there
12467         are no accessors defined.
12468
12469         * expression.cs (ResolveMemberAccess): If there is no associated
12470         field with the event, that means we have an event defined with its
12471         own accessors and we should flag error cs0070 since transforming
12472         ourselves into a field is not valid in that case.
12473
12474         * ecore.cs (SimpleName.DoResolve): Same as above.
12475
12476         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
12477         and charset to sane values.
12478
12479 2001-12-25  Ravi Pratap  <ravi@ximian.com>
12480
12481         * assign.cs (DoResolve): Perform check on events only if they 
12482         are being accessed outside the declaring type.
12483
12484         * cs-parser.jay (event_declarations): Update rules to correctly
12485         set the type of the implicit parameter etc.
12486
12487         (add_accessor, remove_accessor): Set current local parameters.
12488
12489         * expression.cs (Binary): For delegate addition and subtraction,
12490         cast the return value from the method into the appropriate delegate
12491         type.
12492
12493 2001-12-24  Ravi Pratap  <ravi@ximian.com>
12494
12495         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
12496         of these as the workaround is unnecessary.
12497
12498         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
12499         delegate data - none of that is needed at all.
12500
12501         Re-write bits to extract the instance expression and the delegate method
12502         correctly.
12503
12504         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
12505         on delegates too.
12506
12507         * attribute.cs (ApplyAttributes): New method to take care of common tasks
12508         of attaching attributes instead of duplicating code everywhere.
12509
12510         * everywhere : Update code to do attribute emission using the above method.
12511
12512 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
12513
12514         * expression.cs (IsParamsMethodApplicable): if there are not
12515         parameters, return immediately.
12516
12517         * ecore.cs: The 0 literal can be implicity converted to an enum
12518         type. 
12519
12520         (SimpleName.DoResolve): First lookup the type, then lookup the
12521         members. 
12522
12523         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
12524         want to get its address.  If the InstanceExpression is not
12525         addressable, store the result in a temporary variable, then get
12526         the address of it.
12527
12528         * codegen.cs: Only display 219 errors on warning level or above. 
12529
12530         * expression.cs (ArrayAccess): Make it implement the
12531         IMemoryLocation interface.
12532
12533         (Binary.DoResolve): handle the operator == (object a, object b)
12534         and operator != (object a, object b) without incurring into a
12535         BoxedCast (because 5 != o should never be performed).
12536
12537         Handle binary enumerator operators.
12538
12539         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
12540         value type, otherwise use Ldelem_ref.
12541
12542         Use precomputed names;
12543
12544         (AddressOf): Implement address of
12545
12546         * cs-parser.jay (labeled_statement): Fix recursive block
12547         addition by reworking the production.
12548
12549         * expression.cs (New.DoEmit): New has a special case:
12550                 
12551                  If we are dealing with a ValueType, we have a few
12552                  situations to deal with:
12553                 
12554                     * The target of New is a ValueType variable, that is
12555                       easy, we just pass this as the variable reference
12556                 
12557                     * The target of New is being passed as an argument,
12558                       to a boxing operation or a function that takes a
12559                       ValueType.
12560                 
12561                       In this case, we need to create a temporary variable
12562                       that is the argument of New.
12563
12564
12565 2001-12-23  Ravi Pratap  <ravi@ximian.com>
12566
12567         * rootcontext.cs (LookupType): Check that current_type is not null before
12568         going about looking at nested types.
12569
12570         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
12571         not implement the IAssignMethod interface any more.
12572
12573         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
12574         where we tranform them into FieldExprs if they are being resolved from within
12575         the declaring type.
12576
12577         * ecore.cs (SimpleName.DoResolve): Do the same here.
12578
12579         * assign.cs (DoResolve, Emit): Clean up code considerably. 
12580
12581         * ../errors/bug10.cs : Add.
12582
12583         * ../errors/cs0070.cs : Add.
12584
12585         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
12586
12587         * assign.cs : Get rid of EventIsLocal everywhere.
12588
12589 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
12590
12591         * ecore.cs (ConvertIntLiteral): finished the implementation.
12592
12593         * statement.cs (SwitchLabel): Convert the value we are using as a
12594         key before looking up the table.
12595
12596 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
12597
12598         * codegen.cs (EmitTopBlock): Require a Location argument now.
12599
12600         * cs-parser.jay (constructor_declarator): We need to setup
12601         current_local_parameters before we parse the
12602         opt_constructor_initializer, to allow the variables to be bound
12603         to the constructor arguments.
12604
12605         * rootcontext.cs (LookupType): First lookup nested classes in our
12606         class and our parents before we go looking outside our class.
12607
12608         * expression.cs (ConstantFold): Extract/debox the values at the
12609         beginnning. 
12610
12611         * rootcontext.cs (EmitCode): Resolve the constants first before we
12612         resolve the types.  This is not really needed, but it helps debugging.
12613
12614         * statement.cs: report location.
12615
12616         * cs-parser.jay: pass location to throw statement.
12617
12618         * driver.cs: Small bug fix.
12619
12620         * report.cs: Updated format to be 4-zero filled digits.
12621
12622 2001-12-22  Ravi Pratap  <ravi@ximian.com>
12623
12624         * expression.cs (CheckIndices): Fix minor bug where the wrong
12625         variable was being referred to ;-)
12626
12627         (DoEmit): Do not call EmitStaticInitializers when the 
12628         underlying type is System.Object.
12629
12630 2001-12-21  Ravi Pratap  <ravi@ximian.com>
12631
12632         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
12633         and do the usual workaround for SRE.
12634
12635         * class.cs (MyEventBuilder.EventType): New member to get at the type
12636         of the event, quickly.
12637
12638         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
12639
12640         * assign.cs (Assign.DoResolve): Handle the case when the target
12641         is an EventExpr and perform the necessary checks.
12642
12643         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
12644         interface.
12645
12646         (SimpleName.MemberStaticCheck): Include check for EventExpr.
12647
12648         (EventExpr): Set the type in the constructor itself since we 
12649         are meant to be born fully resolved.
12650
12651         (EventExpr.Define): Revert code I wrote earlier.
12652                 
12653         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
12654         instance expression is null. The instance expression is a This in that case
12655         or a null, depending on whether it is a static method or not.
12656
12657         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
12658         refers to more than one method.
12659
12660         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
12661         and accordingly flag errors.
12662
12663 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
12664
12665         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
12666
12667 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
12668
12669         * location.cs (ToString): Provide useful rutine.
12670
12671 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
12672
12673         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
12674         objects, return the actual integral boxed.
12675
12676         * statement.cs (SwitchLabel): define an ILLabel for each
12677         SwitchLabel. 
12678
12679         (Switch.CheckSwitch): If the value is a Literal, extract
12680         the underlying literal.
12681
12682         Also in the unused hashtable we had, add the SwitchLabel so we can
12683         quickly look this value up.
12684
12685         * constant.cs: Implement a bunch of new constants.  Rewrite
12686         Literal based on this.  Made changes everywhere to adapt to this.
12687
12688         * expression.cs (Expression.MakeByteBlob): Optimize routine by
12689         dereferencing array only once, and also copes with enumrations.
12690
12691         bytes are two bytes wide, not one.
12692
12693         (Cast): Perform constant conversions.
12694
12695         * ecore.cs (TryImplicitIntConversion): Return literals instead of
12696         wrappers to the literals here.
12697
12698         * expression.cs (DoNumericPromotions): long literals can converted
12699         to ulong implicity (this is taken care of elsewhere, but I was
12700         missing this spot).
12701
12702         * ecore.cs (Expression.Literalize): Make the return type Literal,
12703         to improve type checking.
12704
12705         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
12706
12707 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
12708
12709         * literal.cs: Revert code from ravi that checked the bounds.  The
12710         bounds are sane by the definition of the type itself. 
12711
12712         * typemanager.cs: Fix implementation of ImplementsInterface.  We
12713         need to actually look up in our parent hierarchy for interfaces
12714         implemented. 
12715
12716         * const.cs: Use the underlying type for enumerations
12717
12718         * delegate.cs: Compute the basename for the delegate creation,
12719         that should fix the delegate test case, and restore the correct
12720         Type Lookup semantics in rootcontext
12721
12722         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
12723         referencing a nested type with the Reflection API is using the "+"
12724         sign. 
12725
12726         * cs-parser.jay: Do not require EOF token at the end.
12727
12728 2001-12-20  Ravi Pratap  <ravi@ximian.com>
12729
12730         * rootcontext.cs (LookupType): Concatenate type names with
12731         a '.' instead of a '+' The test suite passes again.
12732
12733         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
12734         field of the enumeration.
12735
12736         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
12737         the case when the member is an EventExpr.
12738
12739         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
12740         static has an associated instance expression.
12741
12742         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
12743
12744         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
12745
12746         * class.cs (Event.Define): Register event and perform appropriate checks
12747         for error #111.
12748
12749         We define the Add and Remove methods even if the use provides none because
12750         in that case, we provide default implementations ourselves.
12751
12752         Define a private field of the type of the event. This is done by the CSC compiler
12753         and we should be doing it too ;-)
12754
12755         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
12756         More methods we use in code we generate.
12757
12758         (multicast_delegate_type, delegate_type): Two separate types since the distinction
12759         is important.
12760
12761         (InitCoreTypes): Update accordingly for the above.
12762
12763         * class.cs (Event.Emit): Generate code for default accessors that we provide
12764
12765         (EmitDefaultMethod): Do the job in the above.
12766
12767         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
12768         appropriate place.
12769
12770 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
12771
12772         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
12773         builders even if we were missing one.
12774
12775         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
12776         pass the Basename as our class name instead of the Name.  The
12777         basename will be correctly composed for us.
12778
12779         * parameter.cs (Paramters): Now takes a Location argument.
12780
12781         * decl.cs (DeclSpace.LookupType): Removed convenience function and
12782         make all the code call directly LookupType in RootContext and take
12783         this chance to pass the Location information everywhere.
12784
12785         * Everywhere: pass Location information.
12786
12787 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
12788
12789         * class.cs (Constructor.Define): Updated way of detecting the
12790         length of the parameters.
12791
12792         (TypeContainer.DefineType): Use basename as the type name for
12793         nested types.
12794
12795         (TypeContainer.Define): Do not recursively define types here, as
12796         definition is taken care in order by the RootContext.
12797
12798         * tree.cs: Keep track of namespaces in a per-file basis.
12799
12800         * parameter.cs (Parameter.ComputeSignature): Update to use
12801         DeclSpace. 
12802
12803         (Parameters.GetSignature): ditto.
12804
12805         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
12806         instead of a TypeContainer.
12807
12808         (Interface.SemanticAnalysis): Use `this' instead of our parent to
12809         resolve names.  Because we need to be resolve in our context, not
12810         our parents.
12811
12812         * driver.cs: Implement response files.
12813
12814         * class.cs (TypeContainer.DefineType): If we are defined, do not
12815         redefine ourselves.
12816
12817         (Event.Emit): Emit the code for add/remove handlers.
12818         (Event.Define): Save the MethodBuilders for add/remove.
12819
12820         * typemanager.cs: Use pair here too.
12821
12822         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
12823         DictionaryEntry requires the first argument to be non-null.  
12824
12825         (enum_declaration): Compute full name for registering the
12826         enumeration.
12827
12828         (delegate_declaration): Instead of using
12829         formal_parameter_list, use opt_formal_parameter_list as the list
12830         can be empty.
12831
12832         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
12833         (EventParsing): New property that controls whether `add' and
12834         `remove' are returned as tokens or identifiers (for events);
12835
12836 2001-12-19  Ravi Pratap  <ravi@ximian.com>
12837
12838         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
12839         use MyEventBuilder only and let it wrap the real builder for us.
12840
12841         (MyEventBuilder): Revamp constructor etc.
12842
12843         Implement all operations that we perform on EventBuilder in precisely the same
12844         way here too.
12845
12846         (FindMembers): Update to use the EventBuilder member.
12847
12848         (Event.Emit): Update accordingly.
12849
12850 2001-12-18  Ravi Pratap  <ravi@ximian.com>
12851
12852         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
12853         by calling the appropriate methods.
12854
12855         (GetCustomAttributes): Make stubs as they cannot possibly do anything
12856         useful.
12857
12858         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
12859
12860 2001-12-17  Ravi Pratap  <ravi@ximian.com>
12861
12862         * delegate.cs (Delegate.Populate): Check that the return type
12863         and various parameters types are indeed accessible.
12864
12865         * class.cs (Constructor.Define): Same here.
12866
12867         (Field.Define): Ditto.
12868
12869         (Event.Define): Ditto.
12870
12871         (Operator.Define): Check that the underlying Method defined itself
12872         correctly - so it's MethodBuilder should not be null.
12873
12874         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
12875         expression happens to be null.
12876
12877         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
12878         members but as of now we don't seem to be able to do anything really useful with it.
12879
12880         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
12881         not the EventBuilder.
12882
12883 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
12884
12885         * cs-tokenizer.cs: Add support for defines.
12886         Add support for #if, #elif, #else, #endif
12887
12888         (eval_var): evaluates a variable.
12889         (eval): stubbed for evaluating functions.
12890
12891         * cs-parser.jay: Pass the defines information
12892
12893         * driver.cs: Add --define command line option.
12894
12895         * decl.cs: Move MemberCore here.
12896
12897         Make it the base class for DeclSpace.  This allows us to catch and
12898         report 108 and 109 for everything now.
12899
12900         * class.cs (TypeContainer.Define): Extract all the members
12901         before populating and emit the warning 108 (new keyword required
12902         to override) instead of having each member implement this.
12903
12904         (MemberCore.Define): New abstract method, we will be using this in
12905         the warning reporting engine in Populate.
12906
12907         (Operator.Define): Adjust to new MemberCore protocol. 
12908
12909         * const.cs (Const): This does not derive from Expression, it is a
12910         temporary object we use to create fields, it is a MemberCore. 
12911
12912         * class.cs (Method.Define): Allow the entry point to be in a
12913         specific class.
12914
12915         * driver.cs: Rewrite the argument handler to clean it up a bit.
12916
12917         * rootcontext.cs: Made it just an auxiliary namespace feature by
12918         making everything static.
12919
12920         * driver.cs: Adapt code to use RootContext type name instead of
12921         instance variable.
12922
12923         * delegate.cs: Remove RootContext argument.
12924
12925         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
12926         argument. 
12927
12928         * class.cs (Event.Define): The lookup can fail.
12929
12930         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
12931
12932         * expression.cs: Resolve the this instance before invoking the code.
12933
12934 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
12935
12936         * cs-parser.jay: Add a production in element_access that allows
12937         the thing to become a "type" reference.  This way we can parse
12938         things like "(string [])" as a type.
12939
12940         Note that this still does not handle the more complex rules of
12941         casts. 
12942
12943
12944         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
12945
12946         * ecore.cs: (CopyNewMethods): new utility function used to
12947         assemble the list of methods from running FindMembers.
12948
12949         (MemberLookup): Rework FindMembers so that 
12950
12951 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
12952
12953         * class.cs (TypeContainer): Remove Delegates who fail to be
12954         defined.
12955
12956         * delegate.cs (Populate): Verify that we dont get null return
12957         values.   TODO: Check for AsAccessible.
12958
12959         * cs-parser.jay: Use basename to emit error 574 (destructor should
12960         have the same name as container class), not the full name.
12961
12962         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
12963         possible representation.  
12964
12965         Also implements integer type suffixes U and L.
12966
12967 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
12968
12969         * expression.cs (ArrayCreation.DoResolve): We need to do the
12970         argument resolution *always*.
12971
12972         * decl.cs: Make this hold the namespace.  Hold the root context as
12973         well.
12974         (LookupType): Move here.
12975
12976         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
12977
12978         * location.cs (Row, Name): Fixed the code, it was always returning
12979         references to the first file.
12980
12981         * interface.cs: Register properties defined through interfaces.
12982
12983         * driver.cs: Add support for globbing on the command line
12984
12985         * class.cs (Field): Make it derive from MemberCore as well.
12986         (Event): ditto.
12987
12988 2001-12-15  Ravi Pratap  <ravi@ximian.com>
12989
12990         * class.cs (Event::Define): Check that the type of the event is a delegate
12991         type else flag error #66.
12992
12993         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
12994         same.
12995
12996         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
12997         values of EntryPoint, CharSet etc etc.
12998
12999         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
13000
13001         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
13002         be null and we should ignore this. I am not sure if this is really clean. Apparently,
13003         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
13004         which needs this to do its work.
13005
13006         * ../errors/cs0066.cs : Add.
13007
13008 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
13009
13010         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
13011         helper functions.
13012
13013         * class.cs: (MethodSignature.MethodSignature): Removed hack that
13014         clears out the parameters field.
13015         (MemberSignatureCompare): Cleanup
13016
13017         (MemberCore): New base class used to share code between MethodCore
13018         and Property.
13019
13020         (RegisterRequiredImplementations) BindingFlags.Public requires
13021         either BindingFlags.Instace or Static.  Use instance here.
13022
13023         (Property): Refactored code to cope better with the full spec.
13024
13025         * parameter.cs (GetParameterInfo): Return an empty array instead
13026         of null on error.
13027
13028         * class.cs (Property): Abstract or extern properties have no bodies.
13029
13030         * parameter.cs (GetParameterInfo): return a zero-sized array.
13031
13032         * class.cs (TypeContainer.MethodModifiersValid): Move all the
13033         method modifier validation to the typecontainer so we can reuse
13034         this on properties.
13035
13036         (MethodCore.ParameterTypes): return an empty sized array of types.
13037
13038         (Property.Define): Test property modifier validity.
13039
13040         Add tests for sealed/override too.
13041
13042         (Method.Emit): abstract or extern methods have no bodies.
13043
13044 2001-12-14  Ravi Pratap  <ravi@ximian.com>
13045
13046         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
13047         thing.
13048
13049         (Method::Define, ::Emit): Modify accordingly.
13050
13051         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
13052
13053         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
13054
13055         * makefile: Pass in /unsafe.
13056
13057 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
13058
13059         * class.cs (MakeKey): Kill routine.
13060
13061         * class.cs (TypeContainer.Define): Correctly define explicit
13062         method implementations (they require the full interface name plus
13063         the method name).
13064
13065         * typemanager.cs: Deply the PtrHashtable here and stop using the
13066         lame keys.  Things work so much better.
13067
13068         This of course broke everyone who depended on `RegisterMethod' to
13069         do the `test for existance' test.  This has to be done elsewhere.
13070
13071         * support.cs (PtrHashtable): A hashtable that avoid comparing with
13072         the object stupid Equals method (because, that like fails all over
13073         the place).  We still do not use it.
13074
13075         * class.cs (TypeContainer.SetRequiredInterface,
13076         TypeContainer.RequireMethods): Killed these two routines and moved
13077         all the functionality to RegisterRequiredImplementations.
13078
13079         (TypeContainer.RegisterRequiredImplementations): This routine now
13080         registers all the implementations required in an array for the
13081         interfaces and abstract methods.  We use an array of structures
13082         which can be computed ahead of time to reduce memory usage and we
13083         also assume that lookups are cheap as most classes will not
13084         implement too many interfaces.
13085
13086         We also avoid creating too many MethodSignatures.
13087
13088         (TypeContainer.IsInterfaceMethod): Update and optionally does not
13089         clear the "pending" bit if we find that there are problems with
13090         the declaration.
13091
13092         (TypeContainer.VerifyPendingMethods): Update to report errors of
13093         methods that look like implementations but are not.
13094
13095         (TypeContainer.Define): Add support for explicit interface method
13096         implementation. 
13097
13098 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
13099
13100         * typemanager.cs: Keep track of the parameters here instead of
13101         being a feature of the TypeContainer.
13102
13103         * class.cs: Drop the registration of parameters here, as
13104         InterfaceMethods are also interface declarations.
13105
13106         * delegate.cs: Register methods with the TypeManager not only with
13107         the TypeContainer.  This code was buggy.
13108
13109         * interface.cs: Full registation here.
13110
13111 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
13112
13113         * expression.cs: Remove reducer for binary expressions, it can not
13114         be done this way.
13115
13116         * const.cs: Put here the code that used to go into constant.cs
13117
13118         * constant.cs: Put here the code for constants, this is a new base
13119         class for Literals.
13120
13121         * literal.cs: Make Literal derive from Constant.
13122
13123 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
13124
13125         * statement.cs (Return.Emit): Report error 157 if the user
13126         attempts to return from a finally block.
13127
13128         (Return.Emit): Instead of emitting a return, jump to the end of
13129         the function.
13130
13131         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
13132         LocalBuilder to store the result of the function.  ReturnLabel is
13133         the target where we jump.
13134
13135
13136 2001-12-09  Radek Doulik  <rodo@ximian.com>
13137
13138         * cs-parser.jay: remember alias in current namespace
13139
13140         * ecore.cs (SimpleName::DoResolve): use aliases for types or
13141         namespaces
13142
13143         * class.cs (LookupAlias): lookup alias in my_namespace
13144
13145         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
13146         aliases hashtable
13147         (LookupAlias): lookup alias in this and if needed in parent
13148         namespaces
13149
13150 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
13151
13152         * support.cs: 
13153
13154         * rootcontext.cs: (ModuleBuilder) Made static, first step into
13155         making things static.  I need this to avoid passing the
13156         TypeContainer when calling ParameterType.
13157
13158         * support.cs (InternalParameters.ParameterType): Remove ugly hack
13159         that did string manipulation to compute the type and then call
13160         GetType.  Use Parameter.ParameterType instead.
13161
13162         * cs-tokenizer.cs: Consume the suffix for floating values.
13163
13164         * expression.cs (ParameterReference): figure out whether this is a
13165         reference parameter or not.  Kill an extra variable by computing
13166         the arg_idx during emission.
13167
13168         * parameter.cs (Parameters.GetParameterInfo): New overloaded
13169         function that returns whether a parameter is an out/ref value or not.
13170
13171         (Parameter.ParameterType): The type of the parameter (base,
13172         without ref/out applied).
13173
13174         (Parameter.Resolve): Perform resolution here.
13175         (Parameter.ExternalType): The full type (with ref/out applied).
13176
13177         * statement.cs (Using.Emit, Using.EmitExpression): Implement
13178         support for expressions on the using statement.
13179
13180 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
13181
13182         * statement.cs (Using.EmitLocalVariableDecls): Split the
13183         localvariable handling of the using statement.
13184
13185         (Block.EmitMeta): Keep track of variable count across blocks.  We
13186         were reusing slots on separate branches of blocks.
13187
13188         (Try.Emit): Emit the general code block, we were not emitting it. 
13189
13190         Check the type of the declaration to be an IDisposable or
13191         something that can be implicity converted to it. 
13192
13193         Emit conversions if required.
13194
13195         * ecore.cs (EmptyExpression): New utility class.
13196         (Expression.ImplicitConversionExists): New utility function.
13197
13198 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
13199
13200         * statement.cs (Using): Implement.
13201
13202         * expression.cs (LocalVariableReference): Support read only variables.
13203
13204         * statement.cs: Remove the explicit emit for the Leave opcode.
13205         (VariableInfo): Add a readonly field.
13206
13207 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
13208
13209         * ecore.cs (ConvCast): new class used to encapsulate the various
13210         explicit integer conversions that works in both checked and
13211         unchecked contexts.
13212
13213         (Expression.ConvertNumericExplicit): Use new ConvCast class to
13214         properly generate the overflow opcodes.
13215
13216 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13217
13218         * statement.cs: The correct type for the EmptyExpression is the
13219         element_type, not the variable type.  Ravi pointed this out.
13220
13221 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13222
13223         * class.cs (Method::Define): Handle PInvoke methods specially
13224         by using DefinePInvokeMethod instead of the usual one.
13225
13226         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
13227         above to do the task of extracting information and defining the method.
13228
13229 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13230
13231         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
13232         of the condition for string type.
13233
13234         (Emit): Move that here. 
13235
13236         (ArrayCreation::CheckIndices): Keep string literals in their expression
13237         form.
13238
13239         (EmitDynamicInitializers): Handle strings appropriately.
13240
13241 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13242
13243         * codegen.cs (EmitContext): Replace multiple variables with a
13244         single pointer to the current Switch statement.
13245
13246         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
13247         EmitContext.
13248
13249 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13250
13251         * statement.cs 
13252
13253         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
13254         default'.
13255
13256         (Foreach.Emit): Foreach on arrays was not setting
13257         up the loop variables (for break/continue).
13258
13259         (GotoCase): Semi-implented.
13260
13261 2001-12-03  Ravi Pratap  <ravi@ximian.com>
13262
13263         * attribute.cs (CheckAttribute): Handle system attributes by using
13264         Attribute.GetAttributes to examine information we need.
13265
13266         (GetValidPlaces): Same here.
13267
13268         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
13269
13270         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
13271
13272         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
13273
13274         (Method::Define): Set appropriate flags if we have a DllImport attribute.
13275
13276         (Method::Emit): Handle the case when we are a PInvoke method.
13277
13278 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13279
13280         * expression.cs: Use ResolveWithSimpleName on compound names.
13281
13282 2001-12-02  Ravi Pratap  <ravi@ximian.com>
13283
13284         * constant.cs (EmitConstant): Make sure we resolve the associated expression
13285         before trying to reduce it.
13286
13287         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
13288
13289         * constant.cs (LookupConstantValue): Implement.
13290
13291         (EmitConstant): Use the above in emitting the constant.
13292
13293         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
13294         that are user-defined by doing a LookupConstantValue on them.
13295
13296         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
13297         too, like above.
13298
13299 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
13300
13301         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
13302
13303         (BaseAccess.DoResolve): Implement.
13304
13305         (MemberAccess.DoResolve): Split this routine into a
13306         ResolveMemberAccess routine that can be used independently
13307
13308 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
13309
13310         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
13311         As that share bits of the implementation.  Is returns a boolean,
13312         while As returns the Type that is being probed.
13313
13314 2001-12-01  Ravi Pratap  <ravi@ximian.com>
13315
13316         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
13317         instead of a Literal - much easier.
13318
13319         (EnumInTransit): Remove - utterly useless :-)
13320
13321         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
13322
13323         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
13324
13325         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
13326         chain when we have no associated expression.
13327
13328 2001-11-30  Ravi Pratap  <ravi@ximian.com>
13329
13330         * constant.cs (Define): Use Location while reporting the errror.
13331
13332         Also emit a warning when 'new' is used and there is no inherited
13333         member to hide.
13334
13335         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
13336         populated.
13337
13338         (LookupEnumValue): Implement to lookup an enum member's value and define it
13339         if necessary.
13340
13341         (Populate): Re-write accordingly to use the above routine.
13342
13343 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
13344
13345         * expression.cs (This): Fix prototype for DoResolveLValue to
13346         override the base class DoResolveLValue.
13347
13348         * cs-parser.cs: Report errors cs574 and cs575 (destructor
13349         declarations) 
13350
13351         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
13352         (we need to load the address of the field here).  This fixes
13353         test-22. 
13354
13355         (FieldExpr.DoResolveLValue): Call the DoResolve
13356         function to initialize the Instance expression.
13357
13358         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
13359         correctly the GetEnumerator operation on a value type.
13360
13361         * cs-parser.jay: Add more simple parsing error catches.
13362
13363         * statement.cs (Switch): Add support for string switches.
13364         Handle null specially.
13365
13366         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
13367
13368 2001-11-28  Ravi Pratap  <ravi@ximian.com>
13369
13370         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
13371
13372         (declare_local_constant): New helper function.
13373
13374         * statement.cs (AddConstant): Keep a separate record of constants
13375
13376         (IsConstant): Implement to determine if a variable is a constant.
13377
13378         (GetConstantExpression): Implement.
13379
13380         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
13381
13382         * statement.cs (IsVariableDefined): Re-write.
13383
13384 2001-11-27  Ravi Pratap  <ravi@ximian.com>
13385
13386         * class.cs (TypeContainer::FindMembers): Look for constants
13387         in the case when we are looking for MemberTypes.Field
13388
13389         * expression.cs (MemberAccess::DoResolve): Check that in the
13390         case we are a FieldExpr and a Literal, we are not being accessed
13391         by an instance reference.
13392
13393         * cs-parser.jay (local_constant_declaration): Implement.
13394
13395         (declaration_statement): Implement for constant declarations.
13396
13397 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
13398
13399         * statement.cs (Switch): Catch double defaults.
13400
13401         (Switch): More work on the switch() statement
13402         implementation.  It works for integral values now, need to finish
13403         string support.
13404
13405
13406 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
13407
13408         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
13409         integer literals into other integer literals.  To be used by
13410         switch. 
13411
13412 2001-11-24  Ravi Pratap  <ravi@ximian.com>
13413
13414         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
13415         some memory.
13416
13417         (EmitDynamicInitializers): Cope with the above since we extract data
13418         directly from ArrayData now.
13419
13420         (ExpectInitializers): Keep track of whether initializers are mandatory
13421         or not.
13422
13423         (Bounds): Make it a hashtable to prevent the same dimension being 
13424         recorded for every element in that dimension.
13425
13426         (EmitDynamicInitializers): Fix bug which prevented the Set array method
13427         from being found.
13428
13429         Also fix bug which was causing the indices to be emitted in the reverse
13430         order.
13431
13432 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
13433
13434         * expression.cs (ArrayCreation): Implement the bits that Ravi left
13435         unfinished.  They do not work, because the underlying code is
13436         sloppy.
13437
13438 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13439
13440         * cs-parser.jay: Remove bogus fixme.
13441
13442         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
13443         on Switch statement.
13444
13445 2001-11-23  Ravi Pratap  <ravi@ximian.com>
13446
13447         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
13448         the same. 
13449
13450         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
13451         parameter. Apparently, any expression is allowed. 
13452
13453         (ValidateInitializers): Update accordingly.
13454
13455         (CheckIndices): Fix some tricky bugs thanks to recursion.
13456
13457         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
13458         I was being completely brain-dead.
13459
13460         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
13461         and re-write acordingly.
13462
13463         (DelegateInvocation): Re-write accordingly.
13464
13465         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
13466
13467         (MakeByteBlob): Handle types more correctly.
13468
13469         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
13470         initialization from expressions but it is incomplete because I am a complete
13471         Dodo :-|
13472
13473 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13474
13475         * statement.cs (If.Emit): Fix a bug that generated incorrect code
13476         on If.  Basically, we have to return `true' (ie, we do return to
13477         our caller) only if both branches of the if return.
13478
13479         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
13480         short-circuit operators, handle them as short circuit operators. 
13481
13482         (Cast.DoResolve): Resolve type.
13483         (Cast.Cast): Take an expression as the target type.
13484
13485         * cs-parser.jay (cast_expression): Remove old hack that only
13486         allowed a limited set of types to be handled.  Now we take a
13487         unary_expression and we resolve to a type during semantic
13488         analysis.
13489
13490         Use the grammar productions from Rhys to handle casts (this is
13491         not complete like Rhys syntax yet, we fail to handle that corner
13492         case that C# has regarding (-x), but we will get there.
13493
13494 2001-11-22  Ravi Pratap  <ravi@ximian.com>
13495
13496         * class.cs (EmitFieldInitializer): Take care of the case when we have a
13497         field which is an array type.
13498
13499         * cs-parser.jay (declare_local_variables): Support array initialization too.
13500
13501         * typemanager.cs (MakeKey): Implement.
13502
13503         (everywhere): Use the above appropriately.
13504
13505         * cs-parser.jay (for_statement): Update for array initialization while
13506         declaring variables.
13507
13508         * ecore.cs : The error message was correct, it's the variable's names that
13509         were misleading ;-) Make the code more readable.
13510
13511         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
13512         the correct type etc.
13513
13514         (ConvertExplicit): Handle Enum types by examining the underlying type.
13515
13516 2001-11-21  Ravi Pratap  <ravi@ximian.com>
13517
13518         * parameter.cs (GetCallingConvention): Always return
13519         CallingConventions.Standard for now.
13520
13521 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13522
13523         * expression.cs (Binary.ResolveOperator): Update the values of `l'
13524         and `r' after calling DoNumericPromotions.
13525
13526         * ecore.cs: Fix error message (the types were in the wrong order).
13527
13528         * statement.cs (Foreach.ProbeCollectionType): Need to pass
13529         BindingFlags.Instance as well 
13530
13531         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
13532         implicit int literal conversion in an empty cast so that we
13533         propagate the right type upstream.
13534
13535         (UnboxCast): new class used to unbox value types.
13536         (Expression.ConvertExplicit): Add explicit type conversions done
13537         by unboxing.
13538
13539         (Expression.ImplicitNumericConversion): Oops, forgot to test for
13540         the target type before applying the implicit LongLiterals to ULong
13541         literal cast.
13542
13543 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
13544
13545         * cs-parser.jay (for_statement): Reworked the way For works: now
13546         we declare manually any variables that are introduced in
13547         for_initializer to solve the problem of having out-of-band code
13548         emition (that is what got for broken).
13549
13550         (declaration_statement): Perform the actual variable declaration
13551         that used to be done in local_variable_declaration here.
13552
13553         (local_variable_declaration): Do not declare anything, just pass
13554         the information on a DictionaryEntry
13555
13556 2001-11-20  Ravi Pratap  <ravi@ximian.com>
13557
13558         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
13559         re-write of the logic to now make it recursive.
13560
13561         (UpdateIndices): Re-write accordingly.
13562
13563         Store element data in a separate ArrayData list in the above methods.
13564
13565         (MakeByteBlob): Implement to dump the array data into a byte array.
13566
13567 2001-11-19  Ravi Pratap  <ravi@ximian.com>
13568
13569         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
13570         into CheckIndices.
13571
13572         * constant.cs (Define): Implement.
13573
13574         (EmitConstant): Re-write fully.
13575
13576         Pass in location info.
13577
13578         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
13579         respectively.
13580
13581         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
13582         DictionaryEntry since we need location info too.
13583
13584         (constant_declaration): Update accordingly.
13585
13586         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
13587         code into another method : UpdateIndices.
13588
13589 2001-11-18  Ravi Pratap  <ravi@ximian.com>
13590
13591         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
13592         some type checking etc.
13593
13594 2001-11-17  Ravi Pratap  <ravi@ximian.com>
13595
13596         * expression.cs (ArrayCreation::ValidateInitializers): Implement
13597         bits to provide dimension info if the user skips doing that.
13598
13599         Update second constructor to store the rank correctly.
13600
13601 2001-11-16  Ravi Pratap  <ravi@ximian.com>
13602
13603         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
13604         and try to implement.
13605
13606         * ../errors/cs0150.cs : Add.
13607
13608         * ../errors/cs0178.cs : Add.
13609
13610 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
13611
13612         * statement.cs: Implement foreach on multi-dimensional arrays. 
13613
13614         * parameter.cs (Parameters.GetParameterByName): Also lookup the
13615         name of the params argument.
13616
13617         * expression.cs: Use EmitStoreOpcode to get the right opcode while
13618         initializing the array.
13619
13620         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
13621         we can use this elsewhere.
13622
13623         * statement.cs: Finish implementation of foreach for single
13624         dimension arrays.
13625
13626         * cs-parser.jay: Use an out-of-band stack to pass information
13627         around, I wonder why I need this.
13628
13629         foreach_block: Make the new foreach_block the current_block.
13630
13631         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
13632         function used to return a static Parameters structure.  Used for
13633         empty parameters, as those are created very frequently.
13634
13635         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
13636
13637 2001-11-15  Ravi Pratap  <ravi@ximian.com>
13638
13639         * interface.cs : Default modifier is private, not public. The
13640         make verify test passes again.
13641
13642 2001-11-15  Ravi Pratap  <ravi@ximian.com>
13643
13644         * support.cs (ReflectionParameters): Fix logic to determine
13645         whether the last parameter is a params one. Test 9 passes again.
13646
13647         * delegate.cs (Populate): Register the builders we define with
13648         RegisterParameterForBuilder. Test 19 passes again.
13649
13650         * cs-parser.jay (property_declaration): Reference $6 instead
13651         of $$ to get at the location.
13652
13653         (indexer_declaration): Similar stuff.
13654
13655         (attribute): Ditto.
13656
13657         * class.cs (Property): Register parameters for the Get and Set methods
13658         if they exist. Test 23 passes again.
13659
13660         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
13661         call to EmitArguments as we are sure there aren't any params arguments. 
13662         Test 32 passes again.
13663
13664         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
13665         IndexOutOfRangeException. 
13666
13667         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
13668         Test 33 now passes again.
13669
13670 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
13671
13672         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
13673         broke a bunch of things.  Will have to come up with a better way
13674         of tracking locations.
13675
13676         * statement.cs: Implemented foreach for single dimension arrays.
13677
13678 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
13679
13680         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
13681         an error.  This removes the lookup from the critical path.
13682
13683         * cs-parser.jay: Removed use of temporary_loc, which is completely
13684         broken. 
13685
13686 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
13687
13688         * support.cs (ReflectionParameters.ParameterModifier): Report
13689         whether the argument is a PARAMS argument or not.
13690
13691         * class.cs: Set the attribute `ParamArrayAttribute' on the
13692         parameter argument.
13693
13694         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
13695         and cons_param_array_attribute (ConstructorInfo for
13696         ParamArrayAttribute)., 
13697
13698         * codegen.cs: Emit the return using the `Return' statement, that
13699         way we can report the error correctly for missing return values. 
13700
13701         * class.cs (Method.Emit): Clean up.
13702
13703         * expression.cs (Argument.Resolve): Take another argument: the
13704         location where this argument is used.  Notice that this is not
13705         part of the "Argument" class as to reduce the size of the
13706         structure (we know the approximate location anyways).
13707
13708         Test if the argument is a variable-reference, if not, then
13709         complain with a 206.
13710
13711         (Argument.Emit): Emit addresses of variables.
13712
13713         (Argument.FullDesc): Simplify.
13714
13715         (Invocation.DoResolve): Update for Argument.Resolve.
13716
13717         (ElementAccess.DoResolve): ditto.
13718
13719         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
13720         method should be virtual, as this method is always virtual.
13721
13722         (NewDelegate.DoResolve): Update for Argument.Resolve.
13723
13724         * class.cs (ConstructorInitializer.DoResolve): ditto.
13725
13726         * attribute.cs (Attribute.Resolve): ditto.
13727
13728 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
13729
13730         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
13731
13732         * expression.cs (ParameterReference): Drop IStackStorage and implement
13733         IAssignMethod instead. 
13734
13735         (LocalVariableReference): ditto.
13736
13737         * ecore.cs (FieldExpr): Drop IStackStorage and implement
13738         IAssignMethod instead. 
13739
13740 2001-11-13  Miguel de Icaza <miguel@ximian.com>
13741
13742         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
13743         enumerations that are used in heavily used structures derive from
13744         byte in a laughable and pathetic attempt to reduce memory usage.
13745         This is the kind of pre-optimzations that you should not do at
13746         home without adult supervision.
13747
13748         * expression.cs (UnaryMutator): New class, used to handle ++ and
13749         -- separatedly from the other unary operators.  Cleans up the
13750         code, and kills the ExpressionStatement dependency in Unary.
13751
13752         (Unary): Removed `method' and `Arguments' from this class, making
13753         it smaller, and moving it all to SimpleCall, so I can reuse this
13754         code in other locations and avoid creating a lot of transient data
13755         strucutres when not required.
13756
13757         * cs-parser.jay: Adjust for new changes.
13758
13759 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
13760
13761         * enum.cs (Enum.Populate): If there is a failure during
13762         definition, return
13763
13764         * cs-parser.jay (opt_enum_base): we used to catch type errors
13765         here, but this is really incorrect.  The type error should be
13766         catched during semantic analysis.
13767
13768 2001-12-11  Ravi Pratap  <ravi@ximian.com>
13769
13770         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
13771         current_local_parameters as expected since I, in my stupidity, had forgotten
13772         to do this :-)
13773
13774         * attribute.cs (GetValidPlaces): Fix stupid bug.
13775
13776         * class.cs (Method::Emit): Perform check on applicability of attributes.
13777
13778         (Constructor::Emit): Ditto.
13779
13780         (Field::Emit): Ditto.
13781
13782         (Field.Location): Store location information.
13783
13784         (Property, Event, Indexer, Operator): Ditto.
13785
13786         * cs-parser.jay (field_declaration): Pass in location for each field.
13787
13788         * ../errors/cs0592.cs : Add.
13789
13790 2001-11-12  Ravi Pratap  <ravi@ximian.com>
13791
13792         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
13793
13794         (InitCoreTypes): Update accordingly.
13795
13796         (RegisterAttrType, LookupAttr): Implement.
13797
13798         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
13799         info about the same.
13800
13801         (Resolve): Update to populate the above as necessary.
13802
13803         (Error592): Helper.
13804
13805         (GetValidPlaces): Helper to the above.
13806
13807         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
13808
13809         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
13810
13811 2001-11-12  Ravi Pratap  <ravi@ximian.com>
13812
13813         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
13814
13815         * ../errors/cs0617.cs : Add.
13816
13817 2001-11-11  Ravi Pratap  <ravi@ximian.com>
13818
13819         * enum.cs (Emit): Rename to Populate to be more consistent with what
13820         we expect it to do and when exactly it is called.
13821
13822         * class.cs, rootcontext.cs : Update accordingly.
13823
13824         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
13825         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
13826
13827         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
13828
13829         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
13830         of a fieldinfo using the above, when dealing with a FieldBuilder.
13831
13832 2001-11-10  Ravi Pratap  <ravi@ximian.com>
13833
13834         * ../errors/cs0031.cs : Add.
13835
13836         * ../errors/cs1008.cs : Add.
13837
13838         * ../errrors/cs0543.cs : Add.
13839
13840         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
13841         enum type.
13842
13843         (FindMembers): Implement.
13844
13845         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
13846         enums and delegates too.
13847
13848         (enum_types): Rename to builder_to_enum.
13849
13850         (delegate_types): Rename to builder_to_delegate.
13851
13852         * delegate.cs (FindMembers): Implement.
13853
13854 2001-11-09  Ravi Pratap  <ravi@ximian.com>
13855
13856         * typemanager.cs (IsEnumType): Implement.
13857
13858         * enum.cs (Emit): Re-write parts to account for the underlying type
13859         better and perform checking etc.
13860
13861         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
13862         of the underlying type.
13863
13864         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
13865         value
13866
13867         * enum.cs (error31): Helper to report error #31.
13868
13869         * cs-parser.jay (enum_declaration): Store location of each member too.
13870
13871         * enum.cs (member_to_location): New hashtable. 
13872
13873         (AddEnumMember): Update location hashtable.
13874
13875         (Emit): Use the location of each member while reporting errors.
13876
13877 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
13878
13879         * cs-parser.jay: A for_initializer if is a
13880         local_variable_declaration really ammount to have an implicit
13881         block with the variable declaration and no initializer for for.
13882
13883         * statement.cs (For.Emit): Cope with null initializers.
13884
13885         This fixes the infinite loop on for initializers.
13886
13887 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
13888
13889         * enum.cs: More cleanup.
13890
13891         * ecore.cs: Remove dead code.
13892
13893         * class.cs (Property.Emit): More simplification.
13894         (Event.Emit): ditto.
13895
13896         Reworked to have less levels of indentation.
13897
13898 2001-11-08  Ravi Pratap  <ravi@ximian.com>
13899
13900         * class.cs (Property): Emit attributes.
13901
13902         (Field): Ditto.
13903
13904         (Event): Ditto.
13905
13906         (Indexer): Ditto.
13907
13908         (Operator): Ditto.
13909
13910         * enum.cs (Emit): Ditto.
13911
13912         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
13913         Enums too.
13914
13915         * class.cs (Field, Event, etc.): Move attribute generation into the
13916         Emit method everywhere.
13917
13918         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
13919         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
13920         as we had no way of defining nested enums !
13921
13922         * rootcontext.cs : Adjust code accordingly.
13923
13924         * typemanager.cs (AddEnumType): To keep track of enum types separately.
13925
13926 2001-11-07  Ravi Pratap  <ravi@ximian.com>
13927
13928         * expression.cs (EvalConstantExpression): Move into ecore.cs
13929
13930         * enum.cs (Enum): Rename some members and make them public and readonly
13931         according to our convention.
13932
13933         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
13934         nothing else.
13935
13936         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
13937
13938         (Enum::Emit): Write a simple version for now which doesn't try to compute
13939         expressions. I shall modify this to be more robust in just a while.
13940
13941         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
13942
13943         (TypeContainer::CloseType): Create the Enum types too.
13944
13945         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
13946
13947         * expression.cs (EvalConstantExpression): Get rid of completely.
13948
13949         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
13950         user-defined values and other cases.
13951
13952         (IsValidEnumLiteral): Helper function.
13953
13954         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
13955         out there in the case we had a literal FieldExpr.
13956
13957         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
13958
13959         (Literalize): Revamp a bit to take two arguments.
13960
13961         (EnumLiteral): New class which derives from Literal to wrap enum literals.
13962
13963 2001-11-06  Ravi Pratap  <ravi@ximian.com>
13964
13965         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
13966
13967         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
13968
13969         (Resolve): Use the above to ensure we have proper initializers.
13970
13971 2001-11-05  Ravi Pratap  <ravi@ximian.com>
13972
13973         * expression.cs (Expression::EvalConstantExpression): New method to 
13974         evaluate constant expressions.
13975
13976         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
13977
13978 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
13979
13980         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
13981         in an array.
13982
13983         (Binary.ResolveOperator): Handle operator != (object a, object b)
13984         and operator == (object a, object b);
13985
13986         (Binary.DoNumericPromotions): Indicate whether the numeric
13987         promotion was possible.
13988
13989         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
13990         Implement.  
13991
13992         Made the ArrayAccess implement interface IAssignMethod instead of
13993         IStackStore as the order in which arguments are passed reflects
13994         this.
13995
13996         * assign.cs: Instead of using expr.ExprClass to select the way of
13997         assinging, probe for the IStackStore/IAssignMethod interfaces.
13998
13999         * typemanager.cs: Load InitializeArray definition.
14000
14001         * rootcontext.cs (RootContext.MakeStaticData): Used to define
14002         static data that can be used to initialize arrays. 
14003
14004 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
14005
14006         * expression.cs: Handle operator== and operator!= for booleans.
14007
14008         (Conditioal.Reduce): Implement reducer for the ?: operator.
14009
14010         (Conditional.Resolve): Implement dead code elimination.
14011
14012         (Binary.Resolve): Catch string literals and return a new
14013         concatenated string.
14014
14015         (Unary.Reduce): Implement reduction of unary expressions.
14016
14017         * ecore.cs: Split out the expression core handling here.
14018
14019         (Expression.Reduce): New method used to perform constant folding
14020         and CSE.  This is needed to support constant-expressions. 
14021
14022         * statement.cs (Statement.EmitBoolExpression): Pass true and false
14023         targets, and optimize for !x.
14024
14025 2001-11-04  Ravi Pratap  <ravi@ximian.com>
14026
14027         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
14028         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
14029         set custom atttributes.
14030
14031         * literal.cs (Literal::GetValue): New abstract method to return the actual
14032         value of the literal, cast as an object.
14033
14034         (*Literal): Implement GetValue method.
14035
14036         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
14037         expressions to the arraylist but objects of type Argument.
14038
14039         * class.cs (TypeContainer::Emit): Emit our attributes too.
14040
14041         (Method::Emit, Constructor::Emit): Ditto.
14042
14043         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
14044         to be ignoring earlier.
14045
14046 2001-11-03  Ravi Pratap  <ravi@ximian.com>
14047
14048         * attribute.cs (AttributeSection::Define): Implement to do the business
14049         of constructing a CustomAttributeBuilder.
14050
14051         (Attribute): New trivial class. Increases readability of code.  
14052
14053         * cs-parser.jay : Update accordingly.
14054
14055         (positional_argument_list, named_argument_list, named_argument): New rules
14056
14057         (attribute_arguments): Use the above so that we are more correct.
14058
14059 2001-11-02  Ravi Pratap  <ravi@ximian.com>
14060
14061         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
14062         to perform all checks for a method with a params parameter.
14063
14064         (Invocation::OverloadResolve): Update to use the above method and therefore
14065         cope correctly with params method invocations.
14066
14067         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
14068         params too.
14069
14070         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
14071         constructors in our parent too because we can't afford to miss out on 
14072         protected ones ;-)
14073
14074         * attribute.cs (AttributeSection): New name for the class Attribute
14075
14076         Other trivial changes to improve readability.
14077
14078         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
14079         use the new class names.
14080
14081 2001-11-01  Ravi Pratap  <ravi@ximian.com>
14082
14083         * class.cs (Method::Define): Complete definition for params types too
14084
14085         (Indexer::Define): Ditto.
14086
14087         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
14088         Cope everywhere with a request for info about the array parameter.
14089
14090 2001-11-01  Ravi Pratap  <ravi@ximian.com>
14091
14092         * tree.cs (RecordNamespace): Fix up to check for the correct key.
14093
14094         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
14095         local_variable_type to extract the string corresponding to the type.
14096
14097         (local_variable_type): Fixup the action to use the new helper method.
14098
14099         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
14100         go.
14101
14102         * expression.cs : Clean out code which uses the above.
14103
14104 2001-10-31  Ravi Pratap  <ravi@ximian.com>
14105
14106         * typemanager.cs (RegisterMethod): Check if we already have an existing key
14107         and bale out if necessary by returning a false.
14108
14109         (RegisterProperty): Ditto.
14110
14111         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
14112         and print out appropriate error messages.
14113
14114         * interface.cs (everywhere): Ditto.
14115
14116         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
14117         location to constructor.
14118
14119         * class.cs (Property, Event, Indexer): Update accordingly.
14120
14121         * ../errors/cs111.cs : Added.
14122
14123         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
14124         of a method, as laid down by the spec.
14125
14126         (Invocation::OverloadResolve): Use the above method.
14127
14128 2001-10-31  Ravi Pratap  <ravi@ximian.com>
14129
14130         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
14131         now take a TypeContainer and a Parameters object.
14132
14133         (ParameterData): Modify return type of ParameterModifier method to be 
14134         Parameter.Modifier and not a string.
14135
14136         (ReflectionParameters, InternalParameters): Update accordingly.
14137
14138         * expression.cs (Argument::GetParameterModifier): Same here.
14139
14140         * support.cs (InternalParameters::ParameterType): Find a better way of determining
14141         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
14142         symbol in it at all so maybe this is only for now.
14143
14144 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14145
14146         * support.cs (InternalParameters): Constructor now takes an extra argument 
14147         which is the actual Parameters class.
14148
14149         (ParameterDesc): Update to provide info on ref/out modifiers.
14150
14151         * class.cs (everywhere): Update call to InternalParameters to pass in
14152         the second argument too.
14153
14154         * support.cs (ParameterData): Add ParameterModifier, which is a method 
14155         to return the modifier info [ref/out etc]
14156
14157         (InternalParameters, ReflectionParameters): Implement the above.
14158
14159         * expression.cs (Argument::ParameterModifier): Similar function to return
14160         info about the argument's modifiers.
14161
14162         (Invocation::OverloadResolve): Update to take into account matching modifiers 
14163         too.
14164
14165         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
14166         a new SetFormalParameters object which we pass to InternalParameters.
14167
14168 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14169
14170         * expression.cs (NewArray): Merge into the ArrayCreation class.
14171
14172 2001-10-29  Ravi Pratap  <ravi@ximian.com>
14173
14174         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
14175         NewUserdefinedArray into one as there wasn't much of a use in having
14176         two separate ones.
14177
14178         * expression.cs (Argument): Change field's name to ArgType from Type.
14179
14180         (Type): New readonly property which returns the proper type, taking into 
14181         account ref/out modifiers.
14182
14183         (everywhere): Adjust code accordingly for the above.
14184
14185         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
14186         whether we are emitting for a ref or out parameter.
14187
14188         * expression.cs (Argument::Emit): Use the above field to set the state.
14189
14190         (LocalVariableReference::Emit): Update to honour the flag and emit the
14191         right stuff.
14192
14193         * parameter.cs (Attributes): Set the correct flags for ref parameters.
14194
14195         * expression.cs (Argument::FullDesc): New function to provide a full desc.
14196
14197         * support.cs (ParameterData): Add method ParameterDesc to the interface.
14198
14199         (ReflectionParameters, InternalParameters): Implement the above method.
14200
14201         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
14202         reporting errors.
14203
14204         (Invocation::FullMethodDesc): Ditto. 
14205
14206 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
14207
14208         * cs-parser.jay: Add extra production for the second form of array
14209         creation. 
14210
14211         * expression.cs (ArrayCreation): Update to reflect the above
14212         change. 
14213
14214         * Small changes to prepare for Array initialization.
14215
14216 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
14217
14218         * typemanager.cs (ImplementsInterface): interface might be null;
14219         Deal with this problem;
14220
14221         Also, we do store negative hits on the cache (null values), so use
14222         this instead of calling t.GetInterfaces on the type everytime.
14223
14224 2001-10-28  Ravi Pratap  <ravi@ximian.com>
14225
14226         * typemanager.cs (IsBuiltinType): New method to help determine the same.
14227
14228         * expression.cs (New::DoResolve): Get rid of array creation code and instead
14229         split functionality out into different classes.
14230
14231         (New::FormArrayType): Move into NewBuiltinArray.
14232
14233         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
14234         quite useless.
14235
14236         (NewBuiltinArray): New class to handle creation of built-in arrays.
14237
14238         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
14239         account creation of one-dimensional arrays.
14240
14241         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
14242
14243         (NewUserdefinedArray::DoResolve): Implement.
14244
14245         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
14246
14247         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
14248         we maintain inside the TypeManager. This is necessary to perform lookups on the
14249         module builder.
14250
14251         (LookupType): Update to perform GetType on the module builders too.     
14252
14253         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
14254
14255         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
14256
14257 2001-10-23  Ravi Pratap  <ravi@ximian.com>
14258
14259         * expression.cs (New::DoResolve): Implement guts of array creation.
14260
14261         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
14262
14263 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
14264
14265         * expression.cs: Fix bug I introduced lsat night that broke
14266         Delegates. 
14267
14268         (Expression.Resolve): Report a 246 error (can not resolve name)
14269         if we find a SimpleName in the stream.
14270
14271         (Expression.ResolveLValue): Ditto.
14272
14273         (Expression.ResolveWithSimpleName): This function is a variant of
14274         ResolveName, this one allows SimpleNames to be returned without a
14275         warning.  The only consumer of SimpleNames is MemberAccess
14276
14277 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
14278
14279         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
14280         might arrive here.  I have my doubts that this is correct.
14281
14282         * statement.cs (Lock): Implement lock statement.
14283
14284         * cs-parser.jay: Small fixes to support `lock' and `using'
14285
14286         * cs-tokenizer.cs: Remove extra space
14287
14288         * driver.cs: New flag --checked, allows to turn on integer math
14289         checking. 
14290
14291         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
14292         Threading.Monitor.Exit 
14293
14294 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
14295
14296         * expression.cs (IndexerAccess::DoResolveLValue): Set the
14297         Expression Class to be IndexerAccess.
14298
14299         Notice that Indexer::DoResolve sets the eclass to Value.
14300
14301 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
14302
14303         * class.cs (TypeContainer::Emit): Emit code for indexers.
14304
14305         * assign.cs (IAssignMethod): New interface implemented by Indexers
14306         and Properties for handling assignment.
14307
14308         (Assign::Emit): Simplify and reuse code. 
14309
14310         * expression.cs (IndexerAccess, PropertyExpr): Implement
14311         IAssignMethod, clean up old code. 
14312
14313 2001-10-22  Ravi Pratap  <ravi@ximian.com>
14314
14315         * typemanager.cs (ImplementsInterface): New method to determine if a type
14316         implements a given interface. Provides a nice cache too.
14317
14318         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
14319         method.
14320
14321         (ConvertReferenceExplicit): Ditto.
14322
14323         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
14324         various methods, with correct names etc.
14325
14326         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
14327         Operator.UnaryNegation.
14328
14329         * cs-parser.jay (operator_declarator): Be a little clever in the case where
14330         we have a unary plus or minus operator.
14331
14332         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
14333         UnaryMinus.
14334
14335         * everywhere : update accordingly.
14336
14337         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
14338         respectively.
14339
14340         * class.cs (Method::Define): For the case where we are implementing a method
14341         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
14342         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
14343
14344 2001-10-21  Ravi Pratap  <ravi@ximian.com>
14345
14346         * interface.cs (FindMembers): Implement to work around S.R.E
14347         lameness.
14348
14349         * typemanager.cs (IsInterfaceType): Implement.
14350
14351         (FindMembers): Update to handle interface types too.
14352
14353         * expression.cs (ImplicitReferenceConversion): Re-write bits which
14354         use IsAssignableFrom as that is not correct - it doesn't work.
14355
14356         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
14357         and accordingly override EmitStatement.
14358
14359         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
14360         using the correct logic :-)
14361
14362 2001-10-19  Ravi Pratap  <ravi@ximian.com>
14363
14364         * ../errors/cs-11.cs : Add to demonstrate error -11 
14365
14366 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
14367
14368         * assign.cs (Assign::Resolve): Resolve right hand side first, and
14369         then pass this as a hint to ResolveLValue.
14370
14371         * expression.cs (FieldExpr): Add Location information
14372
14373         (FieldExpr::LValueResolve): Report assignment to readonly
14374         variable. 
14375
14376         (Expression::ExprClassFromMemberInfo): Pass location information.
14377
14378         (Expression::ResolveLValue): Add new method that resolves an
14379         LValue. 
14380
14381         (Expression::DoResolveLValue): Default invocation calls
14382         DoResolve. 
14383
14384         (Indexers): New class used to keep track of indexers in a given
14385         Type. 
14386
14387         (IStackStore): Renamed from LValue, as it did not really describe
14388         what this did.  Also ResolveLValue is gone from this interface and
14389         now is part of Expression.
14390
14391         (ElementAccess): Depending on the element access type
14392
14393         * typemanager.cs: Add `indexer_name_type' as a Core type
14394         (System.Runtime.CompilerServices.IndexerNameAttribute)
14395
14396         * statement.cs (Goto): Take a location.
14397
14398 2001-10-18  Ravi Pratap  <ravi@ximian.com>
14399
14400         * delegate.cs (Delegate::VerifyDelegate): New method to verify
14401         if two delegates are compatible.
14402
14403         (NewDelegate::DoResolve): Update to take care of the case when
14404         we instantiate a delegate from another delegate.
14405
14406         * typemanager.cs (FindMembers): Don't even try to look up members
14407         of Delegate types for now.
14408
14409 2001-10-18  Ravi Pratap  <ravi@ximian.com>
14410
14411         * delegate.cs (NewDelegate): New class to take care of delegate
14412         instantiation.
14413
14414         * expression.cs (New): Split the delegate related code out into 
14415         the NewDelegate class.
14416
14417         * delegate.cs (DelegateInvocation): New class to handle delegate 
14418         invocation.
14419
14420         * expression.cs (Invocation): Split out delegate related code into
14421         the DelegateInvocation class.
14422
14423 2001-10-17  Ravi Pratap  <ravi@ximian.com>
14424
14425         * expression.cs (New::DoResolve): Implement delegate creation fully
14426         and according to the spec.
14427
14428         (New::DoEmit): Update to handle delegates differently.
14429
14430         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
14431         because of which we were printing out arguments in reverse order !
14432
14433         * delegate.cs (VerifyMethod): Implement to check if the given method
14434         matches the delegate.
14435
14436         (FullDelegateDesc): Implement.
14437
14438         (VerifyApplicability): Implement.
14439
14440         * expression.cs (Invocation::DoResolve): Update to accordingly handle
14441         delegate invocations too.
14442
14443         (Invocation::Emit): Ditto.
14444
14445         * ../errors/cs1593.cs : Added.
14446
14447         * ../errors/cs1594.cs : Added.
14448
14449         * delegate.cs (InstanceExpression, TargetMethod): New properties.
14450
14451 2001-10-16  Ravi Pratap  <ravi@ximian.com>
14452
14453         * typemanager.cs (intptr_type): Core type for System.IntPtr
14454
14455         (InitCoreTypes): Update for the same.
14456
14457         (iasyncresult_type, asynccallback_type): Ditto.
14458
14459         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
14460         correct.
14461
14462         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
14463         too.
14464
14465         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
14466         the builders for the 4 members of a delegate type :-)
14467
14468         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
14469         type.
14470
14471         * expression.cs (New::DoResolve): Implement guts for delegate creation.
14472
14473         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
14474
14475 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
14476
14477         * statement.cs (Break::Emit): Implement.   
14478         (Continue::Emit): Implement.
14479
14480         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14481         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14482         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14483         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
14484         end loop
14485
14486         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
14487         properties that track the label for the current loop (begin of the
14488         loop and end of the loop).
14489
14490 2001-10-15  Ravi Pratap  <ravi@ximian.com>
14491
14492         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
14493         use of emitting anything at all.
14494
14495         * class.cs, rootcontext.cs : Get rid of calls to the same.
14496
14497         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
14498
14499         (Populate): Define the constructor correctly and set the implementation
14500         attributes.
14501
14502         * typemanager.cs (delegate_types): New hashtable to hold delegates that
14503         have been defined.
14504
14505         (AddDelegateType): Implement.
14506
14507         (IsDelegateType): Implement helper method.
14508
14509         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
14510
14511         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
14512         and accordingly handle it.
14513
14514         * delegate.cs (Populate): Take TypeContainer argument.
14515         Implement bits to define the Invoke method. However, I still haven't figured out
14516         how to take care of the native int bit :-(
14517
14518         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
14519         Qualify the name of the delegate, not its return type !
14520
14521         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
14522         conversion.
14523
14524         (StandardConversionExists): Checking for array types turns out to be recursive.
14525
14526         (ConvertReferenceExplicit): Implement array conversion.
14527
14528         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
14529
14530 2001-10-12  Ravi Pratap  <ravi@ximian.com>
14531
14532         * cs-parser.jay (delegate_declaration): Store the fully qualified
14533         name as it is a type declaration.
14534
14535         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
14536         readonly.
14537
14538         (DefineDelegate): Renamed from Define. Does the same thing essentially,
14539         as TypeContainer::DefineType.
14540
14541         (Populate): Method in which all the definition of the various methods (Invoke)
14542         etc is done.
14543
14544         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
14545         see.
14546
14547         (CloseDelegate): Finally creates the delegate.
14548
14549         * class.cs (TypeContainer::DefineType): Update to define delegates.
14550         (Populate, Emit and CloseType): Do the same thing here too.
14551
14552         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
14553         delegates in all these operations.
14554
14555 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
14556
14557         * expression.cs: LocalTemporary: a new expression used to
14558         reference a temporary that has been created.
14559
14560         * assign.cs: Handle PropertyAccess back here, so that we can
14561         provide the proper semantic access to properties.
14562
14563         * expression.cs (Expression::ConvertReferenceExplicit): Implement
14564         a few more explicit conversions. 
14565
14566         * modifiers.cs: `NEW' modifier maps to HideBySig.
14567
14568         * expression.cs (PropertyExpr): Make this into an
14569         ExpressionStatement, and support the EmitStatement code path. 
14570
14571         Perform get/set error checking, clean up the interface.
14572
14573         * assign.cs: recognize PropertyExprs as targets, and if so, turn
14574         them into toplevel access objects.
14575
14576 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
14577
14578         * expression.cs: PropertyExpr::PropertyExpr: use work around the
14579         SRE.
14580
14581         * typemanager.cs: Keep track here of our PropertyBuilders again to
14582         work around lameness in SRE.
14583
14584 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
14585
14586         * expression.cs (LValue::LValueResolve): New method in the
14587         interface, used to perform a second resolution pass for LValues. 
14588
14589         (This::DoResolve): Catch the use of this in static methods.
14590
14591         (This::LValueResolve): Implement.
14592
14593         (This::Store): Remove warning, assigning to `this' in structures
14594         is 
14595
14596         (Invocation::Emit): Deal with invocation of
14597         methods on value types.  We need to pass the address to structure
14598         methods rather than the object itself.  (The equivalent code to
14599         emit "this" for structures leaves the entire structure on the
14600         stack instead of a pointer to it). 
14601
14602         (ParameterReference::DoResolve): Compute the real index for the
14603         argument based on whether the method takes or not a `this' pointer
14604         (ie, the method is static).
14605
14606         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
14607         value types returned from functions when we need to invoke a
14608         method on the sturcture.
14609
14610
14611 2001-10-11  Ravi Pratap  <ravi@ximian.com>
14612
14613         * class.cs (TypeContainer::DefineType): Method to actually do the business of
14614         defining the type in the Modulebuilder or Typebuilder. This is to take
14615         care of nested types which need to be defined on the TypeBuilder using
14616         DefineNestedMethod.
14617
14618         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
14619         methods in RootContext, only ported to be part of TypeContainer.
14620
14621         (TypeContainer::GetInterfaceOrClass): Ditto.
14622
14623         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
14624
14625         * interface.cs (Interface::DefineInterface): New method. Does exactly
14626         what RootContext.CreateInterface did earlier, only it takes care of nested types 
14627         too.
14628
14629         (Interface::GetInterfaces): Move from RootContext here and port.
14630
14631         (Interface::GetInterfaceByName): Same here.
14632
14633         * rootcontext.cs (ResolveTree): Re-write.
14634
14635         (PopulateTypes): Re-write.
14636
14637         * class.cs (TypeContainer::Populate): Populate nested types too.
14638         (TypeContainer::Emit): Emit nested members too.
14639
14640         * typemanager.cs (AddUserType): Do not make use of the FullName property,
14641         instead just use the name argument passed in as it is already fully
14642         qualified.
14643
14644         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
14645         to TypeContainer mapping to see if a type is user-defined.
14646
14647         * class.cs (TypeContainer::CloseType): Implement. 
14648
14649         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
14650         the default constructor.
14651
14652         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
14653         twice.
14654
14655         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
14656
14657         * interface.cs (CloseType): Create the type here.
14658
14659         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
14660         the hierarchy.
14661
14662         Remove all the methods which are now in TypeContainer.
14663
14664 2001-10-10  Ravi Pratap  <ravi@ximian.com>
14665
14666         * delegate.cs (Define): Re-write bits to define the delegate
14667         correctly.
14668
14669 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
14670
14671         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
14672
14673         * expression.cs (ImplicitReferenceConversion): handle null as well
14674         as a source to convert to any reference type.
14675
14676         * statement.cs (Return): Perform any implicit conversions to
14677         expected return type.  
14678
14679         Validate use of return statement.  
14680
14681         * codegen.cs (EmitContext): Pass the expected return type here.
14682
14683         * class.cs (Method, Constructor, Property): Pass expected return
14684         type to EmitContext.
14685
14686 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
14687
14688         * expression.cs: Make DoResolve take an EmitContext instead of a
14689         TypeContainer.
14690
14691         Replaced `l' and `location' for `loc', for consistency.
14692
14693         (Error, Warning): Remove unneeded Tc argument.
14694
14695         * assign.cs, literal.cs, constant.cs: Update to new calling
14696         convention. 
14697
14698         * codegen.cs: EmitContext now contains a flag indicating whether
14699         code is being generated in a static method or not.
14700
14701         * cs-parser.jay: DecomposeQI, new function that replaces the old
14702         QualifiedIdentifier.  Now we always decompose the assembled
14703         strings from qualified_identifier productions into a group of
14704         memberaccesses.
14705
14706 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
14707
14708         * rootcontext.cs: Deal with field-less struct types correctly now
14709         by passing the size option to Define Type.
14710
14711         * class.cs: Removed hack that created one static field. 
14712
14713 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
14714
14715         * statement.cs: Moved most of the code generation here. 
14716
14717 2001-10-09  Ravi Pratap  <ravi@ximian.com>
14718
14719         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
14720         seem very right.
14721
14722         (ElementAccess): Remove useless bits for now - keep checks as the spec
14723         says.
14724
14725 2001-10-08  Ravi Pratap  <ravi@ximian.com>
14726
14727         * expression.cs (ElementAccess::DoResolve): Remove my crap code
14728         and start performing checks according to the spec.
14729
14730 2001-10-07  Ravi Pratap  <ravi@ximian.com>
14731
14732         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
14733         rank_specifiers instead.
14734
14735         (rank_specifiers): Change the order in which the rank specifiers are stored
14736
14737         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
14738
14739         * expression.cs (ElementAccess): Implement the LValue interface too.
14740
14741 2001-10-06  Ravi Pratap  <ravi@ximian.com>
14742
14743         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
14744         except that user defined conversions are not included.
14745
14746         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
14747         perform the conversion of the return type, if necessary.
14748
14749         (New::DoResolve): Check whether we are creating an array or an object
14750         and accordingly do the needful.
14751
14752         (New::Emit): Same here.
14753
14754         (New::DoResolve): Implement guts of array creation.
14755
14756         (New::FormLookupType): Helper function.
14757
14758 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
14759
14760         * codegen.cs: Removed most of the code generation here, and move the
14761         corresponding code generation bits to the statement classes. 
14762
14763         Added support for try/catch/finalize and throw.
14764
14765         * cs-parser.jay: Added support for try/catch/finalize.
14766
14767         * class.cs: Catch static methods having the flags override,
14768         virtual or abstract.
14769
14770         * expression.cs (UserCast): This user cast was not really doing
14771         what it was supposed to do.  Which is to be born in fully resolved
14772         state.  Parts of the resolution were being performed at Emit time! 
14773
14774         Fixed this code.
14775
14776 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
14777
14778         * expression.cs: Implicity convert the result from UserCast.
14779
14780 2001-10-05  Ravi Pratap  <ravi@ximian.com>
14781
14782         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
14783         prevented it from working correctly. 
14784
14785         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
14786         merely ConvertImplicit.
14787
14788 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
14789
14790         * typemanager.cs: Make the LookupTypeContainer function static,
14791         and not per-instance.  
14792
14793         * class.cs: Make static FindMembers (the one that takes a Type
14794         argument). 
14795
14796         * codegen.cs: Add EmitForeach here.
14797
14798         * cs-parser.jay: Make foreach a toplevel object instead of the
14799         inline expansion, as we need to perform semantic analysis on it. 
14800
14801 2001-10-05  Ravi Pratap  <ravi@ximian.com>
14802
14803         * expression.cs (Expression::ImplicitUserConversion): Rename to
14804         UserDefinedConversion.
14805
14806         (Expression::UserDefinedConversion): Take an extra argument specifying 
14807         whether we look for explicit user conversions too.
14808
14809         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
14810
14811         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
14812
14813         (ExplicitUserConversion): Make it a call to UserDefinedConversion
14814         with the appropriate arguments.
14815
14816         * cs-parser.jay (cast_expression): Record location too.
14817
14818         * expression.cs (Cast): Record location info.
14819
14820         (Expression::ConvertExplicit): Take location argument.
14821
14822         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
14823         to determine if we are doing explicit conversions.
14824
14825         (UserCast::Emit): Update accordingly.
14826
14827         (Expression::ConvertExplicit): Report an error if everything fails.
14828
14829         * ../errors/cs0030.cs : Add.
14830
14831 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
14832
14833         * modifiers.cs: If the ABSTRACT keyword is present, also set the
14834         virtual and newslot bits. 
14835
14836         * class.cs (TypeContainer::RegisterRequiredImplementations):
14837         Record methods we need.
14838
14839         (TypeContainer::MakeKey): Helper function to make keys for
14840         MethodBases, since the Methodbase key is useless.
14841
14842         (TypeContainer::Populate): Call RegisterRequiredImplementations
14843         before defining the methods.   
14844
14845         Create a mapping for method_builders_to_methods ahead of time
14846         instead of inside a tight loop.
14847
14848         (::RequireMethods):  Accept an object as the data to set into the
14849         hashtable so we can report interface vs abstract method mismatch.
14850
14851 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
14852
14853         * report.cs: Make all of it static.
14854
14855         * rootcontext.cs: Drop object_type and value_type computations, as
14856         we have those in the TypeManager anyways.
14857
14858         Drop report instance variable too, now it is a global.
14859
14860         * driver.cs: Use try/catch on command line handling.
14861
14862         Add --probe option to debug the error reporting system with a test
14863         suite. 
14864
14865         * report.cs: Add support for exiting program when a probe
14866         condition is reached.
14867
14868 2001-10-03  Ravi Pratap  <ravi@ximian.com>
14869
14870         * expression.cs (Binary::DoNumericPromotions): Fix the case when
14871         we do a forcible conversion regardless of type, to check if 
14872         ForceConversion returns a null.
14873
14874         (Binary::error19): Use location to report error.
14875
14876         (Unary::error23): Use location here too.
14877
14878         * ../errors/cs0019.cs : Check in.
14879
14880         * ../errors/cs0023.cs : Check in.
14881
14882         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
14883         case of a non-null MethodInfo object with a length of 0 !
14884
14885         (Binary::ResolveOperator): Flag error if overload resolution fails to find
14886         an applicable member - according to the spec :-)
14887         Also fix logic to find members in base types.
14888
14889         (Unary::ResolveOperator): Same here.
14890
14891         (Unary::report23): Change name to error23 and make first argument a TypeContainer
14892         as I was getting thoroughly confused between this and error19 :-)
14893
14894         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
14895         (::FindMostEncompassedType): Implement.
14896         (::FindMostEncompassingType): Implement.
14897         (::StandardConversionExists): Implement.
14898
14899         (UserImplicitCast): Re-vamp. We now need info about most specific
14900         source and target types so that we can do the necessary conversions.
14901
14902         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
14903         mathematical union with no duplicates.
14904
14905 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
14906
14907         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
14908         in order from base classes to child classes, so that we can in
14909         child classes look up in our parent for method names and
14910         attributes (required for handling abstract, virtual, new, override
14911         constructs: we need to instrospect our base class, and if we dont
14912         populate the classes in order, the introspection might be
14913         incorrect.  For example, a method could query its parent before
14914         the parent has any methods and would determine that the parent has
14915         no abstract methods (while it could have had them)).
14916
14917         (RootContext::CreateType): Record the order in which we define the
14918         classes.
14919
14920 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
14921
14922         * class.cs (TypeContainer::Populate): Also method definitions can
14923         fail now, keep track of this.
14924
14925         (TypeContainer::FindMembers): Implement support for
14926         DeclaredOnly/noDeclaredOnly flag.
14927
14928         (Constructor::Emit) Return the ConstructorBuilder.
14929
14930         (Method::Emit) Return the MethodBuilder. 
14931         Check for abstract or virtual methods to be public.
14932
14933         * rootcontext.cs (RootContext::CreateType): Register all the
14934         abstract methods required for the class to be complete and the
14935         interface methods that must be implemented. 
14936
14937         * cs-parser.jay: Report error 501 (method requires body if it is
14938         not marked abstract or extern).
14939
14940         * expression.cs (TypeOf::Emit): Implement.
14941
14942         * typemanager.cs: runtime_handle_type, new global type.
14943
14944         * class.cs (Property::Emit): Generate code for properties.
14945
14946 2001-10-02  Ravi Pratap  <ravi@ximian.com>
14947
14948         * expression.cs (Unary::ResolveOperator): Find operators on base type
14949         too - we now conform exactly to the spec.
14950
14951         (Binary::ResolveOperator): Same here.
14952
14953         * class.cs (Operator::Define): Fix minor quirk in the tests.
14954
14955         * ../errors/cs0215.cs : Added.
14956
14957         * ../errors/cs0556.cs : Added.
14958
14959         * ../errors/cs0555.cs : Added.
14960
14961 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
14962
14963         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
14964         single integer which is really efficient
14965
14966 2001-10-01  Ravi Pratap  <ravi@ximian.com>
14967
14968         *  expression.cs (Expression::ImplicitUserConversion): Use location
14969         even in the case when we are examining True operators.
14970  
14971         * class.cs (Operator::Define): Perform extensive checks to conform
14972         with the rules for operator overloading in the spec.
14973
14974         * expression.cs (Expression::ImplicitReferenceConversion): Implement
14975         some of the other conversions mentioned in the spec.
14976
14977         * typemanager.cs (array_type): New static member for the System.Array built-in
14978         type.
14979
14980         (cloneable_interface): For System.ICloneable interface.
14981
14982         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
14983         we start resolving the tree and populating types.
14984
14985         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
14986  
14987 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
14988
14989         * expression.cs (Expression::ExprClassFromMemberInfo,
14990         Expression::Literalize): Create literal expressions from
14991         FieldInfos which are literals.
14992
14993         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
14994         type casts, because they were wrong.  The test suite in tests
14995         caught these ones.
14996
14997         (ImplicitNumericConversion): ushort to ulong requires a widening
14998         cast. 
14999
15000         Int32 constant to long requires widening cast as well.
15001
15002         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
15003         for integers because the type on the stack is not i4.
15004
15005 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * expression.cs (report118): require location argument. 
15008
15009         * parameter.cs: Do not dereference potential null value.
15010
15011         * class.cs: Catch methods that lack the `new' keyword when
15012         overriding a name.  Report warnings when `new' is used without
15013         anything being there to override.
15014
15015         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
15016
15017         * class.cs: Only add constructor to hashtable if it is non-null
15018         (as now constructors can fail on define).
15019
15020         (TypeManager, Class, Struct): Take location arguments.
15021
15022         Catch field instance initialization in structs as errors.
15023
15024         accepting_filter: a new filter for FindMembers that is static so
15025         that we dont create an instance per invocation.
15026
15027         (Constructor::Define): Catch errors where a struct constructor is
15028         parameterless 
15029
15030         * cs-parser.jay: Pass location information for various new
15031         constructs. 
15032
15033         * delegate.cs (Delegate): take a location argument.
15034
15035         * driver.cs: Do not call EmitCode if there were problesm in the
15036         Definition of the types, as many Builders wont be there. 
15037
15038         * decl.cs (Decl::Decl): Require a location argument.
15039
15040         * cs-tokenizer.cs: Handle properly hex constants that can not fit
15041         into integers, and find the most appropiate integer for it.
15042
15043         * literal.cs: Implement ULongLiteral.
15044
15045         * rootcontext.cs: Provide better information about the location of
15046         failure when CreateType fails.
15047
15048 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
15049
15050         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
15051         as well.
15052
15053         * expression.cs (Binary::CheckShiftArguments): Add missing type
15054         computation.
15055         (Binary::ResolveOperator): Add type to the logical and and logical
15056         or, Bitwise And/Or and Exclusive Or code paths, it was missing
15057         before.
15058
15059         (Binary::DoNumericPromotions): In the case where either argument
15060         is ulong (and most signed types combined with ulong cause an
15061         error) perform implicit integer constant conversions as well.
15062
15063 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
15064
15065         * expression.cs (UserImplicitCast): Method should always be
15066         non-null. 
15067         (Invocation::BetterConversion): Simplified test for IntLiteral.
15068
15069         (Expression::ImplicitNumericConversion): Split this routine out.
15070         Put the code that performs implicit constant integer conversions
15071         here. 
15072
15073         (Expression::Resolve): Become a wrapper around DoResolve so we can
15074         check eclass and type being set after resolve.
15075
15076         (Invocation::Badness): Remove this dead function
15077
15078         (Binary::ResolveOperator): Do not compute the expensive argumnets
15079         unless we have a union for it.
15080
15081         (Probe::Emit): Is needs to do an isinst and then
15082         compare against null.
15083
15084         (::CanConvert): Added Location argument.  If the Location argument
15085         is null (Location.Null), then we do not report errors.  This is
15086         used by the `probe' mechanism of the Explicit conversion.  We do
15087         not want to generate an error for something that the user
15088         explicitly requested to be casted.  But the pipeline for an
15089         explicit cast first tests for potential implicit casts.
15090
15091         So for now, if the Location is null, it means `Probe only' to
15092         avoid adding another argument.   Might have to revise this
15093         strategy later.
15094
15095         (ClassCast): New class used to type cast objects into arbitrary
15096         classes (used in Explicit Reference Conversions).
15097
15098         Implement `as' as well.
15099
15100         Reverted all the patches from Ravi below: they were broken:
15101
15102                 * The use of `level' as a mechanism to stop recursive
15103                   invocations is wrong.  That was there just to catch the
15104                   bug with a strack trace but not as a way of addressing
15105                   the problem.
15106
15107                   To fix the problem we have to *understand* what is going
15108                   on and the interactions and come up with a plan, not
15109                   just get things going.
15110
15111                 * The use of the type conversion cache that I proposed
15112                   last night had an open topic: How does this work across
15113                   protection domains.  A user defined conversion might not
15114                   be public in the location where we are applying the
15115                   conversion, a different conversion might be selected
15116                   (ie, private A->B (better) but public B->A (worse),
15117                   inside A, A->B applies, but outside it, B->A will
15118                   apply).
15119
15120                 * On top of that (ie, even if the above is solved),
15121                   conversions in a cache need to be abstract.  Ie, `To
15122                   convert from an Int to a Short use an OpcodeCast', not
15123                   `To convert from an Int to a Short use the OpcodeCast on
15124                   the variable 5' (which is what this patch was doing).
15125
15126 2001-09-28  Ravi Pratap  <ravi@ximian.com>
15127
15128         * expression.cs (Invocation::ConversionExists): Re-write to use
15129         the conversion cache
15130
15131         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
15132         cache all conversions done, not just user-defined ones.
15133
15134         (Invocation::BetterConversion): The real culprit. Use ConversionExists
15135         to determine if a conversion exists instead of acutually trying to 
15136         perform the conversion. It's faster too.
15137
15138         (Expression::ConvertExplicit): Modify to use ConversionExists to check
15139         and only then attempt the implicit conversion.
15140
15141 2001-09-28  Ravi Pratap  <ravi@ximian.com>
15142
15143         * expression.cs (ConvertImplicit): Use a cache for conversions
15144         already found. Check level of recursion and bail out if necessary.
15145
15146 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
15147
15148         * typemanager.cs (string_concat_string_string, string_concat_object_object):
15149         Export standard methods that we expect for string operations.
15150
15151         * statement.cs (Block::UsageWarning): Track usage of variables and
15152         report the errors for not used variables.
15153
15154         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
15155         operator. 
15156
15157 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15158
15159         * codegen.cs: remove unnneded code 
15160
15161         * expression.cs: Removed BuiltinTypeAccess class
15162
15163         Fix the order in which implicit conversions are
15164         done.  
15165
15166         The previous fixed dropped support for boxed conversions (adding a
15167         test to the test suite now)
15168
15169         (UserImplicitCast::CanConvert): Remove test for source being null,
15170         that code is broken.  We should not feed a null to begin with, if
15171         we do, then we should track the bug where the problem originates
15172         and not try to cover it up here.
15173
15174         Return a resolved expression of type UserImplicitCast on success
15175         rather than true/false.  Ravi: this is what I was talking about,
15176         the pattern is to use a static method as a "constructor" for
15177         objects. 
15178
15179         Also, do not create arguments until the very last minute,
15180         otherwise we always create the arguments even for lookups that
15181         will never be performed. 
15182
15183         (UserImplicitCast::Resolve): Eliminate, objects of type
15184         UserImplicitCast are born in a fully resolved state. 
15185
15186         * typemanager.cs (InitCoreTypes): Init also value_type
15187         (System.ValueType). 
15188
15189         * expression.cs (Cast::Resolve): First resolve the child expression.
15190
15191         (LValue): Add new method AddressOf to be used by
15192         the `&' operator.  
15193
15194         Change the argument of Store to take an EmitContext instead of an
15195         ILGenerator, because things like FieldExpr need to be able to call
15196         their children expression to generate the instance code. 
15197
15198         (Expression::Error, Expression::Warning): Sugar functions for
15199         reporting errors.
15200
15201         (Expression::MemberLookup): Accept a TypeContainer instead of a
15202         Report as the first argument.
15203
15204         (Expression::ResolvePrimary): Killed.  I still want to improve
15205         this as currently the code is just not right.
15206
15207         (Expression::ResolveMemberAccess): Simplify, but it is still
15208         wrong. 
15209
15210         (Unary::Resolve): Catch errors in AddressOf operators.
15211
15212         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
15213         index to a byte for the short-version, or the compiler will choose
15214         the wrong Emit call, which generates the wrong data.
15215
15216         (ParameterReference::Emit, ::Store): same.
15217
15218         (FieldExpr::AddressOf): Implement.
15219
15220         * typemanager.cs: TypeManager: made public variable instead of
15221         property.
15222
15223         * driver.cs: document --fatal.
15224
15225         * report.cs (ErrorMessage, WarningMessage): new names for the old
15226         Error and Warning classes.
15227
15228         * cs-parser.jay (member_access): Turn built-in access to types
15229         into a normal simplename
15230
15231 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15232
15233         * expression.cs (Invocation::BetterConversion): Fix to cope
15234         with q being null, since this was introducing a bug.
15235
15236         * expression.cs (ConvertImplicit): Do built-in conversions first.
15237
15238 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15239
15240         * expression.cs (UserImplicitCast::Resolve): Fix bug.
15241
15242 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15243
15244         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
15245         I had introduced long ago (what's new ?).
15246
15247         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
15248         the work of all the checking. 
15249         (ConvertImplicit): Call CanConvert and only then create object if necessary.
15250         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
15251
15252         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
15253         that is the right way. 
15254
15255         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
15256         overloading resolution. Use everywhere instead of cutting and pasting code.
15257
15258         (Binary::ResolveOperator): Use MakeUnionSet.
15259
15260         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
15261         we have to convert to bool types. Not complete yet.
15262
15263 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15264
15265         * typemanager.cs (TypeManager::CSharpName): support ushort.
15266
15267         * expression.cs (Expression::TryImplicitIntConversion): Attempts
15268         to provide an expression that performsn an implicit constant int
15269         conversion (section 6.1.6).
15270         (Expression::ConvertImplicitRequired): Reworked to include
15271         implicit constant expression conversions.
15272
15273         (Expression::ConvertNumericExplicit): Finished.
15274
15275         (Invocation::Emit): If InstanceExpression is null, then it means
15276         that we perform a call on this.
15277
15278 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15279
15280         * expression.cs (Unary::Emit): Remove some dead code.
15281         (Probe): Implement Resolve and Emit for `is'.
15282         (Expression::ConvertImplicitRequired): Attempt to do constant
15283         expression conversions here.  Maybe should be moved to
15284         ConvertImplicit, but I am not sure.
15285         (Expression::ImplicitLongConstantConversionPossible,
15286         Expression::ImplicitIntConstantConversionPossible): New functions
15287         that tell whether is it possible to apply an implicit constant
15288         expression conversion.
15289
15290         (ConvertNumericExplicit): Started work on explicit numeric
15291         conversions.
15292
15293         * cs-parser.jay: Update operator constants.
15294
15295         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
15296         (Parameters::GetSignature): Hook up VerifyArgs here.
15297         (Parameters::VerifyArgs): Verifies that no two arguments have the
15298         same name. 
15299
15300         * class.cs (Operator): Update the operator names to reflect the
15301         ones that the spec expects (as we are just stringizing the
15302         operator names).
15303
15304         * expression.cs (Unary::ResolveOperator): Fix bug: Use
15305         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
15306         previous usage did only work for our methods.
15307         (Expression::ConvertImplicit): Handle decimal implicit numeric
15308         conversions as well.
15309         (Expression::InternalTypeConstructor): Used to invoke constructors
15310         on internal types for default promotions.
15311
15312         (Unary::Emit): Implement special handling for the pre/post
15313         increment/decrement for overloaded operators, as they need to have
15314         the same semantics as the other operators.
15315
15316         (Binary::ResolveOperator): ditto.
15317         (Invocation::ConversionExists): ditto.
15318         (UserImplicitCast::Resolve): ditto.
15319
15320 2001-09-26  Ravi Pratap  <ravi@ximian.com>
15321
15322         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
15323         operator, return after emitting body. Regression tests pass again !
15324
15325         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
15326         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
15327         (Invocation::OverloadResolve): Ditto.
15328         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
15329
15330         * everywhere : update calls to the above methods accordingly.
15331
15332 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15333
15334         * assign.cs (Assign): Make it inherit from ExpressionStatement.
15335
15336         * expression.cs (ExpressionStatement): New base class used for
15337         expressions that can appear in statements, so that we can provide
15338         an alternate path to generate expression that do not leave a value
15339         on the stack.
15340
15341         (Expression::Emit, and all the derivatives): We no longer return
15342         whether a value is left on the stack or not.  Every expression
15343         after being emitted leaves a single value on the stack.
15344
15345         * codegen.cs (EmitContext::EmitStatementExpression): Use the
15346         facilties of ExpressionStatement if possible.
15347
15348         * cs-parser.jay: Update statement_expression.
15349
15350 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
15351
15352         * driver.cs: Change the wording of message
15353
15354 2001-09-25  Ravi Pratap  <ravi@ximian.com>
15355
15356         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
15357         the type of the expression to the return type of the method if
15358         we have an overloaded operator match ! The regression tests pass again !
15359         (Unary::ResolveOperator): Ditto.
15360
15361         * expression.cs (Invocation::ConversionExists): Correct the member lookup
15362         to find "op_Implicit", not "implicit" ;-)
15363         (UserImplicitCast): New class to take care of user-defined implicit conversions.
15364         (ConvertImplicit, ForceConversion): Take TypeContainer argument
15365
15366         * everywhere : Correct calls to the above accordingly.
15367
15368         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
15369         (ConvertImplicit): Do user-defined conversion if it exists.
15370
15371 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
15372
15373         * assign.cs: track location.
15374         (Resolve): Use implicit conversions on assignment.
15375
15376         * literal.cs: Oops.  Not good, Emit of short access values should
15377         pass (Bytes) or the wrong argument will be selected.
15378
15379         * expression.cs (Unary::Emit): Emit code for -expr.
15380
15381         (Unary::ResolveOperator): Handle `Substract' for non-constants
15382         (substract from zero from the non-constants).
15383         Deal with Doubles as well. 
15384
15385         (Expression::ConvertImplicitRequired): New routine that reports an
15386         error if no implicit conversion exists. 
15387
15388         (Invocation::OverloadResolve): Store the converted implicit
15389         expressions if we make them
15390
15391 2001-09-24  Ravi Pratap  <ravi@ximian.com>
15392
15393         * class.cs (ConstructorInitializer): Take a Location argument.
15394         (ConstructorBaseInitializer): Same here.
15395         (ConstructorThisInitializer): Same here.
15396
15397         * cs-parser.jay : Update all calls accordingly.
15398
15399         * expression.cs (Unary, Binary, New): Take location argument.
15400         Update accordingly everywhere.
15401
15402         * cs-parser.jay : Update all calls to the above to take a location
15403         argument.
15404
15405         * class.cs : Ditto.
15406
15407 2001-09-24  Ravi Pratap  <ravi@ximian.com>
15408
15409         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
15410         (Invocation::BetterConversion): Same here
15411         (Invocation::ConversionExists): Ditto.
15412
15413         (Invocation::ConversionExists): Implement.
15414
15415 2001-09-22  Ravi Pratap  <ravi@ximian.com>
15416
15417         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
15418         Also take an additional TypeContainer argument.
15419
15420         * All over : Pass in TypeContainer as argument to OverloadResolve.
15421
15422         * typemanager.cs (CSharpName): Update to check for the string type and return
15423         that too.
15424
15425         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
15426         a given method.
15427
15428 2001-09-21  Ravi Pratap  <ravi@ximian.com>
15429
15430         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
15431         (Invocation::BetterFunction): Implement.
15432         (Invocation::BetterConversion): Implement.
15433         (Invocation::ConversionExists): Skeleton, no implementation yet.
15434
15435         Okay, things work fine !
15436
15437 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
15438
15439         * typemanager.cs: declare and load enum_type, delegate_type and
15440         void_type. 
15441
15442         * expression.cs (Expression::Emit): Now emit returns a value that
15443         tells whether a value is left on the stack or not.  This strategy
15444         might be reveted tomorrow with a mechanism that would address
15445         multiple assignments.
15446         (Expression::report118): Utility routine to report mismatches on
15447         the ExprClass.
15448
15449         (Unary::Report23): Report impossible type/operator combination
15450         utility function.
15451
15452         (Unary::IsIncrementableNumber): Whether the type can be
15453         incremented or decremented with add.
15454         (Unary::ResolveOperator): Also allow enumerations to be bitwise
15455         complemented. 
15456         (Unary::ResolveOperator): Implement ++, !, ~,
15457
15458         (Invocation::Emit): Deal with new Emit convetion.
15459
15460         * All Expression derivatives: Updated their Emit method to return
15461         whether they leave values on the stack or not.
15462
15463         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
15464         stack for expressions that are statements. 
15465
15466 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
15467
15468         * expression.cs (LValue): New interface.  Must be implemented by
15469         LValue objects.
15470         (LocalVariableReference, ParameterReference, FieldExpr): Implement
15471         LValue interface.
15472
15473         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
15474         interface for generating code, simplifies the code.
15475
15476 2001-09-20  Ravi Pratap  <ravi@ximian.com>
15477
15478         * expression.cs (everywhere): Comment out return statements in ::Resolve
15479         methods to avoid the warnings.
15480
15481 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
15482
15483         * driver.cs (parse): Report error 2001 if we can not open the
15484         source file.
15485
15486         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
15487         not resolve it.
15488
15489         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
15490         object. 
15491
15492         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
15493         otherwise nested blocks end up with the same index.
15494
15495         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
15496
15497         * expression.cs:  Instead of having FIXMEs in the Resolve
15498         functions, throw exceptions so it is obvious that we are facing a
15499         bug. 
15500
15501         * cs-parser.jay (invocation_expression): Pass Location information.
15502
15503         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
15504         Use a basename for those routines because .NET does not like paths
15505         on them. 
15506
15507         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
15508         already defined.
15509
15510 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
15511
15512         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
15513         are loading the correct data types (throws an exception if not).
15514         (TypeManager::InitCoreTypes): Use CoreLookupType
15515
15516         * expression.cs (Unary::ResolveOperator): return the child
15517         expression for expressions which are just +expr.
15518         (Unary::ResolveOperator): Return negative literals for -LITERAL
15519         expressions (otherwise they are Unary {Literal}).
15520         (Invocation::Badness): Take into account `Implicit constant
15521         expression conversions'.
15522
15523         * literal.cs (LongLiteral): Implement long literal class.
15524         (IntLiteral): export the `Value' of the intliteral. 
15525
15526 2001-09-19  Ravi Pratap  <ravi@ximian.com>
15527
15528         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
15529
15530         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
15531         instead of 'Operator'
15532
15533         * expression.cs (Binary::ResolveOperator): Update accordingly.
15534         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
15535         and 'Minus'
15536
15537         * cs-parser.jay (unary_expression): Update to use the new names.
15538
15539         * gen-treedump.cs (GetUnary): Same here.
15540
15541         * expression.cs (Unary::Resolve): Implement.
15542         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
15543         operators are found instead of making noise ;-)
15544         (Unary::ResolveOperator): New method to do precisely the same thing which
15545         Binary::ResolveOperator does for Binary expressions.
15546         (Unary.method, .Arguments): Add.
15547         (Unary::OperName): Implement.   
15548         (Unary::ForceConversion): Copy and Paste !
15549
15550         * class.cs (Operator::Define): Fix a small bug for the case when we have 
15551         a unary operator.
15552
15553         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
15554         for the inbuilt operators. Only overloading works for now ;-)
15555
15556 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
15557
15558         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
15559         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
15560
15561         * expression.cs (This::Emit): Implement. 
15562         (This::Resolve): Implement.
15563         (TypeOf:Resolve): Implement.
15564         (Expression::ResolveSimpleName): Add an implicit this to instance
15565         field references. 
15566         (MemberAccess::Resolve): Deal with Parameters and Fields. 
15567         Bind instance variable to Field expressions.
15568         (FieldExpr::Instance): New field used to track the expression that
15569         represents the object instance.
15570         (FieldExpr::Resolve): Track potential errors from MemberLookup not
15571         binding 
15572         (FieldExpr::Emit): Implement.
15573
15574         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
15575         the last instruction contains a return opcode to avoid generating
15576         the last `ret' instruction (this generates correct code, and it is
15577         nice to pass the peverify output).
15578
15579         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
15580         initializer for static and instance variables.
15581         (Constructor::Emit): Allow initializer to be null in the case of
15582         static constructors.  Only emit initializer for instance
15583         constructors. 
15584
15585         (TypeContainer::FindMembers): Return a null array if there are no
15586         matches.
15587
15588         Also fix the code for the MemberTypes.Method branch, as it was not
15589         scanning that for operators (or tried to access null variables before).
15590
15591         * assign.cs (Assign::Emit): Handle instance and static fields. 
15592
15593         * TODO: Updated.
15594
15595         * driver.cs: Stop compilation if there are parse errors.
15596
15597         * cs-parser.jay (constructor_declaration): Provide default base
15598         initializer for non-static constructors.
15599         (constructor_declarator): Do not provide a default base
15600         initializers if none was specified.
15601         Catch the fact that constructors should not have parameters.
15602
15603         * class.cs: Do not emit parent class initializers for static
15604         constructors, that should be flagged as an error.
15605
15606 2001-09-18  Ravi Pratap  <ravi@ximian.com>
15607
15608         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
15609         Move back code into TypeContainer::Populate.
15610
15611 2001-09-18  Ravi Pratap  <ravi@ximian.com>
15612
15613         * class.cs (TypeContainer::AddConstructor): Fix the check to
15614         compare against Name, not Basename. 
15615         (Operator::OpType): Change Plus and Minus to Add and Subtract.
15616
15617         * cs-parser.jay : Update accordingly.
15618
15619         * class.cs (TypeContainer::FindMembers): For the case where we are searching
15620         for methods, don't forget to look into the operators too.
15621         (RegisterMethodBuilder): Helper method to take care of this for
15622         methods, constructors and operators.
15623         (Operator::Define): Completely revamp.
15624         (Operator.OperatorMethod, MethodName): New fields.
15625         (TypeContainer::Populate): Move the registering of builders into
15626         RegisterMethodBuilder.
15627         (Operator::Emit): Re-write.
15628
15629         * expression.cs (Binary::Emit): Comment out code path to emit method
15630         invocation stuff for the case when we have a user defined operator. I am
15631         just not able to get it right !
15632
15633 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
15634
15635         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
15636         argument. 
15637
15638         (Expression::MemberLookup): Provide a version that allows to
15639         specify the MemberTypes and BindingFlags. 
15640
15641         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
15642         so it was not fetching variable information from outer blocks.
15643
15644         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
15645         Beforefieldinit as it was buggy.
15646
15647         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
15648         that Ravi put here.  
15649
15650         * class.cs (Constructor::Emit): Only emit if block is not null.
15651         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
15652         deal with this by semantically definining it as if the user had
15653         done it.
15654
15655         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
15656         constructors as we now "emit" them at a higher level.
15657
15658         (TypeContainer::DefineDefaultConstructor): Used to define the
15659         default constructors if none was provided.
15660
15661         (ConstructorInitializer): Add methods Resolve and Emit. 
15662
15663         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
15664
15665 2001-09-17  Ravi Pratap  <ravi@ximian.com>
15666
15667         * class.cs (TypeContainer::EmitDefaultConstructor): Register
15668         the default constructor builder with our hashtable for methodbuilders
15669         to methodcores.
15670
15671         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
15672         and argument_count is 0 in which case we have a match.
15673         (Binary::ResolveOperator): More null checking and miscellaneous coding
15674         style cleanup.
15675
15676 2001-09-17  Ravi Pratap  <ravi@ximian.com>
15677
15678         * rootcontext.cs (IsNameSpace): Compare against null.
15679
15680         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
15681
15682         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
15683         and Unary::Operator.
15684
15685         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
15686         accordingly.
15687
15688         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
15689         we have overloaded operators.
15690         (Binary::ResolveOperator): Implement the part which does the operator overload
15691         resolution.
15692
15693         * class.cs (Operator::Emit): Implement.
15694         (TypeContainer::Emit): Emit the operators we have too.
15695
15696         * expression.cs (Binary::Emit): Update to emit the appropriate code for
15697         the case when we have a user-defined operator.
15698
15699 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
15700
15701         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
15702
15703 2001-09-16  Ravi Pratap  <ravi@ximian.com>
15704
15705         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
15706         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
15707         (Constructor::Emit): Implement.
15708         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
15709         if we have no work to do. 
15710         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
15711         Emit method.
15712
15713         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
15714         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
15715
15716         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
15717         of parent.parent.
15718
15719 2001-09-15  Ravi Pratap  <ravi@ximian.com>
15720
15721         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
15722         in the source.
15723         (Tree::RecordNamespace): Method to do what the name says ;-)
15724         (Tree::Namespaces): Property to get at the namespaces hashtable.
15725
15726         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
15727         keep track.
15728
15729         * rootcontext.cs (IsNamespace): Fixed it :-)
15730
15731 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
15732
15733         * class.cs (TypeContainer::FindMembers): Add support for
15734         constructors. 
15735         (MethodCore): New class that encapsulates both the shared aspects
15736         of a Constructor and a Method.  
15737         (Method, Constructor): Factored pieces into MethodCore.
15738
15739         * driver.cs: Added --fatal which makes errors throw exceptions.
15740         Load System assembly as well as part of the standard library.
15741
15742         * report.cs: Allow throwing exceptions on errors for debugging.
15743
15744         * modifiers.cs: Do not use `parent', instead use the real type
15745         container to evaluate permission settings.
15746
15747         * class.cs: Put Ravi's patch back in.  He is right, and we will
15748         have to cope with the
15749
15750 2001-09-14  Ravi Pratap  <ravi@ximian.com>
15751
15752         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
15753         FamORAssem, not FamANDAssem.
15754
15755 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
15756
15757         * driver.cs: Added --parse option that only parses its input files
15758         and terminates.
15759
15760         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
15761         incorrect.  IsTopLevel is not used to tell whether an object is
15762         root_types or not (that can be achieved by testing this ==
15763         root_types).  But to see if this is a top-level *class* (not
15764         necessarly our "toplevel" container). 
15765
15766 2001-09-14  Ravi Pratap  <ravi@ximian.com>
15767
15768         * enum.cs (Enum::Define): Modify to call the Lookup method on the
15769         parent instead of a direct call to GetType.
15770
15771 2001-09-14  Ravi Pratap  <ravi@ximian.com>
15772
15773         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
15774         Modifiers.TypeAttr. This should just be a call to that method.
15775
15776         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
15777         object so that we can determine if we are top-level or not.
15778
15779         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
15780         TypeContainer too.
15781
15782         * enum.cs (Enum::Define): Ditto.
15783
15784         * modifiers.cs (FieldAttr): Re-write.
15785
15786         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
15787         (TypeContainer::HaveStaticConstructor): New property to provide access
15788         to precisely that info.
15789
15790         * modifiers.cs (MethodAttr): Re-write.
15791         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
15792
15793         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
15794         of top-level types as claimed.
15795
15796 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
15797
15798         * expression.cs (MemberLookup): Fruitless attempt to lookup
15799         constructors.  Maybe I need to emit default constructors?  That
15800         might be it (currently .NET emits this for me automatically).
15801         (Invocation::OverloadResolve): Cope with Arguments == null.
15802         (Invocation::EmitArguments): new function, shared by the new
15803         constructor and us.
15804         (Invocation::Emit): Handle static and instance methods.  Emit
15805         proper call instruction for virtual or non-virtual invocations.
15806         (New::Emit): Implement.
15807         (New::Resolve): Implement.
15808         (MemberAccess:Resolve): Implement.
15809         (MethodGroupExpr::InstanceExpression): used conforming to the spec
15810         to track instances.
15811         (FieldExpr::Resolve): Set type.
15812
15813         * support.cs: Handle empty arguments.
15814                 
15815         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
15816         SimpleLookup): Auxiliary routines to help parse a qualifier
15817         identifier.  
15818
15819         Update qualifier_identifier rule.
15820
15821         * codegen.cs: Removed debugging messages.
15822
15823         * class.cs: Make this a global thing, this acts just as a "key" to
15824         objects that we might have around.
15825
15826         (Populate): Only initialize method_builders_to_methods once.
15827
15828         * expression.cs (PropertyExpr): Initialize type from the
15829         PropertyType. 
15830
15831         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
15832         Resolve pattern.  Attempt to implicitly convert value to boolean.
15833         Emit code.
15834
15835         * expression.cs: Set the type for the int32/int32 argument case.
15836         (Binary::ResolveOperator): Set the return type to boolean for
15837         comparission operators
15838
15839         * typemanager.cs: Remove debugging print code.
15840
15841         (Invocation::Resolve): resolve type.
15842
15843         * class.cs: Allocate a MemberInfo of the correct size, as the code
15844         elsewhere depends on the test to reflect the correct contents.
15845
15846         (Method::) Keep track of parameters, due to System.Reflection holes
15847
15848         (TypeContainer::Populate): Keep track of MethodBuilders to Method
15849         mapping here.
15850
15851         (TypeContainer::FindMembers): Use ArrayList and then copy an array
15852         of the exact size and return that.
15853
15854         (Class::LookupMethodByBuilder): New function that maps
15855         MethodBuilders to its methods.  Required to locate the information
15856         on methods because System.Reflection bit us again.
15857
15858         * support.cs: New file, contains an interface ParameterData and
15859         two implementations: ReflectionParameters and InternalParameters
15860         used to access Parameter information.  We will need to grow this
15861         as required.
15862
15863         * expression.cs (Invocation::GetParameterData): implement a cache
15864         and a wrapper around the ParameterData creation for methods. 
15865         (Invocation::OverloadResolve): Use new code.
15866
15867 2001-09-13  Ravi Pratap  <ravi@ximian.com>
15868
15869         * class.cs (TypeContainer::EmitField): Remove and move into 
15870         (Field::Define): here and modify accordingly.
15871         (Field.FieldBuilder): New member.
15872         (TypeContainer::Populate): Update accordingly.
15873         (TypeContainer::FindMembers): Implement.
15874
15875 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
15876
15877         * statement.cs: (VariableInfo::VariableType): New field to be
15878         initialized with the full type once it is resolved. 
15879
15880 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
15881
15882         * parameter.cs (GetParameterInfo): Use a type cache to compute
15883         things only once, and to reuse this information
15884
15885         * expression.cs (LocalVariableReference::Emit): Implement.
15886         (OpcodeCast::Emit): fix.
15887
15888         (ParameterReference::Resolve): Implement.
15889         (ParameterReference::Emit): Implement.
15890
15891         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
15892         that are expressions need to stay as Expressions.
15893
15894         * typemanager.cs (CSharpName): Returns the C# name of a type if
15895         possible. 
15896
15897         * expression.cs (Expression::ConvertImplicit): New function that
15898         implements implicit type conversions.
15899
15900         (Expression::ImplicitReferenceConversion): Implements implicit
15901         reference conversions.
15902
15903         (EmptyCast): New type for transparent casts.
15904
15905         (OpcodeCast): New type for casts of types that are performed with
15906         a sequence of bytecodes.
15907
15908         (BoxedCast): New type used for casting value types into reference
15909         types.  Emits a box opcode.
15910
15911         (Binary::DoNumericPromotions): Implements numeric promotions of
15912         and computation of the Binary::Type.
15913
15914         (Binary::EmitBranchable): Optimization.
15915
15916         (Binary::Emit): Implement code emission for expressions.
15917
15918         * typemanager.cs (TypeManager): Added two new core types: sbyte
15919         and byte.
15920
15921 2001-09-12  Ravi Pratap  <ravi@ximian.com>
15922
15923         * class.cs (TypeContainer::FindMembers): Method which does exactly
15924         what Type.FindMembers does, only we don't have to use reflection. No
15925         implementation yet.
15926
15927         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
15928         typecontainer objects as we need to get at them.
15929         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
15930
15931         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
15932         typecontainer object.
15933
15934         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
15935         of just a Report object.
15936
15937 2001-09-11  Ravi Pratap  <ravi@ximian.com>
15938
15939         * class.cs (Event::Define): Go back to using the prefixes "add_" and
15940         "remove_"
15941         (TypeContainer::Populate): Now define the delegates of the type too.
15942         (TypeContainer.Delegates): Property to access the list of delegates defined
15943         in the type.
15944
15945         * delegates.cs (Delegate::Define): Implement partially.
15946
15947         * modifiers.cs (TypeAttr): Handle more flags.
15948
15949 2001-09-11  Ravi Pratap  <ravi@ximian.com>
15950
15951         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
15952         and not <=
15953         (Operator::Define): Re-write logic to get types by using the LookupType method
15954         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
15955         (Indexer::Define): Ditto.
15956         (Event::Define): Ditto.
15957         (Property::Define): Ditto.
15958
15959 2001-09-10  Ravi Pratap  <ravi@ximian.com>
15960
15961         * class.cs (TypeContainer::Populate): Now define operators too. 
15962         (TypeContainer.Operators): New property to access the list of operators
15963         in a type.
15964         (Operator.OperatorMethodBuilder): New member to hold the method builder
15965         for the operator we are defining.
15966         (Operator::Define): Implement.
15967
15968 2001-09-10  Ravi Pratap  <ravi@ximian.com>
15969
15970         * class.cs (Event::Define): Make the prefixes of the accessor methods
15971         addOn_ and removeOn_ 
15972
15973         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
15974         of the location being passed in too. Ideally, this should go later since all
15975         error reporting should be done through the Report object.
15976
15977         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
15978         (Populate): Iterate thru the indexers we have and define them too.
15979         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
15980         for the get and set accessors.
15981         (Indexer::Define): Implement.
15982
15983 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
15984
15985         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
15986         my previous implementation, did not work.
15987
15988         * typemanager.cs: Add a couple of missing types (the longs).
15989
15990         * literal.cs: Use TypeManager.bool_type instead of getting it.
15991
15992         * expression.cs (EventExpr): New kind of expressions.
15993         (Expressio::ExprClassFromMemberInfo): finish
15994
15995 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
15996
15997         * assign.cs: Emit stores to static fields differently.
15998
15999 2001-09-08  Ravi Pratap  <ravi@ximian.com>
16000
16001         * Merge in changes and adjust code to tackle conflicts. Backed out my
16002         code in Assign::Resolve ;-) 
16003
16004 2001-09-08  Ravi Pratap  <ravi@ximian.com>
16005
16006         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
16007         instead Report.Error and also pass in the location.
16008         (CSharpParser::Lexer): New readonly property to return the reference
16009         to the Tokenizer object.
16010         (declare_local_variables): Use Report.Error with location instead of plain 
16011         old error.
16012         (CheckDef): Ditto.
16013
16014         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
16015         (Operator.CheckBinaryOperator): Ditto.
16016
16017         * cs-parser.jay (operator_declarator): Update accordingly.
16018
16019         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
16020         (CheckBinaryOperator): Same here.
16021
16022         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
16023         on the name without any prefixes of namespace names etc. This is because we
16024         already might have something already fully qualified like 
16025         'System.Console.WriteLine'
16026
16027         * assign.cs (Resolve): Begin implementation. Stuck ;-)
16028
16029 2001-09-07  Ravi Pratap  <ravi@ximian.com>
16030
16031         * cs-tokenizer.cs (location): Return a string which also contains
16032         the file name.
16033
16034         * expression.cs (ElementAccess): New class for expressions of the
16035         type 'element access.'
16036         (BaseAccess): New class for expressions of the type 'base access.'
16037         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
16038         respectively.
16039
16040         * cs-parser.jay (element_access): Implement action.
16041         (base_access): Implement actions.
16042         (checked_expression, unchecked_expression): Implement.
16043
16044         * cs-parser.jay (local_variable_type): Correct and implement.
16045         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
16046
16047         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
16048
16049         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
16050         name and the specifiers.
16051
16052         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
16053
16054         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
16055         making them all public ;-)
16056
16057         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
16058         class anyways.
16059
16060 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
16061
16062         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
16063         PropertyExprs.
16064         (FieldExpr, PropertyExprs): New resolved expressions.
16065         (SimpleName::MemberStaticCheck): Perform static checks for access
16066         to non-static fields on static methods. Maybe this should be
16067         generalized for MemberAccesses. 
16068         (SimpleName::ResolveSimpleName): More work on simple name
16069         resolution. 
16070
16071         * cs-parser.jay (primary_expression/qualified_identifier): track
16072         the parameter index.
16073
16074         * codegen.cs (CodeGen::Save): Catch save exception, report error.
16075         (EmitContext::EmitBoolExpression): Chain to expression generation
16076         instead of temporary hack.
16077         (::EmitStatementExpression): Put generic expression code generation.
16078
16079         * assign.cs (Assign::Emit): Implement variable assignments to
16080         local variables, parameters and fields.
16081
16082 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
16083
16084         * statement.cs (Block::GetVariableInfo): New method, returns the
16085         VariableInfo for a variable name in a block.
16086         (Block::GetVariableType): Implement in terms of GetVariableInfo
16087
16088         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
16089         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
16090
16091 2001-09-06  Ravi Pratap  <ravi@ximian.com>
16092
16093         * cs-parser.jay (operator_declaration): Continue on my quest : update
16094         to take attributes argument.
16095         (event_declaration): Ditto.
16096         (enum_declaration): Ditto.
16097         (indexer_declaration): Ditto.
16098
16099         * class.cs (Operator::Operator): Update constructor accordingly.
16100         (Event::Event): Ditto.
16101
16102         * delegate.cs (Delegate::Delegate): Same here.
16103
16104         * enum.cs (Enum::Enum): Same here.
16105
16106 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16107
16108         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
16109
16110         * ../tests/cs0658.cs : New file to demonstrate error 0658.
16111
16112         * attribute.cs (Attributes): New class to encapsulate all attributes which were
16113         being passed around as an arraylist.
16114         (Attributes::AddAttribute): Method to add attribute sections.
16115
16116         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
16117         (struct_declaration): Update accordingly.
16118         (constant_declaration): Update.
16119         (field_declaration): Update.
16120         (method_header): Update.
16121         (fixed_parameter): Update.
16122         (parameter_array): Ditto.
16123         (property_declaration): Ditto.
16124         (destructor_declaration): Ditto.
16125
16126         * class.cs (Struct::Struct): Update constructors accordingly.
16127         (Class::Class): Ditto.
16128         (Field::Field): Ditto.
16129         (Method::Method): Ditto.
16130         (Property::Property): Ditto.
16131         (TypeContainer::OptAttribute): update property's return type.
16132
16133         * interface.cs (Interface.opt_attributes): New member.
16134         (Interface::Interface): Update to take the extra Attributes argument.
16135
16136         * parameter.cs (Parameter::Parameter): Ditto.
16137
16138         * constant.cs (Constant::Constant): Ditto.
16139
16140         * interface.cs (InterfaceMemberBase): New OptAttributes field.
16141         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
16142         the attributes as a parameter.
16143         (InterfaceProperty): Update constructor call.
16144         (InterfaceEvent): Ditto.
16145         (InterfaceMethod): Ditto.
16146         (InterfaceIndexer): Ditto.
16147
16148         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
16149         pass the attributes too.
16150         (interface_event_declaration): Ditto.
16151         (interface_property_declaration): Ditto.
16152         (interface_method_declaration): Ditto.
16153         (interface_declaration): Ditto.
16154
16155 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
16156
16157         * class.cs (Method::Define): Track the "static Main" definition to
16158         create an entry point. 
16159
16160         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
16161         EntryPoint if we find it. 
16162
16163         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
16164         (EmitContext::ig): Make this variable public.
16165
16166         * driver.cs: Make the default output file be the first file name
16167         with the .exe extension.  
16168
16169         Detect empty compilations
16170
16171         Handle various kinds of output targets.  Handle --target and
16172         rename -t to --dumper.
16173
16174         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
16175         methods inherited from Expression return now an Expression.  This
16176         will is used during the tree rewriting as we resolve them during
16177         semantic analysis.
16178
16179         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
16180         the spec.  Missing entirely is the information about
16181         accessability of elements of it.
16182
16183         (Expression::ExprClassFromMemberInfo): New constructor for
16184         Expressions that creates a fully initialized Expression based on
16185         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
16186         a Type.
16187
16188         (Invocation::Resolve): Begin implementing resolution of invocations.
16189
16190         * literal.cs (StringLiteral):  Implement Emit.
16191
16192 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16193
16194         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
16195         member.
16196
16197 2001-09-04  Ravi Pratap  <ravi@ximian.com>
16198
16199         * cs-parser.jay (attribute_arguments): Implement actions.
16200         (attribute): Fix bug in production. Implement action.
16201         (attribute_list): Implement.
16202         (attribute_target): Implement.
16203         (attribute_target_specifier, opt_target_specifier): Implement
16204         (CheckAttributeTarget): New method to check if the attribute target
16205         is valid.
16206         (attribute_section): Implement.
16207         (opt_attributes): Implement.
16208
16209         * attribute.cs : New file to handle attributes.
16210         (Attribute): Class to hold attribute info.
16211
16212         * cs-parser.jay (opt_attribute_target_specifier): Remove production
16213         (attribute_section): Modify production to use 2 different rules to 
16214         achieve the same thing. 1 s/r conflict down !
16215         Clean out commented, useless, non-reducing dimension_separator rules.
16216
16217         * class.cs (TypeContainer.attributes): New member to hold list
16218         of attributes for a type.
16219         (Struct::Struct): Modify to take one more argument, the attribute list.
16220         (Class::Class): Ditto.
16221         (Field::Field): Ditto.
16222         (Method::Method): Ditto.
16223         (Property::Property): Ditto.
16224
16225         * cs-parser.jay (struct_declaration): Update constructor call to
16226         pass in the attributes too.
16227         (class_declaration): Ditto.
16228         (constant_declaration): Ditto.
16229         (field_declaration): Ditto.
16230         (method_header): Ditto.
16231         (fixed_parameter): Ditto.
16232         (parameter_array): Ditto.
16233         (property_declaration): Ditto.
16234
16235         * constant.cs (Constant::Constant): Update constructor similarly.
16236         Use System.Collections.
16237
16238         * parameter.cs (Parameter::Parameter): Update as above.
16239
16240 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16241
16242         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
16243         (TypeContainer.delegates): New member to hold list of delegates.
16244
16245         * cs-parser.jay (delegate_declaration): Implement the action correctly 
16246         this time as I seem to be on crack ;-)
16247
16248 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
16249
16250         * rootcontext.cs (RootContext::IsNamespace): new function, used to
16251         tell whether an identifier represents a namespace.
16252
16253         * expression.cs (NamespaceExpr): A namespace expression, used only
16254         temporarly during expression resolution.
16255         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
16256         utility functions to resolve names on expressions.
16257
16258 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
16259
16260         * codegen.cs: Add hook for StatementExpressions. 
16261
16262         * class.cs: Fix inverted test for static flag in methods.
16263
16264 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16265
16266         * class.cs (Operator::CheckUnaryOperator): Correct error number used
16267         to make it coincide with MS' number.
16268         (Operator::CheckBinaryOperator): Ditto.
16269
16270         * ../errors/errors.txt : Remove error numbers added earlier.
16271
16272         * ../errors/cs1019.cs : Test case for error # 1019
16273
16274         * ../errros/cs1020.cs : Test case for error # 1020
16275
16276         * cs-parser.jay : Clean out commented cruft.
16277         (dimension_separators, dimension_separator): Comment out. Ostensibly not
16278         used anywhere - non-reducing rule.
16279         (namespace_declarations): Non-reducing rule - comment out.
16280
16281         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
16282         with TypeContainer::AddEnum.
16283
16284         * delegate.cs : New file for delegate handling classes.
16285         (Delegate): Class for declaring delegates.
16286
16287         * makefile : Update.
16288
16289         * cs-parser.jay (delegate_declaration): Implement.
16290
16291 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
16292
16293         * class.cs (Event::Define): Implement.
16294         (Event.EventBuilder): New member.
16295
16296         * class.cs (TypeContainer::Populate): Update to define all enums and events
16297         we have.
16298         (Events): New property for the events arraylist we hold. Shouldn't we move to using
16299         readonly fields for all these cases ?
16300
16301 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16302
16303         * class.cs (Property): Revamp to use the convention of making fields readonly.
16304         Accordingly modify code elsewhere.
16305
16306         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
16307         the Define method of the Property class.
16308
16309         * class.cs : Clean up applied patch and update references to variables etc. Fix 
16310         trivial bug.
16311         (TypeContainer::Populate): Update to define all the properties we have. Also
16312         define all enumerations.
16313
16314         * enum.cs (Define): Implement.
16315
16316 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16317
16318         * cs-parser.jay (overloadable_operator): The semantic value is an
16319         enum of the Operator class.
16320         (operator_declarator): Implement actions.
16321         (operator_declaration): Implement.
16322
16323         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
16324         validity of definitions.
16325         (Operator::CheckBinaryOperator): Static method to check for binary operators
16326         (TypeContainer::AddOperator): New method to add an operator to a type.
16327
16328         * cs-parser.jay (indexer_declaration): Added line to actually call the
16329         AddIndexer method so it gets added ;-)
16330
16331         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
16332         already taken care of by the MS compiler ?  
16333
16334 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
16335
16336         * class.cs (Operator): New class for operator declarations.
16337         (Operator::OpType): Enum for the various operators.
16338
16339 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
16340
16341         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
16342         ostensibly handle this in semantic analysis.
16343
16344         * cs-parser.jay (general_catch_clause): Comment out
16345         (specific_catch_clauses, specific_catch_clause): Ditto.
16346         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
16347         (catch_args, opt_catch_args): New productions.
16348         (catch_clause): Rewrite to use the new productions above
16349         (catch_clauses): Modify accordingly.
16350         (opt_catch_clauses): New production to use in try_statement
16351         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
16352         and re-write the code in the actions to extract the specific and
16353         general catch clauses by being a little smart ;-)
16354
16355         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
16356         Hooray, try and catch statements parse fine !
16357
16358 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16359
16360         * statement.cs (Block::GetVariableType): Fix logic to extract the type
16361         string from the hashtable of variables.
16362
16363         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
16364         I end up making that mistake ;-)
16365         (catch_clauses): Fixed gross error which made Key and Value of the 
16366         DictionaryEntry the same : $1 !!
16367
16368 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16369
16370         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
16371
16372         * cs-parser.jay (event_declaration): Correct to remove the semicolon
16373         when the add and remove accessors are specified. 
16374
16375 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16376
16377         * cs-parser.jay (IndexerDeclaration): New helper class to hold
16378         information about indexer_declarator.
16379         (indexer_declarator): Implement actions.
16380         (parsing_indexer): New local boolean used to keep track of whether
16381         we are parsing indexers or properties. This is necessary because 
16382         implicit_parameters come into picture even for the get accessor in the 
16383         case of an indexer.
16384         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
16385
16386         * class.cs (Indexer): New class for indexer declarations.
16387         (TypeContainer::AddIndexer): New method to add an indexer to a type.
16388         (TypeContainer::indexers): New member to hold list of indexers for the
16389         type.
16390
16391 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
16392
16393         * cs-parser.jay (add_accessor_declaration): Implement action.
16394         (remove_accessor_declaration): Implement action.
16395         (event_accessors_declaration): Implement
16396         (variable_declarators): swap statements for first rule - trivial.
16397
16398         * class.cs (Event): New class to hold information about event
16399         declarations.
16400         (TypeContainer::AddEvent): New method to add an event to a type
16401         (TypeContainer::events): New member to hold list of events.
16402
16403         * cs-parser.jay (event_declaration): Implement actions.
16404
16405 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
16406
16407         * cs-parser.jay (dim_separators): Implement. Make it a string
16408         concatenating all the commas together, just as they appear.
16409         (opt_dim_separators): Modify accordingly
16410         (rank_specifiers): Update accordingly. Basically do the same
16411         thing - instead, collect the brackets here.
16412         (opt_rank_sepcifiers): Modify accordingly.
16413         (array_type): Modify to actually return the complete type string
16414         instead of ignoring the rank_specifiers.
16415         (expression_list): Implement to collect the expressions
16416         (variable_initializer): Implement. We make it a list of expressions
16417         essentially so that we can handle the array_initializer case neatly too.
16418         (variable_initializer_list): Implement.
16419         (array_initializer): Make it a list of variable_initializers
16420         (opt_array_initializer): Modify accordingly.
16421
16422         * expression.cs (New::NType): Add enumeration to help us
16423         keep track of whether we have an object/delegate creation
16424         or an array creation.
16425         (New:NewType, New::Rank, New::Indices, New::Initializers): New
16426         members to hold data about array creation.
16427         (New:New): Modify to update NewType
16428         (New:New): New Overloaded contructor for the array creation
16429         case.
16430
16431         * cs-parser.jay (array_creation_expression): Implement to call
16432         the overloaded New constructor.
16433
16434 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
16435
16436         * class.cs (TypeContainer::Constructors): Return member
16437         constructors instead of returning null.
16438
16439 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
16440
16441         * typemanager.cs (InitCoreTypes): Initialize the various core
16442         types after we have populated the type manager with the user
16443         defined types (this distinction will be important later while
16444         compiling corlib.dll)
16445
16446         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
16447         on Expression Classification.  Now all expressions have a method
16448         `Resolve' and a method `Emit'.
16449
16450         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
16451         generation from working.     Also add some temporary debugging
16452         code. 
16453
16454 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
16455
16456         * codegen.cs: Lots of code generation pieces.  This is only the
16457         beginning, will continue tomorrow with more touches of polish.  We
16458         handle the fundamentals of if, while, do, for, return.  Others are
16459         trickier and I need to start working on invocations soon.
16460
16461         * gen-treedump.cs: Bug fix, use s.Increment here instead of
16462         s.InitStatement. 
16463
16464         * codegen.cs (EmitContext): New struct, used during code
16465         emission to keep a context.   Most of the code generation will be
16466         here. 
16467
16468         * cs-parser.jay: Add embedded blocks to the list of statements of
16469         this block.  So code generation proceeds in a top down fashion.
16470
16471 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
16472
16473         * statement.cs: Add support for multiple child blocks.
16474
16475 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
16476
16477         * codegen.cs (EmitCode): New function, will emit the code for a
16478         Block of code given a TypeContainer and its ILGenerator. 
16479
16480         * statement.cs (Block): Standard public readonly optimization.
16481         (Block::Block constructors): Link children. 
16482         (Block::Child): Child Linker.
16483         (Block::EmitVariables): Emits IL variable declarations.
16484
16485         * class.cs: Drop support for MethodGroups here, delay until
16486         Semantic Analysis.
16487         (Method::): Applied the same simplification that I did before, and
16488         move from Properties to public readonly fields.
16489         (Method::ParameterTypes): Returns the parameter types for the
16490         function, and implements a cache that will be useful later when I
16491         do error checking and the semantic analysis on the methods is
16492         performed.
16493         (Constructor::GetCallingConvention): Renamed from CallingConvetion
16494         and made a method, optional argument tells whether this is a class
16495         or a structure to apply the `has-this' bit.
16496         (Method::GetCallingConvention): Implement, returns the calling
16497         convention. 
16498         (Method::Define): Defines the type, a second pass is performed
16499         later to populate the methods.
16500
16501         (Constructor::ParameterTypes): implement a cache similar to the
16502         one on Method::ParameterTypes, useful later when we do semantic
16503         analysis. 
16504
16505         (TypeContainer::EmitMethod):  New method.  Emits methods.
16506
16507         * expression.cs: Removed MethodGroup class from here.
16508
16509         * parameter.cs (Parameters::GetCallingConvention): new method.
16510
16511 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
16512
16513         * class.cs (TypeContainer::Populate): Drop RootContext from the
16514         argument. 
16515
16516         (Constructor::CallingConvention): Returns the calling convention.
16517         (Constructor::ParameterTypes): Returns the constructor parameter
16518         types. 
16519
16520         (TypeContainer::AddConstructor): Keep track of default constructor
16521         and the default static constructor.
16522
16523         (Constructor::) Another class that starts using `public readonly'
16524         instead of properties. 
16525
16526         (Constructor::IsDefault): Whether this is a default constructor. 
16527
16528         (Field::) use readonly public fields instead of properties also.
16529
16530         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
16531         track of static constructors;  If none is used, turn on
16532         BeforeFieldInit in the TypeAttributes. 
16533
16534         * cs-parser.jay (opt_argument_list): now the return can be null
16535         for the cases where there are no arguments. 
16536
16537         (constructor_declarator): If there is no implicit `base' or
16538         `this', then invoke the default parent constructor. 
16539
16540         * modifiers.cs (MethodAttr): New static function maps a set of
16541         modifiers flags into a MethodAttributes enum
16542         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
16543         MethodAttr, TypeAttr to represent the various mappings where the
16544         modifiers are used.
16545         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
16546
16547 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
16548
16549         * parameter.cs (GetParameterInfo): Fix bug where there would be no
16550         method arguments.
16551
16552         * interface.cs (PopulateIndexer): Implemented the code generator
16553         for interface indexers.
16554
16555 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
16556
16557         * interface.cs (InterfaceMemberBase): Now we track the new status
16558         here.  
16559
16560         (PopulateProperty): Implement property population.  Woohoo!  Got
16561         Methods and Properties going today. 
16562
16563         Removed all the properties for interfaces, and replaced them with
16564         `public readonly' fields. 
16565
16566 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
16567
16568         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
16569         initialize their hashtables/arraylists only when they are needed
16570         instead of doing this always.
16571
16572         * parameter.cs: Handle refs and out parameters.
16573
16574         * cs-parser.jay: Use an ArrayList to construct the arguments
16575         instead of the ParameterCollection, and then cast that to a
16576         Parameter[] array.
16577
16578         * parameter.cs: Drop the use of ParameterCollection and use
16579         instead arrays of Parameters.
16580
16581         (GetParameterInfo): Use the Type, not the Name when resolving
16582         types. 
16583
16584 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
16585
16586         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
16587         and instead use public readonly fields.
16588
16589         * class.cs: Put back walking code for type containers.
16590
16591 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
16592
16593         * class.cs (MakeConstant): Code to define constants.
16594
16595         * rootcontext.cs (LookupType): New function.  Used to locate types 
16596
16597
16598 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
16599
16600         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
16601         this System.Reflection code is.  Kudos to Microsoft
16602
16603         * typemanager.cs: Implement a type cache and avoid loading all
16604         types at boot time.  Wrap in LookupType the internals.  This made
16605         the compiler so much faster.  Wow.  I rule!
16606
16607         * driver.cs: Make sure we always load mscorlib first (for
16608         debugging purposes, nothing really important).
16609
16610         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
16611         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
16612
16613         * rootcontext.cs: Lookup types on their namespace;  Lookup types
16614         on namespaces that have been imported using the `using' keyword.
16615
16616         * class.cs (TypeContainer::TypeAttr): Virtualize.
16617         (Class::TypeAttr): Return attributes suitable for this bad boy.
16618         (Struct::TypeAttr): ditto.
16619         Handle nested classes.
16620         (TypeContainer::) Remove all the type visiting code, it is now
16621         replaced with the rootcontext.cs code
16622
16623         * rootcontext.cs (GetClassBases): Added support for structs. 
16624
16625 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
16626
16627         * interface.cs, statement.cs, class.cs, parameter.cs,
16628         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
16629         Drop use of TypeRefs, and use strings instead.
16630
16631 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
16632
16633         * rootcontext.cs: 
16634
16635         * class.cs (Struct::Struct): set the SEALED flags after
16636         checking the modifiers.
16637         (TypeContainer::TypeAttr): new property, returns the
16638         TypeAttributes for a class.  
16639
16640         * cs-parser.jay (type_list): Oops, list production was creating a
16641         new list of base types.
16642
16643         * rootcontext.cs (StdLib): New property.
16644         (GetInterfaceTypeByName): returns an interface by type name, and
16645         encapsulates error handling here.
16646         (GetInterfaces): simplified.
16647         (ResolveTree): Encapsulated all the tree resolution here.
16648         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
16649         types. 
16650
16651         * driver.cs: Add support for --nostdlib, to avoid loading the
16652         default assemblies.
16653         (Main): Do not put tree resolution here. 
16654
16655         * rootcontext.cs: Beginning of the class resolution.
16656
16657 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
16658
16659         * rootcontext.cs: Provide better error reporting. 
16660
16661         * cs-parser.jay (interface_base): set our $$ to be interfaces.
16662
16663         * rootcontext.cs (CreateInterface): Handle the case where there
16664         are no parent interfaces.
16665
16666         (CloseTypes): Routine to flush types at the end.
16667         (CreateInterface): Track types.
16668         (GetInterfaces): Returns an array of Types from the list of
16669         defined interfaces.
16670
16671         * typemanager.c (AddUserType): Mechanism to track user types (puts
16672         the type on the global type hash, and allows us to close it at the
16673         end). 
16674
16675 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
16676
16677         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
16678         RecordInterface instead.
16679
16680         * cs-parser.jay: Updated to reflect changes above.
16681
16682         * decl.cs (Definition): Keep track of the TypeBuilder type that
16683         represents this type here.  Not sure we will use it in the long
16684         run, but wont hurt for now.
16685
16686         * driver.cs: Smaller changes to accomodate the new code.
16687
16688         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
16689         when done. 
16690
16691         * rootcontext.cs (CreateInterface):  New method, used to create
16692         the System.TypeBuilder type for interfaces.
16693         (ResolveInterfaces): new entry point to resolve the interface
16694         hierarchy. 
16695         (CodeGen): Property, used to keep track of the code generator.
16696
16697 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
16698
16699         * cs-parser.jay: Add a second production for delegate_declaration
16700         with `VOID'.
16701
16702         (enum_body): Put an opt_comma here instead of putting it on
16703         enum_body or enum_member_declarations so we can handle trailing
16704         commas on enumeration members.  Gets rid of a shift/reduce.
16705
16706         (type_list): Need a COMMA in the middle.
16707
16708         (indexer_declaration): Tell tokenizer to recognize get/set
16709
16710         * Remove old targets.
16711
16712         * Re-add the parser target.
16713
16714 2001-07-13  Simon Cozens <simon@simon-cozens.org>
16715
16716         * cs-parser.jay: Add precendence rules for a number of operators
16717         ot reduce the number of shift/reduce conflicts in the grammar.
16718
16719 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
16720
16721         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
16722         and put it here.
16723
16724         Get rid of old crufty code.
16725
16726         * rootcontext.cs: Use this to keep track of the parsed
16727         representation and the defined types available to the program. 
16728
16729         * gen-treedump.cs: adjust for new convention.
16730
16731         * type.cs: Split out the type manager, and the assembly builder
16732         from here. 
16733
16734         * typemanager.cs: the type manager will live here now.
16735
16736         * cil-codegen.cs: And the code generator here. 
16737
16738 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
16739
16740         * makefile: Fixed up for easy making.
16741
16742 2001-07-13  Simon Cozens <simon@simon-cozens.org>
16743
16744         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
16745         the 
16746
16747         (unary_expression): Expand pre_increment_expression and
16748         post_decrement_expression to reduce a shift/reduce.
16749
16750 2001-07-11  Simon Cozens
16751
16752         * cs-tokenizer.cs: Hex numbers should begin with a 0.
16753
16754         Improve allow_keyword_as_indent name.
16755
16756 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
16757
16758         * Adjustments for Beta2. 
16759
16760 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
16761
16762         * decl.cs: Added `Define' abstract method.
16763         (InTransit): new property, used to catch recursive definitions. 
16764
16765         * interface.cs: Implement `Define'. 
16766
16767         * modifiers.cs: Map Modifiers.constants to
16768         System.Reflection.TypeAttribute flags.
16769
16770         * class.cs: Keep track of types and user-defined types.
16771         (BuilderInit): New method for creating an assembly
16772         (ResolveType): New function to launch the resolution process, only
16773         used by interfaces for now.
16774
16775         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
16776         that are inserted into the name space. 
16777
16778 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
16779
16780         * ARGH.  I have screwed up my tree so many times due to the use of
16781         rsync rather than using CVS.  Going to fix this at once. 
16782
16783         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
16784         load types.
16785
16786 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
16787
16788         * Experiment successful: Use System.Type rather that our own
16789         version of Type.  
16790
16791 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
16792
16793         * cs-parser.jay: Removed nsAliases from here.
16794
16795         Use new namespaces, handle `using XXX;' 
16796
16797         * namespace.cs: Reimplemented namespace handling, use a recursive
16798         definition of the class.  Now we can keep track of using clauses
16799         and catch invalid using clauses.
16800
16801 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
16802
16803         * gen-treedump.cs: Adapted for all the renaming.
16804
16805         * expression.cs (Expression): this class now has a Type property
16806         which returns an expression Type.
16807
16808         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
16809         `Type', as this has a different meaning now in the base
16810
16811 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
16812
16813         * interface.cs, class.cs: Removed from all the sources the
16814         references to signature computation, as we can not do method
16815         signature computation during the parsing time, as we are not
16816         trying to solve at that point distinguishing:
16817
16818         class X {
16819                 void a (Blah x) {}
16820                 void a (NS.Blah x) {}
16821         }
16822
16823         Which depending on the context might be valid or not, as we do not
16824         know if Blah is the same thing as NS.Blah at that point.
16825
16826         * Redid everything so the code uses TypeRefs now instead of
16827         Types.  TypeRefs are just temporary type placeholders, that need
16828         to be resolved.  They initially have a pointer to a string and the
16829         current scope in which they are used.  This is used later by the
16830         compiler to resolve the reference to an actual Type. 
16831
16832         * DeclSpace is no longer a CIR.Type, and neither are
16833         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
16834         are all DeclSpaces, but no Types. 
16835
16836         * type.cs (TypeRefManager): This implements the TypeRef manager,
16837         which keeps track of all the types that need to be resolved after
16838         the parsing has finished. 
16839
16840 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
16841
16842         * ARGH.  We are going to have to store `foreach' as a class rather
16843         than resolving it, as we need to verify error 1579 after name
16844         resolution.   *OR* we could keep a flag that says `This request to
16845         IEnumerator comes from a foreach statement' which we can then use
16846         to generate the error.
16847
16848 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
16849
16850         * class.cs (TypeContainer.AddMethod): we now add methods to the
16851         MethodGroup instead of the method hashtable.  
16852
16853         * expression.cs: Add MethodGroup abstraction, which gets us one
16854         step closer to the specification in the way we handle method
16855         declarations.  
16856
16857         * cs-parser.jay (primary_expression): qualified_identifier now
16858         tried to match up an identifier to a local variable reference or
16859         to a parameter reference.
16860
16861         current_local_parameters is now a parser global variable that
16862         points to the current parameters for the block, used during name
16863         lookup.
16864
16865         (property_declaration): Now creates an implicit `value' argument to
16866         the set accessor.
16867
16868 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
16869
16870         * parameter.cs: Do not use `param' arguments as part of the
16871         signature, per the spec.
16872
16873 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
16874
16875         * decl.cs: Base class for classes, structs and interfaces.  This
16876         is the "Declaration Space" 
16877
16878         * cs-parser.jay: Use CheckDef for checking declaration errors
16879         instead of having one on each function.
16880
16881         * class.cs: Factor out some code for handling error handling in
16882         accordance to the "Declarations" section in the "Basic Concepts"
16883         chapter in the ECMA C# spec.
16884
16885         * interface.cs: Make all interface member classes derive from
16886         InterfaceMemberBase.
16887
16888 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
16889
16890         * Many things: all interfaces are parsed and generated in
16891         gen-treedump.  Support for member variables, constructors,
16892         destructors, properties, constants is there.
16893
16894         Beginning of the IL backend, but very little done, just there for
16895         testing purposes. 
16896
16897 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
16898
16899         * cs-parser.jay: Fix labeled statement.
16900
16901         * cs-tokenizer.cs (escape): Escape " and ' always.
16902         ref_line, ref_name: keep track of the line/filename as instructed
16903         by #line by the compiler.
16904         Parse #line.
16905
16906 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
16907
16908         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
16909         to match the values in System.CodeDOM.
16910
16911         Divid renamed to Divide.
16912
16913         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
16914         statements. 
16915         (Statements.set): remove.
16916
16917         * System.CodeDOM/CodeCatchClause.cs: always have a valid
16918         statements. 
16919
16920         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
16921         falseStatements always have valid values. 
16922
16923         * cs-parser.jay: Use System.CodeDOM now.
16924