2004-10-04 Juraj Skripsky <js@hotfeet.ch>
[mono.git] / mcs / mcs / ChangeLog
1 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2
3         * namespace.cs (NamespaceEntry.Using): No matter which warning
4         level is set, check if this namespace name has already been added.
5
6 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7
8         * expression.cs: reftype [!=]= null should always use br[true,false].
9         # 67410
10
11 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
12
13         Fix #67108
14         * attribute.cs: Enum conversion moved to 
15         GetAttributeArgumentExpression to be applied to the all
16         expressions.
17
18 2004-10-01  Raja R Harinath  <rharinath@novell.com>
19
20         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
21         * class.c (TypeContainer.DefineType): Flag error if
22         base types aren't accessible due to access permissions.
23         * decl.cs (DeclSpace.ResolveType): Move logic to
24         Expression.ResolveAsTypeTerminal.
25         (DeclSpace.ResolveTypeExpr): Thin layer over
26         Expression.ResolveAsTypeTerminal.
27         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
28         Refactor code into NestedAccess.  Use it.
29         (DeclSpace.NestedAccess): New.
30         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
31         argument to silence errors.  Check access permissions.
32         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
33         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
34         (Cast.DoResolve): Likewise.
35         (New.DoResolve): Likewise.
36         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
37         (TypeOf.DoResolve): Likewise.
38
39         * expression.cs (Invocation.BetterConversion): Return the Type of
40         the better conversion.  Implement section 14.4.2.3 more faithfully.
41         (Invocation.BetterFunction): Make boolean.  Make correspondence to
42         section 14.4.2.2 explicit.
43         (Invocation.OverloadResolve): Update.
44         (Invocation): Remove is_base field.
45         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
46         (Invocation.Emit): Likewise.
47
48 2004-09-27  Raja R Harinath  <rharinath@novell.com>
49
50         * README: Update to changes.
51
52 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
53
54         * cs-parser.jay: Reverted 642 warning fix.
55
56 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
57
58         Fix bug #66615
59         * decl.cs (FindMemberWithSameName): Indexer can have more than
60         1 argument.
61
62 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
63
64         * expression.cs (LocalVariableReference.DoResolveLValue):
65         Do not report warning 219 for out values.
66         (EmptyExpression.Null): New member to avoid extra allocations.
67
68 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
69
70         * cs-parser.jay: Fix wrong warning 642 report.
71
72         * cs-tokenizer.cs (CheckNextToken): New helper;
73         Inspect next character if is same as expected.
74
75 2004-09-23  Martin Baulig  <martin@ximian.com>
76
77         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
78         (Convert.ImplicitReferenceConversionExists): Likewise.
79
80 2004-09-23  Martin Baulig  <martin@ximian.com>
81
82         Merged latest changes into gmcs.  Please keep this comment in
83         here, it makes it easier for me to see what changed in MCS since
84         the last time I merged.
85
86 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
87
88         * class.cs (Operator.Define): Add error 448 and 559 report.
89
90 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
91
92         * class.cs (MemberBase.IsTypePermitted): New protected
93         method for checking error CS0610.
94
95 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
96
97         * class.cs (TypeContainer.HasExplicitLayout): New property
98         Returns whether container has StructLayout attribute set Explicit.
99         (FieldMember): New abstract class for consts and fields.
100         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
101         (Field): Reuse FieldMember.
102
103         * const.cs (Const): Reuse FieldMember.
104
105         * rootcontext.cs: EmitConstants call moved to class.
106
107 2004-09-22  Martin Baulig  <martin@ximian.com>
108
109         Thanks to Peter Sestoft for this bug report.
110
111         * expression.cs (Conditional): If both the `trueExpr' and the
112         `falseExpr' is a NullLiteral, return a NullLiteral.
113
114 2004-09-22  Martin Baulig  <martin@ximian.com>
115
116         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
117         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
118         for the "get_Current" call.
119
120 2004-09-22  Martin Baulig  <martin@ximian.com>
121
122         Marek and me just fixed one of our oldest bugs: #28562 :-)
123
124         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
125
126         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
127         we're an EnumConstant, just return that.
128         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
129         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
130         to get the value which'll actually be written into the attribute.
131         However, we have to use GetValue() to access the attribute's value
132         in the compiler.        
133
134 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
135
136         * constant.cs (Constant.IsNegative): New abstract property
137         IsNegative.
138
139         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
140         (StackAlloc.DoResolve): Reused IsNegative.
141
142 2004-09-21  Martin Baulig  <martin@ximian.com>
143
144         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
145         if we're used in an iterator, we may be called from different
146         methods.
147
148         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
149         we actually have an exception block.
150
151 2004-09-20  John Luke <jluke@cfl.rr.com>
152
153         * class.cs, cs-parser.jay: Improve the error report for 1520:
154         report the actual line where the error happens, not where the
155         class was declared.
156
157         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
158         Pass location information that was available elsewhere.
159
160 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
161
162         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
163         runtime to delay sign assemblies.
164
165 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
166
167         * cs-parser.jay: Do not report the stack trace, this is barely
168         used nowadays.
169
170 2004-08-22  John Luke  <john.luke@gmail.com>
171  
172         * driver.cs : check that a resource id is not already used
173         before adding it, report CS1508 if it is, bug #63637
174
175 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
176
177         * ecore.cs: Removed dead code.
178
179 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
180
181         * class.cs: Do not report warning CS0067 on the interfaces.
182
183 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
184
185         * cs-parser.jay: Add error 504 report.
186
187 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
188
189         * rootcontext.cs: WarningLevel is 4 by default now.
190
191         * statement.cs (Fixed.Resolve): Do not null
192         VariableInfo.
193
194 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
195
196         Fixed bug #55780
197         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
198         deep search when property is not virtual.
199         (PropertyExpr.ResolveAccessors): Make one call for both
200         accessors.
201
202 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
203
204         Fixed bug #65766
205         * statement.cs: Error 152 report constains also location.
206
207 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
208
209         Fixed bug #65766
210         * const.cs: Explicitly set constant as static.
211
212 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
213
214         Fixed bug #64226
215         * cs-parser.jay: Add error 1017 report.
216
217 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
218
219         Fixed bug #59980, #64224
220         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
221
222         * typemanager.cs (IsSpecialMethod): Simplified
223
224 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
225
226         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
227         condition with better params.
228
229 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
230
231         Fixed bug #65238
232         * attribute.cs (Resolve): Property has to have both
233         accessors.
234
235 2004-09-14  Martin Baulig  <martin@ximian.com>
236
237         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
238
239 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
240
241         Fixed bug #61902
242         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
243         called and is obsolete then this member suppress message
244         when call is inside next [Obsolete] method or type.
245
246         * expression.cs: Use TestObsoleteMethodUsage member.
247
248 2004-09-14  Martin Baulig  <martin@ximian.com>
249
250         * cs-parser.jay: Sync a bit with the GMCS version.
251
252 2004-09-14  Martin Baulig  <martin@ximian.com>
253
254         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
255         (CSharpParser.yacc_verbose_flag): New public field.
256
257         * genericparser.cs: Removed.
258
259 2004-09-14  Raja R Harinath  <rharinath@novell.com>
260
261         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
262
263 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
264
265         * class.cs (MethodCore.CheckBase): Fix bug #65757.
266
267 2004-09-10  Martin Baulig  <martin@ximian.com>
268
269         Backported my MemberName changes from GMCS into MCS.
270
271         - we are now using a special `MemberName' class instead of using
272         strings; in GMCS, the `MemberName' also contains the type
273         arguments.
274
275         - changed the grammar rules a bit:
276           * the old `member_name' is now a `namespace_or_type_name':
277             The rule is that we use `namespace_or_type_name' everywhere
278             where we expect either a "member name" (GetEnumerator) or a
279             "member name" with an explicit interface name
280             (IEnumerable.GetEnumerator).
281             In GMCS, the explicit interface name may include type arguments
282             (IEnumerable<T>.GetEnumerator).
283           * we use `member_name' instead of just `IDENTIFIER' for
284             "member names":
285             The rule is that we use `member_name' wherever a member may
286             have type parameters in GMCS.       
287
288         * decl.cs (MemberName): New public class.
289         (MemberCore.MemberName): New public readonly field.
290         (MemberCore.ctor): Take a `MemberName' argument, not a string.
291         (DeclSpace): Likewise.
292
293         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
294         * enum.cs (Enum.ctor): Likewise.
295
296         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
297         MemberName.     
298         (AliasEntry.ctor): Take a MemberName, not an Expression.
299         (AliasEntry.UsingAlias): Likewise.
300
301         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
302         (IMethodData.MemberName): Changed type from string to MemberName.
303         (MemberBase.ExplicitInterfaceName): Likewise.
304         (AbstractPropertyEventMethod.SetupName): Make this private.
305         (AbstractPropertyEventMethod.ctor): Added `string prefix'
306         argument; compute the member name here.
307         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
308         on the `member.MemberName' and the `prefix'.
309
310         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
311         not `type_name'.
312         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
313         thus, we get a `MemberName' instead of a `string'.  These
314         declarations may have type parameters in GMCS.
315         (interface_method_declaration, delegate_declaration): Likewise.
316         (class_declaration, interface_declaration): Likewise.
317         (method_header): Use `namespace_or_type_name' instead of
318         `member_name'.  We may be an explicit interface implementation.
319         (property_declaration, event_declaration): Likewise.
320         (member_name): This is now just an `IDENTIFIER', not a
321         `namespace_or_type_name'.
322         (type_name, interface_type): Removed.
323         (namespace_or_type_name): Return a MemberName, not an Expression.
324         (primary_expression): Use `member_name' instead of `IDENTIFIER';
325         call GetTypeExpression() on the MemberName to get an expression.
326         (IndexerDeclaration.interface_type): Changed type from string to
327         MemberName.
328         (MakeName): Operate on MemberName's instead of string's.
329
330 2004-09-13  Raja R Harinath  <rharinath@novell.com>
331
332         Fix bug #55770.
333         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
334         (NamespaceEntry.Lookup): Add new argument to flag if we want the
335         lookup to avoid symbols introduced by 'using'.
336         * rootcontext.cs (NamespaceLookup): Update.
337
338 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
339
340         * class.cs (TypeContainer.DoDefineMembers): Do not call
341         DefineDefaultConstructor for static classes.
342
343 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
344
345         * attribute.cs (Attribute.Resolve): Add error 653 report.
346
347         * class.cs (Class.ApplyAttributeBuilder): Add error 641
348         report.
349         (Method.ApplyAttributeBuilder): Add error 685 report.
350         (Operator.Define): Add error 564 report.
351
352         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
353
354         * expression.cs (Invocation.DoResolve): Add error
355         245 and 250 report.
356
357         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
358         error 674 report.
359
360 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
361
362         * class.cs (ConstructorInitializer.Resolve):
363         Wrong error number (515->516).
364
365 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
366
367         * class.cs (Indexer.Define): Add error 631 report.
368
369 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
370
371         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
372
373 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
374
375         * expression.cs (Probe.DoResolve): Add error CS0241 report.
376
377 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
378
379         * cs-parser.jay: Added error CS0241 report.
380
381 2004-09-10  Raja R Harinath  <rharinath@novell.com>
382
383         * cs-parser.jay (fixed_statement): Introduce a scope for the
384         declaration in the 'fixed' statement.
385
386 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
387
388         * cs-parser.jay: Added CS0230 error report.
389
390 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
391
392         * cs-parser.jay: Added errors CS0231 and CS0257 report.
393
394 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
395
396         * expression.cs (Argument.Resolve): Added error CS0192 and
397         CS0199 report.
398
399 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
400
401         C# 2.0 #pragma warning feature
402
403         * cs-tokenizer.cs (PreProcessPragma): New method; 
404         Handles #pragma directive.
405
406         * report.cs (WarningRegions): New class; Support
407         class for #pragma warning directive. It tests whether
408         warning is enabled for a given line.
409
410 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
411
412         * const.cs: Add more descriptive error report, tahnks to
413         Sebastien. 
414
415 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
416
417         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
418
419 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
420
421         * expression.cs: Apply patch from Ben: Remove dead code from
422         ArrayCreation, and remove the TurnintoConstant call in const.cs,
423         as that code just threw an exception anwyays.
424
425         * const.cs: Remove the call to the turnintoconstant, for details
426         see bug: #63144
427         
428         * literal.cs: The type of the null-literal is the null type;  So
429         we use a placeholder type (literal.cs:System.Null, defined here)
430         for it.
431
432         * expression.cs (Conditional.DoResolve): Remove some old code that
433         is no longer needed, conversions have been fixed.
434
435         (ArrayCreationExpression.DoResolve): Return false if we fail to
436         resolve the inner expression.
437
438 2004-09-07  Raja R Harinath  <rharinath@novell.com>
439
440         Fix test-290.cs.
441         * cs-parser.jay (delegate_declaration): Record a delegate
442         declaration as a type declaration.
443         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
444
445 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
446
447         * parameter.cs: Do not crash if the type can not be resolved. 
448
449         * expression.cs: Report errors with unsafe pointers, fixes #64896
450
451 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
452
453         * expression.cs: Pointer arith always needs to do a conv.i
454         if the operand is a long. fix 65320
455
456 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
457
458         Fixed cs0619-37.cs, cs0619-38.cs
459
460         * enum.cs (GetObsoleteAttribute): Removed.
461
462         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
463         on Enum member is double staged. The first is tested member
464         and then enum.
465
466 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
467
468         Fixed #56986, #63631, #65231
469
470         * class.cs: (TypeContainer.AddToMemberContainer): New method,
471         adds member to name container.
472         (TypeContainer.AddToTypeContainer): New method, adds type to
473         name container.
474         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
475         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
476         AddOperator): Simplified by reusing AddToMemberContainer.
477         (TypeContainer.UserDefinedStaticConstructor): Changed to property
478         instead of field.
479         (Method.CheckForDuplications): Fixed implementation to test all
480         possibilities.
481         (MemberBase): Detection whether member is explicit interface
482         implementation is now in constructor.
483         (MemberBase.UpdateMemberName): Handles IndexerName.
484         (Accessor): Changed to keep also location information.
485         (AbstractPropertyEventMethod): Is derived from MemberCore.
486         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
487         will be emited or not.
488         (PropertyBase.AreAccessorsDuplicateImplementation):
489         Tests whether accessors are not in collision with some method.
490         (Operator): Is derived from MethodCore to simplify common
491         operations.
492
493         * decl.cs (Flags.TestMethodDuplication): Test for duplication
494         must be performed.
495         (DeclSpace.AddToContainer): Adds the member to defined_names
496         table. It tests for duplications and enclosing name conflicts.
497
498         * enum.cs (EnumMember): Clean up to reuse the base structures
499
500 2004-09-03  Martin Baulig  <martin@ximian.com>
501
502         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
503         into TypeContainer, to make partial classes work again.
504
505 2004-09-03  Martin Baulig  <martin@ximian.com>
506
507         * rootcontext.cs (RootContext.V2): Removed.
508
509 2004-03-23  Martin Baulig  <martin@ximian.com>
510
511         * expression.cs (Invocation.OverloadResolve): Added `bool
512         may_fail' argument and use it instead of the Location.IsNull() hack.
513
514 2004-09-03  Martin Baulig  <martin@ximian.com>
515
516         Merged latest changes into gmcs.  Please keep this comment in
517         here, it makes it easier for me to see what changed in MCS since
518         the last time I merged.
519
520 2004-09-03  Raja R Harinath  <rharinath@novell.com>
521
522         Fix #61128.
523         * expression.cs (BetterConversion): Don't allow either conversion 
524         to be null.  Remove redundant implicit conversion test when 'q ==
525         null' -- when this function is invoked, we already know that the
526         implicit conversion exists.
527         (BetterFunction): Assume that 'best' is non-null.  Remove
528         redundant reimplementation of IsApplicable when 'best' is null.
529         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
530         number of arguments.
531         (IsAncestralType): Extract from OverloadResolve.
532         (OverloadResolve): Make robust to the MethodGroupExpr being
533         unsorted.  Implement all the logic of Section 14.5.5.1, and
534         support overloading of methods from multiple applicable types.
535         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
536
537         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
538         (RealError, Warning): Append type of report to related symbol.
539
540 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
541
542         * enum.cs: Fixed CLS-Compliance checks for enum members.
543         Error tests cs3008-8.cs, cs3014-8.cs
544
545 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
546
547         Fixed bug #62342, #63102
548         * class.cs: ImplementIndexer uses member.IsExplicitImpl
549         like ImplementMethod.
550
551 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
552
553         * attribute.cs (Attribute.GetAttributeArgumentExpression):
554         Fixed bug #65170.
555
556 2004-09-02  Martin Baulig  <martin@ximian.com>
557
558         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
559         TypeManager.GetArgumentTypes() rather than calling GetParameters()
560         on the MethodBase.
561
562 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
563
564         C# 2.0 Static classes implemented
565
566         * class.cs (TypeContainer): instance_constructors,
567         initialized_fields, initialized_static_fields,
568         default_constructor, base_inteface_types are protected to be
569         accessible from StaticClass.
570         (TypeContainer.DefineDefaultConstructor): New virtual method
571         for custom default constructor generating
572         (StaticClass): New class to handle "Static classes" feature.
573
574         * cs-parser.jay: Handle static keyword on class like instance
575         of StaticClass.
576
577         * driver.cs: Added "/langversion" command line switch with two
578         options (iso-1, default).
579
580 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
581
582         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
583
584 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
585
586         * delegate.cs: Style.
587
588 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
589
590         * delegate.cs: Add seperate instance expr field for miguel.
591
592 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
593
594         * PointerArithmetic (Resolve): make sure we are not doing
595         pointer arith on void*. Also, make sure we are resolved
596         by not setting eclass until resolve.
597
598         All callers: Make sure that PointerArithmetic gets resolved.
599
600 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
601
602         * ArrayCreation (LookupType): If the type does not resolve 
603         to an array, give an error.
604
605 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
606
607         * statement.cs (Try.Resolve): Fixed bug #64222
608
609 2004-08-27  Martin Baulig  <martin@ximian.com>
610
611         * class.cs
612         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
613         crash here.     
614
615 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
616
617         * ecore.cs (Constantify): Get underlying type via
618         System.Enum.GetUnderlyingType to avoid StackOverflow on the
619         Windows in special cases.
620
621 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
622
623         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
624         for obtaining also private methods.
625         (GetRemoveMethod): Used GetRemoveMethod (true)
626         for obtaining also private methods.
627
628 2004-08-24  Martin Baulig  <martin@ximian.com>
629
630         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
631         MethodAttributes.HideBySig for operators.
632
633 2004-08-23  Martin Baulig  <martin@ximian.com>
634
635         Back to the old error reporting system :-)
636
637         * report.cs (Message): Removed.
638         (Report.MessageData, ErrorData, WarningData): Removed.
639         (Report.Error, Warning): Back to the old system.
640
641 2004-08-23  Martin Baulig  <martin@ximian.com>
642
643         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
644
645         * class.cs (TypeContainer.ParentContainer): New public virtual
646         method; replaces the explicit interface implementation.
647         (ClassPart.ParentContainer): Override.
648
649 2004-08-23  Martin Baulig  <martin@ximian.com>
650
651         * statement.cs (Switch): Added support for constant switches; see
652         #59428 or test-285.cs.
653
654 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
655
656         Fixed bug #62740.
657         * statement.cs (GetEnumeratorFilter): Removed useless
658         logic because C# specs is strict. GetEnumerator must be
659         public.
660
661 2004-08-22  Martin Baulig  <martin@ximian.com>
662
663         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
664         a switch and may break, reset the barrier.  Fixes #59867.
665
666 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
667
668         CLS-Compliance speed up (~5% for corlib)
669
670         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
671         New method. Tests container for CLS-Compliant names
672
673         * class.cs (TypeContainer.VerifyClsName): New method.
674         Checks whether container name is CLS Compliant.
675         (Constructor): Implements IMethodData.
676
677         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
678         low-case table for CLS Compliance test.
679         (MemberCache.VerifyClsParameterConflict): New method.
680         Checks method parameters for CS3006 error.
681
682         * enum.cs (EnumMember): Is derived from MemberCore.
683         (Enum.VerifyClsName): Optimized for better performance.
684
685 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
686
687         * report.cs: Renamed Error_T to Error and changed all
688         references.
689
690 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
691
692         * class.cs (TypeContainer.IndexerArrayList): New inner class
693         container for indexers.
694         (TypeContainer.DefaultIndexerName): New constant for default
695         indexer name. Replaced all "Item" with this constant.
696         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
697
698         * typemanager.cs (TypeManager.default_member_ctor): Cache here
699         DefaultMemberAttribute constructor.
700
701 2004-08-05  Martin Baulig  <martin@ximian.com>
702
703         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
704         Fix bug #59429.
705
706 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
707
708         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
709         multi platforms problem.
710
711         * compiler.csproj: Included shared files.
712
713 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
714
715         Fix bug 60333, 55971 in the more general way
716         * attribute.cs (Attribute.GetAttributeArgumentExpression):
717         Added arg_type argument for constant conversion.
718         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
719
720 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
721
722         Fix bug #59760
723         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
724         OperatorArrayList, MethodCoreArrayList for typecontainer
725         containers. Changed class member types to these new types.
726         (MethodArrayList.DefineMembers): Added test for CS0659.
727
728 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
729
730         * cfold.cs: Synchronize the folding with the code in expression.cs
731         Binary.DoNumericPromotions for uint operands.
732
733         * attribute.cs: Revert patch from Raja, it introduced a regression
734         while building Blam-1.2.1 (hard to isolate a test case).
735
736 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
737
738         Fix for #55382
739         * class.cs:
740         (TypeContainer.Define): Renamed to DefineContainerMembers because of
741         name collision.
742         (MethodCore.parent_method): New member. The method we're overriding
743         if this is an override method.
744         (MethodCore.CheckBase): Moved from Method class and made common.
745         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
746         private.
747         (MethodCore.CheckForDuplications): New abstract method. For custom
748         member duplication search in a container
749         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
750         method and its return type.
751         (Event.conflict_symbol): New member. Symbol with same name in the
752         parent class.
753
754         * decl.cs:
755         (MemberCache.FindMemberWithSameName): New method. The method
756         is looking for conflict with inherited symbols.
757
758 2004-08-04  Martin Baulig  <martin@ximian.com>
759
760         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
761
762         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
763
764 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
765
766         * report.cs (Message): New enum for better error, warning reference in
767         the code.
768         (MessageData): New inner abstract class. It generally handles printing of
769         error and warning messages.
770         Removed unused Error, Warning, Message methods.
771
772 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
773
774         Fix for cs0592-8.cs test
775         * attribute.cs
776         (Attributable.ValidAttributeTargets): Made public.
777         (Attribute.ExplicitTarget): New member for explicit target value.
778         (Attribute.CheckTargets): Now we translate explicit attribute
779         target to Target here.
780
781 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
782
783         * ecore.cs (MethodGroupExpr): new IsBase property.
784
785         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
786
787         * delegate.cs (DelegateCreation): store a MethodGroupExpr
788         rather than an instance expr.
789
790         (DelegateCreation.Emit): Use the method group rather than
791         the instance expression. Also, if you have base.Foo as the
792         method for a delegate, make sure to emit ldftn, not ldftnvirt.
793
794         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
795
796         (NewDelegate.DoResolve): Only check for the existance of Invoke
797         if the method is going to be needed. Use MethodGroupExpr.
798
799         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
800
801         * expression.cs: For pointer arith., make sure to use
802         the size of the type, not the size of the pointer to
803         the type.
804
805 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
806
807         Fix for #60722
808         * class.cs (Class): Added error CS0502 test.
809
810 2004-08-03  John Luke  <jluke@cfl.rr.com>
811             Raja R Harinath  <rharinath@novell.com>
812
813         Fix for #60997.
814         * attribute.cs (Attribute.complained_before): New flag.
815         (Attribute.ResolveType, Attribute.Resolve),
816         (Attribute.DefinePInvokeMethod): Set it.
817         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
818         
819 2004-08-03  Martin Baulig  <martin@ximian.com>
820
821         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
822         use a user-defined operator; we still need to do numeric
823         promotions in case one argument is a builtin type and the other
824         one has an implicit conversion to that type.  Fixes #62322.
825
826 2004-08-02  Martin Baulig  <martin@ximian.com>
827
828         * statement.cs (LocalInfo.Flags): Added `IsThis'.
829         (LocalInfo.IsThis): New public property.
830         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
831
832 2004-08-01  Martin Baulig  <martin@ximian.com>
833
834         * class.cs (TypeContainer.GetClassBases): Don't set the default
835         here since we may get called from GetPartialBases().
836         (TypeContainer.DefineType): If GetClassBases() didn't return a
837         parent, use the default one.
838
839 2004-07-30  Duncan Mak  <duncan@ximian.com>
840
841         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
842
843 2004-07-30  Martin Baulig  <martin@ximian.com>
844
845         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
846
847         * class.cs (SourceMethod): New public class, derive from the
848         symbol writer's ISourceMethod.
849         (Method): Use the new symbol writer API.
850
851         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
852         as argument and use the new symbol writer.
853
854         * location.cs
855         (SourceFile): Implement the symbol writer's ISourceFile.
856         (Location.SymbolDocument): Removed.
857         (Location.SourceFile): New public property.
858
859         * symbolwriter.cs: Use the new symbol writer API.
860
861 2004-07-30  Raja R Harinath  <rharinath@novell.com>
862
863         * Makefile (install-local): Remove.  Functionality moved to
864         executable.make.
865
866 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
867
868         * Makefile: Install mcs.exe.config file together with mcs.exe.
869         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
870         correct runtime version.
871         
872 2004-07-25  Martin Baulig  <martin@ximian.com>
873
874         * class.cs
875         (TypeContainer.RegisterOrder): Removed, this was unused.
876         (TypeContainer, interface_order): Removed.
877         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
878         TypeContainer as argument since we can also be called with a
879         `PartialContainer' for a partial class/struct/interface.
880         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
881         of checking whether we're an `Interface' - we could be a
882         `PartialContainer'.
883         (PartialContainer.Register): Override; call
884         AddClass()/AddStruct()/AddInterface() on our parent.
885
886         * cs-parser.jay (interface_member_declaration): Add things to the
887         `current_container', not the `current_class'.
888
889         * rootcontext.cs (RegisterOrder): The overloaded version which
890         takes an `Interface' was unused, removed.
891
892         * typemanager.cs (TypeManager.LookupInterface): Return a
893         `TypeContainer', not an `Interface'.
894         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
895         contain a `PartialContainer' for an interface, so check it's
896         `Kind' to figure out what it is.
897
898 2004-07-25  Martin Baulig  <martin@ximian.com>
899
900         * class.cs (Class.DefaultTypeAttributes): New public constant.
901         (Struct.DefaultTypeAttributes): Likewise.
902         (Interface.DefaultTypeAttributes): Likewise.
903         (PartialContainer.TypeAttr): Override this and add the
904         DefaultTypeAttributes.
905
906 2004-07-25  Martin Baulig  <martin@ximian.com>
907
908         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
909         we can just use the `Parent' field instead.
910
911 2004-07-25  Martin Baulig  <martin@ximian.com>
912
913         * class.cs (TypeContainer.Emit): Renamed to EmitType().
914
915 2004-07-25  Martin Baulig  <martin@ximian.com>
916
917         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
918         our parts before defining any methods.
919         (TypeContainer.VerifyImplements): Make this virtual.
920         (ClassPart.VerifyImplements): Override and call VerifyImplements()
921         on our PartialContainer.
922
923 2004-07-25  Martin Baulig  <martin@ximian.com>
924
925         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
926
927         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
928         argument, we can just use the `Parent' field instead.
929
930         * class.cs
931         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
932         (MemberBase.DoDefine): Likewise.
933
934 2004-07-24  Martin Baulig  <martin@ximian.com>
935
936         * decl.cs (MemberCore.Parent): New public field.
937         (DeclSpace.Parent): Moved to MemberCore.
938
939         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
940         (MemberBase.ctor): Added TypeContainer argument, pass it to our
941         parent's .ctor.
942         (FieldBase, Field, Operator): Likewise.
943         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
944         (EventField, Event): Likewise.
945
946 2004-07-23  Martin Baulig  <martin@ximian.com>
947
948         * class.cs (PartialContainer): New public class.
949         (ClassPart): New public class.
950         (TypeContainer): Added support for partial classes.
951         (TypeContainer.GetClassBases): Splitted some of the functionality
952         out into GetNormalBases() and GetPartialBases().
953
954         * cs-tokenizer.cs (Token.PARTIAL): New token.
955         (Tokenizer.consume_identifier): Added some hacks to recognize
956         `partial', but only if it's immediately followed by `class',
957         `struct' or `interface'.
958
959         * cs-parser.jay: Added support for partial clases.
960
961 2004-07-23  Martin Baulig  <martin@ximian.com>
962
963         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
964         a `DeclSpace' and also made it readonly.
965         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
966         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
967         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
968
969         * cs-parser.jay: Pass the `current_class', not the
970         `current_container' (at the moment, this is still the same thing)
971         to a new Method, Property, Event, Indexer or Constructor.
972
973 2004-07-23  Martin Baulig  <martin@ximian.com>
974
975         * cs-parser.jay (CSharpParser): Added a new `current_class' field
976         and removed the `current_interface' one.
977         (struct_declaration, class_declaration, interface_declaration):
978         Set `current_class' to the newly created class/struct/interface;
979         set their `Bases' and call Register() before parsing their body.
980
981 2004-07-23  Martin Baulig  <martin@ximian.com>
982
983         * class.cs (Kind): New public enum.
984         (TypeContainer): Made this class abstract.
985         (TypeContainer.Kind): New public readonly field.
986         (TypeContainer.CheckDef): New public method; moved here from
987         cs-parser.jay.
988         (TypeContainer.Register): New public abstract method.
989         (TypeContainer.GetPendingImplementations): New public abstract
990         method.
991         (TypeContainer.GetClassBases): Removed the `is_class' and
992         `is_iface' parameters.
993         (TypeContainer.DefineNestedTypes): Formerly known as
994         DoDefineType().
995         (ClassOrStruct): Made this class abstract.
996
997         * tree.cs (RootTypes): New public type. 
998
999 2004-07-20  Martin Baulig  <martin@ximian.com>
1000
1001         * tree.cs (Tree.RecordNamespace): Removed.
1002         (Tree.Namespaces): Removed.
1003
1004         * rootcontext.cs (RootContext.IsNamespace): Removed.
1005
1006         * cs-parser.jay (namespace_declaration): Just create a new
1007         NamespaceEntry here.
1008
1009 2004-07-20  Martin Baulig  <martin@ximian.com>
1010
1011         * statement.cs (ExceptionStatement): New abstract class.  This is
1012         now used as a base class for everyone who's using `finally'.
1013         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
1014         our local variables before using them.
1015
1016         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
1017         virtual method.  This is used by Yield.Resolve() to "steal" an
1018         outer block's `finally' clauses.
1019         (FlowBranchingException): The .ctor now takes an ExceptionStatement
1020         argument.
1021
1022         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
1023         version which takes an ExceptionStatement.  This version must be
1024         used to create exception branchings.
1025
1026         * iterator.cs
1027         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
1028         (Iterator.EmitMoveNext): Added exception support; protect the
1029         block with a `fault' clause, properly handle 'finally' clauses.
1030         (Iterator.EmitDispose): Run all the `finally' clauses here.
1031
1032 2004-07-20  Martin Baulig  <martin@ximian.com>
1033
1034         * iterator.cs: This is the first of a set of changes in the
1035         iterator code.  Match the spec more closely: if we're an
1036         IEnumerable, then GetEnumerator() must be called.  The first time
1037         GetEnumerator() is called, it returns the current instance; all
1038         subsequent invocations (if any) must create a copy.
1039
1040 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
1041
1042         * expression.cs: Resolve the constant expression before returning
1043         it. 
1044
1045 2004-07-19  Martin Baulig  <martin@ximian.com>
1046
1047         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
1048         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
1049         the return type of the new EmitContext.
1050
1051 2004-07-18  Martin Baulig  <martin@ximian.com>
1052
1053         * class.cs (Property.Define): Fix iterators.
1054
1055         * iterators.cs (Iterator.Define): Moved the
1056         `container.AddInterator (this)' call here from the .ctor; only do
1057         it if we resolved successfully.
1058
1059 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
1060
1061         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
1062         `true' for preprocessing directives that we parse.  The return
1063         value indicates whether we should return to regular tokenizing or
1064         not, not whether it was parsed successfully.
1065
1066         In the past if we were in: #if false ... #line #endif, we would
1067         resume parsing after `#line'.  See bug 61604.
1068
1069         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
1070         building: IsEnumType should return true only for enums, not for
1071         enums or System.Enum itself.  This fixes #61593.
1072
1073         Likely what happened is that corlib was wrong: mcs depended on
1074         this bug in some places.  The bug got fixed, we had to add the
1075         hack, which caused bug 61593.
1076
1077         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
1078         that was a workaround for the older conditions.
1079
1080 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
1081
1082         * assign.cs: IAssignMethod has a new interface, as documented
1083         inline. All assignment code now uses this new api.
1084
1085         * ecore.cs, expression.cs: All classes which implement
1086         IAssignMethod now use the new interface.
1087
1088         * expression.cs (Invocation): add a hack to EmitCall so that
1089         IndexerAccess can be the target of a compound assignment without
1090         evaluating its arguments twice.
1091
1092         * statement.cs: Handle changes in Invocation api.
1093
1094 2004-07-16  Martin Baulig  <martin@ximian.com>
1095
1096         * iterators.cs: Rewrote this.  We're now using one single Proxy
1097         class for both the IEnumerable and the IEnumerator interface and
1098         `Iterator' derives from Class so we can use the high-level API.
1099
1100         * class.cs (TypeContainer.AddIterator): New method.
1101         (TypeContainer.DoDefineType): New protected virtual method, which
1102         is called from DefineType().
1103         (TypeContainer.DoDefineMembers): Call DefineType() and
1104         DefineMembers() on all our iterators.
1105         (TypeContainer.Emit): Call Emit() on all our iterators.
1106         (TypeContainer.CloseType): Call CloseType() on all our iterators.
1107
1108         * codegen.cs (EmitContext.CurrentIterator): New public field.
1109
1110 2004-07-15  Martin Baulig  <martin@ximian.com>
1111
1112         * typemanager.cs
1113         (TypeManager.not_supported_exception_type): New type.   
1114
1115 2004-07-14  Martin Baulig  <martin@ximian.com>
1116
1117         * iterators.cs: Use real error numbers.
1118
1119 2004-07-14  Martin Baulig  <martin@ximian.com>
1120
1121         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
1122         requires this to be a System.Collection.IEnumerable and not a
1123         class implementing that interface.
1124         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
1125
1126 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
1127
1128         * class.cs: Fixed previous fix, it broke some error tests.
1129
1130 2004-07-12  Martin Baulig  <martin@ximian.com>
1131
1132         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
1133         Fixes #61293.
1134
1135 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
1136
1137         * assign.cs (LocalTemporary): Add new argument: is_address,If
1138         `is_address' is true, then the value that we store is the address
1139         to the real value, and not the value itself.
1140         
1141         * ecore.cs (PropertyExpr): use the new local temporary
1142         stuff to allow us to handle X.Y += z (where X is a struct)
1143
1144 2004-07-08  Martin Baulig  <martin@ximian.com>
1145
1146         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
1147         not always return, just like we're doing in Using.Resolve().
1148
1149 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
1150
1151         * cs-parser.jay (fixed_statement): flag this as Pinned.
1152
1153 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
1154
1155         * typemanager.cs (TypeManager): Removed MakePinned method, this
1156         mechanism is replaced with the .NET 2.x compatible mechanism of
1157         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
1158
1159         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
1160         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
1161         `IsFixed' property which has a different meaning.
1162
1163 2004-07-02  Raja R Harinath  <rharinath@novell.com>
1164
1165         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
1166         visible from inside a nested class, not just the names of the
1167         immediately enclosing class.
1168         Fix for bug #60730.
1169
1170 2004-06-24  Raja R Harinath  <rharinath@novell.com>
1171
1172         * expression.cs (BetterConversion): Remove buggy special-case
1173         handling of "implicit constant expression conversions".  At this
1174         point, we already know that the conversion is possible -- we're
1175         only checking to see which is better.
1176
1177 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1178
1179         * cs-parser.jay: Added error CS0210 test.
1180
1181 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1182
1183         * cs-parser.jay: Added error CS0134 test.
1184
1185 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1186
1187         Fix bug #52507
1188         * cs-parser.jay: Added error CS0145 test.
1189
1190 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
1191
1192         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
1193
1194 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
1195         
1196         * expression.cs (StackAlloc.Resolve): The argument may not
1197         be a constant; deal with this case.
1198         
1199 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
1200
1201         * attribute.cs (IndexerName_GetIndexerName): Renamed to
1202         GetIndexerAttributeValue.
1203         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
1204
1205         * class.cs (Indexer.Define): Added error tests for CS0415,
1206         CS0609.
1207
1208 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
1209
1210         * attribute.cs (Attribute.Resolve): Keep field code in sync with
1211         property code.
1212
1213 2004-06-23  Martin Baulig  <martin@ximian.com>
1214
1215         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
1216         neither return nor throw, reset the barrier as well.  Fixes #60457.
1217
1218 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
1219
1220         * class.cs : EventAttributes is now set to None by default.
1221           This fixes bug #60459.
1222
1223 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1224
1225         Fix bug #60219
1226         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
1227         Don't throw exception but return null (it's sufficient now).
1228
1229 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
1230
1231         * typemanager.cs (GetArgumentTypes): Faster implementation.
1232
1233 2004-06-18  Martin Baulig  <martin@ximian.com>
1234
1235         * attribute.cs (Attribute.Resolve): Check whether we're an
1236         EmptyCast which a Constant child.  Fixes #60333.
1237
1238 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
1239
1240         * statement.cs (EmitCollectionForeach): Account for the fact that
1241         not all valuetypes are in areas which we can take the address of.
1242         For these variables, we store to a temporary variable. Also, make
1243         sure that we dont emit a `callvirt' on a valuetype method.
1244
1245 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1246
1247         * expression.cs (StackAlloc.DoReSolve): Added test for
1248         negative parameter (CS0247).
1249
1250 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1251
1252         Fix bug #59792
1253         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
1254
1255 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
1256
1257         Fix bug #59781
1258         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
1259         ulong.
1260
1261 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1262
1263         Fix bug #58254 & cs1555.cs, cs1556.cs
1264         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
1265
1266 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
1267
1268         * cs-parser.jay: Added error CS1669 test for indexers.
1269
1270 2004-06-11  Martin Baulig  <martin@ximian.com>
1271
1272         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
1273         call this twice: for params and varargs methods.
1274
1275 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1276
1277         * class.cs:
1278         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
1279
1280 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1281
1282         * attribute.cs (Attribute.GetValidTargets): Made public.
1283
1284         * class.cs: 
1285         (AbstractPropertyEventMethod): New class for better code sharing.
1286         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
1287         CS1667 report.
1288         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
1289
1290 2004-06-11  Raja R Harinath  <rharinath@novell.com>
1291
1292         Fix bug #59477.
1293         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
1294         that the call to Resolve is part of a MemberAccess.
1295         (Expression.Resolve): Use it for SimpleName resolution.
1296         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
1297         Add 'intermediate' boolean argument.
1298         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
1299         error message when the SimpleName can be resolved ambiguously
1300         between an expression and a type.
1301         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
1302         public.
1303         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
1304         call on the left-side.
1305
1306 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1307
1308         * class.cs:
1309         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
1310
1311 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1312
1313         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
1314
1315 2004-06-11  Martin Baulig  <martin@ximian.com>
1316
1317         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
1318         varargs methods if applicable.
1319
1320 2004-06-11  Martin Baulig  <martin@ximian.com>
1321
1322         * expression.cs (Invocation.EmitCall): Don't use
1323         `method.CallingConvention == CallingConventions.VarArgs' since the
1324         method could also have `CallingConventions.HasThis'.
1325
1326 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
1327
1328         * class.cs (Event.GetSignatureForError): Implemented.
1329         Fixed crash in error test cs3010.cs
1330
1331 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
1332
1333         * cs-tokenizer.cs: Change the way we track __arglist to be
1334         consistent with the other keywords.
1335
1336 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
1337
1338         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
1339         tomorrow.
1340
1341 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
1342
1343         * codegen.cs: Check that all referenced assemblies have a strongname
1344         before strongnaming the compiled assembly. If not report error CS1577.
1345         Fix bug #56563. Patch by Jackson Harper.
1346         * typemanager.cs: Added a method to return all referenced assemblies.
1347         Fix bug #56563. Patch by Jackson Harper.
1348
1349 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
1350
1351         * class.cs:
1352         (Method.ApplyAttributeBuilder): Moved and added conditional
1353         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
1354
1355         * delegate.cs:
1356         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
1357
1358 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
1359
1360         Fixed #59640
1361         * class.cs: (EventField.attribute_targets): Changed default target.
1362
1363 2004-06-08  Martin Baulig  <martin@ximian.com>
1364
1365         * expression.cs (Invocation.EmitCall): Enable varargs methods.
1366
1367 2004-06-08  Martin Baulig  <martin@ximian.com>
1368
1369         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
1370
1371 2004-06-07  Martin Baulig  <martin@ximian.com>
1372
1373         Added support for varargs methods.
1374
1375         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
1376         keyword.
1377
1378         * cs-parser.jay: Added support for `__arglist'.
1379
1380         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
1381
1382         * expression.cs (Argument.AType): Added `ArgList'.
1383         (Invocation): Added support for varargs methods.
1384         (ArglistAccess): New public class.
1385         (Arglist): New public class.
1386
1387         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
1388
1389         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
1390         a method's top-level block if the method has varargs.
1391
1392         * support.cs (ReflectionParameters, InternalParameters): Added
1393         support for varargs methods.    
1394
1395 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
1396
1397         * class.cs: Provide location in indexer error report.
1398
1399         * driver.cs: Use standard names.
1400
1401         * namespace.cs: Catch the use of using after a namespace has been
1402         declared also on using aliases.
1403
1404 2004-06-03  Raja R Harinath  <rharinath@novell.com>
1405
1406         Bug #50820.
1407         * typemanager.cs (closure_private_ok, closure_invocation_type)
1408         (closure_qualifier_type, closure_invocation_assembly)
1409         (FilterWithClosure): Move to ...
1410         (Closure): New internal nested class.
1411         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
1412         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
1413         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
1414         (MemberLookup, MemberLookupFailed): Use it.
1415         * expression.cs (New.DoResolve): Treat the lookup for the
1416         constructor as being qualified by the 'new'ed type.
1417         (Indexers.GetIndexersForTypeOrInterface): Update.
1418
1419 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
1420
1421         * attribute.cs
1422         (GetConditionalAttributeValue): New method. Returns
1423         condition of ConditionalAttribute.
1424         (SearchMulti): New method.  Returns all attributes of type 't'.
1425         Use it when attribute is AllowMultiple = true.
1426         (IsConditionalMethodExcluded): New method.
1427
1428         * class.cs
1429         (Method.IsExcluded): Implemented. Returns true if method has conditional
1430         attribute and the conditions is not defined (method is excluded).
1431         (IMethodData): Extended interface for ConditionalAttribute support.
1432         (PropertyMethod.IsExcluded): Implemented.
1433
1434         * decl.cs
1435         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
1436
1437         * expression.cs
1438         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
1439         on the method.
1440
1441 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
1442
1443         * expression.cs (ArrayCreationExpression): Make this just an
1444         `expression'. It can't be a statement, so the code here was
1445         dead.
1446
1447 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
1448
1449         Fixed #59072
1450         * typemanager.cs (GetFullNameSignature): New method for
1451         MethodBase types.
1452
1453 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
1454
1455         Fixed #56452
1456         * class.cs (MemberBase.GetSignatureForError): New virtual method.
1457         Use this method when MethodBuilder is null.
1458         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
1459         Added test for error CS0626 (MONO reports error for this situation).
1460         (IMethodData.GetSignatureForError): Extended interface.
1461
1462 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
1463
1464         * attribute.cs
1465         (AttributeTester.GetObsoleteAttribute): Returns instance of
1466         ObsoleteAttribute when type is obsolete.
1467
1468         * class.cs
1469         (TypeContainer.VerifyObsoleteAttribute): Override.
1470         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
1471         (MethodCode.VerifyObsoleteAttribute): Override.
1472         (MemberBase.VerifyObsoleteAttribute): Override.
1473
1474         * decl.cs
1475         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
1476         and report proper error.
1477
1478         *delegate.cs
1479         Delegate.VerifyObsoleteAttribute): Override.
1480
1481         * ecore.cs
1482         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
1483         and report proper error.
1484         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
1485
1486         * enum.cs
1487         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
1488         and enum member.
1489
1490         * expression.cs
1491         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
1492         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
1493         Added test for ObsoleteAttribute.
1494
1495         * statement.cs
1496         (Catch): Derived from Statement.
1497
1498 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
1499  
1500         Fixed bug #59071 & cs0160.cs
1501  
1502         * statement.cs (Try.Resolve): Check here whether order of catch
1503         clauses matches their dependencies.
1504
1505 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
1506
1507         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
1508         caused a regression: #59343.  Referencing nested classes from an
1509         assembly stopped working.
1510
1511 2004-05-31  Martin Baulig  <martin@ximian.com>
1512
1513         MCS is now frozen for beta 2.
1514
1515 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1516
1517         * convert.cs: add a trivial cache for overload operator resolution.
1518
1519 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1520
1521         * decl.cs: If possible, use lookuptypedirect here. We can only do
1522         this if there is no `.' after the namespace. Avoids using
1523         LookupType, which does lots of slow processing.
1524         (FindNestedType) New method, does what it says :-).
1525         * namespace.cs: use LookupTypeDirect.
1526         * rootcontext.cs: use membercache, if possible.
1527         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
1528
1529 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1530
1531         * expression.cs:
1532         According to the spec, 
1533
1534         In a member access of the form E.I, if E is a single identifier,
1535         and if the meaning of E as a simple-name (§7.5.2) is a constant,
1536         field, property, localvariable, or parameter with the same type as
1537         the meaning of E as a type-name (§3.8), then both possible
1538         meanings of E are permitted.
1539
1540         We did not check that E as a simple-name had the same type as E as
1541         a type name.
1542
1543         This trivial check gives us 5-7% on bootstrap time.
1544
1545 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
1546
1547         * expression.cs (Invocation.OverloadResolve): Avoid the
1548         use of hashtables and boxing here by allocating on demand.
1549
1550 2004-05-30  Martin Baulig  <martin@ximian.com>
1551
1552         * rootcontext.cs (RootContext.LookupType): Don't cache things if
1553         we're doing a silent lookup.  Don't try to lookup nested types in
1554         TypeManager.object_type (thanks to Ben Maurer).
1555
1556 2004-05-30  Martin Baulig  <martin@ximian.com>
1557
1558         Committing a patch from Ben Maurer.
1559
1560         * rootcontext.cs (RootContext.LookupType): Cache negative results.
1561
1562 2004-05-29  Martin Baulig  <martin@ximian.com>
1563
1564         * class.cs (IMethodData.ShouldIgnore): New method.
1565
1566         * typemanager.cs (TypeManager.MethodFlags): Don't take a
1567         `Location' argument, we don't need it anywhere.  Use
1568         `IMethodData.ShouldIgnore ()' instead of
1569         `MethodData.GetMethodFlags ()'.
1570         (TypeManager.AddMethod): Removed.
1571         (TypeManager.AddMethod2): Renamed to AddMethod.
1572
1573 2004-05-29  Martin Baulig  <martin@ximian.com>
1574
1575         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
1576
1577         * convert.cs (Convert.ImplicitReferenceConversion): If we're
1578         converting from a class type S to an interface type and we already
1579         have an object on the stack, don't box it again.  Fixes #52578.
1580
1581 2004-05-29  Martin Baulig  <martin@ximian.com>
1582
1583         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
1584         Added support for `params' parameters.  Fixes #59267.
1585
1586 2004-05-29  Martin Baulig  <martin@ximian.com>
1587
1588         * literal.cs (NullPointer): Provide a private .ctor which sets
1589         `type' to TypeManager.object_type.  Fixes #59048.
1590
1591 2004-05-29  Martin Baulig  <martin@ximian.com>
1592
1593         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
1594         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
1595
1596         * ecore.cs (EventExpr.instance_expr): Make the field private.
1597
1598 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
1599
1600         Fixed bug #50080 & cs0214-2.cs
1601         * expression.cs (Cast.DoResolve): Check unsafe context here.
1602         
1603         * statement.cs (Resolve.DoResolve): Likewise.
1604
1605 2004-05-26  Martin Baulig  <martin@ximian.com>
1606
1607         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
1608
1609         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
1610         (RootContext.LookupType): Pass down the `silent' flag.
1611
1612 2004-05-25  Martin Baulig  <martin@ximian.com>
1613
1614         * expression.cs
1615         (MethodGroupExpr.IdenticalTypeName): New public property.
1616         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
1617         expression actually refers to a type.
1618
1619 2004-05-25  Martin Baulig  <martin@ximian.com>
1620
1621         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
1622         for #56176 and made it actually work.
1623
1624 2004-05-25  Martin Baulig  <martin@ximian.com>
1625
1626         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
1627         (FieldExpr, PropertyExpr): Override and implement
1628         CacheTemporaries.  Fixes #52279.
1629
1630 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
1631
1632         * location.cs: In the new compiler listing a file twice is a
1633         warning, not an error.
1634
1635 2004-05-24  Martin Baulig  <martin@ximian.com>
1636
1637         * enum.cs (Enum.DefineType): For the `BaseType' to be a
1638         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
1639
1640 2004-05-24  Martin Baulig  <martin@ximian.com>
1641
1642         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
1643         walking the `using' list.  Fixes #53921.
1644
1645 2004-05-24  Martin Baulig  <martin@ximian.com>
1646
1647         * const.cs (Const.LookupConstantValue): Added support for
1648         EmptyCast's; fixes #55251.
1649
1650 2004-05-24  Martin Baulig  <martin@ximian.com>
1651
1652         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
1653         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
1654         which does the CS0135 check.  The reason is that we first need to
1655         check whether the variable actually exists.
1656
1657 2004-05-24  Martin Baulig  <martin@ximian.com>
1658
1659         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
1660         than RootContext.LookupType() to find the explicit interface
1661         type.  Fixes #58584.
1662
1663 2004-05-24  Raja R Harinath  <rharinath@novell.com>
1664
1665         * Makefile: Simplify.  Use executable.make.
1666         * mcs.exe.sources: New file.  List of sources of mcs.exe.
1667
1668 2004-05-24  Anders Carlsson  <andersca@gnome.org>
1669
1670         * decl.cs:
1671         * enum.cs:
1672         Use the invariant culture when doing String.Compare for CLS case
1673         sensitivity.
1674         
1675 2004-05-23  Martin Baulig  <martin@ximian.com>
1676
1677         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
1678         don't have any dots.  Fixes #52622, added cs0246-8.cs.
1679
1680         * namespace.cs (NamespaceEntry.Lookup): Likewise.
1681         
1682 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
1683
1684         * class.cs (MemberBase.Define): Reuse MemberType member for 
1685         resolved type. Other methods can use it too.
1686
1687 2004-05-23  Martin Baulig  <martin@ximian.com>
1688
1689         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
1690         the variable also exists in the current block (otherwise, we need
1691         to report a CS0103).  Fixes #58670.
1692
1693 2004-05-23  Martin Baulig  <martin@ximian.com>
1694
1695         * flowanalysis.cs (Reachability.Reachable): Compute this
1696         on-the-fly rather than storing it as a field.
1697
1698 2004-05-23  Martin Baulig  <martin@ximian.com>
1699
1700         * flowanalysis.cs (Reachability.And): Manually compute the
1701         resulting `barrier' from the reachability.      
1702        
1703 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
1704
1705         Fix bug #57835
1706         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
1707         instance of ObsoleteAttribute when symbol is obsolete.
1708
1709         * class.cs
1710         (IMethodData): Extended interface for ObsoleteAttribute support.
1711
1712 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
1713
1714         * attribute.cs: Fix bug #55970
1715
1716 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
1717
1718         Fix bug #52705
1719         * attribute.cs
1720         (GetObsoleteAttribute): New method. Creates the instance of
1721         ObsoleteAttribute.
1722         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
1723         ObsoleteAttribute when member is obsolete.
1724         (AttributeTester.Report_ObsoleteMessage): Common method for
1725         Obsolete error/warning reporting.
1726
1727         * class.cs
1728         (TypeContainer.base_classs_type): New member for storing parent type.
1729
1730         * decl.cs
1731         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
1732         for this MemberCore.
1733
1734 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
1735
1736         * attribute.cs, const.cs: Fix bug #58590
1737
1738 2004-05-21  Martin Baulig  <martin@ximian.com>
1739
1740         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
1741         out parameters if the end of the method is unreachable.  Fixes
1742         #58098. 
1743
1744 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
1745
1746         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
1747         Hari was right, why extra method.
1748
1749 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
1750
1751         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
1752
1753 2004-05-20  Martin Baulig  <martin@ximian.com>
1754
1755         Merged this back from gmcs to keep the differences to a minumum.
1756
1757         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
1758         instead of a Declspace.
1759         (Attribute.ResolveType): Likewise.
1760         (Attributes.Search): Likewise.
1761         (Attributes.Contains): Likewise.
1762         (Attributes.GetClsCompliantAttribute): Likewise.
1763
1764         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
1765         argument.
1766         (MethodData.ApplyAttributes): Take an EmitContext instead of a
1767         DeclSpace.
1768
1769 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
1770
1771         Fix bug #58688 (MCS does not report error when the same attribute
1772         is assigned twice)
1773
1774         * attribute.cs (Attribute.Emit): Distinction between null and default.
1775
1776 2004-05-19  Raja R Harinath  <rharinath@novell.com>
1777
1778         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
1779         of a top-level attribute without an attribute target.
1780         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
1781         Make non-static.
1782         (Attribute.Conditional_GetConditionName), 
1783         (Attribute.Obsolete_GetObsoleteMessage): Update.
1784         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
1785         part of ScanForIndexerName.
1786         (Attribute.CanIgnoreInvalidAttribute): New function.
1787         (Attribute.ScanForIndexerName): Move to ...
1788         (Attributes.ScanForIndexerName): ... here.
1789         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
1790         (Attributes.Search): New internal variant that can choose not to
1791         complain if types aren't resolved.  The original signature now
1792         complains.
1793         (Attributes.GetClsCompliantAttribute): Use internal variant, with
1794         complaints suppressed.
1795         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
1796         only if it not useful.
1797         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
1798         top-level for attributes that are shared between the assembly
1799         and a top-level class.
1800         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
1801         * class.cs: Update to reflect changes.
1802         (DefineIndexers): Fuse loops.
1803         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
1804         a couple more variants of attribute names.
1805
1806 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
1807
1808         Fix bug #52585 (Implemented explicit attribute declaration)
1809
1810         * attribute.cs:
1811         (Attributable.ValidAttributeTargets): New abstract method. It gets
1812         list of valid attribute targets for explicit target declaration.
1813         (Attribute.Target): It holds target itself.
1814         (AttributeSection): Removed.
1815         (Attribute.CheckTargets): New method. It checks whether attribute
1816         target is valid for the current element.
1817
1818         * class.cs:
1819         (EventProperty): New class. For events that are declared like
1820         property (with add and remove accessors).
1821         (EventField): New class. For events that are declared like field.
1822         class.cs
1823
1824         * cs-parser.jay: Implemented explicit attribute target declaration.
1825
1826         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
1827         Override ValidAttributeTargets.
1828
1829         * parameter.cs:
1830         (ReturnParameter): Class for applying custom attributes on 
1831         the return type.
1832         (ParameterAtribute): New class. Class for applying custom
1833         attributes on the parameter type.
1834
1835 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
1836
1837         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
1838         definitions. 
1839
1840         (Method): Allow UNSAFE here.
1841
1842         * modifiers.cs: Support unsafe reporting.
1843
1844 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
1845
1846         * decl.cs: Fix bug #58478.
1847
1848 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1849
1850         * statement.cs: When checking for unreachable code on an EmptyStatement,
1851         set the location. Fixes bug #58488.
1852
1853 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
1854
1855         * driver.cs: Add -pkg handling.
1856
1857         From Gonzalo: UseShelLExecute=false
1858
1859 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
1860
1861         * attribute.cs:
1862         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
1863         for attribute.
1864         (Attribute.IsClsCompliaceRequired): Moved to base for better
1865         accesibility.
1866         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
1867         when attribute is AttributeUsageAttribute.
1868         (Attribute.GetValidTargets): Simplified.
1869         (Attribute.GetAttributeUsage): New method returns AttributeUsage
1870         attribute for this type.
1871         (Attribute.ApplyAttributes): Method renamed to Emit and make
1872         non-static.
1873         (GlobalAttributeSection): New class for special handling of global
1874         attributes (assembly, module).
1875         (AttributeSection.Emit): New method.
1876
1877         * class.cs: Implemented Attributable abstract methods.
1878         (MethodCore.LabelParameters): Moved to Parameter class.
1879         (Accessor): Is back simple class.
1880         (PropertyMethod): Implemented Attributable abstract class.
1881         (DelegateMethod): Implemented Attributable abstract class.
1882         (Event): New constructor for disctintion between normal Event
1883         and Event with accessors.
1884
1885         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
1886
1887         * codegen.cs, const.cs, decl.cs, delegate.cs:
1888         (CommonAssemblyModulClass): Implemented Attributable abstract class
1889         and simplified.
1890
1891         * enum.cs: Implement IAttributeSupport interface.
1892         (EnumMember): New class for emum members. Implemented Attributable
1893         abstract class
1894
1895         * parameter.cs:
1896         (ParameterBase): Is abstract.
1897         (ReturnParameter): New class for easier [return:] attribute handling.
1898
1899         * typemanager.cs: Removed builder_to_attr.
1900
1901 2004-05-11  Raja R Harinath  <rharinath@novell.com>
1902
1903         Fix bug #57151.
1904         * attribute.cs (Attribute.GetPositionalValue): New function.
1905         * class.cs (TypeContainer.VerifyMembers): New function.
1906         (TypeContainer.Emit): Use it.
1907         (ClassOrStruct): New base class for Class and Struct.
1908         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
1909         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
1910         class.
1911         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
1912         then each non-static field should have a FieldOffset attribute.
1913         Otherwise, none of the fields should have a FieldOffset attribute.
1914         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
1915         and FieldOffset attributes.
1916         * typemanager.cs (TypeManager.struct_layout_attribute_type)
1917         (TypeManager.field_offset_attribute_type): New core types.
1918         (TypeManager.InitCoreTypes): Initialize them.
1919
1920 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
1921
1922         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
1923         Return correct type.
1924         From bug #58270.
1925
1926 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
1927
1928         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
1929         be implicitly converted to ulong.
1930         
1931         * expression.cs: The logic for allowing operator &, | and ^ worked
1932         was wrong, it worked before because we did not report an error in
1933         an else branch.  Fixes 57895.
1934
1935         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
1936         allow volatile fields to be reference types.
1937
1938 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
1939
1940         * driver.cs: Add support for /debug-
1941
1942 2004-05-07  Raja R Harinath  <rharinath@novell.com>
1943
1944         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
1945         Add a 'complain' parameter to silence errors.
1946         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
1947         silently overlooked type-resolutions.
1948         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
1949         to reflect changes.
1950         (Attributes.Search): New function.
1951         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
1952         (Attributes.GetAttributeFullName): Remove hack.
1953         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
1954         Update to reflect changes.
1955         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1956         Use Attributes.Search instead of nested loops.
1957
1958 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
1959
1960         * decl.cs:
1961         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
1962         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
1963         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
1964
1965         * report.cs: (Report.Warning): Renamed to Warning_T because of
1966         parameter collision.
1967
1968 2004-05-05  Raja R Harinath  <rharinath@novell.com>
1969
1970         * expression.cs (MemberAccess.ResolveMemberAccess):
1971         Exit with non-zero status after Report.Error.
1972         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
1973         Likewise.
1974         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
1975
1976 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
1977
1978         * support.cs: Don't hang when the file is empty.
1979
1980 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
1981
1982         * support.cs: In SeekableStreamReader, compute the preamble size of the
1983           underlying stream. Position changes should take into account that initial
1984           count of bytes.
1985
1986 2004-05-03  Todd Berman  <tberman@sevenl.net>
1987
1988         * driver.cs: remove unused GetSysVersion function.
1989
1990 2004-05-03  Todd Berman  <tberman@sevenl.net>
1991
1992         * driver.cs: Remove the hack from saturday, as well as the hack
1993         from jackson (LoadAssemblyFromGac), also adds the CWD to the
1994         link_paths to get that bit proper.
1995
1996 2004-05-01  Todd Berman  <tberman@sevenl.net>
1997
1998         * driver.cs: Try a LoadFrom before a Load, this checks the current
1999         path. This is currently a bug in mono that is be fixed, however, this
2000         provides a workaround for now. This will be removed when the bug
2001         is fixed.
2002
2003 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
2004
2005         * CryptoConvert.cs: Updated to latest version. Fix issue with 
2006         incomplete key pairs (#57941).
2007
2008 2004-05-01  Todd Berman  <tberman@sevenl.net>
2009
2010         * driver.cs: Remove '.' from path_chars, now System.* loads properly
2011         from the GAC
2012
2013 2004-04-30  Jackson Harper  <jackson@ximian.com>
2014
2015         * codegen.cs: Open keys readonly.
2016         
2017 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2018
2019         * typemanager.cs: don't report cyclic struct layout when a struct
2020         contains 2 or more fields of the same type. Failed for Pango.AttrShape
2021         which has 2 Pango.Rectangle fields.
2022
2023 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2024
2025         * expression.cs: Handle IntPtr comparisons with IL code
2026         rather than a method call.
2027
2028 2004-04-29  Martin Baulig  <martin@ximian.com>
2029
2030         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
2031         the list of PropertyInfo's in class hierarchy and find the
2032         accessor.  Fixes #56013.
2033
2034 2004-04-29  Martin Baulig  <martin@ximian.com>
2035
2036         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
2037
2038 2004-04-29  Martin Baulig  <martin@ximian.com>
2039
2040         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
2041
2042         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
2043
2044 2004-04-29  Martin Baulig  <martin@ximian.com>
2045
2046         * class.cs (ConstructorInitializer.Resolve): Check whether the
2047         parent .ctor is accessible.  Fixes #52146.
2048
2049 2004-04-29  Martin Baulig  <martin@ximian.com>
2050
2051         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
2052
2053         * statement.cs (Using.EmitLocalVariableDecls): Use
2054         TypeManager.idisposable_type, not typeof (IDisposable).
2055         (Foreach.EmitCollectionForeach): Added support for valuetypes.
2056
2057 2004-04-29  Martin Baulig  <martin@ximian.com>
2058
2059         * class.cs (Event.Define): Don't emit the field and don't set
2060         RTSpecialName and SpecialName for events on interfaces.  Fixes
2061         #57703. 
2062
2063 2004-04-29  Raja R Harinath  <rharinath@novell.com>
2064
2065         Refactor Attribute.ApplyAttributes.
2066         * attribute.cs (Attributable): New base class for objects that can
2067         have Attributes applied on them.
2068         (Attribute): Make AttributeUsage fields public.
2069         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
2070         (Attribute.IsInternalCall): New property.
2071         (Attribute.UsageAttr): Convert to a public read-only property.
2072         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
2073         (Attribute.ResolveType, Attribute.Resolve)
2074         (Attribute.ScanForIndexerName): Update to reflect changes.
2075         (Attribute.CheckAttributeTarget): Re-format.
2076         (Attribute.ApplyAttributes): Refactor, to various
2077         Attributable.ApplyAttributeBuilder methods.
2078         * decl.cs (MemberCore): Make Attributable.
2079         * class.cs (Accessor): Make Attributable.
2080         (MethodData.ApplyAttributes): Use proper attribute types, not
2081         attribute names.
2082         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
2083         (TypeContainer.ApplyAttributeBuilder)
2084         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
2085         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
2086         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
2087         (Operator.ApplyAttributeBuilder): New factored-out methods.
2088         * const.cs (Const.ApplyAttributeBuilder): Likewise.
2089         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
2090         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
2091         * parameter.cs (ParameterBase): New Attributable base class
2092         that can also represent Return types.
2093         (Parameter): Update to the changes.
2094
2095 2004-04-29  Jackson Harper  <jackson@ximian.com>
2096
2097         * driver.cs: Prefer the corlib system version when looking for
2098         assemblies in the GAC. This is still a hack, but its a better hack
2099         now.
2100         
2101 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
2102
2103         * decl.cs, enum.cs: Improved error 3005 reporting.
2104   
2105         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
2106         (related_symbols): New private member for list of symbols
2107         related to reported error/warning.
2108         
2109         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
2110
2111 2004-04-29  Martin Baulig  <martin@ximian.com>
2112
2113         * ecore.cs (Expression.Constantify): If we're an enum and
2114         TypeManager.TypeToCoreType() doesn't give us another type, use
2115         t.UnderlyingSystemType.  Fixes #56178.  
2116
2117 2004-04-29  Martin Baulig  <martin@ximian.com>
2118
2119         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
2120         interfaces and for each interface, only add members directly
2121         declared in that interface.  Fixes #53255.
2122
2123 2004-04-28  Martin Baulig  <martin@ximian.com>
2124
2125         * expression.cs (ConditionalLogicalOperator): Use a temporary
2126         variable for `left' to avoid that we evaluate it more than once;
2127         bug #52588.
2128
2129 2004-04-28  Martin Baulig  <martin@ximian.com>
2130
2131         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
2132         `void[]' (CS1547).
2133
2134 2004-04-28  Martin Baulig  <martin@ximian.com>
2135
2136         * statement.cs (LocalInfo.Resolve): Check whether the type is not
2137         void (CS1547).
2138
2139         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
2140         whether the type is not void (CS1547).
2141
2142 2004-04-28  Martin Baulig  <martin@ximian.com>
2143
2144         * expression.cs (Unary.DoResolveLValue): Override this and report
2145         CS0131 for anything but Operator.Indirection.
2146
2147 2004-04-28  Martin Baulig  <martin@ximian.com>
2148
2149         Committing a patch from Ben Maurer; see bug #50820.
2150
2151         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
2152         check for classes.
2153
2154         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
2155         classes.        
2156
2157 2004-04-28  Martin Baulig  <martin@ximian.com>
2158
2159         Committing a patch from Ben Maurer; see bug #50820.
2160
2161         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
2162         check for classes.
2163
2164         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
2165         classes.        
2166
2167 2004-04-28  Martin Baulig  <martin@ximian.com>
2168
2169         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
2170         (Block.AddLabel): Call DoLookupLabel() to only search in the
2171         current block.
2172
2173 2004-04-28  Martin Baulig  <martin@ximian.com>
2174
2175         * cfold.cs (ConstantFold.BinaryFold): Added special support for
2176         comparing StringConstants and NullLiterals in Equality and Inequality.
2177
2178 2004-04-28  Jackson Harper  <jackson@ximian.com>
2179
2180         * driver.cs: Attempt to load referenced assemblies from the
2181         GAC. This is the quick and dirty version of this method that
2182         doesnt take into account versions and just takes the first
2183         canidate found. Will be good enough for now as we will not have more
2184         then one version installed into the GAC until I update this method.
2185
2186 2004-04-28  Martin Baulig  <martin@ximian.com>
2187
2188         * typemanager.cs (TypeManager.CheckStructCycles): New public
2189         static method to check for cycles in the struct layout.
2190
2191         * rootcontext.cs (RootContext.PopulateTypes): Call
2192         TypeManager.CheckStructCycles() for each TypeContainer.
2193         [Note: We only need to visit each type once.]
2194
2195 2004-04-28  Martin Baulig  <martin@ximian.com>
2196
2197         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
2198
2199         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
2200         success and added `out object value'.  Use a `bool resolved' field
2201         to check whether we've already been called rather than
2202         `ConstantValue != null' since this breaks for NullLiterals.
2203
2204 2004-04-28  Raja R Harinath  <rharinath@novell.com>
2205
2206         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
2207         setting of this flag, since the 'set' method may be non-public.
2208
2209 2004-04-28  Raja R Harinath  <rharinath@novell.com>
2210
2211         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
2212         check on current_vector.Block.
2213
2214 2004-04-27  Martin Baulig  <martin@ximian.com>
2215
2216         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
2217         a field initializer.  Fixes #56459.
2218
2219 2004-04-27  Martin Baulig  <martin@ximian.com>
2220
2221         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
2222         we're not attempting to use an indexer.  Fixes #52154.
2223
2224 2004-04-27  Martin Baulig  <martin@ximian.com>
2225
2226         * statement.cs (Return): Don't create a return label if we don't
2227         need it; reverts my change from January 20th.  Thanks to Ben
2228         Maurer for this.
2229
2230 2004-04-27  Martin Baulig  <martin@ximian.com>
2231
2232         According to the spec, `goto' can only leave a nested scope, but
2233         never enter it.
2234
2235         * statement.cs (Block.LookupLabel): Only lookup in the current
2236         block, don't recurse into parent or child blocks.
2237         (Block.AddLabel): Check in parent and child blocks, report
2238         CS0140/CS0158 if we find a duplicate.
2239         (Block): Removed this indexer for label lookups.
2240         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
2241         this already does the error reporting for us.
2242
2243         * flowanalysis.cs
2244         (FlowBranching.UsageVector.Block): New public variable; may be null.
2245         (FlowBranching.CreateSibling): Added `Block' argument.
2246         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
2247         label for the target of a `goto' and check whether we're not
2248         leaving a `finally'.
2249
2250 2004-04-27  Martin Baulig  <martin@ximian.com>
2251
2252         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2253         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
2254         just for returns).
2255
2256 2004-04-27  Martin Baulig  <martin@ximian.com>
2257
2258         * statement.cs (Block.AddLabel): Also check for implicit blocks
2259         and added a CS0158 check.
2260
2261 2004-04-27  Martin Baulig  <martin@ximian.com>
2262
2263         * flowanalysis.cs (FlowBranchingLoop): New class.
2264         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
2265         UsageVector's instead of an ArrayList.
2266         (FlowBranching.Label): Likewise.
2267         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
2268         (FlowBranching.AddBreakVector): New method.
2269
2270 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
2271
2272         * attribute.cs: Small regression fix: only convert the type if we
2273         the type is different, fixes System.Drawing build.
2274
2275 2004-04-27  Martin Baulig  <martin@ximian.com>
2276
2277         * attribute.cs (Attribute.Resolve): If we have a constant value
2278         for a named field or property, implicity convert it to the correct
2279         type.
2280
2281 2004-04-27  Raja R Harinath  <rharinath@novell.com>
2282
2283         * statement.cs (Block.Block): Implicit blocks share
2284         'child_variable_names' fields with parent blocks.
2285         (Block.AddChildVariableNames): Remove.
2286         (Block.AddVariable): Mark variable as "used by a child block" in
2287         every surrounding block.
2288         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
2289         been used in a child block, complain about violation of "Invariant
2290         meaning in blocks" rule.
2291         * cs-parser.jay (declare_local_variables): Don't use
2292         AddChildVariableNames.
2293         (foreach_statement): Don't create an implicit block: 'foreach'
2294         introduces a scope.
2295
2296 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
2297
2298         * convert.cs (ImplicitNumericConversion): 0 is also positive when
2299         converting from 0L to ulong.  Fixes 57522.
2300
2301 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
2302
2303         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
2304         derived class hides via 'new' keyword field from base class (test-242.cs).
2305         TODO: Handle this in the more general way.
2306         
2307         * class.cs (CheckBase): Ditto.
2308
2309 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
2310
2311         * decl.cs (caching_flags): New member for storing cached values
2312         as bit flags.
2313         (MemberCore.Flags): New enum where bit flags for caching_flags
2314         are defined.
2315         (MemberCore.cls_compliance): Moved to caching_flags.
2316         (DeclSpace.Created): Moved to caching_flags.
2317
2318         * class.cs: Use caching_flags instead of DeclSpace.Created
2319         
2320 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
2321
2322         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
2323         if we are only a derived class, not a nested class.
2324
2325         * typemanager.cs: Same as above, but do this at the MemberLookup
2326         level (used by field and methods, properties are handled in
2327         PropertyExpr).   Allow for the qualified access if we are a nested
2328         method. 
2329
2330 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
2331
2332         * class.cs: Refactoring.
2333         (IMethodData): New inteface; Holds links to parent members
2334         to avoid member duplication (reduced memory allocation).
2335         (Method): Implemented IMethodData interface.
2336         (PropertyBase): New inner classes for get/set methods.
2337         (PropertyBase.PropertyMethod): Implemented IMethodData interface
2338         (Event): New inner classes for add/remove methods.
2339         (Event.DelegateMethod): Implemented IMethodData interface.
2340
2341         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
2342         EmitContext (related to class.cs refactoring).
2343
2344 2004-04-21  Raja R Harinath  <rharinath@novell.com>
2345
2346         * delegate.cs (Delegate.VerifyApplicability): If the number of
2347         arguments are the same as the number of parameters, first try to
2348         verify applicability ignoring  any 'params' modifier on the last
2349         parameter.
2350         Fixes #56442.
2351
2352 2004-04-16  Raja R Harinath  <rharinath@novell.com>
2353
2354         * class.cs (TypeContainer.AddIndexer): Use
2355         'ExplicitInterfaceName' to determine if interface name was
2356         explicitly specified.  'InterfaceType' is not initialized at this time.
2357         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
2358         Indexers array is already in the required order.  Initialize
2359         'IndexerName' only if there are normal indexers.
2360         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
2361         (TypeContainer.Emit): Emit DefaultMember attribute only if
2362         IndexerName is initialized.
2363         Fixes #56300.
2364
2365 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
2366
2367         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
2368         Fixes #57007
2369
2370 2004-04-15  Raja R Harinath  <rharinath@novell.com>
2371
2372         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
2373         attributes.
2374         Fix for #56456.
2375
2376         * attribute.cs (Attribute.Resolve): Check for duplicate named
2377         attributes.
2378         Fix for #56463.
2379
2380 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
2381
2382         * iterators.cs (MarkYield): track whether we are in an exception,
2383         and generate code accordingly.  Use a temporary value to store the
2384         result for our state.
2385
2386         I had ignored a bit the interaction of try/catch with iterators
2387         since their behavior was not entirely obvious, but now it is
2388         possible to verify that our behavior is the same as MS .NET 2.0
2389
2390         Fixes 54814
2391
2392 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
2393
2394         * iterators.cs: Avoid creating temporaries if there is no work to
2395         do. 
2396
2397         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
2398         Enumerations, use TypeManager.EnumToUnderlying and call
2399         recursively. 
2400
2401         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
2402         bug #57013
2403
2404         (This.Emit): Use EmitContext.EmitThis to emit our
2405         instance variable.
2406
2407         (This.EmitAssign): Ditto.
2408
2409         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
2410         codepaths, we will move all the functionality into
2411         Mono.CSharp.This 
2412
2413         (FieldExpr.EmitAssign): Ditto.
2414
2415         This fixes several hidden bugs that I uncovered while doing a code
2416         review of this today.
2417
2418         * codegen.cs (EmitThis): reworked so the semantics are more clear
2419         and also support value types "this" instances.
2420
2421         * iterators.cs: Changed so that for iterators in value types, we
2422         do not pass the value type as a parameter.  
2423
2424         Initialization of the enumerator helpers is now done in the caller
2425         instead of passing the parameters to the constructors and having
2426         the constructor set the fields.
2427
2428         The fields have now `assembly' visibility instead of private.
2429
2430 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
2431
2432         * expression.cs (Argument.Resolve): Check if fields passed as ref
2433         or out are contained in a MarshalByRefObject.
2434
2435         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
2436         another compiler type.
2437
2438 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2439
2440         * class.cs (Indexer.Define): use the new name checking method.
2441         Also, return false on an error.
2442         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
2443         (is_identifier_[start/part]_character): make static.
2444
2445 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
2446
2447         * expression.cs (Binary.ResolveOperator): Do no append strings
2448         twice: since we can be invoked more than once (array evaluation)
2449         on the same concatenation, take care of this here.  Based on a fix
2450         from Ben (bug #56454)
2451
2452 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
2453
2454         * codegen.cs: Fix another case where CS1548 must be reported (when 
2455         delay-sign isn't specified and no private is available #56564). Fix
2456         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
2457         error when MCS is used on the MS runtime and we need to delay-sign 
2458         (which seems unsupported by AssemblyBuilder - see #56621).
2459
2460 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
2461
2462         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
2463         (TypeManager.ComputeNamespaces): Faster implementation for
2464         Microsoft runtime.
2465
2466         * compiler.csproj: Updated AssemblyName to mcs.
2467
2468 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
2469
2470         * rootcontext.cs: Add new types to the boot resolution.
2471
2472         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
2473         MulticastDelegate is not allowed.
2474
2475         * typemanager.cs: Add new types to lookup: System.TypedReference
2476         and ArgIterator.
2477
2478         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
2479         check for TypedReference or ArgIterator, they are not allowed. 
2480
2481         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
2482         makes us properly catch 1510 in some conditions (see bug 56016 for
2483         details). 
2484
2485 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
2486
2487         * CryptoConvert.cs: update from corlib version
2488         with endian fixes.
2489
2490 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
2491
2492         * class.cs (Indexer.Define): Check indexername declaration
2493
2494 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
2495
2496         * attribute.cs (IsClsCompliant): Fixed problem with handling
2497         all three states (compliant, not-compliant, undetected).
2498
2499 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
2500
2501         * attribute.cs (Attribute): Location is now public.
2502         (Resolve): Store resolved arguments (pos_values) in attribute class.
2503         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
2504         (GetClsCompliantAttributeValue): New method that gets
2505         CLSCompliantAttribute value.
2506         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
2507         if exists else null.
2508         (AttributeTester): New class for CLS-Compliant verification routines.
2509
2510         * class.cs (Emit): Add CLS-Compliant verification.
2511         (Method.GetSignatureForError): Implemented.
2512         (Constructor.GetSignatureForError): Implemented
2513         (Constructor.HasCompliantArgs): Returns if constructor has
2514         CLS-Compliant arguments.
2515         (Constructor.Emit): Override.
2516         (Construcor.IsIdentifierClsCompliant): New method; For constructors
2517         is needed to test only parameters.
2518         (FieldBase.GetSignatureForError): Implemented.
2519         (TypeContainer): New member for storing base interfaces.
2520         (TypeContainer.FindMembers): Search in base interfaces too.
2521
2522         * codegen.cs (GetClsComplianceAttribute): New method that gets
2523         assembly or module CLSCompliantAttribute value.
2524         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
2525         for assembly.
2526         (ModuleClass.Emit): Add error 3012 test.
2527
2528         * const.cs (Emit): Override and call base for CLS-Compliant tests.
2529
2530         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
2531         state for all decl types.
2532         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
2533         if CLS-Compliant tests are required.
2534         (IsClsCompliaceRequired): New method. Analyze whether code
2535         must be CLS-Compliant.
2536         (IsExposedFromAssembly): New method. Returns true when MemberCore
2537         is exposed from assembly.
2538         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
2539         value or gets cached value.
2540         (HasClsCompliantAttribute): New method. Returns true if MemberCore
2541         is explicitly marked with CLSCompliantAttribute.
2542         (IsIdentifierClsCompliant): New abstract method. This method is
2543         used to testing error 3005.
2544         (IsIdentifierAndParamClsCompliant): New method. Common helper method
2545         for identifier and parameters CLS-Compliant testing.
2546         (VerifyClsCompliance): New method. The main virtual method for
2547         CLS-Compliant verifications.
2548         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
2549         null. I don't know why is null (too many public members !).
2550         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
2551         and get value of first CLSCompliantAttribute that found.
2552
2553         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
2554         (VerifyClsCompliance): Override and add extra tests.
2555
2556         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
2557         clscheck- disable CLS-Compliant verification event if assembly is has
2558         CLSCompliantAttribute(true).
2559
2560         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
2561         ApllyAttribute is now called in emit section as in the other cases.
2562         Possible future Emit integration.
2563         (IsIdentifierClsCompliant): New override.
2564         (VerifyClsCompliance): New override.
2565         (GetEnumeratorName): Returns full enum name.
2566
2567         * parameter.cs (GetSignatureForError): Implemented.
2568
2569         * report.cs (WarningData): New struct for Warning message information.
2570         (LocationOfPreviousError): New method.
2571         (Warning): New method. Reports warning based on the warning table.
2572         (Error_T): New method. Reports error based on the error table.
2573
2574         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
2575         verifications are done here.
2576
2577         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
2578
2579         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
2580         CLSCompliantAttribute.
2581         (all_imported_types): New member holds all imported types from other
2582         assemblies.
2583         (LoadAllImportedTypes): New method fills static table with exported types
2584         from all referenced assemblies.
2585         (Modules): New property returns all assembly modules.
2586
2587 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
2588
2589         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
2590         throwing a parser error.
2591
2592         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
2593         which removes the hardcoded get_/set_ prefixes for properties, as
2594         IL allows for the properties to be named something else.  
2595
2596         Bug #56013
2597
2598         * expression.cs: Do not override operand before we know if it is
2599         non-null.  Fix 56207
2600
2601 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2602
2603         * typemanager.cs: support for pinned variables.
2604
2605 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2606
2607         * decl.cs, typemanager.cs: Avoid using an arraylist
2608         as a buffer if there is only one result set.
2609
2610 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2611
2612         * expression.cs: Make sure you cant call a static method
2613         with an instance expression, bug #56174.
2614
2615 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
2616
2617         * class.cs (IsDuplicateImplementation): Improve error reporting to
2618         flag 663 (method only differs in parameter modifier).
2619
2620         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
2621         in preprocessor directives.
2622
2623         * location.cs (LookupFile): Allow for the empty path.
2624
2625         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
2626         better approach for some of that patch, but its failing with the
2627         CharSet enumeration.  For now try/catch will do.
2628
2629         * typemanager.cs: Do not crash if a struct does not have fields.
2630         Fixes 56150.
2631
2632 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2633
2634         * expression.cs: cs0213, cant fix a fixed expression.
2635         fixes 50231.
2636
2637 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2638
2639         * cs-parser.jay: detect invalid embeded statements gracefully.
2640         bug #51113.
2641
2642 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
2643
2644         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
2645         As a regex:
2646         s/
2647         the invocation type may not be a subclass of the tye of the item/
2648         The type of the item must be a subclass of the invocation item.
2649         /g
2650
2651         Fixes bug #50820.
2652
2653 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
2654
2655         * attribute.cs: Added methods to get a string and a bool from an
2656         attribute. Required to information from AssemblyKeyFileAttribute,
2657         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
2658         * codegen.cs: Modified AssemblyName creation to include support for
2659         strongnames. Catch additional exceptions to report them as CS1548.
2660         * compiler.csproj: Updated include CryptoConvert.cs.
2661         * compiler.csproj.user: Removed file - user specific configuration.
2662         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
2663         Mono.Security assembly. The original class is maintained and tested in
2664         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
2665         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
2666         like CSC 8.0 (C# v2) supports.
2667         * Makefile: Added CryptoConvert.cs to mcs sources.
2668         * rootcontext.cs: Added new options for strongnames.
2669
2670 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
2671
2672         * driver.cs: For --expect-error, report error code `2'
2673         if the program compiled with no errors, error code `1' if
2674         it compiled with an error other than the one expected.
2675
2676 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
2677
2678         * compiler.csproj: Updated for Visual Studio .NET 2003.
2679         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
2680         * compiler.sln: Updated for Visual Studio .NET 2003.
2681
2682 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
2683
2684         * expression.cs: Fix bug #47234. We basically need to apply the
2685         rule that we prefer the conversion of null to a reference type
2686         when faced with a conversion to 'object' (csc behaviour).
2687
2688 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2689
2690         * statement.cs: Shorter form for foreach, eliminates
2691         a local variable. r=Martin.
2692
2693 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2694
2695         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
2696         checks if we can use brtrue/brfalse to test for 0.
2697         * expression.cs: use the above in the test for using brtrue/brfalse.
2698         cleanup code a bit.
2699
2700 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2701
2702         * expression.cs: Rewrite string concat stuff. Benefits:
2703
2704         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
2705         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
2706         rather than a concat chain.
2707
2708         * typemanager.cs: Add lookups for more concat overloads.
2709
2710 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
2711
2712         * expression.cs: Emit shorter il code for array init.
2713
2714         newarr
2715         dup
2716         // set 1
2717
2718         // set 2
2719
2720         newarr
2721         stloc.x
2722
2723         ldloc.x
2724         // set 1
2725
2726         ldloc.x
2727         // set 2
2728
2729 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
2730
2731         * statement.cs: Before, two switch blocks would be merged if the
2732         total size of the blocks (end_item - begin_item + 1) was less than
2733         two times the combined sizes of the blocks.
2734
2735         Now, it will only merge if after the merge at least half of the
2736         slots are filled.
2737
2738         fixes 55885.
2739
2740 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
2741
2742         * class.cs : csc build fix for GetMethods(). See bug #52503.
2743
2744 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
2745
2746         * expression.cs: Make sure fp comparisons work with NaN.
2747         This fixes bug #54303. Mig approved this patch a long
2748         time ago, but we were not able to test b/c the runtime
2749         had a related bug.
2750
2751 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
2752
2753         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
2754
2755 2004-03-19  Martin Baulig  <martin@ximian.com>
2756
2757         * class.cs (MemberCore.IsDuplicateImplementation): Report the
2758         error here and not in our caller.
2759
2760 2004-03-19  Martin Baulig  <martin@ximian.com>
2761
2762         * interface.cs: Completely killed this file.
2763         (Interface): We're now a TypeContainer and live in class.cs.
2764
2765         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
2766         argument; we're now also called for interfaces.
2767         (TypeContainer.DefineMembers): Allow this method being called
2768         multiple times.
2769         (TypeContainer.GetMethods): New public method; formerly known as
2770         Interface.GetMethod().  This is used by PendingImplementation.
2771         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
2772         it's now private and non-static.
2773         (Interface): Moved this here; it's now implemented similar to
2774         Class and Struct.
2775         (Method, Property, Event, Indexer): Added `bool is_interface'
2776         argument to their .ctor's.
2777         (MemberBase.IsInterface): New public field.
2778
2779         * cs-parser.jay: Create normal Method, Property, Event, Indexer
2780         instances instead of InterfaceMethod, InterfaceProperty, etc.
2781         (opt_interface_base): Removed; we now use `opt_class_base' instead.
2782         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
2783
2784 2004-03-19  Martin Baulig  <martin@ximian.com>
2785
2786         * class.cs (MethodCore.IsDuplicateImplementation): New private
2787         method which does the CS0111 checking.
2788         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
2789         Use IsDuplicateImplementation().
2790
2791 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
2792
2793         * decl.cs (FindMemberToOverride): New method to find the correct
2794         method or property to override in the base class.
2795         * class.cs
2796             - Make Method/Property use the above method to find the
2797               version in the base class.
2798             - Remove the InheritableMemberSignatureCompare as it is now
2799               dead code.
2800
2801         This patch makes large code bases much faster to compile, as it is
2802         O(n) rather than O(n^2) to do this validation.
2803
2804         Also, it fixes bug 52458 which is that nested classes are not
2805         taken into account when finding the base class member.
2806
2807         Reviewed/Approved by Martin.
2808
2809 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
2810
2811         * interface.cs: In all interface classes removed redundant
2812         member initialization.
2813
2814 2004-03-16  Martin Baulig  <martin@ximian.com>
2815
2816         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
2817
2818 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
2819
2820         * decl.cs (DefineTypeAndParents): New helper method to define a
2821         type's containers before the type itself is defined;  This is a
2822         bug exposed by the recent changes to Windows.Forms when an
2823         implemented interface was defined inside a class that had not been
2824         built yet.   
2825
2826         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
2827
2828         (Check): Loop correctly to report errors modifiers
2829         (UNSAFE was not in the loop, since it was the same as TOP).
2830
2831         * interface.cs: Every interface member now takes a ModFlags,
2832         instead of a "is_new" bool, which we set on the base MemberCore. 
2833
2834         Every place where we called "UnsafeOk" in the interface, now we
2835         call the proper member (InterfaceMethod.UnsafeOK) instead to get
2836         the unsafe settings from the member declaration instead of the
2837         container interface. 
2838
2839         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
2840
2841         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
2842         `set_indexer_name' to the pending bits (one per type).
2843
2844         We fixed a bug today that was picking the wrong method to
2845         override, since for properties the existing InterfaceMethod code
2846         basically ignored the method name.  Now we make sure that the
2847         method name is one of the valid indexer names.
2848
2849 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
2850  
2851         * support.cs (SeekableStreamReader): Keep track of stream byte
2852         positions and don't mix them with character offsets to the buffer.
2853
2854         Patch from Gustavo Giráldez
2855
2856 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
2857
2858         * interface.cs (InterfaceSetGetBase): Removed double member
2859         initialization, base class does it as well.
2860
2861 2004-03-13  Martin Baulig  <martin@ximian.com>
2862
2863         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
2864         when compiling corlib.
2865
2866 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
2867
2868         * convert.cs (ExplicitConversion): We were reporting an error on
2869         certain conversions (object_type source to a value type, when the
2870         expression was `null') before we had a chance to pass it through
2871         the user defined conversions.
2872
2873         * driver.cs: Replace / and \ in resource specifications to dots.
2874         Fixes 50752
2875
2876         * class.cs: Add check for duplicate operators.  Fixes 52477
2877
2878 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
2879
2880         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
2881         that are in the middle of the statements, not only at the end.
2882         Fixes #54987
2883
2884         * class.cs (TypeContainer.AddField): No longer set the
2885         `HaveStaticConstructor' flag, now we call it
2886         `UserDefineStaticConstructor' to diferentiate the slightly
2887         semantic difference.
2888
2889         The situation is that we were not adding BeforeFieldInit (from
2890         Modifiers.TypeAttr) to classes that could have it.
2891         BeforeFieldInit should be set to classes that have no static
2892         constructor. 
2893
2894         See:
2895
2896         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
2897
2898         And most importantly Zoltan's comment:
2899
2900         http://bugzilla.ximian.com/show_bug.cgi?id=44229
2901
2902         "I think beforefieldinit means 'it's ok to initialize the type sometime 
2903          before its static fields are used', i.e. initialization does not need
2904          to be triggered by the first access to the type. Setting this flag
2905          helps the JIT to compile better code, since it can run the static
2906          constructor at JIT time, and does not need to generate code to call it
2907          (possibly lots of times) at runtime. Unfortunately, mcs does not set
2908          this flag for lots of classes like String. 
2909          
2910          csc sets this flag if the type does not have an explicit static 
2911          constructor. The reasoning seems to be that if there are only static
2912          initalizers for a type, and no static constructor, then the programmer
2913          does not care when this initialization happens, so beforefieldinit
2914          can be used.
2915          
2916          This bug prevents the AOT compiler from being usable, since it 
2917          generates so many calls to mono_runtime_class_init that the AOT code
2918          is much slower than the JITted code. The JITted code is faster, 
2919          because it does not generate these calls if the vtable is type is
2920          already initialized, which is true in the majority of cases. But the
2921          AOT compiler can't do this."
2922
2923 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
2924
2925         * class.cs (MethodData.Emit): Refactor the code so symbolic
2926         information is generated for destructors;  For some reasons we
2927         were taking a code path that did not generate symbolic information
2928         before. 
2929
2930 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
2931
2932         * class.cs: Create a Constructor.CheckBase method that
2933         takes care of all validation type code. The method
2934         contains some code that was moved from Define.
2935
2936         It also includes new code that checks for duplicate ctors.
2937         This fixes bug #55148.
2938
2939 2004-03-09  Joshua Tauberer <tauberer@for.net>
2940
2941         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
2942         a { ... }-style array creation invokes EmitStaticInitializers
2943         which is not good for reference-type arrays.  String, decimal
2944         and now null constants (NullCast) are not counted toward
2945         static initializers.
2946
2947 2004-03-05  Martin Baulig  <martin@ximian.com>
2948
2949         * location.cs (SourceFile.HasLineDirective): New public field;
2950         specifies whether the file contains or is referenced by a "#line"
2951         directive.
2952         (Location.DefineSymbolDocuments): Ignore source files which
2953         either contain or are referenced by a "#line" directive.        
2954
2955 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
2956
2957         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
2958         direct access to our parent, so check the method inline there.
2959
2960 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
2961
2962         * expression.cs (Invocation.EmitCall): Miguel's last commit
2963         caused a regression. If you had:
2964
2965             T t = null;
2966             t.Foo ();
2967
2968         In Foo the implict this would be null.
2969
2970 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
2971
2972         * expression.cs (Invocation.EmitCall): If the method is not
2973         virtual, do not emit a CallVirt to it, use Call.
2974
2975         * typemanager.cs (GetFullNameSignature): Improve the method to
2976         cope with ".ctor" and replace it with the type name.
2977
2978         * class.cs (ConstructorInitializer.Resolve): Now the method takes
2979         as an argument the ConstructorBuilder where it is being defined,
2980         to catch the recursive constructor invocations.
2981
2982 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
2983
2984         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
2985         routines to check if a type is an enumerable/enumerator allow
2986         classes that implement the IEnumerable or IEnumerator interfaces.
2987
2988         * class.cs (Property, Operator): Implement IIteratorContainer, and
2989         implement SetYields.
2990
2991         (Property.Define): Do the block swapping for get_methods in the
2992         context of iterators.   We need to check if Properties also
2993         include indexers or not.
2994
2995         (Operator): Assign the Block before invoking the
2996         OperatorMethod.Define, so we can trigger the Iterator code
2997         replacement. 
2998
2999         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
3000         Property and Operator classes are not created when we parse the
3001         declarator but until we have the block completed, so we use a
3002         singleton SimpleIteratorContainer.Simple to flag whether the
3003         SetYields has been invoked.
3004
3005         We propagate this setting then to the Property or the Operator to
3006         allow the `yield' to function.
3007
3008 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
3009
3010         * codegen.cs: Implemented attribute support for modules.
3011         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
3012         Assembly/Module functionality.
3013
3014         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
3015         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
3016         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
3017
3018 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
3019
3020         * interface.cs (FindMembers): The operation is performed on all base
3021         interfaces and not only on the first. It is required for future CLS Compliance patch.
3022
3023 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
3024
3025         * statement.cs, codegen.cs:
3026         This patch deals with patterns such as:
3027
3028         public class List : IEnumerable {
3029
3030                 public MyEnumerator GetEnumerator () {
3031                         return new MyEnumerator(this);
3032                 }
3033
3034                 IEnumerator IEnumerable.GetEnumerator () {
3035                         ...
3036                 }
3037                 
3038                 public struct MyEnumerator : IEnumerator {
3039                         ...
3040                 }
3041         }
3042
3043         Before, there were a few things we did wrong:
3044         1) we would emit callvirt on a struct, which is illegal
3045         2) we emited ldarg when we needed to emit ldarga
3046         3) we would mistakenly call the interface methods on an enumerator
3047         type that derived from IEnumerator and was in another assembly. For example:
3048
3049         public class MyEnumerator : IEnumerator
3050
3051         Would have the interface methods called, even if there were public impls of the
3052         method. In a struct, this lead to invalid IL code.
3053
3054 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
3055
3056         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
3057           renamed to Emit.
3058
3059         * delegate.cs (Define): Fixed crash when delegate type is undefined.
3060
3061 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
3062
3063         * cs-parser.jay: Fix small regression: we were not testing V2
3064         compiler features correctly.
3065
3066         * interface.cs: If the emit context is null, then create one
3067
3068 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
3069
3070         * decl.cs (GetSignatureForError): New virtual method to get full name
3071           for error messages.
3072
3073         * attribute.cs (IAttributeSupport): New interface for attribute setting.
3074           Now it is possible to rewrite ApplyAttributes method to be less if/else.
3075
3076         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
3077           Duplicated members and code in these classes has been removed.
3078           Better encapsulation in these classes.
3079
3080 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
3081
3082         * assign.cs (Assign.DoResolve): When dealing with compound
3083         assignments, there is a new rule in ECMA C# 2.4 (might have been
3084         there before, but it is documented here) that states that in:
3085
3086         a op= b;
3087
3088         If b is of type int, and the `op' is a shift-operator, then the
3089         above is evaluated as:
3090
3091         a = (int) a op b 
3092
3093         * expression.cs (Binary.ResolveOperator): Instead of testing for
3094         int/uint/long/ulong, try to implicitly convert to any of those
3095         types and use that in pointer arithmetic.
3096
3097         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
3098         method to print information for from the type, not from the
3099         null-method we were given.
3100
3101 2004-02-01  Duncan Mak  <duncan@ximian.com>
3102
3103         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
3104         parsing for cmd, fixes bug #53694.
3105
3106 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
3107
3108         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
3109         in the member name duplication tests. Property and operator name duplication
3110         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
3111
3112 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
3113
3114         * interface.cs (PopulateMethod): Fixed crash when interface method
3115         returns not existing type (error test cs0246-3.cs).
3116
3117 2004-02-02  Ravi Pratap M <ravi@ximian.com>
3118
3119         * cs-parser.jay (interface_accessors): Re-write actions to also
3120         store attributes attached to get and set methods. Fix spelling
3121         while at it.
3122
3123         (inteface_property_declaration): Modify accordingly.
3124
3125         (InterfaceAccessorInfo): New helper class to store information to pass
3126         around between rules that use interface_accessors.
3127
3128         * interface.cs (Emit): Apply attributes on the get and set
3129         accessors of properties and indexers too.
3130
3131         * attribute.cs (ApplyAttributes): Modify accordingly to use the
3132         right MethodBuilder when applying attributes to the get and set accessors.
3133
3134 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
3135
3136         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
3137
3138 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
3139
3140         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
3141
3142 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
3143
3144         * cs-parser.jay: Remove YIELD token, instead use the new grammar
3145         changes that treat `yield' specially when present before `break'
3146         or `return' tokens.
3147
3148         * cs-tokenizer.cs: yield is no longer a keyword.
3149
3150 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
3151
3152         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
3153         setting for default constructors.
3154         For default constructors are almost every time set wrong Modifier. The
3155         generated IL code has been alright. But inside mcs this values was
3156         wrong and this was reason why several of my CLS Compliance tests
3157         failed.
3158
3159 2004-01-22  Martin Baulig  <martin@ximian.com>
3160
3161         * cs-parser.jay (namespace_or_type_name): Return an Expression,
3162         not a QualifiedIdentifier.  This is what `type_name_expression'
3163         was previously doing.
3164         (type_name_expression): Removed; the code is now in
3165         `namespace_or_type_name'.
3166         (qualified_identifier): Removed, use `namespace_or_type_name'
3167         instead.
3168         (QualifiedIdentifier): Removed this class.      
3169
3170 2004-01-22  Martin Baulig  <martin@ximian.com>
3171
3172         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
3173         not a string as alias name.
3174
3175 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
3176
3177         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
3178         #52730 bug, and instead compute correctly the need to use a
3179         temporary variable when requesting an address based on the
3180         static/instace modified of the field and the constructor.
3181  
3182 2004-01-21  Martin Baulig  <martin@ximian.com>
3183
3184         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
3185         class and namespace before looking up aliases.  Fixes #52517.
3186
3187 2004-01-21  Martin Baulig  <martin@ximian.com>
3188
3189         * flowanalysis.cs (UsageVector.Merge): Allow variables being
3190         assinged in a 'try'; fixes exception4.cs.
3191
3192 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3193         * class.cs : Implemented parameter-less constructor for TypeContainer
3194
3195         * decl.cs: Attributes are now stored here. New property OptAttributes
3196
3197         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
3198
3199         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
3200
3201 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3202
3203         * typemanager.cs (CSharpSignature): Now reports also inner class name.
3204           (CSharpSignature): New method for indexer and property signature.
3205
3206 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3207
3208         * pending.cs (IsVirtualFilter): Faster implementation.
3209
3210 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3211
3212         * typemanager.cs: Avoid inclusion of same assembly more than once.
3213
3214 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3215
3216         * cs-parser.jay: Fixed problem where the last assembly attribute
3217           has been applied also to following declaration (class, struct, etc.)
3218           
3219 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
3220
3221         * class.cs: Added error CS0538, CS0539 reporting.
3222         Fixed crash on Microsoft runtime when field type is void.
3223
3224         * cs-parser.jay: Added error CS0537 reporting.
3225
3226         * pending.cs: Added error CS0535 reporting.
3227         Improved error report for errors CS0536, CS0534.
3228
3229 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
3230
3231         Merge a few bits from the Anonymous Method MCS tree.
3232
3233         * statement.cs (ToplevelBlock): New class for toplevel methods,
3234         will hold anonymous methods, lifted variables.
3235
3236         * cs-parser.jay: Create toplevel blocks for delegates and for
3237         regular blocks of code. 
3238
3239 2004-01-20  Martin Baulig  <martin@ximian.com>
3240
3241         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
3242         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
3243         and `NeedExplicitReturn'; added `IsLastStatement'.
3244         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
3245         have a `ReturnLabel' or we're not unreachable.
3246
3247         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
3248         child's reachability; don't just override ours with it.  Fixes
3249         #58058 (lluis's example).
3250         (FlowBranching): Added public InTryOrCatch(), InCatch(),
3251         InFinally(), InLoop(), InSwitch() and
3252         BreakCrossesTryCatchBoundary() methods.
3253
3254         * statement.cs (Return): Do all error checking in Resolve().
3255         Unless we are the last statement in a top-level block, always
3256         create a return label and jump to it.
3257         (Break, Continue): Do all error checking in Resolve(); also make
3258         sure we aren't leaving a `finally'.
3259         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
3260         statement in a top-level block.
3261         (Block.Flags): Added `IsDestructor'.
3262         (Block.IsDestructor): New public property.
3263
3264 2004-01-20  Martin Baulig  <martin@ximian.com>
3265
3266         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
3267
3268 2004-01-20  Martin Baulig  <martin@ximian.com>
3269
3270         * statement.cs (Statement.ResolveUnreachable): New public method.
3271         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
3272         (Block.Resolve): Resolve unreachable statements.
3273
3274 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3275
3276         * expression.cs: We need to fix the case where we do
3277         not have a temp variable here.
3278
3279         * assign.cs: Only expression compound assignments need
3280         temporary variables.
3281
3282 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
3283
3284         * flowanalysis.cs: Reduce memory allocation in a few ways:
3285           - A block with no variables should not allocate a bit
3286             vector for itself.
3287           - A method with no out parameters does not need any tracking
3288             for assignment of the parameters, so we need not allocate
3289             any data for it.
3290           - The arrays:
3291                 public readonly Type[] VariableTypes;
3292                 public readonly string[] VariableNames;
3293             Are redundant. The data is already stored in the variable
3294             map, so we need not allocate another array for it.
3295           - We need to add alot of checks for if (params | locals) == null
3296             due to the first two changes.
3297
3298 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
3299
3300         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
3301         implement IMemoryLocation, we store a copy on a local variable and
3302         take the address of it.  Patch from Benjamin Jemlich
3303
3304         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
3305         to use a special "type_name_expression" rule which reduces the
3306         number of "QualifiedIdentifier" classes created, and instead
3307         directly creates MemberAccess expressions.
3308
3309 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
3310
3311         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
3312         that fixes #52853.  Null literal assignment to ValueType
3313
3314         * class.cs (MethodData.Emit): Instead of checking the name of the
3315         method to determine if its a destructor, create a new derived
3316         class from Method called Destructor, and test for that.  
3317
3318         * cs-parser.jay: Create a Destructor object instead of a Method.  
3319
3320         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
3321
3322         Fixes: 52933
3323
3324 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
3325
3326         * expression.cs (Binary.ResolveOperator): Perform an implicit
3327         conversion from MethodGroups to their delegate types on the
3328         Addition operation.
3329
3330         * delegate.cs: Introduce a new class DelegateCreation that is the
3331         base class for `NewDelegate' and `ImplicitDelegateCreation',
3332         factor some code in here.
3333
3334         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
3335         conversion from MethodGroups to compatible delegate types. 
3336
3337         * ecore.cs (Expression.Resolve): Do not flag error 654
3338         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
3339         we allow conversions from MethodGroups to delegate types now.
3340
3341         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
3342         assignments in v2 either.
3343
3344 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
3345
3346         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
3347         static read-only fields in ctors.
3348
3349         Applied patch from Benjamin Jemlich 
3350
3351         * expression.cs (UnaryMutator): Avoid leaking local variables. 
3352
3353 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
3354
3355         * cs-tokenizer.cs (IsCastToken): Allow the various native types
3356         here to return true, as they can be used like this:
3357
3358                 (XXX) int.MEMBER ()
3359
3360         Fixed 49836 and all the other dups
3361
3362 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
3363
3364         * driver.cs: Implement /win32res and /win32icon.
3365
3366 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
3367
3368         * cs-parser.jay: Add a rule to improve error handling for the
3369         common mistake of placing modifiers after the type.
3370
3371 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
3372
3373         * cs-parser.jay (interface_event_declaration): Catch
3374         initialization of events on interfaces, and report cs0068
3375
3376         * cs-parser.jay (interface_event_declaration): Catch
3377         initialization of events. 
3378
3379         * ecore.cs: Better report missing constructors.
3380
3381         * expression.cs (Binary.ResolveOperator): My previous bug fix had
3382         the error reporting done in the wrong place.  Fix.
3383
3384         * expression.cs (Binary.ResolveOperator): Catch the 
3385         operator + (E x, E y) error earlier, and later allow for implicit
3386         conversions in operator +/- (E e, U x) from U to the underlying
3387         type of E.
3388
3389         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
3390         52596, if the container class is abstract, the default constructor
3391         is protected otherwise its public (before, we were always public).
3392
3393         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
3394         fixed statement.
3395
3396         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
3397         Jemlich that fixes bug #52597, MCS was generating invalid code for
3398         idisposable structs.   Thanks to Ben for following up with this
3399         bug as well.
3400
3401 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
3402
3403         * driver.cs: Allow assemblies without code to be generated, fixes
3404         52230.
3405
3406 2004-01-07  Nick Drochak <ndrochak@gol.com>
3407
3408         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
3409
3410 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
3411
3412         * cs-parser.jay: Add rules to improve error reporting if fields or
3413         methods are declared at the namespace level (error 116)
3414
3415         * Add rules to catch event add/remove
3416
3417 2004-01-04  David Sheldon <dave-mono@earth.li>
3418
3419   * expression.cs: Added matching ")" to error message for 
3420   CS0077
3421
3422 2004-01-03 Todd Berman <tberman@gentoo.org>
3423
3424         * ecore.cs, attribute.cs:
3425         Applying fix from #52429.
3426
3427 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3428
3429         * ecore.cs, expression.cs, statement.cs:
3430         Total rewrite of how we handle branching. We
3431         now handle complex boolean expressions with fewer
3432         jumps. As well if (x == 0) no longer emits a ceq.
3433
3434         if (x is Foo) is much faster now, because we generate
3435         better code.
3436
3437         Overall, we get a pretty big improvement on our benchmark
3438         tests. The code we generate is smaller and more readable.
3439
3440         I did a full two-stage bootstrap. The patch was reviewed
3441         by Martin and Miguel.
3442
3443 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3444
3445         * cs-parser.jay: Make primary_expression not take a QI.
3446         we dont need this because the member_access rule covers
3447         us here. So we replace the rule with just IDENTIFIER.
3448
3449         This has two good effects. First, we remove a s/r conflict.
3450         Second, we allocate many fewer QualifiedIdentifier objects.
3451
3452 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3453
3454         * attribute.cs: Handle MarshalAs attributes as pseudo, and
3455         set the correct information via SRE. This prevents
3456         hanging on the MS runtime. Fixes #29374.
3457
3458 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
3459
3460         * convert.cs: correctly handle conversions to value types
3461         from Enum and ValueType as unboxing conversions.
3462
3463         Fixes bug #52569. Patch by Benjamin Jemlich.
3464
3465 2004-01-02  Ravi Pratap  <ravi@ximian.com>
3466
3467         * expression.cs (BetterConversion): Prefer int -> uint
3468         over int -> ulong (csc's behaviour). This fixed bug #52046.
3469
3470 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
3471
3472         * decl.cs (MemberCache.FindMembers): now returns a
3473         MemberInfo [].
3474
3475         * typemanager.cs: In general, go with with ^^.
3476         (CopyNewMethods): take an IList.
3477         (RealMemberLookup): Only allocate an arraylist
3478         if we copy from two sets of methods.
3479
3480         This change basically does two things:
3481         1) Fewer array lists allocated due to CopyNewMethods.
3482         2) the explicit cast in MemberList costed ALOT.
3483
3484 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
3485
3486         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
3487         a hashtable to avoid needless string allocations when an identifier is
3488         used more than once (the common case).
3489
3490 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
3491
3492         * pending.cs: MS's TypeBuilder.GetInterfaces ()
3493         is broken, it will not return anything. So, we
3494         have to use the information we have in mcs to
3495         do the task.
3496
3497         * typemanager.cs: Add a cache for GetInterfaces,
3498         since this will now be used more often (due to ^^)
3499
3500         (GetExplicitInterfaces) New method that gets the
3501         declared, not effective, interfaces on a type
3502         builder (eg, if you have interface IFoo, interface
3503         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
3504         { IBar }.
3505
3506         This patch makes MCS able to bootstrap itself on
3507         Windows again.
3508
3509 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
3510
3511         * expression.cs: Remove the Nop's that Miguel put
3512         in by mistake.
3513
3514 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3515
3516         * report.cs, codegen.cs: Give the real stack trace to
3517         the error when an exception is thrown.
3518
3519 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3520
3521         * decl.cs: only allocate hashtables for ifaces if 
3522         it is an iface!
3523
3524 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3525
3526         * expression.cs: fix the error from cs0121-2.cs
3527         (a parent interface has two child interfaces that
3528         have a function with the same name and 0 params
3529         and the function is called through the parent).
3530
3531 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3532
3533         * class.cs, rootcontext.cs, typmanager.cs: do not
3534         leak pointers.
3535
3536 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
3537
3538         * codegen.cs: remove stack for the ec flow branching.
3539         It is already a linked list, so no need.
3540
3541 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
3542
3543         * Makefile: Allow custom profiler here.
3544
3545 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
3546
3547         * typemanager.cs (LookupType):
3548           - Use a static char [], because split takes
3549             a param array for args, so it was allocating
3550             every time.
3551           - Do not store true in a hashtable, it boxes.
3552
3553 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
3554
3555         * flowanalysis.cs: bytify common enums.
3556
3557 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
3558
3559         * modifiers.cs: Add a new set of flags for the
3560         flags allowed on explicit interface impls.
3561         * cs-parser.jay: catch the use of modifiers in
3562         interfaces correctly.
3563         * class.cs: catch private void IFoo.Blah ().
3564
3565         All related to bug #50572.
3566
3567 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
3568
3569         * decl.cs: Rewrite the consistant accessability checking.
3570         Accessability is not linear, it must be implemented in
3571         a tableish way. Fixes #49704.
3572
3573 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
3574
3575         * expression.cs: Handle negation in a checked context.
3576         We must use subtraction from zero. Fixes #38674.
3577
3578 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3579
3580         * class.cs: Ignore static void main in DLLs.
3581         * rootcontext.cs: Handle the target type here,
3582         since we are have to access it from class.cs
3583         * driver.cs: account for the above.
3584
3585 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
3586
3587         * report.cs: Give line numbers and files if available.
3588
3589 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
3590
3591         * driver.cs: Implement /addmodule.
3592
3593         * typemanager.cs:  Change 'modules' field so it now contains Modules not
3594         ModuleBuilders.
3595
3596 2003-12-20  Martin Baulig  <martin@ximian.com>
3597
3598         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
3599         (FieldBase.IsAssigned): Removed this field.
3600         (FieldBase.SetAssigned): New public method.
3601         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
3602
3603 2003-12-20  Martin Baulig  <martin@ximian.com>
3604
3605         * expression.cs (LocalVariableReference.DoResolve): Don't set
3606         `vi.Used' if we're called from DoResolveLValue().
3607
3608         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
3609         returns the usage vector it just merged into the current one -
3610         pass this one to UsageWarning().
3611         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
3612         of the `EmitContext', don't call this recursively on our children.
3613
3614 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
3615
3616         * driver.cs: Implement /target:module.
3617
3618 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
3619
3620         * support.cs (CharArrayHashtable): New helper class.
3621
3622         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
3623         char arrays, not strings, so we can avoid creating a string in
3624         consume_identifier if the identifier is a keyword.
3625
3626 2003-12-16  Martin Baulig  <martin@ximian.com>
3627
3628         * statement.cs (LocalInfo.Assigned): Removed this property.
3629         (LocalInfo.Flags): Removed `Assigned'.
3630         (LocalInfo.IsAssigned): New public method; takes the EmitContext
3631         and uses flow analysis.
3632         (Block.UsageWarning): Made this method private.
3633         (Block.Resolve): Call UsageWarning() if appropriate.
3634
3635         * expression.cs (LocalVariableReference.DoResolve): Always set
3636         LocalInfo.Used here.
3637
3638 2003-12-13  Martin Baulig  <martin@ximian.com>
3639
3640         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
3641         any value here; we're now using flow analysis to figure out
3642         whether a statement/block returns a value.
3643
3644 2003-12-13  Martin Baulig  <martin@ximian.com>
3645
3646         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
3647         working again.
3648         (FlowBranching.MergeFinally): Don't call
3649         `branching.CheckOutParameters()' here, this is called in
3650         MergeTopBlock().
3651         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
3652         when adding the `finally' vector.       
3653
3654 2003-12-13  Martin Baulig  <martin@ximian.com>
3655
3656         * flowanalysis.cs
3657         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
3658         actually work and also fix #48962.
3659
3660 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
3661
3662         * decl.cs: Do not check System.Object for nested types,
3663         since we know it does not have any. Big bang for buck:
3664
3665         BEFORE:
3666            Run 1:   8.35 seconds
3667            Run 2:   8.32 seconds
3668            corlib:  17.99 seconds
3669         AFTER:
3670            Run 1:   8.17 seconds
3671            Run 2:   8.17 seconds
3672            corlib:  17.39 seconds
3673
3674 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
3675
3676         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
3677         time we are returning 0 members, so we save alot here.
3678
3679 2003-12-11  Martin Baulig  <martin@ximian.com>
3680
3681         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
3682         `MergeChild()', also just take the `FlowBranching' as argument;
3683         call Merge() on it and return the result.
3684         (FlowBranching.Merge): We don't need to do anything if we just
3685         have one sibling.
3686
3687 2003-12-11  Martin Baulig  <martin@ximian.com>
3688
3689         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
3690         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
3691         Maurer for this idea.
3692
3693 2003-12-11  Martin Baulig  <martin@ximian.com>
3694
3695         * flowanalysis.cs (MergeResult): This class is now gone; we now
3696         use the `UsageVector' for this.  The reason for this is that if a
3697         branching just has one sibling, we don't need to "merge" them at
3698         all - that's the next step to do.
3699         (FlowBranching.Merge): We now return a `UsageVector' instead of a
3700         `MergeResult'.
3701
3702 2003-12-11  Martin Baulig  <martin@ximian.com>
3703
3704         Reworked flow analyis and made it more precise and bug-free.  The
3705         most important change is that we're now using a special `Reachability'
3706         class instead of having "magic" meanings of `FlowReturns'.  I'll
3707         do some more cleanups and optimizations and also add some more
3708         documentation this week.
3709
3710         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
3711         largely reworked this class.
3712         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
3713         the new `Reachability' class instead of having "magic" values here.
3714         (FlowBranching): We're now using an instance of `Reachability'
3715         instead of having separate `Returns', `Breaks' etc. fields.
3716
3717         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
3718         based on flow analysis; ignore the return value of block.Emit ().
3719
3720 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
3721
3722         * driver.cs typemanager.cs: Find the mono extensions to corlib even
3723         if they are private.
3724
3725 2003-12-09  Martin Baulig  <martin@ximian.com>
3726
3727         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
3728         call them directly on the UsageVector.
3729
3730 2003-12-09  Martin Baulig  <martin@ximian.com>
3731
3732         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
3733         Changed return type from `FlowReturns' to `Reachability'.
3734
3735 2003-12-09  Martin Baulig  <martin@ximian.com>
3736
3737         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
3738         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
3739         `Reachable' fields with a single `Reachability' one.
3740
3741 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
3742
3743         * class.cs (FindMembers): Remove foreach's.
3744
3745         Bootstrap times:
3746
3747         BEFORE
3748                 Run 1:   8.74 seconds
3749                 Run 2:   8.71 seconds
3750
3751         AFTER
3752                 Run 1:   8.64 seconds
3753                 Run 2:   8.58 seconds
3754
3755
3756 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
3757
3758         * cs-parser.jay:
3759         * gen-treedump.cs:
3760         * statement.cs:
3761         This patch does a few things:
3762                 1. EmptyStatement is now a singleton, so it is never reallocated.
3763                 2. All blah is EmptyStatement constructs have been changed to
3764                    blah == EmptyStatement.Value, which is much faster and valid
3765                    now that EmptyStatement is a singleton.
3766                 3. When resolving a block, rather than allocating a new array for
3767                    the non-empty statements, empty statements are replaced with
3768                    EmptyStatement.Value
3769                 4. Some recursive functions have been made non-recursive.
3770         Mainly the performance impact is from (3), however (1) and (2) are needed for
3771         this to work. (4) does not make a big difference in normal situations, however
3772         it makes the profile look saner.
3773
3774         Bootstrap times:
3775
3776         BEFORE
3777         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
3778         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
3779         Total memory allocated: 56397 KB
3780
3781         AFTER
3782         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
3783         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
3784         Total memory allocated: 55666 KB
3785
3786 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
3787
3788         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
3789         than the hashtable in a hashtable version
3790
3791         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
3792         we always end up concating a string. This results in a huge perf
3793         loss, because many strings have to be tracked by the GC. In this
3794         patch, we first use a hashtable that works with two keys, so that
3795         the strings do not need to be concat'ed.
3796
3797         Bootstrap times:
3798         BEFORE
3799                 Run 1:   8.74 seconds
3800                 Run 2:   8.71 seconds
3801
3802         AFTER
3803                 Run 1:   8.65 seconds
3804                 Run 2:   8.56 seconds
3805
3806 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
3807
3808         * Makefile: Add a new target `do-time' that does a quick and simple
3809         profile, leaving easy to parse output.
3810
3811 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
3812
3813         * codegen.cs (Init): Create the dynamic assembly with 
3814         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
3815
3816 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
3817
3818         * support.cs: Make the PtrHashtable use only one
3819         instance of its comparer.
3820
3821 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
3822
3823         * typemanager.cs: Fix lookup of GetNamespaces.
3824
3825 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
3826
3827         * expression.cs: Removed redundant line.
3828
3829         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
3830         ArrayLists, use for loops with bounds.  
3831
3832         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
3833         arraylist.
3834
3835         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
3836         arraylists, use for loop with bounds.
3837
3838         The above three changes give us a 0.071 second performance
3839         improvement out of 3.294 seconds down to 3.223.  On my machine
3840         the above changes reduced the memory usage by 1,387 KB during
3841         compiler bootstrap.
3842
3843         * cs-parser.jay (QualifiedIdentifier): New class used to represent
3844         QualifiedIdentifiers.  Before we created a new string through
3845         concatenation, and mostly later on, the result would be
3846         manipulated by DecomposeQI through string manipulation.
3847
3848         This reduced the compiler memory usage for bootstrapping from
3849         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
3850         compile times in 0.05 seconds.
3851
3852 2003-11-28  Dick Porter  <dick@ximian.com>
3853
3854         * support.cs: Do string compares with the Invariant culture.
3855
3856         * rootcontext.cs: 
3857         * gen-treedump.cs: 
3858         * expression.cs: 
3859         * driver.cs: 
3860         * decl.cs: 
3861         * codegen.cs: 
3862         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
3863         the comparison is done with the Invariant culture.
3864
3865 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
3866
3867         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
3868         GetEnumerator method.
3869
3870         (ProbeCollectionType): Iterate starting at the most specific type
3871         upwards looking for a GetEnumerator
3872
3873         * expression.cs: Shift count can be up to 31 for int/uint and 63
3874         for long/ulong.
3875
3876 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
3877
3878         * statement.cs (Block.LookupLabel): Also look for the label on the
3879         children blocks.  Use a hash table to keep track of visited
3880         nodes. 
3881
3882         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
3883         we actually did transform the other operand, otherwise fall back
3884         to the common codepath that casts to long.
3885
3886         * cs-tokenizer.cs: Use the same code pattern as the int case.
3887         Maybe I should do the parsing myself, and avoid depending on the
3888         Parse routines to get this done.
3889
3890 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
3891
3892         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
3893         which fixes bug 51347.  This time test it.
3894
3895         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
3896         attributes for example can not tell the difference between these.
3897         The difference was only a syntax feature of the language. 
3898
3899         * attribute.cs: Apply attributes to delegates.
3900
3901         * delegate.cs: Call the apply attributes method.
3902
3903 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
3904
3905         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
3906         comparing 0 vs Byte.MinValue, not the value
3907
3908         (ImplicitConversionRequired): When reporting a conversion error,
3909         use error 31 to print out the constant error instead of the
3910         simpler 29.
3911
3912         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
3913         which fixes bug 51347.
3914
3915 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
3916
3917         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
3918         which fixes the -warnaserror command line option.
3919
3920 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
3921
3922         * cfold.cs (DoNumericPromotions): During constant folding of
3923         additions on UIntConstant, special case intconstants with
3924         IntConstants like we do on the expression binary operator. 
3925
3926 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
3927
3928         * convert.cs (ImplicitReferenceConversion): We were missing a case
3929         (System.Enum are not value types or class types, so we need to
3930         classify them separatedly).
3931
3932         * driver.cs: We do not support error 2007.
3933
3934 2003-11-12 Jackson Harper <jackson@ximian.com>
3935
3936         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
3937         system directory. Also use the full file name so users can
3938         libraries names mscorlib-o-tron.dll in a non system dir.
3939
3940 2003-11-10  Martin Baulig  <martin@ximian.com>
3941
3942         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
3943         (TypeManager.InitCoreTypes): Initialize them here, but instead of
3944         calling `ResolveType()' on them, directly assign their `Type'.
3945
3946 2003-11-08  Martin Baulig  <martin@ximian.com>
3947
3948         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
3949         return value and the `out parent' parameter.
3950         (TypeContainer.DefineType): Moved the CS0644 check into
3951         GetClassBases().  Don't pass the interface types to the
3952         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
3953         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
3954
3955         * ecore.cs (TypeExpr.IsAttribute): New property.
3956         (TypeExpr.GetInterfaces): New method.
3957
3958         * interface.cs (Interface.GetInterfaceTypeByName): Return a
3959         TypeExpr instead of a Type.
3960         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
3961         (Interface.DefineType): Don't pass the interface types to the
3962         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
3963         them later and then call `TypeBulider.AddInterfaceImplementation()'.
3964
3965         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
3966         instead of a `Type[]'.
3967         (TypeManager.RegisterBuilder): Likewise.
3968         (TypeManager.AddUserInterface): Likewise.
3969         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
3970         `Type[]' and also return a `TypeExpr[]'.
3971         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
3972
3973 2003-11-08  Martin Baulig  <martin@ximian.com>
3974
3975         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
3976         Expression.     
3977
3978 2003-11-08  Martin Baulig  <martin@ximian.com>
3979
3980         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
3981         TypeManager.ResolveExpressionTypes().
3982
3983         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
3984         instead of an Expression.
3985         (TypeExpr): This is now an abstract base class for `TypeExpression'.
3986         (TypeExpression): New public class; formerly known as `TypeExpr'.
3987
3988         * expression.cs (ComposedCast): Derive from TypeExpr.
3989
3990         * typemanager.cs (TypeManager.system_*_expr): These are now
3991         TypExpr's instead of Expression's.
3992         (TypeManager.ResolveExpressionTypes): New public static function;
3993         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
3994         of them.        
3995
3996 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
3997
3998         * expression.cs (New.DoResolve): Do not dereference value that
3999         might be a null return.
4000
4001         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
4002         sure that the constant value has the right type.  Fixes an
4003         unreported bug, similar to 50425.
4004
4005         * const.cs (Const.LookupConstantValue): Call
4006         ImplicitStandardConversionExists before doing a conversion to
4007         avoid havng the TypeManager.ChangeType do conversions.
4008
4009         Reduced the number of casts used
4010
4011         (Const.ChangeType): New routine to enable reuse of the constant
4012         type changing code from statement.
4013
4014         * typemanager.cs (ChangeType): Move common initialization to
4015         static global variables.
4016
4017         Fixes #50425.
4018
4019         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
4020         every value type to go through, even if it was void.  Fix that. 
4021
4022         * cs-tokenizer.cs: Use is_identifier_start_character on the start
4023         character of the define, and the is_identifier_part_character for
4024         the rest of the string.
4025
4026 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
4027
4028         * expression.cs (UnaryMutator.EmitCode): When I updated
4029         LocalVariableReference.DoResolve, I overdid it, and dropped an
4030         optimization done on local variable references.
4031
4032 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
4033
4034         * ecore.cs: Convert the return from Ldlen into an int.
4035
4036 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
4037
4038         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
4039         the accessibility, this is a special case for toplevel non-public
4040         classes (internal for instance).
4041
4042 2003-10-20  Nick Drochak <ndrochak@gol.com>
4043
4044         * ecore.cs: Fix typo and build.  Needed another right paren.
4045
4046 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
4047
4048         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
4049         `internal' case regular and protected, but not allowing protected
4050         to be evaluated later.  Bug 49840
4051
4052 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
4053
4054         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
4055         to kb.Nlast, and not the kb.nFirst to isolate the switch
4056         statement.
4057
4058         Extract the underlying type, so enumerations of long/ulong are
4059         treated like long/ulong.
4060
4061 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
4062
4063         * expression.cs (New): Overload the meaning of RequestedType to
4064         track the possible creation of the NewDelegate type, since
4065         DoResolve is invoked more than once for new constructors on field
4066         initialization.
4067
4068         See bugs: #48800 and #37014
4069
4070         * cs-parser.jay (declare_local_constants): Take an arraylist
4071         instead of a single constant.
4072
4073         (local_constant_declaration): It should take a
4074         constant_declarators, not a constant_declarator.  Fixes 49487
4075
4076         * convert.cs: Fix error report.
4077
4078 2003-10-13 Jackson Harper <jackson@ximian.com>
4079
4080         * typemanager.cs (TypeToCoreType): Add float and double this fixes
4081         bug #49611
4082
4083 2003-10-09  Martin Baulig  <martin@ximian.com>
4084
4085         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
4086         to the .ctor.
4087         (MethodCore.DoDefineParameters): Removed the TypeContainer
4088         argument; use the DeclSpace which was passed to the .ctor instead.
4089         (MethodCore.CheckParameter): Take a DeclSpace instead of a
4090         TypeContainer; we only need a DeclSpace here.
4091
4092 2003-10-09  Martin Baulig  <martin@ximian.com>
4093
4094         * class.cs (MethodData): Added additional `DeclSpace ds' argument
4095         to the .ctor.
4096         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
4097         EmitContext's .ctor.    
4098
4099 2003-10-09  Martin Baulig  <martin@ximian.com>
4100
4101         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
4102         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
4103         AsAccessible(), moved them as well.
4104
4105         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
4106
4107 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
4108
4109         * cs-parser.jay : Renamed yyName to yyNames related to jay.
4110
4111 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
4112
4113         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
4114         generation for >=, as spotted by Paolo, bug 48679.  
4115         Patch from David Waite.
4116
4117         * cs-tokenizer.cs: Add handling for #pragma.
4118
4119         * cs-parser.jay: Allow for both yield and yield return in the
4120         syntax.  The anti-cobolization of C# fight will go on!
4121
4122         * class.cs (TypeBuilder.DefineType): Catch error condition here
4123         (Parent.DefineType erroring out and returning null).
4124
4125         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
4126         coping with enumerations variables, we were mistakenly processing
4127         them as a regular value type instead of built-in types.  Fixes the
4128         bug #48063
4129
4130         * typemanager.cs (IsBuiltinOrEnum): New method.
4131
4132 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
4133
4134         * cs-parser.jay: Upgrade: yield now needs the return clause.
4135
4136 2003-09-19  Martin Baulig  <martin@ximian.com>
4137
4138         * decl.cs (MemberCache.SetupCacheForInterface): Take a
4139         `MemberCache parent' argument.  Normally, an interface doesn't
4140         have a parent type except System.Object, but we use this in gmcs
4141         for generic type parameters.
4142
4143 2003-09-18  Martin Baulig  <martin@ximian.com>
4144
4145         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
4146         on `type.IsInterface'; don't check whether the type has a parent
4147         to determine whether it's an interface.
4148
4149 2003-09-15  Martin Baulig  <martin@ximian.com>
4150
4151         * class.cs (TypeContainer.DefineType): Added an error flag to
4152         avoid reporting duplicate CS0146's ("class definition is
4153         circular.").
4154
4155         * driver.cs (Driver.MainDriver): Abort if
4156         RootContext.ResolveTree() reported any errors.
4157
4158 2003-09-07  Martin Baulig  <martin@ximian.com>
4159
4160         * report.cs (Error, Warning): Added overloaded versions which take
4161         a `params object[] args' and call String.Format().
4162
4163 2003-09-07  Martin Baulig  <martin@ximian.com>
4164
4165         * decl.cs (DeclSpace..ctor): Don't call
4166         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
4167         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
4168         (DeclSpace.RecordDecl): New method.
4169
4170         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
4171
4172 2003-09-02  Ravi Pratap  <ravi@ximian.com>
4173
4174         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
4175         value attributes to be applied to ParameterBuilders.
4176
4177         * class.cs (MethodCore.LabelParameters): Make static and more
4178         generic so that it can be used from other places - like interface
4179         methods, for instance.
4180
4181         * interface.cs (Interface.Emit): Call LabelParameters before
4182         emitting attributes on the InterfaceMethod.
4183
4184 2003-08-26  Martin Baulig  <martin@ximian.com>
4185
4186         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
4187         resolving aliases; fixes #47927.
4188
4189 2003-08-26  Martin Baulig  <martin@ximian.com>
4190
4191         * statement.cs (Using.DoResolve): This is internally emitting a
4192         try/finally clause, so we need to set ec.NeedExplicitReturn if we
4193         do not always return.  Fixes #47681.
4194
4195 2003-08-26  Martin Baulig  <martin@ximian.com>
4196
4197         * decl.cs (MemberCore): Moved WarningNotHiding(),
4198         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
4199         into MemberBase.
4200         (AdditionResult): Make this nested in DeclSpace.
4201         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
4202         argument; call NamespaceEntry.Define() unless we're nested in a
4203         class or struct.
4204
4205         * namespace.cs (Namespace.DefineName): New public function.  This
4206         is called from DeclSpace's .ctor to add 
4207         (Namespace.Lookup): Include DeclSpaces in the lookup.
4208
4209         * class.cs (Operator): Derive from MemberBase, not MemberCore.
4210
4211         * const.cs (Const): Derive from MemberBase, not MemberCore.     
4212
4213 2003-08-25  Martin Baulig  <martin@ximian.com>
4214
4215         * convert.cs (Convert.ExplicitReferenceConversion): When
4216         converting from an interface type to a class, unbox if the target
4217         type is a struct type.  Fixes #47822.
4218
4219 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4220
4221         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
4222         #47854.
4223
4224 2003-08-22  Martin Baulig  <martin@ximian.com>
4225
4226         * class.cs (TypeManager.DefineType): When defining a nested type,
4227         call DefineType() on our parent; fixes #47801.
4228
4229 2003-08-22  Martin Baulig  <martin@ximian.com>
4230
4231         * class.cs (MethodData.Define): While checking if a method is an
4232         interface implementation, improve the test a bit more to fix #47654.
4233
4234 2003-08-22  Martin Baulig  <martin@ximian.com>
4235
4236         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
4237         correctly; fixes #47722.
4238
4239 2003-08-22  Martin Baulig  <martin@ximian.com>
4240
4241         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
4242         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
4243
4244         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
4245
4246 2003-08-22  Martin Baulig  <martin@ximian.com>
4247
4248         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
4249         can only be assigned in static constructors.  Fixes #47161.
4250
4251 2003-08-22  Martin Baulig  <martin@ximian.com>
4252
4253         Rewrote and improved the flow analysis code.
4254
4255         * flowbranching.cs (FlowBranching): Make this class abstract.
4256         (FlowBranching.CreateBranching): New static function to create a
4257         new flow branching.
4258         (FlowBranchingBlock, FlowBranchingException): New classes.
4259         (FlowBranching.UsageVector.Type): New public readonly field.
4260         (FlowBranching.UsageVector.Breaks): Removed the setter.
4261         (FlowBranching.UsageVector.Returns): Removed the setter.
4262         (FlowBranching.UsageVector): Added Break(), Return(),
4263         NeverReachable() and Throw() methods to modify the reachability.
4264         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
4265         done by FlowBranching.Merge().
4266         (FlowBranching.UsageVector.MergeChild): New method; merges the
4267         merge result into the current vector.
4268         (FlowBranching.Merge): New abstract method to merge a branching.
4269
4270 2003-08-12  Martin Baulig  <martin@ximian.com>
4271
4272         * expression.cs (Indirection.CacheTemporaries): Create the
4273         LocalTemporary with the pointer type, not its element type.
4274
4275 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
4276
4277         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
4278         token was a keyword or not.
4279
4280         Add `error' options where an IDENTIFIER was expected;  Provide
4281         CheckToken and CheckIdentifierToken convenience error reporting
4282         functions. 
4283
4284         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
4285
4286         * decl.cs: Rename `NamespaceEntry Namespace' public field into
4287         NameSpaceEntry NameSpaceEntry.
4288
4289         (LookupInterfaceOrClass): Avoid creating a full qualified name
4290         from namespace and name: avoid doing lookups when we know the
4291         namespace is non-existant.   Use new Tree.LookupByNamespace which
4292         looks up DeclSpaces based on their namespace, name pair.
4293
4294         * driver.cs: Provide a new `parser verbose' to display the
4295         exception thrown during parsing.  This is turned off by default
4296         now, so the output of a failure from mcs is more graceful.
4297
4298         * namespace.cs: Track all the namespaces defined in a hashtable
4299         for quick lookup.
4300
4301         (IsNamespace): New method
4302
4303 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
4304
4305         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
4306         we know that we need to concatenate (full typename can never be
4307         null). 
4308
4309         * class.cs: ditto.
4310
4311         * statement.cs: Use a bitfield;  Do not initialize to null things
4312         which are done by the constructor by default.
4313
4314         * cs-parser.jay: bug fix, parameter was 4, not 3.
4315
4316         * expression.cs: Just use the property;
4317
4318         * statement.cs: No need for GetVariableInfo method.
4319
4320 2003-08-08  Martin Baulig  <martin@ximian.com>
4321
4322         * flowanalysis.cs (FlowReturns): This is now nested in the
4323         `FlowBranching' class.
4324         (MyBitVector): Moved this here from statement.cs.
4325         (FlowBranching.SiblingType): New enum type.
4326         (FlowBranching.CreateSibling): Added `SiblingType' argument.
4327
4328 2003-08-07  Martin Baulig  <martin@ximian.com>
4329
4330         * flowanalysis.cs (FlowBranchingType): This is now nested in the
4331         `FlowBranching' class and called `BranchingType'.
4332
4333 2003-08-07  Martin Baulig  <martin@ximian.com>
4334
4335         * flowanalysis.cs: Moved all the control flow analysis code into
4336         its own file.
4337
4338 2003-08-07  Martin Baulig  <martin@ximian.com>
4339
4340         * assign.cs (Assign.DoResolve): `target' must either be an
4341         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
4342         #37319.
4343
4344 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
4345
4346         * expression.cs (BinaryMethod): This kind of expression is created by the
4347         Binary class if it determines that the operator has to be handled
4348         by a method.
4349
4350         (BinaryDelegate): This kind of expression is created if we are
4351         dealing with a + or - operator on delegates.
4352
4353         (Binary): remove method, argumetns, and DelegateOperator: when
4354         dealing with methods, 
4355
4356         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
4357
4358         * statement.cs (Block): use bitfields for the three extra booleans
4359         we had in use.   Remove unused topblock parameter.
4360
4361         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
4362
4363         * assign.cs: Drop extra unneeded tests.
4364
4365 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
4366
4367         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
4368
4369         * statement.cs (Foreach): Use VariableStorage instead of
4370         LocalBuilders.   
4371
4372         * codegen.cs (VariableStorage): New class used by clients that
4373         require a variable stored: locals or fields for variables that
4374         need to live across yield.
4375
4376         Maybe provide a convenience api for EmitThis+EmitLoad?
4377
4378         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
4379         these bad boys.
4380
4381 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
4382
4383         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
4384         RemapParameterLValue): New methods that are used to turn a
4385         precomputed FieldInfo into an expression like this:
4386
4387                 instance.FieldInfo
4388
4389         The idea is to use this instead of making LocalVariableReference
4390         have more than one meaning.
4391
4392         * cs-parser.jay: Add error production to BASE.
4393
4394         * ecore.cs: Deal with TypeManager.GetField returning null, which
4395         is now a valid return value.
4396
4397         (FieldExprNoAddress): New expression for Fields whose address can
4398         not be taken.
4399
4400         * expression.cs (LocalVariableReference): During the resolve
4401         phases, create new expressions if we are in a remapping context.
4402         Remove code that dealt with remapping here.
4403
4404         (ParameterReference): same.
4405
4406         (ProxyInstance): New expression, like the `This' expression, but
4407         it is born fully resolved.  We know what we are doing, so remove
4408         the errors that are targeted to user-provided uses of `this'.
4409
4410         * statement.cs (Foreach): our variable is now stored as an
4411         Expression;  During resolution, follow the protocol, dont just
4412         assume it will return this.
4413
4414 2003-08-06  Martin Baulig  <martin@ximian.com>
4415
4416         * support.cs (SeekableStreamReader.cs): New public class.
4417
4418         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
4419         SeekableStreamReader instead of the normal StreamReader.
4420
4421 2003-08-04  Martin Baulig  <martin@ximian.com>
4422
4423         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
4424         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
4425         deambiguate casts and delegate invocations.
4426         (parenthesized_expression): Use the new tokens to ensure this is
4427         not a cast of method invocation.
4428
4429         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
4430         when reading a `)' and Deambiguate_CloseParens () was previously
4431         called.
4432
4433         * expression.cs (ParenthesizedExpression): New class.  This is
4434         just used for the CS0075 test.
4435         (Binary.DoResolve): Check for CS0075.   
4436
4437 2003-07-29  Ravi Pratap  <ravi@ximian.com>
4438
4439         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
4440         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
4441         reference comparison.
4442
4443         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
4444         examine the ReturnType for equality - this is necessary in the
4445         cases of implicit and explicit operators whose signature also
4446         includes the return type.
4447
4448 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
4449
4450         * namespace.cs: Cache the result of the namespace computation,
4451         instead of computing it every time.
4452
4453 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
4454
4455         * decl.cs: Use a global arraylist that we reuse over invocations
4456         to avoid excesive memory consumption.  Reduces memory usage on an
4457         mcs compile by one meg (45 average).
4458
4459         * typemanager.cs (LookupTypeReflection): In .NET pointers are
4460         private, work around that.
4461
4462 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
4463
4464         * literal.cs (IntLiteral): Define Zero and One static literals. 
4465
4466         * cs-parser.jay (integer_literal): use static literals to reduce
4467         memory usage for the most used literals (0, 1 and -1).  211kb
4468         reduced in memory usage.
4469
4470         Replace all calls to `new ArrayList' with `new
4471         ArrayList(4)' which is a good average number for most allocations,
4472         and also requires only 16 bytes of memory for its buffer by
4473         default. 
4474
4475         This reduced MCS memory usage in seven megabytes for the RSS after
4476         bootstrapping.
4477
4478 2003-07-28  Ravi Pratap  <ravi@ximian.com>
4479
4480         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
4481         handle params methods the correct way by forming only one
4482         applicable set with params and normal methods in them. Earlier we
4483         were looking at params methods only if we found no normal methods
4484         which was not the correct thing to do.
4485
4486         (Invocation.BetterFunction): Take separate arguments indicating
4487         when candidate and the best method are params methods in their
4488         expanded form.
4489
4490         This fixes bugs #43367 and #46199.
4491
4492         * attribute.cs: Documentation updates.
4493
4494         (CheckAttribute): Rename to CheckAttributeTarget.
4495         (GetValidPlaces): Rename to GetValidTargets.
4496
4497         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
4498         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
4499
4500         Fixes bug #44468.
4501
4502 2003-07-28  Martin Baulig  <martin@ximian.com>
4503
4504         * class.cs (TypeContainer.DefineMembers): Use the base type's full
4505         name when looking up the base class of a nested class.  Fixes #46977.
4506
4507 2003-07-26  Martin Baulig  <martin@ximian.com>
4508
4509         * expression.cs (Indexers.Indexer): New nested struct; contains
4510         getter, setter and the indexer's type.
4511         (Indexers.Properties): This is now an ArrayList of
4512         Indexers.Indexer's.
4513         (IndexerAccess.DoResolveLValue): Correctly set the type if the
4514         indexer doesn't have any getters.
4515
4516         * assign.cs (Assign.DoResolve): Also do the implicit conversions
4517         for embedded property and indexer assignments.
4518
4519 2003-07-26  Martin Baulig  <martin@ximian.com>
4520
4521         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
4522         preprocessor directive is not the first non-whitespace character
4523         on a line.
4524
4525 2003-07-26  Martin Baulig  <martin@ximian.com>
4526
4527         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
4528         namespace parsing, follow the spec more closely.
4529
4530         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
4531         NamespaceEntry.Lookup().
4532
4533 2003-07-25  Martin Baulig  <martin@ximian.com>
4534
4535         * MethodCore.cs (OverridesSomething): New public field; it's set
4536         from TypeContainer.DefineMembers if this method overrides
4537         something (which doesn't need to be a method).  Fix #39462.
4538
4539 2003-07-25  Ravi Pratap  <ravi@ximian.com>
4540
4541         * typemanager.cs (GetMembers): Ensure that the list of members is
4542         reversed. This keeps things in sync.
4543
4544         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
4545         find an AttributeUsage attribute.
4546
4547         * expression.cs (Invocation.OverloadResolve): Perform the check
4548         which disallows Invoke to be directly called on a Delegate.
4549
4550         (Error_InvokeOnDelegate): Report error cs1533.
4551
4552 2003-07-25  Martin Baulig  <martin@ximian.com>
4553
4554         * expression.cs (Indexers.GetIndexersForType): Only look in the
4555         interface hierarchy if the requested type is already an
4556         interface.  Fixes #46788 while keeping #46502 fixed.
4557
4558 2003-07-25  Martin Baulig  <martin@ximian.com>
4559
4560         * class.cs (TypeContainer.DefineMembers): Check whether all
4561         readonly fields have been assigned and report warning CS0649 if
4562         not.
4563
4564         * statement.cs (LocalInfo.IsFixed): Always return true if this is
4565         a valuetype.
4566
4567 2003-07-24  Ravi Pratap  <ravi@ximian.com>
4568
4569         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
4570         returned from GetMethods to make things consistent with the
4571         assumptions MCS makes about ordering of methods.
4572
4573         This should comprehensively fix bug #45127 and it does :-)
4574
4575         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
4576         ordering is actually reverse.
4577
4578         * Clean up some debug messages I left lying around.
4579
4580         * interface.cs (Populate*): Get rid of code which emits attributes
4581         since the stage in which we emit attributes is the 'Emit' stage,
4582         not the define stage.
4583
4584         (Emit): Move attribute emission for interface members here.
4585
4586 2003-07-22  Ravi Pratap  <ravi@ximian.com>
4587
4588         * expression.cs (Invocation.OverloadResolve): Follow the spec more
4589         closely: we eliminate methods in base types when we have an
4590         applicable method in a top-level type.
4591
4592         Please see section 14.5.5.1 for an exact description of what goes
4593         on. 
4594
4595         This fixes bug #45127 and a host of other related to corlib compilation.
4596
4597         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
4598         array is the method corresponding to the top-level type (this is
4599         because of the changes made to icall.c) so we change this
4600         accordingly.
4601
4602         (MethodGroupExpr.Name): This too.
4603
4604         * typemanager.cs (GetElementType): New method which does the right
4605         thing when compiling corlib. 
4606
4607         * everywhere: Make use of the above in the relevant places.
4608
4609 2003-07-22  Martin Baulig  <martin@ximian.com>
4610
4611         * cs-parser.jay (invocation_expression): Moved
4612         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
4613         `cast_expression', but create a InvocationOrCast which later
4614         resolves to either an Invocation or a Cast.
4615
4616         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
4617         method; call this before EmitStatement() to make sure that this
4618         expression can be used as a statement.
4619
4620         * expression.cs (InvocationOrCast): New class; resolves to either
4621         an Invocation or a Cast.
4622
4623         * statement.cs (StatementExpression): Call ResolveStatement() on
4624         the ExpressionStatement before emitting it.
4625
4626 2003-07-21  Martin Baulig  <martin@ximian.com>
4627
4628         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
4629         `ref' and `out' attributes match; fixes #46220.
4630         (MemberAccess.ResolveMemberAccess): You can't reference a type
4631         through an expression; fixes #33180.
4632         (Indexers.GetIndexersForType): Don't return the indexers from
4633         interfaces the class implements; fixes #46502.
4634
4635 2003-07-21  Martin Baulig  <martin@ximian.com>
4636
4637         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
4638         CS0661 checks; fixes bug #30442.
4639
4640 2003-07-21  Martin Baulig  <martin@ximian.com>
4641
4642         * decl.cs (AdditionResult): Added `Error'.
4643
4644         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
4645
4646         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
4647         makes cs0031.cs actually work.
4648
4649 2003-07-20  Martin Baulig  <martin@ximian.com>
4650
4651         * namespace.cs: Fixed that bug which caused a crash when compiling
4652         the debugger's GUI.
4653
4654 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
4655
4656         * typemanager.cs (LookupTypeReflection): Never expose types which
4657         are NotPublic, NestedPrivate, NestedAssembly, or
4658         NestedFamANDAssem.  We used to return these, and later do a check
4659         that would report a meaningful error, but the problem is that we
4660         would not get the real match, if there was a name override.
4661
4662 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
4663
4664         * namespace.cs (Namespace, Name): Do not compute the namespace
4665         name dynamically, compute it in the constructor.  This reduced
4666         memory usage by 1697 KB.
4667
4668         * driver.cs: Use --pause to pause at the end.
4669
4670 2003-07-17  Peter Williams  <peter@newton.cx>
4671
4672         * Makefile: Change the name of the test target so that it doesn't
4673         conflict with the recursive test target.
4674
4675 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
4676
4677         * expression.cs (LocalVariableReference.Emit, EmitAssign,
4678         AddressOf): Do not use EmitThis, that was wrong, use the actual
4679         this pointer.
4680
4681 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
4682
4683         * class.cs (MethodData.Define): While checking if a method is an
4684         interface implementation, improve the test: If we are not public
4685         (use new test here: use the computed MethodAttributes directly,
4686         instead of the parsed modifier flags) check if the `implementing'
4687         method comes from an interface or not.
4688
4689         * pending.cs (VerifyPendingMethods): Slightly better error
4690         message.
4691
4692         * makefile: add test target that does the mcs bootstrap.
4693
4694 2003-07-16  Ravi Pratap  <ravi@ximian.com>
4695
4696         * interface.cs (Define): Do nothing here since there are no
4697         members to populate etc. Move the attribute emission out of here
4698         since this was just totally the wrong place to put it. Attribute
4699         application happens during the 'Emit' phase, not in the 'Define'
4700         phase.
4701
4702         (Emit): Add this method and move the attribute emission here
4703
4704         * rootcontext.cs (EmitCode): Call the Emit method on interface
4705         types too.
4706
4707 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
4708
4709         * expression.cs (OverloadResolve): Report error only if Location
4710         is not 'Null' which means that there was a probe going on.
4711
4712 2003-07-14  Martin Baulig  <martin@ximian.com>
4713
4714         * expression.cs (ConditionalLogicalOperator): New public class to
4715         implement user defined conditional logical operators.
4716         This is section 14.11.2 in the spec and bug #40505.
4717
4718 2003-07-14  Martin Baulig  <martin@ximian.com>
4719
4720         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
4721
4722 2003-07-14  Martin Baulig  <martin@ximian.com>
4723
4724         * codegen.cs (EmitContext.InFixedInitializer): New public field.
4725
4726         * ecore.cs (IVariable.VerifyFixed): New interface method.
4727
4728         * expression.cs (Unary.ResolveOperator): When resolving the `&'
4729         operator, check whether the variable is actually fixed.  Fixes bug
4730         #36055.  Set a variable definitely assigned when taking its
4731         address as required by the spec.
4732
4733         * statement.cs (LocalInfo.IsFixed): New field.
4734         (LocalInfo.MakePinned): Set `IsFixed' to true.
4735
4736 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
4737
4738         * attribute.cs (Attribute.Resolve): While doing a Member lookup
4739         for .ctors, ensure that we only ask for members declared in the
4740         attribute type (BindingFlags.DeclaredOnly).
4741
4742         Fixes bug #43632.
4743
4744         * expression.cs (Error_WrongNumArguments): Report error 1501
4745         correctly the way CSC does.
4746
4747 2003-07-13  Martin Baulig  <martin@ximian.com>
4748
4749         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
4750         lookup on the fully qualified name, to make things like "X.X" work
4751         where "X.X" is a fully qualified type name, but we also have a
4752         namespace "X" in the using list.  Fixes #41975.
4753
4754 2003-07-13  Martin Baulig  <martin@ximian.com>
4755
4756         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
4757         function. If we're a CompoundAssign, we need to create an embedded
4758         CompoundAssign, not an embedded Assign.
4759         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
4760         Fixes #45854.
4761
4762 2003-07-13  Martin Baulig  <martin@ximian.com>
4763
4764         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
4765         work to fix bug #46088.
4766
4767 2003-07-13  Ravi Pratap <ravi@ximian.com>
4768
4769         * class.cs (Operator.Emit): Do not emit attributes here - it is
4770         taken care of by the Method class that we delegate too. This takes
4771         care of bug #45876.
4772
4773 2003-07-10  Martin Baulig  <martin@ximian.com>
4774
4775         * expression.cs (TypeOfVoid): New class.
4776         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
4777
4778 2003-07-10  Martin Baulig  <martin@ximian.com>
4779
4780         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
4781         bug #35957.
4782
4783 2003-07-10  Martin Baulig  <martin@ximian.com>
4784
4785         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
4786         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
4787
4788         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
4789
4790         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
4791
4792 2003-07-10  Martin Baulig  <martin@ximian.com>
4793
4794         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
4795         of decimal.  Fixes #42850.
4796
4797         NOTE: I also fixed the created byte blob, but this doesn't work on
4798         the MS runtime and csc never produces any byte blobs for decimal
4799         arrays.
4800
4801 2003-07-10  Martin Baulig  <martin@ximian.com>
4802
4803         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
4804         structs; fixes #32068.
4805         (Block.AddChildVariableNames): Fixed #44302.
4806
4807 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4808
4809         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
4810
4811 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
4812
4813         * attribute.cs: And this test is onger needed.
4814
4815 2003-07-08  Martin Baulig  <martin@ximian.com>
4816
4817         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
4818         inaccessible types.  Fixes #36313.
4819
4820         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
4821
4822         * namespace.cs (NamespaceEntry): Create implicit entries for all
4823         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
4824         implicit entries for N1.N2 and N1.
4825
4826 2003-07-08  Martin Baulig  <martin@ximian.com>
4827
4828         Rewrote the handling of namespaces to fix a lot of the issues
4829         wrt. `using' aliases etc.
4830
4831         * namespace.cs (Namespace): Splitted this class into a
4832         per-assembly `Namespace' and a per-file `NamespaceEntry'.
4833
4834         * typemanager.cs (TypeManager.IsNamespace): Removed.
4835         (TypeManager.ComputeNamespaces): Only compute namespaces from
4836         loaded assemblies here, not the namespaces from the assembly we're
4837         currently compiling.
4838
4839 2003-07-08  Martin Baulig  <martin@ximian.com>
4840
4841         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
4842
4843 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
4844
4845         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
4846         already fixed it.  
4847
4848         I thought about the memory savings here, but LookupTypeReflection
4849         is used under already very constrained scenarios.  Compiling
4850         corlib or mcs only exposes one hit, so it would not really reduce
4851         any memory consumption.
4852
4853 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4854
4855         * typemanager.cs: fixes bug #45889 by only adding public types from
4856         other assemblies to the list of known types.
4857
4858 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
4859
4860         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
4861         on the type we resolved.
4862
4863 2003-07-05  Martin Baulig  <martin@ximian.com>
4864
4865         * pending.cs (PendingImplementation.ParentImplements): Don't
4866         create the proxy if the parent is abstract.
4867
4868         * class.cs (TypeContainer.DefineIndexers): Process explicit
4869         interface implementations first.  Fixes #37714.
4870
4871 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
4872
4873         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
4874         defined recursively;  but since we modify the input parameters
4875         (left is set to `this' temporarily), we reset this value if the
4876         left_is_explicit is false, which gives the original semantics to
4877         the code.  
4878
4879         * literal.cs (NullPointer): new class used to represent a null
4880         literal in a pointer context.
4881
4882         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
4883         type is a pointer, use a NullPointer object instead of a
4884         NullLiteral.   Closes 43687
4885
4886         (ExplicitConversion): Convert pointer values using
4887         the conv opcode to the proper type.
4888
4889         * ecore.cs (New): change ValueTypeVariable property into a method,
4890         that returns whether the valuetype is suitable for being used.
4891
4892         * expression.cs (Binary.DoNumericPromotions): Only return if we
4893         the int constant was a valid uint, and we can return both left and
4894         right as uints.  If not, we continue processing, to trigger the
4895         type conversion.  This fixes 39018.
4896
4897         * statement.cs (Block.EmitMeta): During constant resolution, set
4898         the CurrentBlock property on the emitcontext, so that we resolve
4899         constants propertly.
4900
4901 2003-07-02  Martin Baulig  <martin@ximian.com>
4902
4903         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
4904         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
4905
4906         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
4907         than emitting it here.
4908
4909         * statement.cs: Fixed some more flow analysis bugs.
4910
4911 2003-07-02  Martin Baulig  <martin@ximian.com>
4912
4913         * class.cs (MethodData.Define): When implementing interface
4914         methods, set Final unless we're Virtual.
4915
4916         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
4917         check work for interface methods.
4918
4919 2003-07-01  Martin Baulig  <martin@ximian.com>
4920
4921         * ecore.cs (EmitContext.This): Replaced this property with a
4922         GetThis() method which takes a Location argument.  This ensures
4923         that we get the correct error location for a CS0188.
4924
4925 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
4926
4927         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
4928         ImplicitStandardConversion.
4929
4930         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
4931
4932 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
4933
4934         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
4935         optimization.
4936
4937 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
4938
4939         * class.cs (Constructor.Define): Turn off initlocals for unsafe
4940         constructors.
4941
4942         (MethodData.Define): Turn off initlocals for unsafe methods.
4943
4944 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
4945
4946         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
4947         complete;  Fixes #37521.
4948
4949         * delegate.cs: Use Modifiers.TypeAttr to compute the
4950         TypeAttributes, instead of rolling our own.  This makes the flags
4951         correct for the delegates.
4952
4953 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
4954
4955         * class.cs (Constructor.Define): Set the private flag for static
4956         constructors as well.
4957
4958         * cs-parser.jay (statement_expression): Set the return value to
4959         null, to avoid a crash when we catch an error.
4960
4961 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
4962
4963         * cs-parser.jay: Applied patch from Jackson that adds support for
4964         extern and unsafe modifiers to destructor declarations.
4965
4966         * expression.cs: Report error 21 if the user is trying to index a
4967         System.Array.
4968
4969         * driver.cs: Add an error message, suggested by the bug report.
4970
4971         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
4972         if we do not have a ": this ()" constructor initializer.  Fixes 45149
4973
4974 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
4975
4976         * namespace.cs: Add some information to reduce FAQs.
4977
4978 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
4979
4980         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
4981         underlying enumeration types.  Fixes #43915.
4982
4983         * expression.cs: Treat ushort/short as legal values to be used in
4984         bitwise operations.
4985
4986 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
4987
4988         * delegate.cs: transfer custom attributes for paramenters from
4989         the delegate declaration to Invoke and BeginInvoke.
4990
4991 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
4992
4993         * attribute.cs: handle custom marshalers and emit marshal info
4994         for fields, too.
4995
4996 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
4997
4998         * makefile.gnu: Added anonymous.cs to the compiler sources.
4999
5000 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
5001
5002         * iterators.cs: Change the name of the proxy class to include two
5003         underscores.
5004
5005         * cs-parser.jay: Update grammar to include anonymous methods.
5006
5007         * anonymous.cs: new file.
5008
5009 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
5010
5011         * class.cs (Field.Define): Add missing test for pointers and
5012         safety. 
5013
5014 2003-05-27  Ravi Pratap  <ravi@ximian.com>
5015
5016         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
5017         we use the stobj opcode.
5018
5019         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
5020         since it wasn't the correct fix. 
5021
5022         It still is puzzling that we are required to use stobj for IntPtr
5023         which seems to be a ValueType.
5024
5025 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
5026
5027         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
5028         during regular simple name resolution.   Now, the trick is that
5029         instead of returning for processing the simplename, we do a
5030         TypeManager.LookupType (ie, a rooted lookup as opposed to a
5031         contextual lookup type).   If a match is found, return that, if
5032         not, return for further composition.
5033
5034         This fixes long-standing 30485.
5035
5036         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
5037         using the address to initialize an object, do an Stobj instead of
5038         using the regular Stelem.
5039
5040         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
5041         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
5042         Because if we are a BaseIndexerAccess that value will be true.
5043         Fixes 43643.
5044
5045         * statement.cs (GotoCase.Resolve): Return after reporting an
5046         error, do not attempt to continue. 
5047
5048         * expression.cs (PointerArithmetic.Emit): If our operand is a
5049         long, convert our constants to match the operand before
5050         multiplying.  Convert to I type before adding.   Fixes 43670.
5051
5052 2003-05-14  Ravi Pratap  <ravi@ximian.com>
5053
5054         * enum.cs (ImplicitConversionExists) : Rename to
5055         ImplicitEnumConversionExists to remove ambiguity. 
5056
5057         * ecore.cs (NullCast): New type of cast expression class which
5058         basically is very similar to EmptyCast with the difference being
5059         it still is a constant since it is used only to cast a null to
5060         something else
5061         (eg. (string) null)
5062
5063         * convert.cs (ImplicitReferenceConversion): When casting a null
5064         literal, we return a NullCast.
5065
5066         * literal.cs (NullLiteralTyped): Remove - I don't see why this
5067         should be around anymore.
5068
5069         The renaming (reported was slightly wrong). Corrections:
5070
5071         ConvertImplicitStandard -> ImplicitConversionStandard
5072         ConvertExplicitStandard -> ExplicitConversionStandard
5073
5074         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
5075         before passing them in !
5076
5077         * convert.cs (ImplicitConversionStandard): When comparing for
5078         equal expr and target types, ensure that expr is not a
5079         NullLiteral.
5080
5081         In general, we must not be checking (expr_type ==
5082         target_type) in the top level conversion methods
5083         (ImplicitConversion, ExplicitConversion etc). This checking is
5084         done in the methods that they delegate to.
5085
5086 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
5087
5088         * convert.cs: Move Error_CannotConvertType,
5089         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
5090         ImplicitNumericConversion, ImplicitConversionExists,
5091         ImplicitUserConversionExists, StandardConversionExists,
5092         FindMostEncompassedType, FindMostSpecificSource,
5093         FindMostSpecificTarget, ImplicitUserConversion,
5094         ExplicitUserConversion, GetConversionOperators,
5095         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
5096         TryImplicitIntConversion, Error_CannotConvertImplicit,
5097         ConvertImplicitRequired, ConvertNumericExplicit,
5098         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
5099         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
5100         its own file.
5101
5102         Perform the following renames:
5103
5104         StandardConversionExists -> ImplicitStandardConversionExists
5105         ConvertImplicit -> ImplicitConversion
5106         ConvertImplicitStandard -> ImplicitStandardConversion
5107         TryImplicitIntConversion -> ImplicitIntConversion
5108         ConvertImplicitRequired -> ImplicitConversionRequired
5109         ConvertNumericExplicit -> ExplicitNumericConversion
5110         ConvertReferenceExplicit -> ExplicitReferenceConversion
5111         ConvertExplicit -> ExplicitConversion
5112         ConvertExplicitStandard -> ExplicitStandardConversion
5113
5114 2003-05-19  Martin Baulig  <martin@ximian.com>
5115
5116         * statement.cs (TypeInfo.StructInfo): Made this type protected.
5117         (TypeInfo): Added support for structs having structs as fields.
5118
5119         * ecore.cs (FieldExpr): Implement IVariable.
5120         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
5121         VariableInfo for the field.
5122
5123 2003-05-18  Martin Baulig  <martin@ximian.com>
5124
5125         * expression.cs (This.DoResolve): Report a CS0027 if we're
5126         emitting a field initializer.
5127
5128 2003-05-18  Martin Baulig  <martin@ximian.com>
5129
5130         * expression.cs (This.ResolveBase): New public function.
5131         (This.DoResolve): Check for CS0188.
5132
5133         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
5134         This.Resolve().
5135
5136         * ecore.cs (MethodGroupExpr.DoResolve): Set the
5137         `instance_expression' to null if we don't have any non-static
5138         methods.
5139
5140 2003-05-18  Martin Baulig  <martin@ximian.com>
5141
5142         Reworked the way how local variables and parameters are handled by
5143         the flow analysis code.
5144
5145         * statement.cs (TypeInfo, VariableMap): New public classes.
5146         (VariableInfo): New public class.  This is now responsible for
5147         checking whether a variable has been assigned.  It is used for
5148         parameters and local variables.
5149         (Block.EmitMeta): Take the InternalParameters as argument; compute
5150         the layout of the flow vectors here.
5151         (Block.LocalMap, Block.ParameterMap): New public properties.
5152         (FlowBranching): The .ctor doesn't get the InternalParameters
5153         anymore since Block.EmitMeta() now computes the layout of the flow
5154         vector.
5155         (MyStructInfo): This class is now known as `StructInfo' and nested
5156         in `TypeInfo'; we don't access this directly anymore.
5157
5158         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
5159         property and removed IsAssigned(), IsFieldAssigned(),
5160         SetAssigned() and SetFieldAssigned(); we now call them on the
5161         VariableInfo so we don't need to duplicate this code everywhere.
5162
5163         * expression.cs (ParameterReference): Added `Block block' argument
5164         to the .ctor.
5165         (LocalVariableReference, ParameterReference, This): The new
5166         VariableInfo class is now responsible for all the definite
5167         assignment stuff.
5168
5169         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
5170         IsParameterAssigned, SetParameterAssigned): Removed.
5171
5172 2003-05-18  Martin Baulig  <martin@ximian.com>
5173
5174         * typemanager.cs (InitCoreTypes): Try calling
5175         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
5176         the 3-args-version.  Corlib now also needs our `void_type'.
5177         (GetMethod): Added overloaded version which takes an optional
5178         `bool report_errors' to allow lookups of optional methods.
5179
5180 2003-05-12  Martin Baulig  <martin@ximian.com>
5181
5182         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
5183         only used for locals and not for parameters.
5184
5185 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
5186
5187         * support.cs (InternalParameters.ParameterType): Return the
5188         ExternalType of the parameter.
5189
5190         * parameter.cs (Parameter.ExternalType): drop the two arguments,
5191         they were unused.
5192
5193 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
5194
5195         * class.cs (MethodData.Define): Do not set the `newslot' on
5196         interface members, if they are also flagged as "override".
5197
5198         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
5199         better code for ++i and i++.  This only works for static fields
5200         and local variables.
5201
5202         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
5203         want to pull the DeclSpace out of the builder_to_declspace instead
5204         of the TypeBuilder (like in TypeContainer.FindMembers).
5205
5206         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
5207         instead of LookupTypeContainer.  Fixes the crash on .NET for
5208         looking up interface members.
5209
5210         * const.cs: Create our own emit context during the Definition
5211         stage, so that constants are evaluated in the proper context, when
5212         a recursive definition happens.
5213
5214 2003-05-11  Martin Baulig  <martin@ximian.com>
5215
5216         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
5217         new block for a switch section.
5218         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
5219         the adding/lookup in the switch block.  Fixes #39828.
5220
5221 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
5222
5223         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
5224         functionality: I needed to convert the data after I had performed
5225         the add/sub operation into the operands type size.
5226
5227         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
5228         pass the type for the box operation, otherwise the resulting
5229         object would have been of type object.
5230
5231         (BoxedCast): Add constructor to specify the type to box as.
5232
5233 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
5234
5235         * iterators.cs: I was reusing the `count' variable inadvertently,
5236         take steps to not allow this to happen.
5237
5238 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
5239
5240         * attribute.cs (Attribute.Resolve): Params attributes are encoded
5241         by creating an array at the point where the params starts and
5242         putting all those arguments there, then adjusting the size of the
5243         array.
5244
5245 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
5246
5247         * expression.cs (New.AddressOf): Implement interface
5248         IMemoryLocation.  This is used when the `new' operator is used in
5249         the context of an invocation to a method on a value type.
5250
5251         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
5252         example. 
5253
5254         * namespace.cs: Also check the using aliases here.
5255
5256         * driver.cs: Move the test for using validity after the types have
5257         been entered, so we do a single pass that also includes the using
5258         aliases. 
5259
5260         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
5261         in the regular case.   CreateSiblingForFinally is doing extra
5262         error checking.
5263
5264         * attribute.cs (GetAttributeArgumentExpression): Store the result
5265         on an out value, and use the return value to indicate failure
5266         instead of using null (which is a valid return for Constant.GetValue).
5267
5268         * statement.cs: Perform the analysis flow for the increment
5269         portion after the statement, because this will be the real flow of
5270         execution.  Fixes #42385
5271
5272         * codegen.cs (EmitContext.EmitArgument,
5273         EmitContext.EmitStoreArgument): New helper functions when the
5274         RemapToProxy flag is set.
5275
5276         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
5277         function.
5278
5279         Add support for remapping parameters. 
5280
5281         * iterators.cs: Propagate parameter values;  Store parameter
5282         values in the proxy classes.
5283
5284 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
5285
5286         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
5287         need a proxy reference;  I do not know what I was thinking
5288
5289         * cs-parser.jay (constructor_initializer): catch another error,
5290         and display nice message.
5291
5292         (field_declaration): catch void field declaration
5293         to flag a better error. 
5294
5295         * class.cs (MemberBase.CheckBase): Report an error instead of a
5296         warning if a new protected member is declared in a struct. 
5297         (Field.Define): catch the error of readonly/volatile.
5298
5299         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
5300
5301         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
5302         volatile variable is taken
5303
5304 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
5305
5306         * statement.cs (Fixed.Resolve): Report an error if we are not in
5307         an unsafe context.
5308
5309 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
5310
5311         * typemanager.cs: reuse the code that handles type clashes for
5312         delegates and enumerations.
5313
5314         * class.cs (Report28): Always report.
5315
5316         * expression.cs (EncodeAsAttribute): Allow nulls here.
5317
5318 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
5319
5320         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
5321         the functionality for testing whether an expression is valid for
5322         an attribute here.  Also handle the case of arrays of elements
5323         being stored. 
5324
5325         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
5326         encoding a linear array into an array of objects that are suitable
5327         to be passed to an CustomAttributeBuilder.
5328
5329         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
5330
5331         * ecore.cs: (FieldExpr): Handle field remapping here.
5332
5333         * iteratators.cs: Pass the instance variable (if the method is an
5334         instance method) to the constructors, so we can access the field
5335         variables on the class.
5336
5337         TODO: Test this with structs.  I think the THIS variable on
5338         structs might have to be a pointer, and not a refenrece
5339
5340 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
5341
5342         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
5343         local variables to fields in a proxy class.
5344
5345         * iterators.cs (PopulateProxy): Rename our internal fields to
5346         <XXX>.  
5347         Create a <THIS> field if we are an instance method, so we can
5348         reference our parent container variables.
5349         (MapVariable): Called back from the EmitContext code to enter a
5350         new variable to field mapping into the proxy class (we just create
5351         a FieldBuilder).
5352
5353         * expression.cs
5354         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
5355         for using the remapped locals to fields.
5356
5357         I placed the code here, because that gives the same semantics to
5358         local variables, and only changes the Emit code.
5359
5360         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
5361         statements inside iterators.
5362         (VariableInfo): Add a FieldBuilder for the cases when we are
5363         remapping local variables to fields in a proxy class
5364
5365         * ecore.cs (SimpleNameResolve): Avoid testing two times for
5366         current_block != null.
5367
5368         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
5369         not cope with strings, as it has been moved to the
5370         TableSwitchEmit.  Fixed bug in switch generation.
5371
5372         * expression.cs (New.DoResolve): Provide more context for the user
5373         when reporting an error.
5374
5375         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
5376         pointers. 
5377
5378         * expression.cs (MemberAccess.DoResolve): When we get a type back,
5379         check the permissions for it.  Note than in a type-resolution
5380         context the check was already present in DeclSpace.ResolveType,
5381         but was missing from the MemberAccess.
5382
5383         (ArrayCreation.CheckIndices): warn if the user has
5384         more nested levels of expressions, but there are no more
5385         dimensions specified.  Avoids crash on bug 41906.
5386
5387 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
5388
5389         * statement.cs (Block): replace Implicit bool, for a generic
5390         flags.   
5391         New flag: `Unchecked'.  This is used during the EmitMeta phase
5392         (which is out-of-line with the regular Resolve/Emit process for a
5393         statement, as this is done ahead of time, but still gets a chance
5394         to call constant resolve).
5395
5396         (Block.Flags): new enum for adding a new flag.
5397
5398         (Block.EmitMeta): track the state of unchecked.
5399
5400         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
5401         to enable constant resolution to work there as well.
5402
5403 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
5404
5405         * typemanager.cs (ienumerable_type): Also look up
5406         System.Collections.IEnumerable. 
5407
5408 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
5409
5410         TODO: Test more than one conditional per method.
5411
5412         * class.cs (Indexer.Define): Report the location where the user is
5413         referencing the unsupported feature.
5414
5415         (MethodData): Overload the use of `conditionals' to
5416         minimize the creation of needless ArrayLists.   This saves roughly
5417         212kb on my machine.
5418
5419         (Method): Implement the new IIteratorContainer interface.
5420         (Method.SetYields): Implement the method by setting the ModFlags
5421         to contain METHOD_YIELDS.
5422
5423         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
5424         which just got set to null.
5425
5426         * iterators.cs: New file.
5427
5428         (Yield, YieldBreak): New statements.
5429
5430         * statement.cs (Return.Resolve): Flag an error if we are used in
5431         an iterator method.
5432
5433         * codegen.cs (InIterator): New flag set if the code is being
5434         compiled in an iterator method.
5435
5436         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
5437         internal modifier, and we just use it to avoid adding extra
5438         fields, as this is seldom used.  
5439
5440         * cs-parser.jay: Add yield_statement (yield and yield break).
5441
5442         * driver.cs: New flag -v2 to turn on version 2 features. 
5443
5444         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
5445         hashtable when v2 is enabled.
5446
5447 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
5448
5449         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
5450         there is already a namespace defined with this name.
5451
5452         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
5453         people upgraded their corlibs.
5454
5455         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
5456         always use fully qualified types, no need to use the compiler
5457         front end.
5458
5459         (TypeManager.IsNamespace): Use binarysearch.
5460
5461         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
5462         AddDelegate): I did not quite use the new IsValid API properly: I
5463         have to pass the short-name and the fullname.  I was passing only
5464         the basename instead of the fullname sometimes. 
5465
5466         (TypeContainer.DefineType): call NamespaceClash.
5467
5468         * interface.cs (Interface.DefineType): use NamespaceClash before
5469         defining the type.
5470
5471         * delegate.cs (Delegate.DefineType): use NamespaceClash before
5472         defining the type.
5473
5474         * enum.cs: (Enum.DefineType): use NamespaceClash before
5475         defining the type.
5476
5477         * typemanager.cs (: 3-line patch that gives us some tasty 11%
5478         speed increase.  First, use the negative_hits cache when we get a
5479         negative.  Second, add the type with its full original name
5480         instead of the new . and + encoded name (reflection uses + to
5481         separate type from a nested type).  Use LookupTypeReflection
5482         directly which bypasses the type->name hashtable (that we already
5483         know does not contain the type.
5484
5485         * decl.cs (DeclSpace.ResolveTypeExpr): track the
5486         location/container type. 
5487
5488         * driver.cs: When passing utf8, use directly the UTF8Encoding.
5489
5490 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
5491
5492         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
5493
5494         * delegate.cs (NewDelegate.Resolve): Test whether an instance
5495         method is being referenced in the method group from a static
5496         context, and report error 120 if so.
5497
5498         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
5499         Error118. 
5500
5501         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
5502         is created, we create the A namespace).
5503
5504         * cs-parser.jay: A namespace also introduces a DeclarationFound.
5505         Fixes #41591
5506
5507 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
5508
5509         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
5510         invocation to ModuleBuilder.GetType with the same values will
5511         return a new type instance, so we need to cache its return
5512         values. 
5513
5514         * expression.cs (Binary.ResolveOperator): Only allow the compare
5515         operators on enums if they are of the same type.
5516
5517         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
5518         types of ValueType on their own case.  Before we were giving them
5519         the same treatment as objects.
5520
5521         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
5522         fullname.  Short name is used to compare against container name.
5523         Fullname is used to check against defined namespace names.
5524
5525         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
5526         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
5527
5528         (Method.CheckBase): Call parent.
5529         (MemberBase.CheckBase): Check for protected members on sealed
5530         classes.
5531         (PropertyBase.CheckBase): Call parent.
5532         (Field.Define): Call parent.
5533
5534         * report.cs: Negative error codes are now mapped to 8000 - code,
5535         so that the display is render more nicely.
5536
5537         * typemanager.cs: Do not use try/catch, instead report a regular
5538         error. 
5539
5540         (GetPointerType, GetReferenceType): These methods provide
5541         mechanisms to obtain the T* and T& from a T.  We had the code
5542         previously scattered around the code base, and it also used
5543         TypeManager.LookupType that would go through plenty of caches.
5544         This one goes directly to the type source.
5545
5546         In some places we did the Type.GetType followed by
5547         ModuleBuilder.GetType, but not in others, so this unifies the
5548         processing as well.
5549
5550         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
5551         statements now that we have namespace information.
5552
5553         * typemanager.cs (IsNamespace): New method, returns whether the
5554         string presented is a namespace or not.
5555
5556         (ComputeNamespaces): New public entry point, computes the list of
5557         available namespaces, using the GetNamespaces API call in Mono, or
5558         the slower version in MS.NET.   
5559
5560         Now before we start the semantic analysis phase, we have a
5561         complete list of namespaces including everything that the user has
5562         provided.
5563
5564         Deleted old code to cache namespaces in .nsc files.
5565
5566 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
5567
5568         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
5569         class/struct location definition Location for the implicit
5570         constructor location.
5571
5572         (Operator.Define): Use the location of the operator for the
5573         implicit Method definition.
5574
5575         (Constructor.Emit): use the constructor location for the implicit
5576         base initializer constructor.
5577
5578         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
5579         and the Expression class now contains two new methods:
5580
5581         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
5582         isolate type lookup from the rest of the resolution process.
5583
5584         Since we use Expressions to hold type definitions due to the way
5585         we parse the input we have historically overloaded Resolve to
5586         perform the Type lookups if a special flag is passed.  Now this is
5587         eliminated and two methods take their place. 
5588
5589         The differences in the two methods between xStep and xTerminal is
5590         that xStep is involved in our current lookup system that uses
5591         SimpleNames to compose a name, while xTerminal is used just to
5592         catch the case where the simplename lookup failed.
5593
5594 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
5595
5596         * expression.cs (ResolveMemberAccess): Remove redundant code.
5597         TypeExpr expressions are always born fully resolved.
5598
5599         * interface.cs (PopulateMethod): Do not lookup the types twice.
5600         We were doing it once during SemanticAnalysis and once during
5601         PopulateMethod.
5602
5603         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
5604         in local variable type definitions, were being returned as a
5605         SimpleName (we decomposed everything into a string), that is
5606         because primary_expression was being used instead of a type in the
5607         grammar (reduce/reduce conflicts).
5608
5609         The part that was wrong is that we converted the expression into a
5610         string (an oversimplification in one hand, compounded with primary
5611         expressions doing string concatenation).
5612
5613         So things like:
5614
5615         A.B.C [] x;
5616
5617         Would return "A.B.C[]" as a SimpleName.  This stopped things like
5618         using clauses from working on this particular context.  And a type
5619         was being matched directly against "A.B.C[]".
5620
5621         We now use the correct approach, and allow for ComposedCast to be
5622         part of the unary expression.  So the "A.B.C []" become a composed
5623         cast of "A.B.C" (as a nested group of MemberAccess with a
5624         SimpleName at the end) plus the rank composition "[]". 
5625
5626         Also fixes 35567
5627
5628 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
5629
5630         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
5631         for the access level checking.
5632
5633         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
5634         `TypeContainer container', because I kept getting confused when I
5635         was debugging this code.
5636
5637         * expression.cs (Indexers): Instead of tracking getters/setters,
5638         we now track them in parallel.  We create one arraylist less, but
5639         most importantly it is possible now for the LValue code to find a
5640         matching get for a set.
5641
5642         (IndexerAccess.DoResolveLValue): Update the code.
5643         GetIndexersForType has been modified already to extract all the
5644         indexers from a type.  The code assumed it did not.
5645
5646         Also make the code set the correct return type for the indexer.
5647         This was fixed a long time ago for properties, but was missing for
5648         indexers.  It used to be void_type.
5649
5650         (Binary.Emit): Test first for doubles instead of
5651         floats, as they are more common.
5652
5653         (Binary.EmitBranchable): Use the .un version of the branch opcodes
5654         when dealing with floats and the <=, >= operators.  This fixes bug
5655         #39314 
5656
5657         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
5658         to load the array value by emitting a load on the foreach variable
5659         type.  This was incorrect.  
5660
5661         We now emit the code to load an element using the the array
5662         variable type, and then we emit the conversion operator.
5663
5664         Fixed #40176
5665
5666 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
5667
5668         * attribute.cs: Avoid allocation of ArrayLists in the common case.
5669
5670 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
5671
5672         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
5673         test for protection before we test for signatures. 
5674
5675         (MethodSignature.ToString): implement.
5676
5677         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
5678         to the case where we reduced into a LongConstant.
5679
5680         * decl.cs (CheckAccessLevel): If the type is an array, we can not
5681         depend on whether the information is acurrate, because the
5682         Microsoft runtime will always claim that the array type is public,
5683         regardless of the real state.
5684
5685         If the type is a pointer, another problem happens: the type is
5686         reported as non-public in Microsoft.  
5687
5688         In both cases we have to call CheckAccessLevel recursively with
5689         the underlying type as the argument to be tested.
5690
5691 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
5692
5693         * assign.cs (Assign.Emit): If we are dealing with a compound
5694         assignment expression, we should use the code path that stores the
5695         intermediate result in a temporary value.  This fixes #40903.
5696
5697         *expression.cs (Indirection.ToString): Provide ToString method for
5698         debugging. 
5699
5700 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
5701
5702         * class.cs: Null out fields holding references to Block objects so
5703         they can be garbage collected.
5704
5705         * expression.cs (OverloadResolve): Remove unused local.
5706
5707 2003-04-07  Martin Baulig  <martin@ximian.com>
5708
5709         * codegen.cs (EmitContext.CurrentFile): New public field.
5710         (EmitContext.Mark): Use the CurrentFile to check whether the
5711         location is in the correct file.
5712         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
5713
5714 2003-04-07  Martin Baulig  <martin@ximian.com>
5715
5716         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
5717
5718         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
5719         location.  [FIXME: The location argument which gets passed to this
5720         method is sometimes wrong!]
5721
5722 2003-04-07  Nick Drochak <ndrochak@gol.com>
5723
5724         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
5725
5726 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
5727
5728         * expression.cs (Indirection.EmitAssign): We were using the
5729         temporary, but returning immediately instead of continuing the
5730         EmitAssing flow.
5731
5732 2003-04-06  Martin Baulig  <martin@ximian.com>
5733
5734         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
5735         if it's a nested child, but also deriving from the outer class.
5736         See test 190.cs.
5737
5738         * typemanager.cs (IsNestedChildOf): Make this work if it's a
5739         nested child, but also deriving from the outer class.  See
5740         test-190.cs.
5741         (FilterWithClosure): We may access private members of the outer
5742         class if we're a nested child and deriving from the outer class.
5743         (RealMemberLookup): Only set `closure_private_ok' if the
5744         `original_bf' contained BindingFlags.NonPublic.
5745
5746 2003-04-05  Martin Baulig  <martin@ximian.com>
5747
5748         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
5749
5750 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
5751
5752         * class.cs (Event.Define): Do not allow abstract events to have
5753         initializers. 
5754
5755 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
5756
5757         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
5758         block in event declarations.
5759
5760         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
5761         value type, get its address.
5762
5763         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
5764         leaving a class on the stack instead of a boolean value (int
5765         0/1).  Change the code so we compare against null, and then the
5766         result against zero.
5767
5768         * class.cs (TypeContainer.GetClassBases): We were checking for the
5769         parent class being sealed too late.
5770
5771         * expression.cs (Binary.Emit): For <= and >= when dealing with
5772         floating point values, use cgt.un and clt.un instead of cgt and
5773         clt alone.
5774
5775 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
5776
5777         * statement.cs: Apply the same optimization as MS: skip the 
5778         GetEnumerator returning an IEnumerator, and use the one returning a 
5779         CharEnumerator instead. This allows us to avoid the try-finally block 
5780         and the boxing.
5781
5782 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
5783
5784         * cs-parser.jay: Attributes cannot be applied to
5785                          namespaces. Fixes #40473
5786
5787 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5788
5789         * class.cs:
5790         (Add*): check if the name is valid using the full name for constants,
5791         fields, properties and events.
5792
5793 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
5794
5795         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
5796         char constants to be part of the enumeration.
5797
5798         * expression.cs (Conditional.DoResolve): Add support for operator
5799         true. Implements the missing functionality from 14.12
5800
5801         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
5802         operator true/false as required by the spec.
5803
5804         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
5805         implicit conversion to boolean.
5806
5807         * statement.cs (Statement.ResolveBoolean): A boolean expression is
5808         also one where the type implements `operator true'. 
5809
5810         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
5811         get an expression that will invoke operator true based on an
5812         expression.  
5813
5814         (GetConversionOperators): Removed the hack that called op_True
5815         here.  
5816
5817         (Expression.ResolveBoolean): Move this from Statement.
5818
5819 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
5820
5821         * ecore.cs (FieldExpr): do not allow initialization of initonly
5822         fields on derived classes
5823
5824 2003-03-13  Martin Baulig  <martin@ximian.com>
5825
5826         * statement.cs (Block.Emit): Call ig.BeginScope() and
5827         ig.EndScope() when compiling with debugging info; call
5828         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
5829
5830 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
5831
5832         * expression.cs (Indexers): Do not construct immediately, allow
5833         for new members to be appended as we go.  Fixes 38143
5834
5835 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5836
5837         * expression.cs: save/restore context when resolving an unchecked
5838         expression.
5839
5840 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
5841
5842         * cfold.cs: Catch division by zero in modulus operator during
5843         constant folding.
5844
5845 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
5846
5847         * interface.cs (Interface.DefineMembers): Avoid defining members
5848         twice. 
5849
5850 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
5851
5852         * driver.cs: handle the +/- options for -noconfig
5853
5854         * statement.cs (Unckeched.Resolve): Also track the state of
5855         unchecked in the Resolve phase.
5856
5857 2003-02-27  Martin Baulig  <martin@ximian.com>
5858
5859         * ecore.cs (Expression.MemberLookup): Don't create a
5860         MethodGroupExpr for something which is not a method.  Fixes #38291.
5861
5862 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
5863
5864         * class.cs (MemberBase.CheckParameters): Also check that the type
5865         is unmanaged if it is a pointer.
5866
5867         * expression.cs (SizeOf.Resolve): Add location information.
5868
5869         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
5870         a managed type is declared.
5871
5872         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
5873         parameter modifiers as well.  Fixes bug 38606
5874
5875         * class.cs: Very sad.  Am backing out the speed up changes
5876         introduced by the ArrayList -> Array in the TypeContainer, as they
5877         were not actually that much faster, and introduced a bug (no error
5878         reports on duplicated methods).
5879
5880         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
5881         source first, this will guarantee that we have a valid expression
5882         before calling in lower levels functions that will require a
5883         resolved object.  Then use this original_source in the
5884         target.ResolveLValue instead of the original source that was
5885         passed to us.
5886
5887         Another change.  Use target.Resolve instead of LValueResolve.
5888         Although we are resolving for LValues, we will let the Assign code
5889         take care of that (it will be called again from Resolve).  This
5890         basically allows code like this:
5891
5892         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
5893         class Y { void A (X x) { x [0] += o; }
5894
5895         The problem was that the indexer was trying to resolve for
5896         set_Item (idx, object o) and never finding one.  The real set_Item
5897         was set_Item (idx, X).  By delaying the process we get the right
5898         semantics. 
5899
5900         Fixes bug 36505
5901
5902 2003-02-23  Martin Baulig  <martin@ximian.com>
5903
5904         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
5905         while calling DoEmit ().
5906
5907         * codegen.cs (EmitContext.Mark): Don't mark locations in other
5908         source files; if you use the #line directive inside a method, the
5909         compiler stops emitting line numbers for the debugger until it
5910         reaches the end of the method or another #line directive which
5911         restores the original file.
5912
5913 2003-02-23  Martin Baulig  <martin@ximian.com>
5914
5915         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
5916
5917 2003-02-23  Martin Baulig  <martin@ximian.com>
5918
5919         * statement.cs (Block.AddChildVariableNames): We need to call this
5920         recursively, not just for our immediate children.
5921
5922 2003-02-23  Martin Baulig  <martin@ximian.com>
5923
5924         * class.cs (Event.Define): Always make the field private, like csc does.
5925
5926         * typemanager.cs (TypeManager.RealMemberLookup): Make events
5927         actually work, fixes bug #37521.
5928
5929 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
5930
5931         * delegate.cs: When creating the various temporary "Parameters"
5932         classes, make sure that we call the ComputeAndDefineParameterTypes
5933         on those new parameters (just like we do with the formal ones), to
5934         allow them to be resolved in the context of the DeclSpace.
5935
5936         This fixes the bug that Dick observed in Bugzilla #38530.
5937
5938 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
5939
5940         * expression.cs (ResolveMemberAccess): When resolving a constant,
5941         do not attempt to pull a constant if the value was not able to
5942         generate a valid constant.
5943
5944         * const.cs (LookupConstantValue): Do not report more errors than required.
5945
5946 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5947
5948         * expression.cs: fixes bug #38328.
5949
5950 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
5951
5952         * class.cs: Changed all the various members that can be part of a
5953         class from being an ArrayList to be an Array of the right type.
5954         During the DefineType type_list, interface_list, delegate_list and
5955         enum_list are turned into types, interfaces, delegates and enums
5956         arrays.  
5957
5958         And during the member population, indexer_list, event_list,
5959         constant_list, field_list, instance_constructor_list, method_list,
5960         operator_list and property_list are turned into their real arrays.
5961
5962         Although we could probably perform this operation earlier, for
5963         good error reporting we need to keep the lists and remove the
5964         lists for longer than required.
5965
5966         This optimization was triggered by Paolo profiling the compiler
5967         speed on the output of `gen-sample-program.pl' perl script. 
5968
5969         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
5970         not crash in methods like MemberLookupFailed that use this field.  
5971
5972         This problem arises when the compiler fails to resolve a type
5973         during interface type definition for example.
5974
5975 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
5976
5977         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
5978         inherit from System.Object, so we have to stop at null, not only
5979         when reaching System.Object.
5980
5981 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
5982
5983         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
5984         DeclaredOnly because the parent indexer might have had a different
5985         name, but did not loop until the top of the hierarchy was reached.
5986
5987         The problem this one fixes is 35492: when a class implemented an
5988         indexer from an interface, we were getting the interface method
5989         (which was abstract) and we were flagging an error (can not invoke
5990         abstract method).
5991
5992         This also keeps bug 33089 functioning, and test-148 functioning.
5993
5994         * typemanager.cs (IsSpecialMethod): The correct way of figuring
5995         out if a method is special is to see if it is declared in a
5996         property or event, or whether it is one of the predefined operator
5997         names.   This should fix correctly #36804.
5998
5999 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
6000
6001         The goal here is to remove the dependency on EmptyCast.Peel ().
6002         Killing it completely.
6003
6004         The problem is that currently in a number of places where
6005         constants are expected, we have to "probe" for an EmptyCast, and
6006         Peel, which is not the correct thing to do, as this will be
6007         repetitive and will likely lead to errors. 
6008
6009         The idea is to remove any EmptyCasts that are used in casts that
6010         can be reduced to constants, so we only have to cope with
6011         constants. 
6012
6013         This bug hunt was triggered by Bug 37363 and the desire to remove
6014         the duplicate pattern where we were "peeling" emptycasts to check
6015         whether they were constants.  Now constants will always be
6016         constants.
6017
6018         * ecore.cs: Use an enumconstant here instead of wrapping with
6019         EmptyCast.  
6020
6021         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
6022         throwing me off.  By handling this we can get rid of a few hacks.
6023
6024         * statement.cs (Switch): Removed Peel() code.
6025
6026 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
6027
6028         * class.cs: Location information for error 508
6029
6030         * expression.cs (New.DoResolve): Add a guard against double
6031         resolution of an expression.  
6032
6033         The New DoResolve might be called twice when initializing field
6034         expressions (see EmitFieldInitializers, the call to
6035         GetInitializerExpression will perform a resolve on the expression,
6036         and later the assign will trigger another resolution
6037
6038         This leads to bugs (#37014)
6039
6040         * delegate.cs: The signature for EndInvoke should contain any ref
6041         or out parameters as well.  We were not doing this in the past. 
6042
6043         * class.cs (Field.Define): Do not overwrite the type definition
6044         inside the `volatile' group.  Turns out that volatile enumerations
6045         were changing the type here to perform a validity test, which
6046         broke conversions. 
6047
6048 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
6049
6050         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
6051         and structs, we do not want to load the instance variable
6052
6053         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
6054         enum_type has to be handled like an object reference (implicit
6055         conversions exists from this to object), but the regular IsClass
6056         and IsValueType tests will never return true for this one.
6057
6058         Also we use TypeManager.IsValueType instead of type.IsValueType,
6059         just for consistency with the rest of the code (this is only
6060         needed if we ever use the construct exposed by test-180.cs inside
6061         corlib, which we dont today).
6062
6063 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
6064
6065         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
6066         just InternalCall.
6067
6068 2003-02-09  Martin Baulig  <martin@ximian.com>
6069
6070         * namespace.cs (Namespace..ctor): Added SourceFile argument.
6071         (Namespace.DefineNamespaces): New static public method; this is
6072         called when we're compiling with debugging to add all namespaces
6073         to the symbol file.
6074
6075         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
6076         pass it to the Namespace's .ctor.
6077
6078         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
6079         and MethodBase arguments; pass the namespace ID to the symwriter;
6080         pass the MethodBase instead of the token to the symwriter.
6081         (SymbolWriter.DefineNamespace): New method to add a namespace to
6082         the symbol file.
6083
6084 2003-02-09  Martin Baulig  <martin@ximian.com>
6085
6086         * symbolwriter.cs: New file.  This is a wrapper around
6087         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
6088         methods here in near future.
6089
6090 2003-02-09  Martin Baulig  <martin@ximian.com>
6091
6092         * codegen.cs (EmitContext.Mark): Just pass the arguments to
6093         ILGenerator.MarkSequencePoint() which are actually used by the
6094         symbol writer.
6095
6096 2003-02-09  Martin Baulig  <martin@ximian.com>
6097
6098         * location.cs (SourceFile): New public sealed class.  This
6099         contains the name and an index which is used in the location's token.
6100         (Location): Reserve an appropriate number of bits in the token for
6101         the source file instead of walking over that list, this gives us a
6102         really huge performance improvement when compiling with debugging.
6103
6104         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
6105         `SourceFile' argument instead of a string.
6106         (Driver.ProcessFile): Add all the files via Location.AddFile(),
6107         but don't parse/tokenize here, we need to generate the list of all
6108         source files before we do that.
6109         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
6110         the files.
6111
6112         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
6113         instead of a string.
6114
6115         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
6116         of a string.
6117
6118 2003-02-09  Martin Baulig  <martin@ximian.com>
6119
6120         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
6121         filename on `#line default'.
6122
6123 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
6124
6125         * statement.cs: don't clear the pinned var when the fixed statement
6126         returns from the method (fixes bug#37752).
6127
6128 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
6129
6130         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
6131         to IsValueType.
6132
6133 2003-02-07  Martin Baulig  <martin@ximian.com>
6134
6135         * driver.cs: Removed the `--debug-args' command line argument.
6136
6137         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
6138         automatically by the AsssemblyBuilder.
6139         (CodeGen.InitializeSymbolWriter): We don't need to call any
6140         initialization function on the symbol writer anymore.  This method
6141         doesn't take any arguments.
6142
6143 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
6144
6145         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
6146         from referenced assemblies as well.
6147
6148 2003-02-02  Martin Baulig  <martin@ximian.com>
6149
6150         * class.cs (MethodData.Emit): Generate debugging info for external methods.
6151
6152 2003-02-02  Martin Baulig  <martin@ximian.com>
6153
6154         * class.cs (Constructor.Emit): Open the symbol writer before
6155         emitting the constructor initializer.
6156         (ConstructorInitializer.Emit): Call ec.Mark() to allow
6157         single-stepping through constructor initializers.
6158
6159 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
6160
6161         * class.cs: Handle error 549: do not allow virtual methods in
6162         sealed classes. 
6163
6164 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
6165
6166         * decl.cs: Check access levels when resolving types
6167
6168 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
6169
6170         * statement.cs: Add parameters and locals set in catch blocks that might 
6171         return to set vector
6172
6173 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
6174
6175         * class.cs (Operator): Set the SpecialName flags for operators.
6176
6177         * expression.cs (Invocation.DoResolve): Only block calls to
6178         accessors and operators on SpecialName methods.
6179
6180         (Cast.TryReduce): Handle conversions from char constants.
6181
6182
6183 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
6184
6185         * statement.cs: small memory and time optimization in FlowBranching.
6186
6187 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
6188
6189         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
6190         problem that the last fix but in the other sid (Set).
6191
6192         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
6193         access when there is no indexer in the hierarchy.
6194
6195 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
6196
6197         * class.cs: Combine some if statements.
6198
6199 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6200
6201         * driver.cs: fixed bug #37187.
6202
6203 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
6204
6205         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
6206         any indexer, it's needed to build a list with all the indexers in the
6207         hierarchy (AllGetters), else we have problems. Fixes #35653.
6208
6209 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
6210
6211         * class.cs (MethodData.Define): It is wrong for an interface
6212         implementation to be static in both cases: explicit and implicit.
6213         We were only handling this in one case.
6214
6215         Improve the if situation there to not have negations.
6216
6217         * class.cs (Field.Define): Turns out that we do not need to check
6218         the unsafe bit on field definition, only on usage.  Remove the test.
6219
6220 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6221
6222         * driver.cs: use assembly.Location instead of Codebase (the latest
6223         patch made mcs fail when using MS assemblies).
6224
6225 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
6226
6227         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
6228         get the path to *corlib.dll.
6229
6230 2003-01-21  Nick Drochak <ndrochak@gol.com>
6231
6232         * cs-tokenizer.cs:
6233         * pending.cs:
6234         * typemanager.cs: Remove compiler warnings
6235
6236 2003-01-20  Duncan Mak  <duncan@ximian.com>
6237
6238         * AssemblyInfo.cs: Bump the version number to 0.19.
6239
6240 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6241
6242         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
6243
6244 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
6245
6246         * class.cs (Constructor::Emit): Emit debugging info for constructors.
6247
6248 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
6249
6250         * cs-parser.jay: Small fix: we were not comparing the constructor
6251         name correctly.   Thanks to Zoltan for the initial pointer.
6252
6253 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
6254
6255         * cs-tokenizer.cs: Set file name when specified with #line
6256
6257 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
6258
6259         * cs-parser.jay: Only perform the constructor checks here if we
6260         are named like the class;  This will help provider a better
6261         error.  The constructor path is taken when a type definition is
6262         not found, but most likely the user forgot to add the type, so
6263         report that rather than the constructor error.
6264
6265 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
6266
6267         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
6268         allocations.
6269
6270 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
6271
6272         * cs-parser.jay: Add cleanup call.
6273
6274 2003-01-13  Duncan Mak  <duncan@ximian.com>
6275
6276         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
6277         consistent with other methods.
6278
6279 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
6280
6281         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
6282
6283 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
6284
6285         * attribute.cs: only set GuidAttr to true when we have a
6286         GuidAttribute.
6287
6288 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6289
6290         * ecore.cs:
6291         * expression.cs:
6292         * typemanager.cs: fixes to allow mcs compile corlib with the new
6293         Type.IsSubclassOf fix.
6294
6295 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
6296
6297         * expression.cs (LocalVariableReference.DoResolve): Classify a
6298         constant as a value, not as a variable.   Also, set the type for
6299         the variable.
6300
6301         * cs-parser.jay (fixed_statement): take a type instead of a
6302         pointer_type, so we can produce a better error message later.
6303
6304         * statement.cs (Fixed.Resolve): Flag types that are not pointers
6305         as an error.  
6306
6307         (For.DoEmit): Make inifinite loops have a
6308         non-conditional branch back.
6309
6310         (Fixed.DoEmit): First populate the pinned variables, then emit the
6311         statement, then clear the variables.  Before I was emitting the
6312         code once for each fixed piece.
6313
6314
6315 2003-01-08  Martin Baulig  <martin@ximian.com>
6316
6317         * statement.cs (FlowBranching.MergeChild): A break in a
6318         SWITCH_SECTION does not leave a loop.  Fixes #36155.
6319
6320 2003-01-08  Martin Baulig  <martin@ximian.com>
6321
6322         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
6323         lives in the same number space than `param_map'.  Fixes #36154.
6324
6325 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
6326
6327         * cs-parser.jay (constructor_declaration): Set the
6328         Constructor.ModFlags before probing for it.  This makes the
6329         compiler report 514, 515 and 132 (the code was there, but got
6330         broken). 
6331
6332         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
6333         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
6334         (GotoCase.Resolve): Set `Returns' to ALWAYS.
6335
6336 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
6337
6338         * enum.cs: create the enum static fields using the enum type.
6339
6340 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
6341
6342         * class.cs: don't try to create the ParamBuilder for the return
6343         type if it's not needed (and handle it breaking for the ms runtime
6344         anyway).
6345
6346 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
6347
6348         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
6349
6350 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
6351
6352         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
6353         the command.   This showed up while compiling the JANET source
6354         code, which used \r as its only newline separator.
6355
6356 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
6357
6358         * class.cs (Method.Define): If we are an operator (because it
6359         reuses our code), then set the SpecialName and HideBySig.  #36128
6360
6361 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
6362
6363         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
6364         exception, report error 120 `object reference required'.
6365
6366         * driver.cs: Add --pause option, used during to measure the size
6367         of the process as it goes with --timestamp.
6368
6369         * expression.cs (Invocation.DoResolve): Do not allow methods with
6370         SpecialName to be invoked.
6371
6372 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
6373
6374         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
6375         number before adding it.
6376
6377 2002-12-21  Ravi Pratap  <ravi@ximian.com>
6378
6379         * ecore.cs (StandardImplicitConversion): When in an unsafe
6380         context, we allow conversion between void * to any other pointer
6381         type. This fixes bug #35973.
6382
6383 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
6384
6385         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
6386         is not thrown when extensionless outputs are used 
6387
6388 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6389
6390         * rootcontext.cs: fixed compilation of corlib.
6391
6392 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
6393
6394         * attribute.cs (Attributes.Contains): Add new method.
6395
6396         * class.cs (MethodCore.LabelParameters): if the parameter is an
6397         `out' parameter, check that no attribute `[In]' has been passed.
6398
6399         * enum.cs: Handle the `value__' name in an enumeration.
6400
6401 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
6402
6403         * decl.cs: Added special case to allow overrides on "protected
6404         internal" methods
6405
6406 2002-12-18  Ravi Pratap  <ravi@ximian.com>
6407
6408         * attribute.cs (Attributes.AddAttributeSection): Rename to this
6409         since it makes much more sense.
6410
6411         (Attributes.ctor): Don't require a Location parameter.
6412
6413         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
6414
6415         * attribute.cs (ApplyAttributes): Remove extra Location parameters
6416         since we already have that information per attribute.
6417
6418         * everywhere : make appropriate changes.
6419
6420         * class.cs (LabelParameters): Write the code which actually
6421         applies attributes to the return type. We can't do this on the MS
6422         .NET runtime so we flag a warning in the case an exception is
6423         thrown.
6424
6425 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
6426
6427         * const.cs: Handle implicit null conversions here too.
6428
6429 2002-12-17  Ravi Pratap  <ravi@ximian.com>
6430
6431         * class.cs (MethodCore.LabelParameters): Remove the extra
6432         Type [] parameter since it is completely unnecessary. Instead
6433         pass in the method's attributes so that we can extract
6434         the "return" attribute.
6435
6436 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
6437
6438         * cs-parser.jay (parse): Use Report.Error to flag errors instead
6439         of ignoring it and letting the compile continue.
6440
6441         * typemanager.cs (ChangeType): use an extra argument to return an
6442         error condition instead of throwing an exception.
6443
6444 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
6445
6446         * expression.cs (Unary.TryReduce): mimic the code for the regular
6447         code path.  Perform an implicit cast in the cases where we can
6448         implicitly convert to one of the integral types, and then reduce
6449         based on that constant.   This fixes bug #35483.
6450
6451 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6452
6453         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
6454
6455 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6456
6457         * namespace.cs: fixed bug #35489.
6458
6459 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
6460
6461         * class.cs: Remove some dead code.
6462
6463         * cs-parser.jay: Estimate the number of methods needed
6464         (RootContext.MethodCount);
6465
6466         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
6467         numbers instead of StringBuilders.
6468
6469         * support.cs (PtrHashtable): Add constructor with initial size;
6470         We can now reduce reallocations of the method table.
6471
6472 2002-12-10  Ravi Pratap  <ravi@ximian.com>
6473
6474         * attribute.cs (ApplyAttributes): Keep track of the emitted
6475         attributes on a per-target basis. This fixes bug #35413.
6476
6477 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
6478
6479         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
6480         default to the Windows 1252 encoding.
6481
6482         (UnixParseOption): Support version, thanks to Alp for the missing
6483         pointer. 
6484
6485         * AssemblyInfo.cs: Add nice assembly information.
6486
6487         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
6488         (bug 35169).
6489
6490         * cs-parser.jay: Allow a trailing comma before the close bracked
6491         in the attribute_section production.
6492
6493         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
6494         address of the instance was being taken, I will take this out,
6495         because we take the address of the object immediately here.
6496
6497 2002-12-09  Ravi Pratap  <ravi@ximian.com>
6498
6499         * typemanager.cs (AreMultipleAllowed): Take care of the most
6500         obvious case where attribute type is not in the current assembly -
6501         stupid me ;-)
6502
6503 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
6504
6505         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
6506         definitions, instead of doing that afterwards.  
6507
6508         Also we use a nice little hack, depending on the constructor, we
6509         know if we are a "composed" name or a simple name.  Hence, we
6510         avoid the IndexOf test, and we avoid 
6511
6512         * codegen.cs: Add code to assist in a bug reporter to track down
6513         the source of a compiler crash. 
6514
6515 2002-12-07  Ravi Pratap  <ravi@ximian.com>
6516
6517         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
6518         types have been emitted for a given element and flag an error
6519         if something which does not have AllowMultiple set is used more
6520         than once.
6521
6522         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
6523         attribute types and their corresponding AllowMultiple properties
6524
6525         (AreMultipleAllowed): Check the property for a given type.
6526
6527         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
6528         property in the case we have a TypeContainer.
6529
6530         (Attributes.AddAttribute): Detect duplicates and just skip on
6531         adding them. This trivial fix catches a pretty gross error in our
6532         attribute emission - global attributes were being emitted twice!
6533
6534         Bugzilla bug #33187 is now fixed.
6535
6536 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
6537
6538         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
6539         instead of pp_and).
6540
6541         * expression.cs (Binary.ResolveOperator): I can only use the
6542         Concat (string, string, string) and Concat (string, string,
6543         string, string) if the child is actually a concatenation of
6544         strings. 
6545
6546 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
6547
6548         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
6549         context where we need a 2-character lookahead.
6550
6551         * pending.cs (PendingImplementation): Rework so we can keep track
6552         of interface types all the time, and flag those which were
6553         implemented by parents as optional.
6554
6555 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
6556
6557         * expression.cs (Binary.ResolveOperator): Use
6558         String.Concat(string,string,string) or
6559         String.Concat(string,string,string,string) when possible. 
6560
6561         * typemanager: More helper methods.
6562
6563
6564 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
6565
6566         * pending.cs: remove the bogus return from GetMissingInterfaces()
6567         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
6568
6569 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6570
6571         * namespace.cs: avoid duplicated 'using xxx' being added to
6572         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
6573         when we get more than one 'using' statement for the same namespace.
6574         Report a CS0105 warning for it.
6575
6576 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
6577
6578         * cs-tokenizer.cs (consume_identifier): use read directly, instead
6579         of calling getChar/putback, uses internal knowledge of it.    
6580
6581         (xtoken): Reorder tokenizer so most common patterns are checked
6582         first.  This reduces the compilation time in another 5% (from 8.11s
6583         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
6584
6585         The parsing time is 22% of the compilation in mcs, and from that
6586         64% is spent on the tokenization process.  
6587
6588         I tried using a binary search for keywords, but this is slower
6589         than the hashtable.  Another option would be to do a couple of
6590         things:
6591
6592                 * Not use a StringBuilder, instead use an array of chars,
6593                   with a set value.  Notice that this way we could catch
6594                   the 645 error without having to do it *afterwards*.
6595
6596                 * We could write a hand-parser to avoid the hashtable
6597                   compares altogether.
6598
6599         The identifier consumption process takes 37% of the tokenization
6600         time.  Another 15% is spent on is_number.  56% of the time spent
6601         on is_number is spent on Int64.Parse:
6602
6603                 * We could probably choose based on the string length to
6604                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
6605                   computations. 
6606
6607         Another 3% is spend on wrapping `xtoken' in the `token' function.
6608
6609         Handle 0xa0 as whitespace (#34752)
6610
6611 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
6612
6613         * typemanager.cs (IsCLRType): New routine to tell whether a type
6614         is one of the builtin types.  
6615
6616         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
6617         typecode in more places instead of doing pointer comparissions.
6618         We could leverage some knowledge about the way the typecodes are
6619         laid out.
6620
6621         New code to cache namespaces in assemblies, it is currently not
6622         invoked, to be used soon.
6623
6624         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
6625
6626         * expression.cs (Binary.ResolveOperator): specially handle
6627         strings, and do not perform user-defined operator overloading for
6628         built-in types.
6629
6630 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
6631
6632         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
6633         internalcall as it is a pretty simple operation;  Avoid whenever
6634         possible to call Char.IsLetter.
6635
6636         (consume_identifier): Cut by half the number of
6637         hashtable calls by merging the is_keyword and GetKeyword behavior.
6638
6639         Do not short-circuit, because if we do, we
6640         report errors (ie, #if false && true would produce an invalid
6641         directive error);
6642
6643
6644 2002-11-24  Martin Baulig  <martin@ximian.com>
6645
6646         * expression.cs (Cast.TryReduce): If we're in checked syntax,
6647         check constant ranges and report a CS0221.  Fixes #33186.
6648
6649 2002-11-24  Martin Baulig  <martin@ximian.com>
6650
6651         * cs-parser.jay: Make this work for uninitialized variable
6652         declarations in the `for' initializer.  Fixes #32416.
6653
6654 2002-11-24  Martin Baulig  <martin@ximian.com>
6655
6656         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
6657         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
6658
6659 2002-11-24  Martin Baulig  <martin@ximian.com>
6660
6661         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
6662         argument; if true, we also check for user-defined conversions.
6663         This is only needed if both arguments are of a user-defined type.
6664         Fixes #30443, added test-175.cs.
6665         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
6666
6667         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
6668
6669 2002-11-24  Martin Baulig  <martin@ximian.com>
6670
6671         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
6672         function to get the store opcode.
6673         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
6674         only emit the Ldelema if the store opcode is Stobj.  You must run
6675         both test-34 and test-167 to test this.  Fixes #34529.
6676
6677 2002-11-23  Martin Baulig  <martin@ximian.com>
6678
6679         * ecore.cs (Expression.MemberLookup): Added additional
6680         `qualifier_type' argument which is used when we're being called
6681         from MemberAccess.DoResolve() and null if we're called from a
6682         SimpleName lookup.
6683         (Expression.MemberLookupFailed): New method to report errors; this
6684         does the CS1540 check and reports the correct error message.
6685
6686         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
6687         argument for the CS1540 check and redone the way how we're dealing
6688         with private members.  See the comment in the source code for details.
6689         (FilterWithClosure): Reverted this back to revision 1.197; renamed
6690         `closure_start_type' to `closure_qualifier_type' and check whether
6691         it's not null.  It was not this filter being broken, it was just
6692         being called with the wrong arguments.
6693
6694         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
6695         and pass it the correct `qualifier_type'; this also does the error
6696         handling for us.
6697
6698 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
6699
6700         * expression.cs (Invocation.EmitParams): If the we are dealing
6701         with a non-built-in value type, load its address as well.
6702
6703         (ArrayCreation): Use a a pretty constant instead
6704         of the hardcoded value 2.   Use 6 instead of 2 for the number of
6705         static initializers.  
6706
6707         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
6708         because they are not really value types, just glorified integers. 
6709
6710         * driver.cs: Do not append .exe, the CSC compiler does not do it.
6711
6712         * ecore.cs: Remove redundant code for enumerations, make them use
6713         the same code path as everything else, fixes the casting issue
6714         with enumerations in Windows.Forms.
6715
6716         * attribute.cs: Do only cast to string if it is a string, the
6717         validation happens later.
6718
6719         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
6720         people upgrade their corlibs.
6721
6722         * ecore.cs: Oops, enumerations were not following the entire code path
6723
6724 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
6725
6726         * typemanager.cs (FilterWithClosure): Commented out the test for
6727         1540 in typemanager.cs, as it has problems when accessing
6728         protected methods from a parent class (see test-174.cs). 
6729
6730         * attribute.cs (Attribute.ValidateGuid): new method.
6731         (Attribute.Resolve): Use above.
6732
6733 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
6734
6735         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
6736
6737         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
6738         handling for enumerations, as we only needed the TypeContainer
6739         functionality to begin with (this is required for the fix below to
6740         work for enums that reference constants in a container class for
6741         example). 
6742
6743         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
6744
6745         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
6746         a valid TypeBuilder to perform lookups on.o
6747
6748         * class.cs (InheritableMemberSignatureCompare): Use true in the
6749         call to GetGetMethod and GetSetMethod, because we are comparing
6750         the signature, and we need to get the methods *even* if they are
6751         private. 
6752
6753         (PropertyBase.CheckBase): ditto.
6754
6755         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
6756         GotoCase.Resolve): Use Peel on EmpytCasts.
6757
6758         * ecore.cs (EmptyCast): drop child, add Peel method.
6759
6760 2002-11-17  Martin Baulig  <martin@ximian.com>
6761
6762         * ecore.cs (EmptyCast.Child): New public property.
6763
6764         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
6765         label resolved to an EmptyCast.  Fixes #34162.
6766         (GotoCase.Resolve): Likewise.
6767         (Block.EmitMeta): Likewise.
6768
6769 2002-11-17  Martin Baulig  <martin@ximian.com>
6770
6771         * expression.cs (Invocation.BetterConversion): Prefer int over
6772         uint; short over ushort; long over ulong for integer literals.
6773         Use ImplicitConversionExists instead of StandardConversionExists
6774         since we also need to check for user-defined implicit conversions.
6775         Fixes #34165.  Added test-173.cs.
6776
6777 2002-11-16  Martin Baulig  <martin@ximian.com>
6778
6779         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
6780         with the `true' and `false' literals.  Fixes #33151.
6781
6782 2002-11-16  Martin Baulig  <martin@ximian.com>
6783
6784         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
6785         October 22nd; don't do the cs1540 check for static members.
6786
6787         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
6788         now using our own filter here and doing the cs1540 check again.
6789
6790 2002-11-16  Martin Baulig  <martin@ximian.com>
6791
6792         * support.cs (InternalParameters): Don't crash if we don't have
6793         any fixed parameters.  Fixes #33532.
6794
6795 2002-11-16  Martin Baulig  <martin@ximian.com>
6796
6797         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
6798         when looking up static methods to make this work on Windows.
6799         Fixes #33773.
6800
6801 2002-11-16  Martin Baulig  <martin@ximian.com>
6802
6803         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
6804         a setter rather than using PropertyInfo.CanWrite.
6805
6806 2002-11-15  Nick Drochak  <ndrochak@gol.com>
6807
6808         * class.cs: Allow acces to block member by subclasses. Fixes build
6809         breaker.
6810
6811 2002-11-14  Martin Baulig  <martin@ximian.com>
6812
6813         * class.cs (Constructor.Emit): Added the extern/block check.
6814         Fixes bug #33678.
6815
6816 2002-11-14  Martin Baulig  <martin@ximian.com>
6817
6818         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
6819         iteration while looking for indexers, this is needed because the
6820         indexer may have a different name in our base classes.  Fixed the
6821         error reporting (no indexers at all, not get accessor, no
6822         overloaded match).  Fixes bug #33089.
6823         (IndexerAccess.DoResolveLValue): Likewise.
6824
6825 2002-11-14  Martin Baulig  <martin@ximian.com>
6826
6827         * class.cs (PropertyBase.CheckBase): Make this work for multiple
6828         indexers.  Fixes the first part of bug #33089.
6829         (MethodSignature.InheritableMemberSignatureCompare): Added support
6830         for properties.
6831
6832 2002-11-13  Ravi Pratap  <ravi@ximian.com>
6833
6834         * attribute.cs (Attribute.Resolve): Catch the
6835         NullReferenceException and report it since it isn't supposed to
6836         happen. 
6837
6838 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
6839
6840         * expression.cs (Binary.EmitBranchable): Also handle the cases for
6841         LogicalOr and LogicalAnd that can benefit from recursively
6842         handling EmitBranchable.  The code now should be nice for Paolo.
6843
6844 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
6845
6846         * typemanager.cs (LookupType): Added a negative-hit hashtable for
6847         the Type lookups, as we perform quite a number of lookups on
6848         non-Types.  This can be removed once we can deterministically tell
6849         whether we have a type or a namespace in advance.
6850
6851         But this might require special hacks from our corlib.
6852
6853         * TODO: updated.
6854
6855         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
6856         and double which avoids a conversion from an integer to a double.
6857
6858         * expression.cs: tiny optimization, avoid calling IsConstant,
6859         because it effectively performs the lookup twice.
6860
6861 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
6862
6863         But a bogus return here to keep the semantics of the old code
6864         until the Mono runtime is fixed.
6865
6866         * pending.cs (GetMissingInterfaces): New method used to remove all
6867         the interfaces that are already implemented by our parent
6868         classes from the list of pending methods. 
6869
6870         * interface.cs: Add checks for calls after ResolveTypeExpr.
6871
6872 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
6873
6874         * class.cs (Class.Emit): Report warning 67: event not used if the
6875         warning level is beyond 3.
6876
6877         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
6878         being a NullLiteral.
6879
6880         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
6881         specifiers. 
6882
6883         * class.cs (TypeContainer.GetClassBases): Cover a missing code
6884         path that might fail if a type can not be resolved.
6885
6886         * expression.cs (Binary.Emit): Emit unsigned versions of the
6887         operators. 
6888
6889         * driver.cs: use error 5.
6890
6891 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
6892
6893         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
6894
6895 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
6896
6897         * cs-parser.jay (switch_section): A beautiful patch from Martin
6898         Baulig that fixed 33094.
6899
6900 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
6901
6902         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
6903         Check whether the base is abstract and report an error if so.
6904
6905         * expression.cs (IndexerAccess.DoResolveLValue,
6906         IndexerAccess.DoResolve): ditto. 
6907
6908         (Invocation.DoResolve): ditto.
6909
6910         (Invocation.FullMethodDesc): Improve the report string.
6911
6912         * statement.cs (Block): Eliminate IsVariableDefined as it is
6913         basically just a wrapper for GetVariableInfo.
6914
6915         * ecore.cs (SimpleName): Use new 
6916
6917         * support.cs (ReflectionParamter.ParameterType): We unwrap the
6918         type, as we return the actual parameter ref/unref state on a
6919         different call.
6920
6921 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
6922
6923         * support.cs: Return proper flags REF/OUT fixing the previous
6924         commit.  
6925
6926         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
6927         not used to mean `ref' but `ref or out' in ParameterReference
6928
6929         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
6930         full type signature instead of calling TypeManger.CSharpName
6931         ourselves. 
6932
6933         * support.cs (InternalParameters.ParameterDesc): Do not compare
6934         directly to the modflags, because REF/OUT will actually be bitsets
6935         if set. 
6936
6937         * delegate.cs (VerifyMethod): Check also the modifiers.
6938
6939         * cs-tokenizer.cs: Fix bug where floating point values with an
6940         exponent where a sign was missing was ignored.
6941
6942         * driver.cs: Allow multiple assemblies to be specified in a single
6943         /r: argument
6944
6945 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
6946
6947         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
6948         because identifiers after a parenthesis would end up in this kind
6949         of production, and we needed to desamiguate it for having casts
6950         like:
6951
6952                 (UserDefinedType *) xxx
6953
6954 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
6955
6956         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
6957         we should set on the Bindingflags.NonPublic, but not turn on
6958         private_ok.  private_ok controls whether a Private member is
6959         returned (this is chekced on the filter routine), while the
6960         BindingFlags.NonPublic just controls whether private/protected
6961         will be allowed.   This fixes the problem part of the problem of
6962         private properties being allowed to be used in derived classes.
6963
6964         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
6965         so we can call the children DoResolveLValue method (this will
6966         properly signal errors on lvalue assignments to base properties)
6967
6968         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
6969         getter are null, and we have a property info, we know that this
6970         happened because the lookup failed, so we report an error 122 for
6971         protection level violation.
6972
6973         We also silently return if setter and getter are null in the
6974         resolve functions, this condition only happens if we have flagged
6975         the error before.  This is the other half of the problem. 
6976
6977         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
6978         not have accessibility information, that is why we were returning
6979         true in the filter function in typemanager.cs.
6980
6981         To properly report 122 (property is inaccessible because of its
6982         protection level) correctly, we report this error in ResolveAccess
6983         by failing if both the setter and the getter are lacking (ie, the
6984         lookup failed). 
6985
6986         DoResolve and DoLResolve have been modified to check for both
6987         setter/getter being null and returning silently, the reason being
6988         that I did not want to put the knowledge about this error in upper
6989         layers, like:
6990
6991         int old = Report.Errors;
6992         x = new PropertyExpr (...);
6993         if (old != Report.Errors)
6994                 return null;
6995         else
6996                 return x;
6997
6998         So the property expr is returned, but it is invalid, so the error
6999         will be flagged during the resolve process. 
7000
7001         * class.cs: Remove InheritablePropertySignatureCompare from the
7002         class, as we no longer depend on the property signature to compute
7003         whether it is possible to implement a method or not.
7004
7005         The reason is that calling PropertyInfo.GetGetMethod will return
7006         null (in .NET, in Mono it works, and we should change this), in
7007         cases where the Get Method does not exist in that particular
7008         class.
7009
7010         So this code:
7011
7012         class X { public virtual int A { get { return 1; } } }
7013         class Y : X { }
7014         class Z : Y { public override int A { get { return 2; } } }
7015
7016         Would fail in Z because the parent (Y) would not have the property
7017         defined.  So we avoid this completely now (because the alternative
7018         fix was ugly and slow), and we now depend exclusively on the
7019         method names.
7020
7021         (PropertyBase.CheckBase): Use a method-base mechanism to find our
7022         reference method, instead of using the property.
7023
7024         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
7025         routines are gone now.
7026
7027         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
7028         names, they were incorrectly named.
7029
7030         * cs-tokenizer.cs: Return are more gentle token on failure. 
7031
7032         * pending.cs (PendingImplementation.InterfaceMethod): This routine
7033         had an out-of-sync index variable, which caused it to remove from
7034         the list of pending methods the wrong method sometimes.
7035
7036 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
7037
7038         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
7039         CanWrite, because those refer to this particular instance of the
7040         property, and do not take into account the fact that we can
7041         override single members of a property.
7042
7043         Constructor requires an EmitContext.  The resolution process does
7044         not happen here, but we need to compute the accessors before,
7045         because the resolution does not always happen for properties.
7046
7047         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
7048         subclass, before we did not update this flag, but we did update
7049         bindingflags. 
7050
7051         (GetAccessors): Drop this routine, as it did not work in the
7052         presence of partially overwritten set/get methods. 
7053
7054         Notice that this broke the cs1540 detection, but that will require
7055         more thinking. 
7056
7057 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7058
7059         * class.cs:
7060         * codegen.cs:
7061         * driver.cs: issue a warning instead of an error if we don't support
7062         debugging for the platform. Also ignore a couple of errors that may
7063         arise when trying to write the symbols. Undo my previous patch.
7064
7065 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7066
7067         * driver.cs: ignore /debug switch except for Unix platforms.
7068
7069 2002-10-23  Nick Drochak  <ndrochak@gol.com>
7070
7071         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
7072
7073 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
7074
7075         * driver.cs: Do not make mcs-debug conditional, so we do not break
7076         builds that use it.
7077
7078         * statement.cs (UsageVector.MergeChildren): I would like Martin to
7079         review this patch.  But basically after all the children variables
7080         have been merged, the value of "Breaks" was not being set to
7081         new_breaks for Switch blocks.  I think that it should be set after
7082         it has executed.  Currently I set this to the value of new_breaks,
7083         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
7084         conservative, but I do not understand this code very well.
7085
7086         I did not break anything in the build, so that is good ;-)
7087
7088         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
7089
7090 2002-10-20  Mark Crichton  <crichton@gimp.org>
7091
7092         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
7093
7094 2002-10-20  Nick Drochak  <ndrochak@gol.com>
7095
7096         * cfold.cs: Fixed compile blocker.
7097
7098 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
7099
7100         * driver.cs: I was chekcing the key, not the file.
7101
7102 2002-10-19  Ravi Pratap  <ravi@ximian.com>
7103
7104         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
7105         message that we were generating - we just need to silently return
7106         a null.
7107
7108 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
7109
7110         * class.cs (Event.Define): Change my previous commit, as this
7111         breaks the debugger.  This is a temporary hack, as it seems like
7112         the compiler is generating events incorrectly to begin with.
7113
7114         * expression.cs (Binary.ResolveOperator): Added support for 
7115         "U operator - (E x, E y)"
7116
7117         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
7118         y)".
7119
7120         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
7121         init-only variables, but this path did not take into account that
7122         there might be also instance readonly variables.  Correct this
7123         problem. 
7124
7125         This fixes bug 32253
7126
7127         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
7128         delegates as well.
7129
7130         * driver.cs: Change the extension for modules to `netmodule'
7131
7132         * cs-parser.jay: Improved slightly the location tracking for
7133         the debugger symbols.
7134
7135         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
7136         modifiers that were specified instead of the hardcoded value
7137         (FamAndAssem).  This was basically ignoring the static modifier,
7138         and others.  Fixes 32429.
7139
7140         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
7141         fixed a bug in the process (32476)
7142
7143         * expression.cs (ArrayAccess.EmitAssign): Patch from
7144         hwang_rob@yahoo.ca that fixes bug 31834.3
7145
7146 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
7147
7148         * driver.cs: Make the module extension .netmodule.
7149
7150 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
7151
7152         * driver.cs: Report an error if the resource file is not found
7153         instead of crashing.
7154
7155         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
7156         false, like Emit does.
7157
7158 2002-10-16  Nick Drochak  <ndrochak@gol.com>
7159
7160         * typemanager.cs: Remove unused private member.  Also reported mcs
7161         bug to report this as a warning like csc.
7162
7163 2002-10-15  Martin Baulig  <martin@gnome.org>
7164
7165         * statement.cs (Statement.Emit): Made this a virtual method; emits
7166         the line number info and calls DoEmit().
7167         (Statement.DoEmit): New protected abstract method, formerly knows
7168         as Statement.Emit().
7169
7170         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
7171
7172 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
7173
7174         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
7175         have fixed a remaining problem: not every AddXXXX was adding a
7176         fully qualified name.  
7177
7178         Now everyone registers a fully qualified name in the DeclSpace as
7179         being defined instead of the partial name.  
7180
7181         Downsides: we are slower than we need to be due to the excess
7182         copies and the names being registered this way.  
7183
7184         The reason for this is that we currently depend (on the corlib
7185         bootstrap for instance) that types are fully qualified, because
7186         we dump all the types in the namespace, and we should really have
7187         types inserted into the proper namespace, so we can only store the
7188         basenames in the defined_names array.
7189
7190 2002-10-10  Martin Baulig  <martin@gnome.org>
7191
7192         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
7193         from bug #31834, see the bug report for a testcase which is
7194         miscompiled.
7195
7196 2002-10-10  Martin Baulig  <martin@gnome.org>
7197
7198         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
7199         flow analysis code for this.
7200
7201         * statement.cs (Do, While, For): Tell the flow analysis code about
7202         infinite loops.
7203         (FlowBranching.UsageVector): Added support for infinite loops.
7204         (Block.Resolve): Moved the dead code elimination here and use flow
7205         analysis to do it.
7206
7207 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
7208
7209         * class.cs (Field.Define): Catch cycles on struct type
7210         definitions. 
7211
7212         * typemanager.cs (IsUnmanagedtype): Do not recursively check
7213         fields if the fields are static.  We only need to check instance
7214         fields. 
7215
7216         * expression.cs (As.DoResolve): Test for reference type.
7217
7218         * statement.cs (Using.ResolveExpression): Use
7219         ConvertImplicitRequired, not ConvertImplicit which reports an
7220         error on failture
7221         (Using.ResolveLocalVariableDecls): ditto.
7222
7223         * expression.cs (Binary.ResolveOperator): Report errors in a few
7224         places where we had to.
7225
7226         * typemanager.cs (IsUnmanagedtype): Finish implementation.
7227
7228 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
7229
7230         * expression.cs: Use StoreFromPtr instead of extracting the type
7231         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
7232
7233         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
7234         an enumeration value to a System.Enum, but System.Enum is not a
7235         value type, but an class type, so we need to box.
7236
7237         (Expression.ConvertExplicit): One codepath could return
7238         errors but not flag them.  Fix this.  Fixes #31853
7239
7240         * parameter.cs (Resolve): Do not allow void as a parameter type.
7241
7242 2002-10-06  Martin Baulig  <martin@gnome.org>
7243
7244         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
7245         if it's a class type and not a struct.  Fixes #31815.
7246
7247 2002-10-06  Martin Baulig  <martin@gnome.org>
7248
7249         * statement.cs: Reworked the flow analysis code a bit to make it
7250         usable for dead code elimination.
7251
7252 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7253
7254         * cs-parser.jay: allow empty source files. Fixes bug #31781.
7255
7256 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
7257
7258         * expression.cs (ComposedCast.DoResolveType): A quick workaround
7259         to fix the test 165, will investigate deeper.
7260
7261 2002-10-04  Martin Baulig  <martin@gnome.org>
7262
7263         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
7264         finally blocks actually work.
7265         (Try.Resolve): We don't need to create a sibling for `finally' if
7266         there is no finally block.
7267
7268 2002-10-04  Martin Baulig  <martin@gnome.org>
7269
7270         * class.cs (Constructor.Define): The default accessibility for a
7271         non-default constructor is private, not public.
7272
7273 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
7274
7275         * class.cs (Constructor): Make AllowedModifiers public, add
7276         EXTERN.
7277
7278         * cs-parser.jay: Perform the modifiers test here, as the
7279         constructor for the Constructor class usually receives a zero
7280         because of the way we create it (first we create, later we
7281         customize, and we were never checking the modifiers).
7282
7283         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
7284         is a version of LookupTypeReflection that includes the type-name
7285         cache.  This can be used as a fast path for functions that know
7286         the fully qualified name and are only calling into *.GetType() to
7287         obtain a composed type.
7288
7289         This is also used by TypeManager.LookupType during its type
7290         composition.
7291
7292         (LookupType): We now also track the real type name, as sometimes
7293         we can get a quey for the real type name from things like
7294         ComposedCast.  This fixes bug 31422.
7295
7296         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
7297         complete type fullname, it does not have to go through the type
7298         resolution system to obtain the composed version of the type (for
7299         obtaining arrays or pointers).
7300
7301         (Conditional.Emit): Use the EmitBoolExpression to
7302         generate nicer code, as requested by Paolo.
7303
7304         (ArrayCreation.CheckIndices): Use the patch from
7305         hwang_rob@yahoo.ca to validate the array initializers. 
7306
7307 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
7308
7309         * class.cs (ConstructorInitializer.Emit): simplify code by using
7310         Invocation.EmitCall, and at the same time, fix the bugs in calling
7311         parent constructors that took variable arguments. 
7312
7313         * ecore.cs (Expression.ConvertNumericExplicit,
7314         Expression.ImplicitNumericConversion): Remove the code that
7315         manually wrapped decimal (InternalTypeConstructor call is now gone
7316         as well).
7317
7318         * expression.cs (Cast.TryReduce): Also handle decimal types when
7319         trying to perform a constant fold on the type.
7320
7321         * typemanager.cs (IsUnmanagedtype): Partially implemented.
7322
7323         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
7324         that only turned off an error report, and did nothing else. 
7325
7326 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
7327
7328         * driver.cs: Handle and ignore /fullpaths
7329
7330 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
7331
7332         * expression.cs (Binary.ResolveOperator): Catch the case where
7333         DoNumericPromotions returns true, 
7334
7335         (Binary.DoNumericPromotions): Simplify the code, and the tests.
7336
7337 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
7338
7339         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
7340         report error 70.
7341
7342 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
7343
7344         * ecore.cs (ConvertNumericExplicit): It is not enough that the
7345         conversion exists, but it is also required that the conversion be
7346         performed.  This manifested in "(Type64Enum) 2".  
7347
7348         * class.cs (TypeManager.AddMethod): The fix is not to change
7349         AddEnum, because that one was using a fully qualified name (every
7350         DeclSpace derivative does), but to change the AddMethod routine
7351         that was using an un-namespaced name.  This now correctly reports
7352         the duplicated name.
7353
7354         Revert patch until I can properly fix it.  The issue
7355         is that we have a shared Type space across all namespaces
7356         currently, which is wrong.
7357
7358         Options include making the Namespace a DeclSpace, and merge
7359         current_namespace/current_container in the parser.
7360
7361 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
7362
7363         * cs-parser.jay: Improve error reporting when we get a different
7364         kind of expression in local_variable_type and
7365         local_variable_pointer_type. 
7366
7367         Propagate this to avoid missleading errors being reported.
7368
7369         * ecore.cs (ImplicitReferenceConversion): treat
7370         TypeManager.value_type as a target just like object_type.   As
7371         code like this:
7372
7373         ValueType v = 1;
7374
7375         Is valid, and needs to result in the int 1 being boxed before it
7376         is assigned to the value type v.
7377
7378         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
7379         to validate the enumeration name.
7380
7381         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
7382         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
7383         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
7384
7385         * ecore.cs (TryImplicitIntConversion): When doing an
7386         implicit-enumeration-conversion, check if the type is 64-bits and
7387         perform a conversion before passing to EnumConstant.
7388
7389 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
7390
7391         * decl.cs (Error_AmbiguousTypeReference); New routine used to
7392         report ambiguous type references.  Unlike the MS version, we
7393         report what the ambiguity is.   Innovation at work ;-)
7394
7395         (DeclSpace.FindType): Require a location argument to
7396         display when we display an ambiguous error.
7397
7398         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
7399
7400         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
7401
7402         * expression.cs (EmitDynamicInitializers): Apply patch from
7403         hwang_rob@yahoo.ca that fixes the order in which we emit our
7404         initializers. 
7405
7406 2002-09-21  Martin Baulig  <martin@gnome.org>
7407
7408         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
7409         delegate takes no arguments.
7410
7411 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
7412
7413         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
7414         from integers.
7415
7416         * expression.cs: Extract the underlying type.
7417
7418         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
7419
7420         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
7421
7422 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
7423
7424         * class.cs (TypeContainer.DefineType): We can not use the nice
7425         PackingSize with the size set to 1 DefineType method, because it
7426         will not allow us to define the interfaces that the struct
7427         implements.
7428
7429         This completes the fixing of bug 27287
7430
7431         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
7432         means also structs.  This fixes part of the problem. 
7433         (Expresion.ImplicitReferenceConversionExists): ditto.
7434
7435         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
7436         error if there were no errors reported during the type lookup
7437         process, to avoid duplicates or redundant errors.  Without this
7438         you would get an ambiguous errors plus a type not found.  We have
7439         beaten the user enough with the first error.  
7440
7441         (DeclSparce.FindType): Emit a warning if we have an ambiguous
7442         reference. 
7443
7444         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
7445         during the resolution process, stop the lookup, this avoids
7446         repeated error reports (same error twice).
7447
7448         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
7449
7450         * typemanager.cs (LookupType): Redo the type lookup code to match
7451         the needs of System.Reflection.  
7452
7453         The issue is that System.Reflection requires references to nested
7454         types to begin with a "+" sign instead of a dot.  So toplevel
7455         types look like: "NameSpace.TopLevelClass", and nested ones look
7456         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
7457         levels. 
7458
7459 2002-09-19  Martin Baulig  <martin@gnome.org>
7460
7461         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
7462         says that a method always returns or always throws an exception,
7463         don't report the CS0161.
7464
7465         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
7466         set `Returns = new_returns'.
7467
7468 2002-09-19  Martin Baulig  <martin@gnome.org>
7469
7470         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
7471         to an enum constant, check for a CS0176.
7472
7473 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
7474
7475         * class.cs (TypeContainer.CheckPairedOperators): Now we check
7476         for operators that must be in pairs and report errors.
7477
7478         * ecore.cs (SimpleName.DoResolveType): During the initial type
7479         resolution process, when we define types recursively, we must
7480         check first for types in our current scope before we perform
7481         lookups in the enclosing scopes.
7482
7483         * expression.cs (MakeByteBlob): Handle Decimal blobs.
7484
7485         (Invocation.VerifyArgumentsCompat): Call
7486         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
7487         I thought we were supposed to always call this, but there are a
7488         few places in the code where we dont do it.
7489
7490 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
7491
7492         * driver.cs: Add support in -linkres and -resource to specify the
7493         name of the identifier.
7494
7495 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
7496
7497         * ecore.cs (StandardConversionExists): Sync with the conversion
7498         code: allow anything-* to void* conversions.
7499
7500         (FindMostSpecificSource): Use an Expression argument
7501         instead of a Type, because we might be handed over a Literal which
7502         gets a few more implicit conversions that plain types do not.  So
7503         this information was being lost.
7504
7505         Also, we drop the temporary type-holder expression when not
7506         required.
7507
7508 2002-09-17  Martin Baulig  <martin@gnome.org>
7509
7510         * class.cs (PropertyBase.CheckBase): Don't check the base class if
7511         this is an explicit interface implementation.
7512
7513 2002-09-17  Martin Baulig  <martin@gnome.org>
7514
7515         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
7516         different `IndexerName' attributes.
7517
7518         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
7519         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
7520         virtual CommonResolve().
7521
7522 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
7523
7524         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
7525         and convert that to the UnderlyingType.
7526
7527         * statement.cs (Foreach.Resolve): Indexers are just like variables
7528         or PropertyAccesses.
7529
7530         * cs-tokenizer.cs (consume_string): Track line numbers and columns
7531         inside quoted strings, we were not doing this before.
7532
7533 2002-09-16  Martin Baulig  <martin@gnome.org>
7534
7535         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
7536         resolve it.  This is needed for the definite assignment check of the
7537         instance expression, fixes bug #29846.
7538         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
7539
7540 2002-09-16  Nick Drochak  <ndrochak@gol.com>
7541
7542         * parameter.cs: Fix compile error.  Cannot reference static member
7543         from an instance object.  Is this an mcs bug?
7544
7545 2002-09-14  Martin Baulig  <martin@gnome.org>
7546
7547         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
7548         multiple times.  Fixes bug #30295, added test-166.cs.
7549
7550 2002-09-14  Martin Baulig  <martin@gnome.org>
7551
7552         * statement.cs (Block.Emit): Don't emit unreachable code.
7553         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
7554         `break' statements.
7555         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
7556
7557 2002-09-14  Martin Baulig  <martin@gnome.org>
7558
7559         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
7560         is set.
7561
7562 2002-09-14  Martin Baulig  <martin@gnome.org>
7563
7564         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
7565         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
7566         be false on the ms runtime.
7567
7568 2002-09-13  Martin Baulig  <martin@gnome.org>
7569
7570         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
7571         the CS0038 error message.
7572
7573 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
7574
7575         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
7576         constant inside, return it.
7577
7578 2002-09-12  Martin Baulig  <martin@gnome.org>
7579
7580         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
7581         implicit conversion can be done between enum types.
7582
7583         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
7584         check whether an implicit conversion to the current enum's UnderlyingType
7585         exists and report an error if not.
7586
7587         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
7588         without debugging support.
7589
7590         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
7591         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
7592
7593 2002-09-12  Martin Baulig  <martin@gnome.org>
7594
7595         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
7596
7597         * ecore.cs (IMemberExpr.DeclaringType): New property.
7598         (SimpleName.SimpleNameResolve): Check whether we're accessing a
7599         nonstatic member of an outer type (CS0038).
7600
7601 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
7602
7603         * driver.cs: Activate the using-error detector at warning level
7604         4 (at least for MS-compatible APIs).
7605
7606         * namespace.cs (VerifyUsing): Small buglett fix.
7607
7608         * pending.cs (PendingImplementation): pass the container pointer. 
7609
7610         * interface.cs (GetMethods): Allow for recursive definition.  Long
7611         term, I would like to move every type to support recursive
7612         definitions, not the current ordering mechanism that we have right
7613         now.
7614
7615         The situation is this: Attributes are handled before interfaces,
7616         so we can apply attributes to interfaces.  But some attributes
7617         implement interfaces, we will now handle the simple cases
7618         (recursive definitions will just get an error).  
7619
7620         * parameter.cs: Only invalidate types at the end if we fail to
7621         lookup all types.  
7622
7623 2002-09-09  Martin Baulig  <martin@gnome.org>
7624
7625         * ecore.cs (PropertyExpr.Emit): Also check for
7626         TypeManager.system_int_array_get_length so this'll also work when
7627         compiling corlib.  Fixes #30003.
7628
7629 2002-09-09  Martin Baulig  <martin@gnome.org>
7630
7631         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
7632         and throw an exception if we can't get the type's size.  Fixed #30040,
7633         added test-165.cs.
7634
7635 2002-09-09  Martin Baulig  <martin@gnome.org>
7636
7637         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
7638
7639         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
7640         context.  Fixes bug #30027.
7641
7642         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
7643         virtual functions.  Fixes bug #30043, added test-164.cs.
7644
7645 2002-09-08  Ravi Pratap  <ravi@ximian.com>
7646
7647         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
7648
7649 2002-09-08  Nick Drochak  <ndrochak@gol.com>
7650
7651         * driver.cs: Use an object to get the windows codepage since it's not a
7652         static property.
7653
7654 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
7655
7656         * statement.cs (For.Emit): for infinite loops (test == null)
7657         return whether there is a break inside, not always "true".
7658
7659         * namespace.cs (UsingEntry): New struct to hold the name of the
7660         using definition, the location where it is defined, and whether it
7661         has been used in a successful type lookup.
7662
7663         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
7664         strings.
7665
7666         * decl.cs: ditto.
7667
7668 2002-09-06  Ravi Pratap  <ravi@ximian.com>
7669
7670         * attribute.cs : Fix incorrect code which relied on catching
7671         a NullReferenceException to detect a null being passed in
7672         where an object was expected.
7673
7674 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
7675
7676         * statement.cs (Try): flag the catch variable as assigned
7677
7678         * expression.cs (Cast): Simplified by using ResolveType instead of
7679         manually resolving.
7680
7681         * statement.cs (Catch): Fix bug by using ResolveType.
7682
7683 2002-09-06  Ravi Pratap  <ravi@ximian.com>
7684
7685         * expression.cs (BetterConversion): Special case for when we have
7686         a NullLiteral as the argument and we have to choose between string
7687         and object types - we choose string the way csc does.
7688
7689         * attribute.cs (Attribute.Resolve): Catch the
7690         NullReferenceException and report error #182 since the Mono
7691         runtime no more has the bug and having this exception raised means
7692         we tried to select a constructor which takes an object and is
7693         passed a null.
7694
7695 2002-09-05  Ravi Pratap  <ravi@ximian.com>
7696
7697         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
7698         message (1502, 1503) when we can't locate a method after overload
7699         resolution. This is much more informative and closes the bug
7700         Miguel reported.
7701
7702         * interface.cs (PopulateMethod): Return if there are no argument
7703         types. Fixes a NullReferenceException bug.
7704
7705         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
7706         expressions too. Previously we were checking only in one place for
7707         positional arguments leaving out named arguments.
7708
7709         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
7710         type to the enum type is not allowed. Remove code corresponding to
7711         that.
7712
7713         (ConvertNumericExplicit): Allow explicit conversions from
7714         the underlying type to enum type. This precisely follows the spec
7715         and closes a bug filed by Gonzalo.
7716
7717 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7718
7719         * compiler.csproj:
7720         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
7721
7722 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
7723
7724         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
7725         it was important that we stored the right value after the
7726         reduction in `converted'.
7727
7728 2002-09-04  Martin Baulig  <martin@gnome.org>
7729
7730         * location.cs (Location.SymbolDocument): Use full pathnames for the
7731         source files.
7732
7733 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
7734
7735         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
7736         of the expression resolve mechanism, because that will catch the
7737         SimpleName error failures.
7738
7739         (Conditional): If we can not resolve the
7740         expression, return, do not crash.
7741
7742 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7743
7744         * cs-tokenizer.cs:
7745         (location): display token name instead of its number.
7746
7747 2002-08-28  Martin Baulig  <martin@gnome.org>
7748
7749         * expression.cs (Binary.ResolveOperator): Don't silently return
7750         but return an error if an operator cannot be applied between two
7751         enum types.
7752
7753 2002-08-28  Martin Baulig  <martin@gnome.org>
7754
7755         * class.cs (Constructor.Define): Set the permission attributes
7756         correctly instead of making all constructors public.
7757
7758 2002-08-28  Martin Baulig  <martin@gnome.org>
7759
7760         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
7761         for private members before reporting a CS0103; if we find anything,
7762         it's a CS0122.
7763
7764 2002-08-28  Martin Baulig  <martin@gnome.org>
7765
7766         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
7767         to check whether `closure_start_type == closure_invocation_type',
7768         we also need to check whether `m.DeclaringType == closure_invocation_type'
7769         before bypassing the permission checks.  We might be accessing
7770         protected/private members from the base class.
7771         (TypeManager.RealMemberLookup): Only set private_ok if private
7772         members were requested via BindingFlags.NonPublic.
7773
7774         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
7775
7776         * expression.cs (MemberAccess.ResolveMemberAccess): Set
7777         MethodGroupExpr.IsExplicitImpl if appropriate.
7778         (Invocation.DoResolve): Don't report the CS0120 for explicit
7779         interface implementations.
7780
7781 2002-08-27  Martin Baulig  <martin@gnome.org>
7782
7783         * expression.cs (Invocation.DoResolve): If this is a static
7784         method and we don't have an InstanceExpression, we must report
7785         a CS0120.
7786
7787 2002-08-25  Martin Baulig  <martin@gnome.org>
7788
7789         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
7790         `==' between a valuetype and an object.
7791
7792 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
7793
7794         * ecore.cs (TypeExpr): Provide a ToString method.
7795
7796 2002-08-24  Martin Baulig  <martin@gnome.org>
7797
7798         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
7799         now called proggie.dbg and it's a binary file.
7800
7801 2002-08-23  Martin Baulig  <martin@gnome.org>
7802
7803         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
7804
7805 2002-08-23  Martin Baulig  <martin@gnome.org>
7806
7807         * struct.cs (MyStructInfo.ctor): Make this work with empty
7808         structs; it's not allowed to use foreach() on null.
7809
7810 2002-08-23  Martin Baulig  <martin@gnome.org>
7811
7812         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
7813         writer the full pathname of the generated assembly.
7814
7815 2002-08-23  Martin Baulig  <martin@gnome.org>
7816
7817         * statements.cs (FlowBranching.UsageVector.MergeChildren):
7818         A `finally' block never returns or breaks; improved handling of
7819         unreachable code.
7820
7821 2002-08-23  Martin Baulig  <martin@gnome.org>
7822
7823         * statement.cs (Throw.Resolve): Allow `throw null'.
7824
7825 2002-08-23  Martin Baulig  <martin@gnome.org>
7826
7827         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
7828         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
7829         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
7830         MemberLookup would return a wrong event if this is an explicit
7831         interface implementation and the class has an event with the same
7832         name.
7833
7834 2002-08-23  Martin Baulig  <martin@gnome.org>
7835
7836         * statement.cs (Block.AddChildVariableNames): New public method.
7837         (Block.AddChildVariableName): Likewise.
7838         (Block.IsVariableNameUsedInChildBlock): Likewise.
7839         (Block.AddVariable): Check whether a variable name has already
7840         been used in a child block.
7841
7842         * cs-parser.jay (declare_local_variables): Mark all variable names
7843         from the current block as being used in a child block in the
7844         implicit block.
7845
7846 2002-08-23  Martin Baulig  <martin@gnome.org>
7847
7848         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
7849         find the symbol writer.
7850
7851         * driver.cs: csc also allows the arguments to /define being
7852         separated by commas, not only by semicolons.
7853
7854 2002-08-23  Martin Baulig  <martin@gnome.org>
7855
7856         * interface.cs (Interface.GetMembers): Added static check for events.
7857
7858 2002-08-15  Martin Baulig  <martin@gnome.org>
7859
7860         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
7861         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
7862
7863         * ecore.cs (Expression.MemberLookup): Added documentation and explained
7864         why the MethodData.EmitDestructor() change was necessary.
7865
7866 2002-08-20  Martin Baulig  <martin@gnome.org>
7867
7868         * class.cs (TypeContainer.FindMembers): Added static check for events.
7869
7870         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
7871
7872         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
7873         use Type.GetEvents(), not Type.FindMembers().
7874
7875 2002-08-20  Martin Baulig  <martin@gnome.org>
7876
7877         * decl.cs (MemberCache): Added a special method cache which will
7878         be used for method-only searched.  This ensures that a method
7879         search will return a MethodInfo with the correct ReflectedType for
7880         inherited methods.      
7881
7882 2002-08-20  Martin Baulig  <martin@gnome.org>
7883
7884         * decl.cs (DeclSpace.FindMembers): Made this public.
7885
7886 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7887
7888         * delegate.cs: fixed build on windows.
7889         [FIXME:  Filed as bug #29150: MCS must report these errors.]
7890
7891 2002-08-19  Ravi Pratap  <ravi@ximian.com>
7892
7893         * ecore.cs (StandardConversionExists): Return a false
7894         if we are trying to convert the void type to anything else
7895         since that is not allowed.
7896
7897         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
7898         we flag error 70 in the event an event is trying to be accessed
7899         directly from outside the declaring type.
7900
7901 2002-08-20  Martin Baulig  <martin@gnome.org>
7902
7903         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
7904         MemberCache from typemanager.cs to decl.cs.
7905
7906 2002-08-19  Martin Baulig  <martin@gnome.org>
7907
7908         * class.cs (TypeContainer): Implement IMemberContainer.
7909         (TypeContainer.DefineMembers): Create the MemberCache.
7910         (TypeContainer.FindMembers): Do better BindingFlags checking; only
7911         return public members if BindingFlags.Public was given, check
7912         whether members are static.
7913
7914 2002-08-16  Martin Baulig  <martin@gnome.org>
7915
7916         * decl.cs (DeclSpace.Define): Splitted this in Define and
7917         DefineMembers.  DefineMembers is called first and initializes the
7918         MemberCache.
7919
7920         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
7921         DefineMembers() on all our DeclSpaces.
7922
7923         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
7924         but call DefineMembers() on all nested interfaces.  We call their
7925         Define() in our new Define() function.
7926
7927         * interface.cs (Interface): Implement IMemberContainer.
7928         (Interface.Define): Moved all code except the attribute stuf to
7929         DefineMembers().
7930         (Interface.DefineMembers): Initialize the member cache.
7931
7932         * typemanager.cs (IMemberFinder): Removed this interface, we don't
7933         need this anymore since we can use MemberCache.FindMembers directly.
7934
7935 2002-08-19  Martin Baulig  <martin@gnome.org>
7936
7937         * typemanager.cs (MemberCache): When creating the cache for an
7938         interface type, add all inherited members.
7939         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
7940         to `out bool used_cache' and documented it.
7941         (TypeManager.MemberLookup): If we already used the cache in the first
7942         iteration, we don't need to do the interfaces check.
7943
7944 2002-08-19  Martin Baulig  <martin@gnome.org>
7945
7946         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
7947         here from IMemberFinder and don't implement this interface anymore.
7948         (DeclSpace.MemberCache): Moved here from IMemberFinder.
7949
7950         * typemanager.cs (IMemberFinder): This interface is now only used by
7951         classes which actually support the member cache.
7952         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
7953         since we only put DeclSpaces into this Hashtable.
7954         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
7955         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
7956
7957 2002-08-16  Martin Baulig  <martin@gnome.org>
7958
7959         * typemanager.cs (ICachingMemberFinder): Removed.
7960         (IMemberFinder.MemberCache): New property.
7961         (TypeManager.FindMembers): Merged this with RealFindMembers().
7962         This function will never be called from TypeManager.MemberLookup()
7963         so we can't use the cache here, just the IMemberFinder.
7964         (TypeManager.MemberLookup_FindMembers): Check whether the
7965         IMemberFinder has a MemberCache and call the cache's FindMembers
7966         function.
7967         (MemberCache): Rewrote larger parts of this yet another time and
7968         cleaned it up a bit.
7969
7970 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
7971
7972         * driver.cs (LoadArgs): Support quoting.
7973
7974         (Usage): Show the CSC-like command line arguments.
7975
7976         Improved a few error messages.
7977
7978 2002-08-15  Martin Baulig  <martin@gnome.org>
7979
7980         * typemanager.cs (IMemberContainer.Type): New property.
7981         (IMemberContainer.IsInterface): New property.
7982
7983         The following changes are conditional to BROKEN_RUNTIME, which is
7984         defined at the top of the file.
7985
7986         * typemanager.cs (MemberCache.MemberCache): Don't add the base
7987         class'es members, but add all members from TypeHandle.ObjectType
7988         if we're an interface.
7989         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
7990         is the current type.
7991         (MemberCache.CacheEntry.Container): Removed this field.
7992         (TypeHandle.GetMembers): Include inherited members.
7993
7994 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7995
7996         * typemanager.cs: fixed compilation and added a comment on a field that
7997         is never used.
7998
7999 2002-08-15  Martin Baulig  <martin@gnome.org>
8000
8001         * class.cs (ConstructorInitializer.Resolve): In the
8002         Expression.MemberLookup call, use the queried_type as
8003         invocation_type.
8004
8005         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
8006         declared' attribute, it's always true.
8007         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
8008         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
8009         temporary wrapper for FindMembers which tells MemberLookup whether
8010         members from the base classes are included in the return value.
8011         This will go away soon.
8012         (TypeManager.MemberLookup): Use this temporary hack here; once the
8013         new MemberCache is completed, we don't need to do the DeclaredOnly
8014         looping here anymore since the MemberCache will take care of this.
8015         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
8016         (MemberCache): When creating the MemberCache for a class, get
8017         members from the current class and all its base classes.
8018         (MemberCache.CacheEntry.Container): New field.  This is a
8019         temporary hack until the Mono runtime is fixed to distinguish
8020         between ReflectedType and DeclaringType.  It allows us to use MCS
8021         with both the MS runtime and the unfixed Mono runtime without
8022         problems and without accecting performance.
8023         (MemberCache.SearchMembers): The DeclaredOnly looping from
8024         TypeManager.MemberLookup is now done here.      
8025
8026 2002-08-14  Martin Baulig  <martin@gnome.org>
8027
8028         * statement.cs (MyStructInfo.MyStructInfo): Don't call
8029         Type.GetFields on dynamic types but get the fields from the
8030         corresponding TypeContainer.
8031         (MyStructInfo.GetStructInfo): Added check for enum types.
8032
8033         * typemanager.cs (MemberList.IsSynchronized): Implemented.
8034         (MemberList.SyncRoot): Implemented.
8035         (TypeManager.FilterWithClosure): No need to check permissions if
8036         closure_start_type == closure_invocation_type, don't crash if
8037         closure_invocation_type is null.
8038
8039 2002-08-13  Martin Baulig  <martin@gnome.org>
8040
8041         Rewrote TypeContainer.FindMembers to use a member cache.  This
8042         gives us a speed increase of about 35% for the self-hosting MCS
8043         build and of about 15-20% for the class libs (both on GNU/Linux).
8044
8045         * report.cs (Timer): New class to get enhanced profiling.  This
8046         whole class is "TIMER" conditional since it remarkably slows down
8047         compilation speed.
8048
8049         * class.cs (MemberList): New class.  This is an IList wrapper
8050         which we're now using instead of passing MemberInfo[]'s around to
8051         avoid copying this array unnecessarily.
8052         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
8053         (ICachingMemberFinder, IMemberContainer): New interface.
8054         (TypeManager.FilterWithClosure): If `criteria' is null, the name
8055         has already been checked, otherwise use it for the name comparision.
8056         (TypeManager.FindMembers): Renamed to RealMemberFinder and
8057         provided wrapper which tries to use ICachingMemberFinder.FindMembers
8058         if possible.  Returns a MemberList, not a MemberInfo [].
8059         (TypeHandle): New class, implements IMemberContainer.  We create
8060         one instance of this class per type, it contains a MemberCache
8061         which is used to do the member lookups.
8062         (MemberCache): New class.  Each instance of this class contains
8063         all members of a type and a name-based hash table.
8064         (MemberCache.FindMembers): This is our new member lookup
8065         function.  First, it looks up all members of the requested name in
8066         the hash table.  Then, it walks this list and sorts out all
8067         applicable members and returns them.
8068
8069 2002-08-13  Martin Baulig  <martin@gnome.org>
8070
8071         In addition to a nice code cleanup, this gives us a performance
8072         increase of about 1.4% on GNU/Linux - not much, but it's already
8073         half a second for the self-hosting MCS compilation.
8074
8075         * typemanager.cs (IMemberFinder): New interface.  It is used by
8076         TypeManager.FindMembers to call FindMembers on a TypeContainer,
8077         Enum, Delegate or Interface.
8078         (TypeManager.finder_to_member_finder): New PtrHashtable.
8079         (TypeManager.finder_to_container): Removed.
8080         (TypeManager.finder_to_delegate): Removed.
8081         (TypeManager.finder_to_interface): Removed.
8082         (TypeManager.finder_to_enum): Removed.
8083
8084         * interface.cs (Interface): Implement IMemberFinder.
8085
8086         * delegate.cs (Delegate): Implement IMemberFinder.
8087
8088         * enum.cs (Enum): Implement IMemberFinder.
8089
8090         * class.cs (TypeContainer): Implement IMemberFinder.
8091
8092 2002-08-12  Martin Baulig  <martin@gnome.org>
8093
8094         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
8095
8096 2002-08-12  Martin Baulig  <martin@gnome.org>
8097
8098         * ecore.cs (ITypeExpression): New interface for expressions which
8099         resolve to a type.
8100         (TypeExpression): Renamed to TypeLookupExpression.
8101         (Expression.DoResolve): If we're doing a types-only lookup, the
8102         expression must implement the ITypeExpression interface and we
8103         call DoResolveType() on it.
8104         (SimpleName): Implement the new ITypeExpression interface.
8105         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
8106         hack, the situation that we're only looking up types can't happen
8107         anymore when this method is called.  Moved the type lookup code to
8108         DoResolveType() and call it.
8109         (SimpleName.DoResolveType): This ITypeExpression interface method
8110         is now doing the types-only lookup.
8111         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
8112         (ResolveFlags): Added MaskExprClass.
8113
8114         * expression.cs (MemberAccess): Implement the ITypeExpression
8115         interface.
8116         (MemberAccess.DoResolve): Added support for a types-only lookup
8117         when we're called via ITypeExpression.DoResolveType().
8118         (ComposedCast): Implement the ITypeExpression interface.
8119
8120         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
8121         Expression.Resolve() with ResolveFlags.Type instead.
8122
8123 2002-08-12  Martin Baulig  <martin@gnome.org>
8124
8125         * interface.cs (Interface.Define): Apply attributes.
8126
8127         * attribute.cs (Attribute.ApplyAttributes): Added support for
8128         interface attributes.
8129
8130 2002-08-11  Martin Baulig  <martin@gnome.org>
8131
8132         * statement.cs (Block.Emit): Only check the "this" variable if we
8133         do not always throw an exception.
8134
8135         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
8136         whether the property has a set accessor.
8137
8138 2002-08-11  Martin Baulig  <martin@gnome.org>
8139
8140         Added control flow analysis support for structs.
8141
8142         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
8143         with control flow analysis turned off.
8144         (IVariable): New interface.
8145         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
8146         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
8147         (FieldExpr.DoResolve): Resolve the instance expression with flow
8148         analysis turned off and do the definite assignment check after the
8149         resolving when we know what the expression will resolve to.
8150
8151         * expression.cs (LocalVariableReference, ParameterReference):
8152         Implement the new IVariable interface, only call the flow analysis
8153         code if ec.DoFlowAnalysis is true.
8154         (This): Added constructor which takes a Block argument.  Implement
8155         the new IVariable interface.
8156         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
8157         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
8158         This does the definite assignment checks for struct members.
8159
8160         * class.cs (Constructor.Emit): If this is a non-static `struct'
8161         constructor which doesn't have any initializer, call
8162         Block.AddThisVariable() to tell the flow analysis code that all
8163         struct elements must be initialized before control returns from
8164         the constructor.
8165
8166         * statement.cs (MyStructInfo): New public class.
8167         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
8168         argument to this indexer.  If non-zero, check an individual struct
8169         member, not the whole struct.
8170         (FlowBranching.CheckOutParameters): Check struct members.
8171         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
8172         overloaded versions of these methods which take an additional
8173         `int field_idx' argument to check struct members.
8174         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
8175         overloaded versions of these methods which take an additional
8176         `string field_name' argument to check struct member.s
8177         (VariableInfo): Implement the IVariable interface.
8178         (VariableInfo.StructInfo): New public property.  Returns the
8179         MyStructInfo instance of the variable if it's a struct or null.
8180         (Block.AddThisVariable): New public method.  This is called from
8181         Constructor.Emit() for non-static `struct' constructor which do
8182         not have any initializer.  It creates a special variable for the
8183         "this" instance variable which will be checked by the flow
8184         analysis code to ensure that all of the struct's fields are
8185         initialized before control returns from the constructor.
8186         (UsageVector): Added support for struct members.  If a
8187         variable/parameter is a struct with N members, we reserve a slot
8188         in the usage vector for each member.  A struct is considered fully
8189         initialized if either the struct itself (slot 0) or all its
8190         members are initialized.
8191
8192 2002-08-08  Martin Baulig  <martin@gnome.org>
8193
8194         * driver.cs (Driver.MainDriver): Only report an error CS5001
8195         if there were no compilation errors.
8196
8197         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
8198         `UnsafeContext' property to determine whether the parent is in
8199         unsafe context rather than checking the parent's ModFlags:
8200         classes nested in an unsafe class are unsafe as well.
8201
8202 2002-08-08  Martin Baulig  <martin@gnome.org>
8203
8204         * statement.cs (UsageVector.MergeChildren): Distinguish between
8205         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
8206         we return.  Added test17() and test18() to test-154.cs.
8207
8208 2002-08-08  Martin Baulig  <martin@gnome.org>
8209
8210         * typemanager.cs (TypeManager.FilterWithClosure): If we have
8211         Family access, make sure the invoking type isn't a subclass of the
8212         queried type (that'd be a CS1540).
8213
8214         * ecore.cs (Expression.MemberLookup): Added overloaded version of
8215         this method which takes an additional `Type invocation_type'.
8216
8217         * expression.cs (BaseAccess.DoResolve): Use the base type as
8218         invocation and query type.
8219         (MemberAccess.DoResolve): If the lookup failed and we're about to
8220         report a CS0122, try a lookup with the ec.ContainerType - if this
8221         succeeds, we must report a CS1540.
8222
8223 2002-08-08  Martin Baulig  <martin@gnome.org>
8224
8225         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
8226         (MethodGroupExpr): Implement the IMemberExpr interface.
8227
8228         * expression (MemberAccess.ResolveMemberAccess): No need to have
8229         any special code for MethodGroupExprs anymore, they're now
8230         IMemberExprs.   
8231
8232 2002-08-08  Martin Baulig  <martin@gnome.org>
8233
8234         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
8235         Family, FamANDAssem and FamORAssem permissions.
8236         (TypeManager.IsSubclassOrNestedChildOf): New public method.
8237
8238 2002-08-08  Martin Baulig  <martin@gnome.org>
8239
8240         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
8241         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
8242         or loop block.
8243
8244 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
8245
8246         * driver.cs: implemented /resource option to embed managed resources.
8247
8248 2002-08-07  Martin Baulig  <martin@gnome.org>
8249
8250         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
8251         (FieldBase.HasFieldInitializer): New public property.
8252         (FieldBase.GetInitializerExpression): New public method.  Resolves and
8253         returns the field initializer and makes sure it is only resolved once.
8254         (TypeContainer.EmitFieldInitializers): Call
8255         FieldBase.GetInitializerExpression to get the initializer, this ensures
8256         that it isn't resolved multiple times.
8257
8258         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
8259         the resolving process (SimpleName/MemberLookup) that we're currently
8260         emitting a field initializer (which must not access any instance members,
8261         this is an error CS0236).
8262
8263         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
8264         argument, if the `IsFieldInitializer' flag is set, we must report and
8265         error CS0236 and not an error CS0120.   
8266
8267 2002-08-07  Martin Baulig  <martin@gnome.org>
8268
8269         * ecore.cs (IMemberExpr): New public interface.
8270         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
8271         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
8272         if the expression is an IMemberExpr.
8273
8274         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
8275         to be null, implicitly default to `this' if we're non-static in
8276         this case.  Simplified the code a lot by using the new IMemberExpr
8277         interface.  Also fixed bug #28176 here.
8278
8279 2002-08-06  Martin Baulig  <martin@gnome.org>
8280
8281         * cs-parser.jay (SimpleLookup): Removed.  We need to create
8282         ParameterReferences during semantic analysis so that we can do a
8283         type-only search when resolving Cast, TypeOf and SizeOf.
8284         (block): Pass the `current_local_parameters' to the Block's
8285         constructor.
8286
8287         * class.cs (ConstructorInitializer): Added `Parameters parameters'
8288         argument to the constructor.
8289         (ConstructorInitializer.Resolve): Create a temporary implicit
8290         block with the parameters.
8291
8292         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
8293         references here if we aren't doing a type-only search.
8294
8295         * statement.cs (Block): Added constructor which takes a
8296         `Parameters parameters' argument.
8297         (Block.Parameters): New public property.
8298
8299         * support.cs (InternalParameters.Parameters): Renamed `parameters'
8300         to `Parameters' and made it public readonly.
8301
8302 2002-08-06  Martin Baulig  <martin@gnome.org>
8303
8304         * ecore.cs (Expression.Warning): Made this public as well.
8305
8306         * report.cs (Report.Debug): Print the contents of collections.
8307
8308 2002-08-06  Martin Baulig  <martin@gnome.org>
8309
8310         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
8311         used to tell Resolve() which kinds of expressions it may return.
8312         (Expression.Resolve): Added overloaded version of this method which
8313         takes a `ResolveFlags flags' argument.  This can be used to tell
8314         Resolve() which kinds of expressions it may return.  Reports a
8315         CS0118 on error.
8316         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
8317         ResolveFlags.SimpleName.
8318         (Expression.Error118): Added overloaded version of this method which
8319         takes a `ResolveFlags flags' argument.  It uses the flags to determine
8320         which kinds of expressions are allowed.
8321
8322         * expression.cs (Argument.ResolveMethodGroup): New public method.
8323         Resolves an argument, but allows a MethodGroup to be returned.
8324         This is used when invoking a delegate.
8325
8326         * TODO: Updated a bit.
8327
8328 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8329
8330         Fixed compilation with csc.
8331
8332         * ecore.cs: Expression.Error made public. Is this correct? Should
8333         Warning be made public too?
8334
8335         * expression.cs: use ea.Location instead of ea.loc.
8336         [FIXME:  Filed as bug #28607: MCS must report these errors.]
8337
8338 2002-08-06  Martin Baulig  <martin@gnome.org>
8339
8340         * ecore.cs (Expression.loc): Moved the location here instead of
8341         duplicating it in all derived classes.
8342         (Expression.Location): New public property.
8343         (Expression.Error, Expression.Warning): Made them non-static and
8344         removed the location argument.
8345         (Expression.Warning): Added overloaded version which takes an
8346         `int level' argument.
8347         (Expression.Error118): Make this non-static and removed the
8348         expression and location arguments.
8349         (TypeExpr): Added location argument to the constructor.
8350
8351         * expression.cs (StaticCallExpr): Added location argument to
8352         the constructor.
8353         (Indirection, PointerArithmetic): Likewise.
8354         (CheckedExpr, UnCheckedExpr): Likewise.
8355         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
8356         (StringPtr): Likewise.
8357
8358
8359 2002-08-05  Martin Baulig  <martin@gnome.org>
8360
8361         * expression.cs (BaseAccess.DoResolve): Actually report errors.
8362
8363         * assign.cs (Assign.DoResolve): Check whether the source
8364         expression is a value or variable.
8365
8366         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
8367         while resolving the corresponding blocks.
8368
8369         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
8370         an error, don't silently return null.
8371
8372         * statement.cs (Block.AddVariable): Do the error reporting here
8373         and distinguish between CS0128 and CS0136.
8374         (Block.DoResolve): Report all unused labels (warning CS0164).
8375         (LabeledStatement): Pass the location to the constructor.
8376         (LabeledStatement.HasBeenReferenced): New property.
8377         (LabeledStatement.Resolve): Set it to true here.
8378
8379         * statement.cs (Return.Emit): Return success even after reporting
8380         a type mismatch error (CS0126 or CS0127), this is what csc does and
8381         it avoids confusing the users with any consecutive errors.
8382
8383 2002-08-05  Martin Baulig  <martin@gnome.org>
8384
8385         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
8386
8387         * const.cs (Const.LookupConstantValue): Catch circular definitions.
8388
8389         * expression.cs (MemberAccess.DoResolve): Silently return if an
8390         error has already been reported.
8391
8392         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
8393         error has already been reported.
8394
8395 2002-08-05  Martin Baulig  <martin@gnome.org>
8396
8397         * statement.cs (UsageVector): Only initialize the `parameters'
8398         vector if we actually have any "out" parameters.
8399
8400 2002-08-05  Martin Baulig  <martin@gnome.org>
8401
8402         * expression.cs (Binary.ResolveOperator): When combining delegates,
8403         they must have the same type.
8404
8405 2002-08-05  Martin Baulig  <martin@gnome.org>
8406
8407         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
8408         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
8409         work with the ms runtime and we also don't need it: if we're a
8410         PropertyBuilder and not in the `indexer_arguments' hash, then we
8411         are a property and not an indexer.
8412
8413         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
8414         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
8415         since the latter one doesn't work with the ms runtime.
8416
8417 2002-08-03  Martin Baulig  <martin@gnome.org>
8418
8419         Fixed bugs #27998 and #22735.
8420
8421         * class.cs (Method.IsOperator): New public field.
8422         (Method.CheckBase): Report CS0111 if there's already a method
8423         with the same parameters in the current class.  Report CS0508 when
8424         attempting to change the return type of an inherited method.
8425         (MethodData.Emit): Report CS0179 if a method doesn't have a body
8426         and it's not marked abstract or extern.
8427         (PropertyBase): New abstract base class for Property and Indexer.
8428         (PropertyBase.CheckBase): Moved here from Property and made it work
8429         for indexers.
8430         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
8431         the same so we can reuse it there.
8432         (Property, Indexer): Derive from PropertyBase.
8433         (MethodSignature.inheritable_property_signature_filter): New delegate
8434         to find properties and indexers.
8435
8436         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
8437         argument and improved error reporting.
8438
8439         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
8440         EmptyReadOnlyParameters and made it a property.
8441
8442         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
8443         version of this method which takes a `PropertyInfo indexer'.
8444         (TypeManager.RegisterIndexer): New method.
8445
8446         * class.cs: Added myself as author of this file :-)
8447
8448 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8449
8450         * class.cs: fixed compilation on windoze.
8451
8452 2002-08-03  Martin Baulig  <martin@gnome.org>
8453
8454         * interface.cs (Interface.GetInterfaceBases): Check whether all
8455         base interfaces are at least as accessible than the current one.
8456
8457         * class.cs (TypeContainer.GetClassBases): Check whether base types
8458         are at least as accessible than the current type.
8459         (TypeContainer.AsAccessible): Implemented and made non-static.
8460         (MemberBase.CheckParameters): Report errors if the accessibility
8461         checks fail.
8462
8463         * delegate.cs (Delegate.Delegate): The default visibility is
8464         internal for top-level types and private for nested types.
8465         (Delegate.Define): Report errors if the accessibility checks fail.
8466
8467         * enum.cs (Enum.Enum): The default visibility is internal for
8468         top-level types and private for nested types.
8469         (Enum.DefineType): Compute the correct visibility.
8470
8471         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
8472         function which takes a `bool is_toplevel' instead of a TypeContainer.
8473
8474         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
8475         builtin type.
8476
8477 2002-08-02  Martin Baulig  <martin@gnome.org>
8478
8479         * expression.cs (LocalVariableReferenc): Added constructor which
8480         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
8481         (LocalVariableReference.IsReadOnly): New property.
8482         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
8483         variable is readonly, use our own readonly flag to do this; you can
8484         use the new constructor to get a writable reference to a read-only
8485         variable.
8486
8487         * cs-parser.jay (foreach_statement, using_statement): Get a writable
8488         reference to the local variable.
8489
8490 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
8491
8492         * rootcontext.cs (ResolveCore): Also include System.Exception
8493
8494         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
8495         we reach an EmptyStatement.
8496
8497         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
8498         is also fine.
8499
8500         * expression.cs (Binary.ResolveOperator): Check error result in
8501         two places.
8502
8503         use brtrue/brfalse directly and avoid compares to null.
8504
8505 2002-08-02  Martin Baulig  <martin@gnome.org>
8506
8507         * class.cs (TypeContainer.Define): Define all nested interfaces here.
8508         Fixes bug #28407, added test-155.cs.
8509
8510 2002-08-01  Martin Baulig  <martin@gnome.org>
8511
8512         * class.cs (Event.EmitDefaultMethod): Make this work with static
8513         events.  Fixes #28311, added verify-3.cs.
8514
8515 2002-08-01  Martin Baulig  <martin@gnome.org>
8516
8517         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
8518         `is_disposable' fields.
8519         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
8520         `hm.is_disposable' if we're using the collection pattern.
8521         (Foreach.EmitCollectionForeach): Use the correct type for the
8522         enumerator's local variable, only emit the try/finally block if
8523         necessary (fixes #27713).
8524
8525 2002-08-01  Martin Baulig  <martin@gnome.org>
8526
8527         * ecore.cs (Expression.report118): Renamed to Error118 and made
8528         it public static.
8529
8530         * statement.cs (Throw.Resolve): Check whether the expression is of
8531         the correct type (CS0118) and whether the type derives from
8532         System.Exception (CS0155).
8533         (Catch.Resolve): New method.  Do the type lookup here and check
8534         whether it derives from System.Exception (CS0155).
8535         (Catch.CatchType, Catch.IsGeneral): New public properties.
8536
8537         * typemanager.cs (TypeManager.exception_type): Added.
8538
8539 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
8540
8541         * driver.cs: Updated About function.
8542
8543 2002-07-31  Martin Baulig  <martin@gnome.org>
8544
8545         Implemented Control Flow Analysis.
8546
8547         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
8548         (EmitContext.CurrentBranching): Added.
8549         (EmitContext.StartFlowBranching): Added.
8550         (EmitContext.EndFlowBranching): Added.
8551         (EmitContext.KillFlowBranching): Added.
8552         (EmitContext.IsVariableAssigned): Added.
8553         (EmitContext.SetVariableAssigned): Added.
8554         (EmitContext.IsParameterAssigned): Added.
8555         (EmitContext.SetParameterAssigned): Added.
8556         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
8557         Added control flow analysis stuff here.
8558
8559         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
8560         resolve the expression as lvalue.
8561         (LocalVariableReference.DoResolve): Check whether the variable has
8562         already been assigned.
8563         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
8564         the parameter as assigned here.
8565         (ParameterReference.DoResolve): Check whether the parameter has already
8566         been assigned.
8567         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
8568         expression as lvalue.
8569
8570         * statement.cs (FlowBranching): New class for the flow analysis code.
8571         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
8572         (LabeledStatement.IsDefined): New public property.
8573         (LabeledStatement.AddUsageVector): New public method to tell flow
8574         analyis that the label may be reached via a forward jump.
8575         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
8576         flow analysis.
8577         (VariableInfo.Number): New public field.  This is used by flow analysis
8578         to number all locals of a block.
8579         (Block.CountVariables): New public property.  This is the number of
8580         local variables in this block (including the locals from all parent
8581         blocks).
8582         (Block.EmitMeta): Number all the variables.
8583
8584         * statement.cs: Added flow analysis support to all classes.
8585
8586 2002-07-31  Martin Baulig  <martin@gnome.org>
8587
8588         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
8589         To get debugging messages, compile mcs with /define:MCS_DEBUG and
8590         then use this argument.
8591
8592         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
8593
8594         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
8595         use this to specify /define options.
8596
8597 2002-07-29  Martin Baulig  <martin@gnome.org>
8598
8599         * statement.cs (Fixed): Moved all code that does variable lookups
8600         and resolvings from Emit to Resolve.
8601
8602         * statement.cs (For): Moved all code that does variable lookups
8603         and resolvings from Emit to Resolve.
8604
8605         * statement.cs (Using): Moved all code that does variable lookups
8606         and resolvings from Emit to Resolve.
8607
8608 2002-07-29  Martin Baulig  <martin@gnome.org>
8609
8610         * attribute.cs (Attribute.Resolve): Explicitly catch a
8611         System.NullReferenceException when creating the
8612         CustromAttributeBuilder and report a different warning message.
8613
8614 2002-07-29  Martin Baulig  <martin@gnome.org>
8615
8616         * support.cs (ParameterData.ParameterName): Added method to
8617         get the name of a parameter.
8618
8619         * typemanager.cs (TypeManager.IsValueType): New public method.
8620
8621 2002-07-29  Martin Baulig  <martin@gnome.org>
8622
8623         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
8624         is a flag which specifies that it's either ref or out.
8625         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
8626         the out parameter to `out Parameter.Modifier mod', also set the
8627         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
8628
8629         * support.cs (InternalParameters.ParameterModifier): Distinguish
8630         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
8631         Parameter.Modifier.ISBYREF flag if it's either ref or out.
8632
8633         * expression.cs (Argument.GetParameterModifier): Distinguish
8634         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
8635         Parameter.Modifier.ISBYREF flag if it's either ref or out.
8636
8637 2002-07-29  Martin Baulig  <martin@gnome.org>
8638
8639         * expression.cs (ParameterReference.ParameterReference): Added
8640         `Location loc' argument to the constructor.
8641
8642         * cs-parser.jay: Pass location to ParameterReference.
8643
8644 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
8645
8646         * statement.cs (Try): Initialize the location.
8647
8648         * cs-parser.jay: pass location to Try.
8649
8650         * expression.cs (Unary.Reduce): Change the prototype to return
8651         whether a constant fold could be performed or not.  The result is
8652         returned in an out parameters.  In the case of Indirection and
8653         AddressOf, we want to perform the full tests.
8654
8655 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
8656
8657         * statement.cs (Statement.Emit): Flag dead code.
8658
8659 2002-07-27  Andrew Birkett  <andy@nobugs.org>
8660
8661         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
8662
8663 2002-07-27  Martin Baulig  <martin@gnome.org>
8664
8665         * class.cs (MethodData.Define): Put back call to
8666         TypeManager.AddMethod(), accidentally commented this out.
8667
8668         * report.cs (Debug): New public method to print debugging information,
8669         this is `[Conditional ("DEBUG")]'.
8670
8671 2002-07-26  Martin Baulig  <martin@gnome.org>
8672
8673         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
8674         (switch_statement): Push the current_block to the switch_stack and
8675         pop it again when we're done with the switch.
8676         (switch_section): The new block is a child of the current_block.
8677         Fixes bug #24007, added test-152.cs.
8678
8679 2002-07-27  Martin Baulig  <martin@gnome.org>
8680
8681         * expression.cs (Invocation.EmitArguments): When calling a varargs
8682         function with only its fixed arguments, we need to pass an empty
8683         array.
8684
8685 2002-07-27  Martin Baulig  <martin@gnome.org>
8686
8687         Mono 0.13 has been released.
8688
8689 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
8690
8691         * driver.cs: Rename --resource to --linkres, because that is what
8692         we do currently, we dont support --resource yet.
8693
8694         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
8695
8696 2002-07-25  Martin Baulig  <martin@gnome.org>
8697
8698         * class.cs (MethodData): New public class.  This is a `method builder'
8699         class for a method or one accessor of a Property/Indexer/Event.
8700         (MethodData.GetMethodFlags): Moved here from MemberBase.
8701         (MethodData.ApplyAttributes): Likewise.
8702         (MethodData.ApplyObsoleteAttribute): Likewise.
8703         (MethodData.ApplyConditionalAttribute): Likewise.
8704         (MethodData.ApplyDllImportAttribute): Likewise.
8705         (MethodData.CheckAbstractAndExternal): Likewise.
8706         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
8707         (MethodData.Emit): Formerly known as Method.Emit().
8708         (MemberBase): Moved everything which was specific to a single
8709         accessor/method to MethodData.
8710         (Method): Create a new MethodData and call Define() and Emit() on it.
8711         (Property, Indexer, Event): Create a new MethodData objects for each
8712         accessor and call Define() and Emit() on them.
8713
8714 2002-07-25  Martin Baulig  <martin@gnome.org>
8715
8716         Made MethodCore derive from MemberBase to reuse the code from there.
8717         MemberBase now also checks for attributes.
8718
8719         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
8720         (MemberBase.GetMethodFlags): Moved here from class Method and marked
8721         as virtual.
8722         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
8723         `CallingConventions cc' and `Attributes opt_attrs' arguments.
8724         (MemberBase.ApplyAttributes): New virtual method; applies the
8725         attributes to a method or accessor.
8726         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
8727         (MemberBase.ApplyConditionalAttribute): Likewise.
8728         (MemberBase.ApplyDllImportAttribute): Likewise.
8729         (MemberBase.CheckAbstractAndExternal): Likewise.
8730         (MethodCore.ParameterTypes): This is now a property instead of a
8731         method, it's initialized from DoDefineParameters().
8732         (MethodCore.ParameterInfo): Removed the set accessor.
8733         (MethodCore.DoDefineParameters): New protected virtual method to
8734         initialize ParameterTypes and ParameterInfo.
8735         (Method.GetReturnType): We can now simply return the MemberType.
8736         (Method.GetMethodFlags): Override the MemberBase version and add
8737         the conditional flags.
8738         (Method.CheckBase): Moved some code from Define() here, call
8739         DoDefineParameters() here.
8740         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
8741         here to avoid some larger code duplication.
8742         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
8743         ensure that abstract and external accessors don't declare a body.
8744
8745         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
8746         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
8747         lookup in the attribute's parent classes, so we need to abort as soon
8748         as we found the first match.
8749         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
8750         the attribute has no arguments.
8751
8752         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
8753         of a Method.
8754
8755 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8756
8757         * cs-parser.jay: reverted previous patch.
8758
8759 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8760
8761         * cs-parser.jay: fixed bug #22119.
8762
8763 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8764
8765         * attribute.cs: fixed compilation. The error was:
8766         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
8767         be assigned to before control leaves the current method."
8768         [FIXME:  Filed as bug #28186: MCS must report this error.]
8769
8770 2002-07-25  Martin Baulig  <martin@gnome.org>
8771
8772         * attribute.cs (Attribute.Conditional_GetConditionName): New static
8773         method to pull the condition name ouf of a Conditional attribute.
8774         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
8775         the obsolete message and error flag out of an Obsolete attribute.
8776
8777         * class.cs (Method.GetMethodFlags): New public method to get the
8778         TypeManager.MethodFlags for this method.
8779         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
8780         private methods.
8781         (Method.Define): Get and apply the Obsolete and Conditional attributes;
8782         if we're overriding a virtual function, set the new private variable
8783         `parent_method'; call the new TypeManager.AddMethod().
8784
8785         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
8786         the MethodBuilder and the Method in a PtrHashtable.
8787         (TypeManager.builder_to_method): Added for this purpose.
8788         (TypeManager.MethodFlags): Added IsObsoleteError.
8789         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
8790         Obsolete and Conditional arguments in MethodBuilders.  If we discover
8791         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
8792         the message from the attribute.
8793
8794 2002-07-24  Martin Baulig  <martin@gnome.org>
8795
8796         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
8797         preprocessor directives, ensure that the argument to #define/#undef is
8798         exactly one identifier and that it's actually an identifier.
8799
8800         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
8801         did not work ....
8802
8803 2002-07-24  Martin Baulig  <martin@gnome.org>
8804
8805         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
8806         initialize it to TypeManager.object_type in the constructor.
8807         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
8808         of the `hm.get_current' method if we're using the collection pattern.
8809         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
8810         for the explicit conversion to make it work when we're using the collection
8811         pattern and the `Current' property has a different return type than `object'.
8812         Fixes #27713.
8813
8814 2002-07-24  Martin Baulig  <martin@gnome.org>
8815
8816         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
8817         does not match, but don't report any errors.  This method is called in
8818         order for all methods in a MethodGroupExpr until a matching method is
8819         found, so we don't want to bail out if the first method doesn't match.
8820         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
8821         matches, report the 123.  Fixes #28070.
8822
8823 2002-07-24  Martin Baulig  <martin@gnome.org>
8824
8825         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
8826         TypeManager.TypeToCoreType() to the top of the method so the
8827         following equality checks will work.  Fixes #28107.
8828
8829 2002-07-24  Martin Baulig  <martin@gnome.org>
8830
8831         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
8832         operand is of type uint, and the other operand is of type sbyte,
8833         short or int, the operands are converted to type long." -
8834         Actually do what this comment already told us.  Fixes bug #28106,
8835         added test-150.cs.
8836
8837 2002-07-24  Martin Baulig  <martin@gnome.org>
8838
8839         * class.cs (MethodBase): New abstract class.  This is now a base
8840         class for Property, Indexer and Event to avoid some code duplication
8841         in their Define() and DefineMethods() methods.
8842         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
8843         generic methods for Define() and DefineMethods().
8844         (FieldBase): Derive from MemberBase, not MemberCore.
8845         (Property): Derive from MemberBase, not MemberCore.
8846         (Property.DefineMethod): Moved all the code from this method to the
8847         new MethodBase.DefineAccessor(), just call it with appropriate
8848         argumetnts.
8849         (Property.Define): Call the new Property.DoDefine(), this does some
8850         sanity checks and we don't need to duplicate the code everywhere.
8851         (Event): Derive from MemberBase, not MemberCore.
8852         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
8853         accessors, this will also make them work with interface events.
8854         (Indexer): Derive from MemberBase, not MemberCore.
8855         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
8856         (Indexer.Define): Use the new MethodBase functions.
8857
8858         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
8859         argument to the constructor.
8860         (Interface.FindMembers): Added support for interface events.
8861         (Interface.PopluateEvent): Implemented.
8862
8863         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
8864
8865 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
8866
8867         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
8868         but this is required to check for a method name being the same as
8869         the containing class.  
8870
8871         Handle this now.
8872
8873 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8874
8875         * interface.cs: initialize variable.
8876
8877 2002-07-23  Martin Baulig  <martin@gnome.org>
8878
8879         Implemented the IndexerName attribute in interfaces.
8880
8881         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
8882         name if this is an explicit interface implementation.
8883         (Indexer.InterfaceIndexerName): New public variable.  If we're
8884         implementing an interface indexer, this is the IndexerName in that
8885         interface.  Otherwise, it's the IndexerName.
8886         (Indexer.DefineMethod): If we're implementing interface indexer,
8887         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
8888         and Pending.ImplementIndexer methods.
8889         (Indexer.Define): Also define the PropertyBuilder if we're
8890         implementing an interface indexer and this is neither an explicit
8891         interface implementation nor do the IndexerName match the one in
8892         the interface.
8893
8894         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
8895         If a method is defined here, then we always need to create a proxy
8896         for it.  This is used when implementing interface indexers.
8897         (Pending.IsInterfaceIndexer): New public method.
8898         (Pending.ImplementIndexer): New public method.
8899         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
8900         This is used when implementing interface indexers to define a proxy
8901         if necessary.
8902         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
8903         define a proxy if necessary.
8904
8905         * interface.cs (Interface.IndexerName): New public variable.
8906         (Interface.PopulateIndexer): Set the IndexerName.
8907         (Interface.DefineIndexers): New private method.  Populate all the
8908         indexers and make sure their IndexerNames match.
8909
8910         * typemanager.cs (IndexerPropertyName): Added support for interface
8911         indexers.
8912
8913 2002-07-22  Martin Baulig  <martin@gnome.org>
8914
8915         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
8916         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
8917         ret if HasReturnLabel.
8918         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
8919         variables.
8920
8921         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
8922         and set the ec.LoopBeginTryCatchLevel.
8923         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
8924         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
8925         the current ec.TryCatchLevel, the branch goes out of an exception
8926         block.  In this case, we need to use Leave and not Br.
8927
8928 2002-07-22  Martin Baulig  <martin@gnome.org>
8929
8930         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
8931         block unless the block does not always return or it is contained in
8932         another try { ... } catch { ... } block.  Fixes bug #26506.
8933         Added verify-1.cs to the test suite.
8934
8935 2002-07-22  Martin Baulig  <martin@gnome.org>
8936
8937         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
8938         then we do not always return.  Fixes bug #24985.
8939
8940 2002-07-22  Martin Baulig  <martin@gnome.org>
8941
8942         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
8943         lookup on a per-class level; ie. walk up the class hierarchy until we
8944         found at least one applicable method, then choose the best among them.
8945         Fixes bug #24463 and test-29.cs.
8946
8947 2002-07-22  Martin Baulig  <martin@gnome.org>
8948
8949         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
8950         return types of the methods.  The return type is not part of the
8951         signature and we must not check it to make the `new' modifier work.
8952         Fixes bug #27999, also added test-147.cs.
8953         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
8954
8955         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
8956         on the method's return type.
8957
8958 2002-07-21  Martin Baulig  <martin@gnome.org>
8959
8960         * assign.cs: Make this work if the rightmost source is a constant and
8961         we need to do an implicit type conversion.  Also adding a few more tests
8962         to test-38.cs which should have caught this.
8963
8964         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
8965         target in the makefile for this.  The makefile.gnu is primarily intended
8966         for end-users who don't want to debug the compiler.
8967
8968 2002-07-21  Martin Baulig  <martin@gnome.org>
8969
8970         * assign.cs: Improved the Assign class so it can now handle embedded
8971         assignments (X = Y = Z = something).  As a side-effect this'll now also
8972         consume less local variables.  test-38.cs now passes with MCS, added
8973         a few new test cases to that test.
8974
8975 2002-07-20  Martin Baulig  <martin@gnome.org>
8976
8977         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
8978         instructions.  Fixes bug #27977, also added test-146.cs.
8979
8980 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8981
8982         * cs-tokenizer.cs: fixed getHex ().
8983
8984 2002-07-19  Martin Baulig  <martin@gnome.org>
8985
8986         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
8987         not Type.GetType() to lookup the array type.  This is needed when
8988         we're constructing an array of a user-defined type.
8989         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
8990         single-dimensional arrays, but also for single-dimensial arrays of
8991         type decimal.
8992
8993 2002-07-19  Martin Baulig  <martin@gnome.org>
8994
8995         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
8996         this function is called, it's not allowed to share LocalBuilders
8997         among ILGenerators.
8998
8999 2002-07-19  Martin Baulig  <martin@gnome.org>
9000
9001         * expression.cs (Argument.Resolve): Report an error 118 when trying
9002         to pass a type as argument.
9003
9004 2002-07-18  Martin Baulig  <martin@gnome.org>
9005
9006         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
9007         Conv_R_Un for the signed `long' type.
9008
9009 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
9010
9011         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
9012         `expr' for the temporary result, as that will fail if we do
9013         multiple resolves on the same expression.
9014
9015 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
9016
9017         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
9018         ec.TypeContainer for looking up aliases. 
9019
9020         * class.cs (TypeContainer): Remove LookupAlias from here.
9021
9022         * decl.cs (DeclSpace); Move here.
9023
9024 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
9025
9026         * class.cs (FindMembers): Only call filter if the constructor
9027         bulider is not null.
9028
9029         Also handle delegates in `NestedTypes' now.  Now we will perform
9030         type lookups using the standard resolution process.  This also
9031         fixes a bug.
9032
9033         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
9034         This uses Expressions (the limited kind that can be parsed by the
9035         tree) instead of strings.
9036
9037         * expression.cs (ComposedCast.ToString): Implement, used to flag
9038         errors since now we have to render expressions.
9039
9040         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
9041         FormArrayType. 
9042
9043         * ecore.cs (SimpleName.ToString): ditto.
9044
9045         * cs-parser.jay: Instead of using strings to assemble types, use
9046         Expressions to assemble the type (using SimpleName, ComposedCast,
9047         MemberAccess).  This should fix the type lookups in declarations,
9048         because we were using a different code path for this.
9049
9050         * statement.cs (Block.Resolve): Continue processing statements
9051         even when there is an error.
9052
9053 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
9054
9055         * class.cs (Event.Define): Also remove the `remove' method from
9056         the list of pending items.
9057
9058         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
9059         generate more compact code. 
9060
9061 2002-07-17  Martin Baulig  <martin@gnome.org>
9062
9063         * const.cs (Const.LookupConstantValue): Add support for constant
9064         `unchecked' and `checked' expressions.
9065         Also adding test case test-140.cs for this.
9066
9067 2002-07-17  Martin Baulig  <martin@gnome.org>
9068
9069         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
9070         check whether mi.ReturnType implements the IEnumerator interface; the
9071         `==' and the IsAssignableFrom() will fail in this situation.
9072
9073 2002-07-16  Ravi Pratap  <ravi@ximian.com>
9074
9075         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
9076         here too.
9077
9078 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9079
9080         * expression.cs: fixed bug #27811.
9081
9082 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
9083
9084         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
9085         Molaro: when we are a ref, the value already contains a pointer
9086         value, do not take the address of it.
9087
9088 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
9089         * removed mb-parser.jay and mb-tokenizer.cs
9090
9091 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
9092
9093         * expression.cs: check against the building corlib void type.
9094
9095 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
9096
9097         * ecore.cs: fix for valuetype static readonly fields: when 
9098         initializing them, we need their address, not the address of a copy.
9099
9100 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
9101
9102         * typemanager.cs: register also enum_type in corlib.
9103
9104 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
9105
9106         * class.cs: allow calling this (but not base) initializers in structs.
9107
9108 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
9109
9110         * ecore.cs: make sure we compare against the building base types
9111         in GetTypeSize ().
9112
9113 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
9114
9115         * typemanager.cs: fix TypeToCoreType() to handle void and object
9116         (corlib gets no more typerefs after this change).
9117
9118 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
9119
9120         * expression.cs (ArrayCreation.EmitArrayArguments): use
9121         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
9122
9123         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
9124         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
9125         array indexes, the runtime actually forbids them.
9126
9127         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
9128         for array arguments here.
9129
9130         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
9131         instead of the default for ValueTypes.
9132
9133         (New.DoEmit): Use IsValueType instead of
9134         IsSubclassOf (value_type)
9135         (New.DoResolve): ditto.
9136         (Invocation.EmitCall): ditto.
9137
9138         * assign.cs (Assign): ditto.
9139
9140         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
9141         Statements *are* currently doing part of their resolution during
9142         Emit.  
9143
9144         Expressions do always resolve during resolve, but statements are
9145         only required to propagate resolution to their children.
9146
9147 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
9148
9149         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
9150
9151         (LoadAssembly): Do not add the dll if it is already specified
9152
9153         (MainDriver): Add the System directory to the link path at the end,
9154         after all the other -L arguments. 
9155
9156         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
9157         wrong opcode for loading bytes and bools (ldelem.i1 instead of
9158         ldelem.u1) and using the opposite for sbytes.
9159
9160         This fixes Digger, and we can finally run it.
9161
9162         * driver.cs (UnixParseOption): Move the option parsing here.  
9163         (CSCParseOption): Implement CSC-like parsing of options.
9164
9165         We now support both modes of operation, the old Unix way, and the
9166         new CSC-like way.  This should help those who wanted to make cross
9167         platform makefiles.
9168
9169         The only thing broken is that /r:, /reference: and /lib: are not
9170         implemented, because I want to make those have the same semantics
9171         as the CSC compiler has, and kill once and for all the confussion
9172         around this.   Will be doing this tomorrow.
9173
9174         * statement.cs (Unsafe.Resolve): The state is checked during
9175         resolve, not emit, so we have to set the flags for IsUnsfe here.
9176
9177 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9178
9179         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
9180         not catch the Error_ObjectRefRequired in SimpleName (as it is
9181         possible to have a class/instance variable name that later gets
9182         deambiguated), we have to check this here.      
9183
9184 2002-07-10  Ravi Pratap  <ravi@ximian.com>
9185
9186         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
9187         make static and put into Expression.
9188
9189         (Event.Define): Register the private field of the event with the 
9190         TypeManager so that GetFieldFromEvent can get at it.
9191
9192         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
9193         keep track of the private field associated with an event which
9194         has no accessors.
9195
9196         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
9197         private field.
9198
9199         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
9200
9201 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
9202
9203         * expression.cs (Binary.EmitBranchable): this routine emits the
9204         Binary expression in a branchable context.  This basically means:
9205         we need to branch somewhere, not just get the value on the stack.
9206
9207         This works together with Statement.EmitBoolExpression.
9208
9209         * statement.cs (Statement.EmitBoolExpression): Use
9210         EmitBranchable. 
9211
9212 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
9213
9214         * statement.cs (For): Reduce the number of jumps in loops.
9215
9216         (For): Implement loop inversion for the For statement.
9217
9218         (Break): We can be breaking out of a Try/Catch controlled section
9219         (foreach might have an implicit try/catch clause), so we need to
9220         use Leave instead of Br.
9221
9222         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
9223         now).  If the instace expression supports IMemoryLocation, we use
9224         the AddressOf method from the IMemoryLocation to extract the
9225         address instead of emitting the instance.
9226
9227         This showed up with `This', as we were emitting the instance
9228         always (Emit) instead of the Address of This.  Particularly
9229         interesting when This is a value type, as we dont want the Emit
9230         effect (which was to load the object).
9231
9232 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
9233
9234         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
9235
9236         * statement.cs (Checked): Set the CheckedState during the resolve
9237         process too, as the ConvCast operations track the checked state on
9238         the resolve process, and not emit.
9239
9240         * cs-parser.jay (namespace_member_declaration): Flag that we have
9241         found a declaration when we do.  This is used to flag error 1529
9242
9243         * driver.cs: Report ok when we display the help only.
9244
9245 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
9246
9247         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
9248
9249 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
9250
9251         * cs-tokenizer.cs (define): We also have to track locally the
9252         defines.  AllDefines is just used for the Conditional Attribute,
9253         but we also need the local defines for the current source code. 
9254
9255 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
9256
9257         * statement.cs (While, For, Do): These loops can exit through a
9258         Break statement, use this information to tell whether the
9259         statement is the last piece of code.
9260
9261         (Break): Flag that we break.
9262
9263         * codegen.cs (EmitContexts): New `Breaks' state variable.
9264
9265 2002-07-03  Martin Baulig  <martin@gnome.org>
9266
9267         * class.cs (TypeContainer.MethodModifiersValid): Allow override
9268         modifiers in method declarations in structs.  Otherwise, you won't
9269         be able to override things like Object.Equals().
9270
9271 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
9272
9273         * class.cs (Method, Property, Indexer): Do not allow the public
9274         modifier to be used in explicit interface implementations.
9275
9276         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
9277         override modifiers in method declarations in structs
9278
9279 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
9280
9281         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
9282         integer or real overflow, report an error
9283
9284 2002-07-02  Martin Baulig  <martin@gnome.org>
9285
9286         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
9287         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
9288         to tell the runtime about our newly created System.Object and
9289         System.ValueType types.
9290
9291 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
9292
9293         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
9294         struct instead of Ldarg/Starg.
9295
9296 2002-07-02  Martin Baulig  <martin@gnome.org>
9297
9298         * expression.cs (Indirection.Indirection): Call
9299         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
9300
9301 2002-07-02  Martin Baulig  <martin@gnome.org>
9302
9303         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
9304         ValueType, call TypeManager.TypeToCoreType() on it.
9305         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
9306         the OpCodes.Newarr argument.
9307
9308 2002-07-02  Martin Baulig  <martin@gnome.org>
9309
9310         * expression.cs (Invocation.EmitCall): When compiling corlib,
9311         replace all calls to the system's System.Array type to calls to
9312         the newly created one.
9313
9314         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
9315         System.Array methods.
9316         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
9317         from the system's System.Array type which must be replaced.
9318
9319 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
9320
9321         * typemanager.cs: load unverifiable_code_ctor so we can build
9322         corlib using the correct type. Avoid using GetTypeCode() with
9323         TypeBuilders.
9324         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
9325         TypeManager.object_type to allow building corlib.
9326
9327 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
9328
9329         * ecore.cs: handle System.Enum separately in LoadFromPtr().
9330
9331 2002-07-01  Martin Baulig  <martin@gnome.org>
9332
9333         * class.cs: Make the last change actually work, we need to check
9334         whether `ifaces != null' to avoid a crash.
9335
9336 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
9337
9338         * class.cs: when we build structs without fields that implement
9339         interfaces, we need to add the interfaces separately, since there is
9340         no API to both set the size and add the interfaces at type creation
9341         time.
9342
9343 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
9344
9345         * expression.cs: the dimension arguments to the array constructors
9346         need to be converted if they are a long.
9347
9348 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
9349
9350         * class.cs: don't emit ldarg.0 if there is no parent constructor
9351         (fixes showstopper for corlib).
9352
9353 2002-06-29  Martin Baulig  <martin@gnome.org>
9354
9355         MCS now compiles corlib on GNU/Linux :-)
9356
9357         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
9358         ie. check for MethodImplOptions.InternalCall.
9359
9360         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
9361         and TypeManager.attribute_type are null, so we must explicitly check
9362         whether parent is not null to find out whether it's an attribute type.
9363         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
9364         and SetBuilder, not only if the property is neither abstract nor external.
9365         This is necessary to set the MethodImplOptions on the accessor methods.
9366         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
9367         SetBuilder, see Property.Emit().
9368
9369         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
9370         populate "System.Object", "System.ValueType" and "System.Attribute" since
9371         they've already been populated from BootCorlib_PopulateCoreTypes().
9372
9373 2002-06-29  Martin Baulig  <martin@gnome.org>
9374
9375         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
9376         is the NullLiteral, we also need to make sure that target_type is not
9377         an enum type.   
9378
9379 2002-06-29  Martin Baulig  <martin@gnome.org>
9380
9381         * rootcontext.cs (RootContext.ResolveCore): We must initialize
9382         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
9383         before calling BootstrapCorlib_ResolveDelegate ().
9384
9385 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9386
9387         * statement.cs: fixed build-breaker. All tests passed ok.
9388
9389 2002-06-27  Martin Baulig  <martin@gnome.org>
9390
9391         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
9392         for System.Decimal when compiling corlib.
9393
9394 2002-06-27  Martin Baulig  <martin@gnome.org>
9395
9396         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
9397         switch blocks which contain nothing but a default clause.
9398
9399 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
9400
9401        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
9402
9403 2002-06-27  Martin Baulig  <martin@gnome.org>
9404
9405         * ecore.cs (PropertyExpr.PropertyExpr): Call
9406         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
9407
9408         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
9409         is already a TypeBuilder.
9410
9411 2002-06-27  Martin Baulig  <martin@gnome.org>
9412
9413         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
9414         `target_type == TypeManager.array_type', not IsAssignableFrom() in
9415         the "from an array-type to System.Array" case.  This makes it work
9416         when compiling corlib.
9417
9418 2002-06-27  Martin Baulig  <martin@gnome.org>
9419
9420         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
9421         non-static PropertyExpr, set its InstanceExpression.  This makes
9422         the `ICollection.Count' property work in System/Array.cs.
9423
9424 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
9425
9426         * driver.cs: Made error handling more consistent.  Errors now
9427         tracked by Report class, so many methods which used to return int
9428         now return void.  Main() now prints success/failure and 
9429         errors/warnings message.
9430
9431         Renamed '--probe' compiler argument to '--expect-error'.  Removed
9432         the magic number return values (123 and 124).  Now, if the
9433         expected error occurs, the compiler exits with success (exit value
9434         0).  If the compilation completes without seeing that particular
9435         error, the compiler exits with failure (exit value 1).  The
9436         makefile in mcs/errors has been changed to handle the new behaviour.
9437
9438         * report.cs: Made 'expected error' number a property and renamed
9439         it from 'Probe' to 'ExpectedError'.
9440
9441         * genericparser.cs: Removed error handling support, since it is
9442         now all done by Report class.
9443
9444         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
9445         class, so parse() no longer returns an int.
9446
9447         * namespace.cs: Use Report.Error instead of GenericParser.error
9448
9449 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
9450
9451         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
9452         TypeContainer.AddOperator): At the front of the list put the
9453         explicit implementations, so they get resolved/defined first. 
9454
9455 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
9456
9457         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
9458         interface type is implemented by this TypeContainer.  Used during
9459         explicit interface implementation.
9460
9461         (Property.Define, Indexer.Define, Method.Define): Validate that
9462         the given interface in the explicit implementation is one of the
9463         base classes for the containing type.
9464
9465         Also if we are explicitly implementing an interface, but there is
9466         no match in the pending implementation table, report an error.
9467
9468         (Property.Define): Only define the property if we are
9469         not explicitly implementing a property from an interface.  Use the
9470         correct name also for those properties (the same CSC uses,
9471         although that is really not needed).
9472
9473         (Property.Emit): Do not emit attributes for explicitly implemented
9474         properties, as there is no TypeBuilder.
9475
9476         (Indexer.Emit): ditto.
9477
9478         Hiding then means that we do not really *implement* a pending
9479         implementation, which makes code fail.
9480
9481 2002-06-22  Martin Baulig  <martin@gnome.org>
9482
9483         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
9484         the return value of Object.GetType().  [FIXME: we need to do this whenever
9485         we get a type back from the reflection library].
9486
9487 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
9488
9489         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
9490
9491 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
9492
9493         * attribute.cs: Return null if we can not look up the type.
9494
9495         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
9496         the interface types found.
9497
9498         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
9499         interface types found.
9500
9501         * typemanager.cs (GetInterfaces): Make this routine returns alll
9502         the interfaces and work around the lame differences between
9503         System.Type and System.Reflection.Emit.TypeBuilder in the results
9504         result for GetInterfaces.
9505
9506         (ExpandInterfaces): Given an array of interface types, expand and
9507         eliminate repeated ocurrences of an interface.  This expands in
9508         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
9509         be IA, IB, IC.
9510
9511 2002-06-21  Martin Baulig  <martin@gnome.org>
9512
9513         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
9514         on System.Enum.
9515
9516 2002-06-21  Martin Baulig  <martin@gnome.org>
9517
9518         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
9519         and called with one of the core types, return the corresponding typebuilder for
9520         that type.
9521
9522         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
9523         element type.
9524
9525 2002-06-21  Martin Baulig  <martin@gnome.org>
9526
9527         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
9528         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
9529         (Expression.ConvertReferenceExplicit): Likewise.
9530
9531         * expression.cs (ElementAccess.DoResolve): Likewise.
9532         (ElementAccess.DoResolveLValue): Likewise.
9533
9534 2002-06-10  Martin Baulig  <martin@gnome.org>
9535
9536         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
9537         add the "value" parameter to the parameter list.
9538
9539         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
9540         to our caller.
9541
9542 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
9543
9544         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
9545         the argument to an int, uint, long or ulong, per the spec.  Also
9546         catch negative constants in array creation.
9547
9548 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
9549
9550         * class.cs: do not allow the same interface to appear twice in
9551         the definition list.
9552
9553 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
9554
9555         * ecore.cs: don't use ldlen with System.Array.
9556
9557 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
9558
9559         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
9560
9561 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
9562
9563         * modifiers.cs: produce correct field attributes for protected
9564         internal. Easy fix so miguel can work on ther harder stuff:-)
9565
9566 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
9567
9568         * pending.cs: New file.  Move the code from class.cs here.
9569         Support clearning the pending flag for all methods (when not doing
9570         explicit interface implementation).
9571
9572 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
9573
9574         * rootcontext.cs: added a couple more types needed to bootstrap.
9575
9576 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
9577
9578         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
9579         constructor in the type, instead of any constructor in the type
9580         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
9581         a bug in the Mono runtime when applying the params attribute). 
9582
9583 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
9584         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
9585
9586 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
9587
9588         * expression.cs (Unary.ResolveOperator): Use TypeManager
9589         to resolve the type.
9590
9591 2002-06-13  Ravi Pratap  <ravi@ximian.com>
9592
9593         * cs-parser.jay (enum_member_declaration): Pass in the attributes
9594         attached.
9595
9596         * enum.cs (AddEnumMember): Add support to store the attributes associated 
9597         with each member too.
9598
9599         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
9600         field builders too - this takes care of the enum member case.
9601
9602 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
9603
9604         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
9605         address-of operator on both value types and pointers.
9606
9607 2002-06-10  Martin Baulig  <martin@gnome.org>
9608
9609         * interface.cs (Interface.PopulateIndexer): Add the indexer's
9610         PropertyBuilder to the `property_builders' list.
9611
9612         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
9613         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
9614         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
9615         find any indexers which are inherited from an interface.
9616
9617 2002-06-09  Martin Baulig  <martin@gnome.org>
9618
9619         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
9620         the same type as the constant if necessary.  There's also a test-130.cs
9621         for this.
9622
9623         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
9624
9625         * typemanager.cs (TypeManager.ChangeType): Previously known as
9626         Enum.ChangeEnumType().
9627
9628 2002-06-09  Martin Baulig  <martin@gnome.org>
9629
9630         * expression.cs (Cast.TryReduce): Added support for consts.
9631
9632 2002-06-08  Ravi Pratap  <ravi@ximian.com>
9633
9634         * class.cs (Accessor): Hold attributes information so we can pass
9635         it along.
9636
9637         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
9638         Modify to pass in attributes attached to the methods.
9639
9640         (add_accessor_declaration, remove_accessor_declaration): Ditto.
9641
9642         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
9643         to handle the Accessor kind :-)
9644
9645         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
9646
9647 2002-06-08  Martin Baulig  <martin@gnome.org>
9648
9649         * expression.cs (Unary.TryReduceNegative): Added support for
9650         ULongConstants.
9651
9652 2002-06-08  Martin Baulig  <martin@gnome.org>
9653
9654         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
9655         name can't be found in the `defined_names' - the caller will do a
9656         MemberLookup in this case and thus find methods in System.Enum
9657         such as Enum.IsDefined().
9658
9659 2002-06-08  Martin Baulig  <martin@gnome.org>
9660
9661         * enum.cs (Enum.ChangeEnumType): This is a custom version of
9662         Convert.ChangeType() which works with TypeBuilder created types.
9663         (Enum.LookupEnumValue, Enum.Define): Use it here.
9664
9665         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
9666         `TypeBuilder.BaseType != null' check.
9667         (TypeContainer.FindMembers): Only lookup parent members if we
9668         actually have a parent.
9669         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
9670         (ConstructorInitializer.Resolve): Likewise.
9671
9672         * interface.cs (Interface.FindMembers): Added
9673         `TypeBuilder.BaseType != null' check.
9674
9675         * rootcontext.cs (RootContext.ResolveCore): Added
9676         "System.Runtime.CompilerServices.IndexerNameAttribute" to
9677         classes_second_stage.
9678
9679         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
9680         debug_type and trace_type when compiling with --nostdlib.       
9681
9682 2002-06-07  Martin Baulig  <martin@gnome.org>
9683
9684         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
9685         (AddField): Set it to true when adding a non-static field.
9686         (DefineType): Use `have_nonstatic_fields' to find out whether we
9687         have non-static fields, not `Fields != null'.
9688
9689 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
9690
9691         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
9692         dereferencing a null on the static-field code path)
9693
9694 2002-05-30  Martin Baulig  <martin@gnome.org>
9695
9696         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
9697         to take command line arguments.  Use reflection to call the new
9698         custom `Initialize' function on the symbol writer and pass it the
9699         command line arguments.
9700
9701         * driver.cs (--debug-args): New command line argument to pass command
9702         line arguments to the symbol writer.
9703
9704 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
9705
9706         * assign.cs (DoResolve): Forgot to do the implicit conversion to
9707         the target type for indexers and properties.  Thanks to Joe for
9708         catching this.
9709
9710 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
9711
9712         * typemanager.cs (MethodFlags): returns the method flags
9713         (Obsolete/ShouldIgnore) that control warning emission and whether
9714         the invocation should be made, or ignored. 
9715
9716         * expression.cs (Invocation.Emit): Remove previous hack, we should
9717         not do this on matching a base type, we should do this based on an attribute
9718
9719         Only emit calls to System.Diagnostics.Debug and
9720         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
9721         on the command line.
9722
9723         * rootcontext.cs: Global settings for tracing and debugging.
9724
9725         * cs-tokenizer.cs (define): New utility function to track
9726         defines.   Set the global settings for TRACE and DEBUG if found.
9727
9728 2002-05-25  Ravi Pratap  <ravi@ximian.com>
9729
9730         * interface.cs (Populate*): Pass in the TypeContainer as well as
9731         the DeclSpace as parameters so that we can create EmitContexts and
9732         then use that to apply attributes etc.
9733
9734         (PopulateMethod, PopulateEvent, PopulateProperty)
9735         (PopulateIndexer): Apply attributes everywhere.
9736
9737         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
9738         etc.
9739
9740         (ApplyAttributes): Update accordingly.
9741
9742         We now apply interface attributes for all members too.
9743
9744 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
9745
9746         * class.cs (Indexer.Define); Correctly check if we are explicit
9747         implementation (instead of checking the Name for a ".", we
9748         directly look up if the InterfaceType was specified).
9749
9750         Delay the creation of the PropertyBuilder.
9751
9752         Only create the PropertyBuilder if we are not an explicit
9753         interface implementation.   This means that explicit interface
9754         implementation members do not participate in regular function
9755         lookups, and hence fixes another major ambiguity problem in
9756         overload resolution (that was the visible effect).
9757
9758         (DefineMethod): Return whether we are doing an interface
9759         implementation. 
9760
9761         * typemanager.cs: Temporary hack until we get attributes in
9762         interfaces (Ravi is working on that) and we get IndexerName
9763         support in interfaces.
9764
9765         * interface.cs: Register the indexers as properties.
9766
9767         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
9768         warning, I have verified that this is a bug in the .NET runtime
9769         (JavaScript suffers of the same problem).
9770
9771         * typemanager.cs (MemberLookup): When looking up members for
9772         interfaces, the parent of an interface is the implicit
9773         System.Object (so we succeed in searches of Object methods in an
9774         interface method invocation.  Example:  IEnumerable x;  x.ToString
9775         ()) 
9776
9777 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
9778
9779         * class.cs (Event): Events should also register if they do
9780         implement the methods that an interface requires.
9781
9782         * typemanager.cs (MemberLookup); use the new GetInterfaces
9783         method. 
9784
9785         (GetInterfaces): The code used to lookup interfaces for a type is
9786         used in more than one place, factor it here. 
9787
9788         * driver.cs: Track the errors at the bottom of the file, we kept
9789         on going.
9790
9791         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
9792         instance if the method we are calling is static!
9793
9794 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
9795
9796         * attribute.cs (ApplyAttributes): Make this function filter out
9797         the IndexerName attribute (as that attribute in reality is never
9798         applied) and return the string constant for the IndexerName
9799         attribute. 
9800
9801         * class.cs (TypeContainer.Emit): Validate that all the indexers
9802         have the same IndexerName attribute, and if so, set the
9803         DefaultName attribute on the class. 
9804
9805         * typemanager.cs: The return value might contain other stuff (not
9806         only methods).  For instance, consider a method with an "Item"
9807         property and an Item method.
9808
9809         * class.cs: If there is a problem with the parameter types,
9810         return. 
9811
9812 2002-05-24  Ravi Pratap  <ravi@ximian.com>
9813
9814         * ecore.cs (ImplicitConversionExists): Wrapper function which also
9815         looks at user defined conversion after making a call to 
9816         StandardConversionExists - we need this for overload resolution.
9817
9818         * expression.cs : Update accordingly the various method calls.
9819
9820         This fixes 2 bugs filed against implicit user defined conversions 
9821
9822 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
9823
9824         * statement.cs: Track the result of the assignment.
9825
9826 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
9827
9828         * expression.cs (MemberAccess): Improved error reporting for
9829         inaccessible members.
9830
9831 2002-05-22  Martin Baulig  <martin@gnome.org>
9832
9833         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
9834         itself with debugging support.
9835
9836 2002-05-22  Martin Baulig  <martin@gnome.org>
9837
9838         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
9839         Removed, this isn't needed anymore.
9840
9841 2002-05-20  Martin Baulig  <martin@gnome.org>
9842
9843         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
9844         be underlying type for an enum.
9845
9846 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
9847
9848         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
9849         that splits out the loading of just the core types.
9850
9851         * rootcontext.cs (ResolveCore): Split the struct resolution in
9852         two, so we can load the enumeration underlying types before any
9853         enums are used.
9854
9855         * expression.cs (Is): Bandaid until we fix properly Switch (see
9856         bug #24985 for details).
9857
9858         * typemanager.cs (ImplementsInterface): The hashtable will contain
9859         a null if there are no interfaces implemented.
9860
9861 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
9862
9863         * cs-parser.jay (indexer_declarator): It is fine to have array
9864         parameters
9865
9866 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
9867
9868         * typemanager.cs: (RegisterBuilder): New function used to register
9869         TypeBuilders that implement interfaces.  Since
9870         TypeBuilder.GetInterfaces (as usual) does not work with lame
9871         Reflection.Emit. 
9872         (AddUserType): register interfaces.
9873
9874         (ImplementsInterface): Use the builder_to_ifaces hash if we are
9875         dealing with TypeBuilder.  Also, arrays are showing up as
9876         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
9877         methods can not be invoked on them!
9878
9879         * ecore.cs (ExplicitReferenceConversionExists): Made public.
9880         (ImplicitReferenceConversionExists): Split out from
9881         StandardConversionExists. 
9882
9883         * expression.cs (As): We were only implementing one of the three
9884         cases for the as operator.  We now implement them all.
9885         (Is): Implement the various other cases for Is as well.
9886
9887         * typemanager.cs (CACHE): New define used to control if we want or
9888         not the FindMembers cache.  Seems to have a negative impact on
9889         performance currently
9890
9891         (MemberLookup): Nested types have full acess to
9892         enclosing type members
9893
9894         Remove code that coped with instance/static returns for events, we
9895         now catch this in RealFindMembers.
9896
9897         (RealFindMembers): only perform static lookup if the instance
9898         lookup did not return a type or an event.  
9899
9900 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
9901
9902         * assign.cs (CompoundAssign): We pass more semantic information
9903         now to Compound Assignments than we did before: now we have all
9904         the information at hand, and now we resolve the target *before* we
9905         do the expression expansion, which allows the "CacheValue" method
9906         to have the effect we intended (before, a [x] += 1 would generate
9907         two differen ArrayAccess expressions from the ElementAccess,
9908         during the resolution process).
9909
9910         (CompoundAssign.DoResolve): Resolve target and original_source here.
9911
9912 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
9913
9914         * expression.cs (ArrayAccess): dropped debugging information. 
9915
9916         * typemanager.cs: Small bug fix: I was always returning i_members,
9917         instead of one of i_members or s_members (depending on which had
9918         the content).
9919
9920         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
9921         method is invoked before any code generation takes place, and it
9922         is a mechanism to inform that the expression will be invoked more
9923         than once, and that the method should use temporary values to
9924         avoid having side effects
9925
9926         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
9927
9928         * ecore.cs (Expression.CacheTemporaries): Provide empty default
9929         implementation.
9930
9931         * expression.cs (Indirection, ArrayAccess): Add support for
9932         CacheTemporaries in these two bad boys. 
9933
9934         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
9935         ldobj or ldind_ref.  
9936         (StoreFromPtr): Handle stobj as well.
9937
9938         * expression.cs (UnaryMutator): Share more code.
9939
9940         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
9941         down: I was not tracking the Filter function as well, which
9942         was affecting the results of the cache.
9943
9944 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
9945
9946         * attribute.cs: Remove the hack to handle the CharSet property on
9947         StructLayouts. 
9948
9949 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
9950
9951         * attribute.cs (DoResolve): More uglyness, we now only try to
9952         resolve the attribute partially, to extract the CharSet
9953         information (only if we are a StructLayout attribute).  Otherwise 
9954
9955         (GetExtraTypeInfo): Add some code to conditionally kill in the
9956         future this.   I am more and more convinced that the .NET
9957         framework has special code to handle the attribute setting on
9958         certain elements.
9959
9960         * expression.cs (IsParamsMethodApplicable): Revert my previous
9961         foreach change here, it was wrong.
9962
9963 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
9964
9965         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
9966         (pp_expr): do not abort on unknown input, just return.
9967         (eval): abort if there are pending chars.
9968
9969         * attribute.cs (Attribute.Resolve): Positional parameters are
9970         optional.  Deal with that case.
9971
9972         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
9973         the Ansi/Unicode/Auto information for the type.
9974
9975         (TypeContainer.DefineType): instantiate the EmitContext here, as
9976         we will be using it during the type definition (to resolve
9977         attributes) and during the emit phase.
9978
9979         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
9980         to pull type information out of the attributes
9981
9982         (Attribute.Resolve): track the constructor builder, and allow for
9983         multiple invocations (structs and classes will use this).
9984
9985         * ecore.cs (MemberLookupFinal): new version with all the
9986         parameters customizable.
9987
9988         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
9989         constructors.  Return if the result value is null (as the error
9990         would have been flagged already by MemberLookupFinal)
9991
9992         Do not allow instances of abstract classes or interfaces to be
9993         created.
9994
9995         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
9996         We have to compare the assembly property here when dealing with
9997         FamANDAssem and Assembly access modifiers, because we might be
9998         creating an assembly from *modules* (that means that we are not
9999         getting TypeBuilders for types defined in other modules that are
10000         part of this assembly).
10001
10002         (Method.Emit): If the method is marked abstract and has a body,
10003         emit an error. 
10004
10005         (TypeContainer.DefineMembers): If both the defined member and the
10006         parent name match are methods, then do not emit any warnings: let
10007         the Method.Define routine take care of flagging warnings.  But if
10008         there is a mismatch (method overrides something else, or method is
10009         overriwritten by something, then emit warning).
10010
10011         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
10012         set to null, this means `do not check for the return type on the
10013         signature'. 
10014
10015         (Method.Define): set the return type for the method signature to
10016         null, so that we get methods with the same name and parameters and
10017         different return types.  This is used to flag warning 114 (you are
10018         hiding a method, and you probably want to use the new/override
10019         keywords instead).
10020
10021         * typemanager.cs (MemberLookup): Implemented proper access
10022         control, closing a long standing set of bug reports.  The problem
10023         was that the Framework only has two bits: Public and NonPublic,
10024         and NonPublic includes private and protected methods, but we need
10025         to enforce the FamANDAssem, FamOrAssem and Family. 
10026
10027 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
10028
10029         * statement.cs (GotoCase): Return true: Ammounts to giving up
10030         knowledge on whether we return or not, and letting the other case
10031         be responsible for it.
10032
10033 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
10034
10035         * driver.cs: Do not load directories for each file processed, only
10036         do it if there is a pattern.
10037
10038         * ecore.cs: Report readonly assigns here as well, as we might have
10039         been resolved only by MemberAccess.
10040
10041         (SimpleName.SimpleNameResolve): Also be useful for LValue
10042         resolution.   We need this to propagate assign to local readonly variables
10043
10044         * typemanager.cs: Use a ptrhashtable for the criteria, because we
10045         do not want to reuse potential criteria memory.
10046
10047         * class.cs (MyEventBuilder): Set reflected_type;
10048
10049         * ecore.cs (Constantify): Added support for constifying bools.
10050
10051         (RootContext.LookupType): Added a cache for values looked up in
10052         the declaration space.
10053
10054         * typemanager.cs (FindMembers): Now is a front-end to
10055         RealFindMembers, and provides a two-level hashtable-based cache to
10056         the request.  
10057
10058         15% performance improvement: from 22.5 to 19.2 seconds.
10059
10060         * expression.cs (IsParamsMethodApplicable): use foreach.
10061         (Invocation.DoResolve): ditto.
10062         (New.DoResolve): ditto.
10063         (ArrayCreation.DoResolve): ditto.
10064
10065         * ecore.cs (FindMostEncompassingType): use foreach.
10066
10067         * delegate.cs (NewDelegate.DoResolve): Use foreach
10068
10069         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
10070         (RemoveMethods): use foreach.
10071
10072         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
10073         nested foreach statements instead of for, and also break out of
10074         the inner loop once a match is found.
10075
10076         (Invocation.OverloadResolve): Use foreach, simplify the code. 
10077
10078 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
10079
10080         * cfold.cs (BinaryFold): During an enumeration evaluation context,
10081         we actually unwrap the expression to allow for extra information
10082         to be extracted. 
10083
10084         * expression.cs: Use Shr_Un on unsigned operations. 
10085
10086 2002-05-08  Ravi Pratap  <ravi@ximian.com>
10087
10088         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
10089         applicable operators was not being considered correctly. This closes
10090         the bug Miguel reported.
10091
10092 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
10093
10094         * attribute.cs: check that the type derives from System.Attribute
10095         and report the correct error in that case (moved the duplicate code to
10096         its own method, too).
10097
10098 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
10099
10100         * attribute.cs: lookup attribute type name as the spec says: first the
10101         bare attribute name and then name + "Attribute" (nant compiles with
10102         mcs after this fix).
10103
10104 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
10105
10106         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
10107         Because of the way we parse things, we should try to see if a
10108         UIntConstant can fit in an integer.
10109
10110 2002-05-07  Ravi Pratap  <ravi@ximian.com>
10111
10112         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
10113         when we are in an explicit context.
10114
10115         (ConvertReferenceExplicit): When converting from Iface type S to Class
10116         T make sure the rules are implemented as an OR.
10117
10118         * parameter.cs (ParameterType): Make it a property for now although the
10119         purpose really isn't anything immediate.
10120
10121         * expression.cs (Is*Applicable): Do better checking on the parameter type
10122         of a ref/out parameter. The ones from the system assemblies are already 
10123         marked with the correct type so we don't need to do any correction.
10124
10125         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
10126         the object type is standard too so include that.
10127
10128 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10129
10130         * ecore.cs (StandardConversionExists): Augment with missing code:
10131         deal with IntConstant, LongConstants and Enumerations.
10132
10133         * assign.cs: Report the error, instead of failing silently
10134
10135         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
10136         typecontainer that they are declared, because the
10137         typecontainer/namespace will have the list of using clauses that
10138         need to be applied.
10139
10140         Assembly Attributes were escaping the normal registration
10141         mechanism. 
10142
10143         (EmitCode): Apply attributes within an EmitContext that represents
10144         the container they were declared on.
10145
10146         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
10147
10148 2002-05-06  Ravi Pratap  <ravi@ximian.com>
10149
10150         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
10151         Revamp completely - make much cleaner as we now operate only
10152         on a set of Types.
10153
10154         (FindMostSpecificSource, FindMostSpecificTarget): New methods
10155         to implement the logic detailed in the spec more correctly.
10156
10157         (UserDefinedConversion): Update accordingly.
10158
10159 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10160
10161         * statement.cs: Return flow analysis information up.
10162
10163         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
10164         and the default.
10165
10166         (token): Do not consume an extra character before calling
10167         decimal_digits.
10168
10169 2002-05-06  Piers Haken <piersh@friskit.com>
10170
10171         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
10172
10173 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
10174
10175         * class.cs (Constructor.Emit): Set the IsStatic flag in the
10176         EmitContext during the instance constructor initializer
10177         resolution, to stop access to instance variables.
10178
10179         This is mandated by the spec, last paragraph of the `constructor
10180         initializers' section. 
10181
10182 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
10183
10184         * cs-parser.jay, class.cs (Accessor): new class used to represent
10185         an accessor (get or set).  In the past we used `null' to represent
10186         a missing accessor.  But this is ambiguous because there was no
10187         way to tell in abstract indexers/properties if one of them was
10188         specified.
10189
10190         Now there is a way of addressing that.
10191
10192         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
10193         instead of FindMembers.
10194
10195         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
10196         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
10197
10198         * attribute.cs: Treat indexers and properties as the same in terms
10199         of applying attributes
10200
10201         * ecore.cs (FindMostEncompassedType): Use statically initialized
10202         EmptyExpressions()s like we do elsewhere to avoid creating useless
10203         objects (and we take this out of the tight loop).
10204
10205         (GetConversionOperators): Move the code to extract the actual
10206         operators to a separate routine to clean things up.
10207
10208 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
10209
10210         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
10211         events are always registered FieldBuilders.
10212
10213         * class.cs (FieldBase): New class shared by Fields 
10214
10215         * delegate.cs: If we are a toplevel delegate, use our full name.
10216         If we are a nested delegate, then only use our tail name.
10217
10218 2002-05-02  Ravi Pratap  <ravi@ximian.com>
10219
10220         * expression.cs (IsApplicable): Ensure that we add the "&" to
10221         ref/out types before comparing it with the type of the argument.
10222
10223         (IsParamsMethodApplicable): Ditto.
10224
10225         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
10226         silly me ;-)
10227
10228         * delegate.cs : Handle the case when we have more than one applicable
10229         method. Flag an error only when we finish checking all.
10230
10231 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
10232
10233         * expression.cs: Add support for boolean static initializers.
10234
10235 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
10236
10237         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
10238
10239         * parameter.cs (ComputeParameterTypes,
10240         ComputeAndDefineParameterTypes): Better error handling: now we
10241         clear the `types' cache if we fail during any of the type lookups.
10242         We also return the status code correctly to our caller
10243
10244         * delegate.cs: If we fail to define a delegate, abort the extra
10245         steps. 
10246
10247         * expression.cs (Binary.ResolveOperator): for
10248         operator==(object,object) and operator !=(object, object) we also
10249         have to verify that there is an implicit conversion from one to
10250         the other.
10251
10252         (ArrayAccess.DoResolve): Array Access can operate on
10253         non-variables. 
10254
10255 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
10256
10257         * assign.cs (CompoundAssign): A new class used as a "flag" that
10258         the assignment actually is happening as part of a compound
10259         assignment operator.
10260
10261         During compound assignment, a few new rules exist to enable things
10262         like:
10263
10264         byte b |= 1 + 2
10265
10266         From the spec:
10267
10268         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
10269         to the type of x) if y is implicitly convertible to the type of x,
10270         and the operator is a builtin operator and the return type of the
10271         operator is explicitly convertible to the type of x. 
10272
10273         * rootcontext.cs: Reset warning level to 2.  4 catches various
10274         "interesting" features in mcs, we must clean this up at some
10275         point, but currently am trying to kill other bugs ;-)
10276
10277         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
10278         in container classes as well.  
10279
10280         * expression.cs (Binary.ResolveOperator): Handle string case
10281         before anything else (as operator overloading does emit an error
10282         before doing anything else).
10283
10284         This code could go away when we move to a table driven model, but
10285         i could not come up with a good plan last night.
10286
10287 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
10288
10289         * typemanager.cs (CSharpName): reimplementation using regex.
10290         * class.cs: added null check for fields in Emit
10291         * rootcontext.cs: set warninglevel to 4
10292
10293 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
10294
10295         * typemanager.cs (CSharpName): reimplemented with Lupus
10296         suggestion.
10297
10298 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
10299
10300         * statement.cs (If): correclty implement Resolve, because we were
10301         not catching sem errors in there.  The same process is needed
10302         everywhere else. 
10303         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
10304
10305
10306         (Statement.Warning_DeadCodeFound): Factorize code.
10307         (While): Report dead code here too.
10308
10309         (Statement): Added Resolve virtual method to allow
10310         for resolution split from the emit code.
10311
10312 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
10313
10314         * statement.cs (EmitBoolExpression): No longer try to resolve the
10315         expression here.    
10316         (MakeBoolean): New utility function that resolve, implicitly
10317         converts to boolean and tags the expression. 
10318
10319
10320         (If, Do): Implement dead code elimination.
10321         (While): Implement loop inversion
10322
10323         (Do, While, For, If): Resolve the expression prior to calling our
10324         code generation.
10325
10326 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
10327
10328         * class.cs:
10329           - added method Report28 (warning: program has more than one entry point)
10330           - added method IsEntryPoint, implements paragraph 10.1 of the spec
10331           - modified method Method.Define, the part at the end of the method
10332
10333         * rootcontext.cs: added static public Location EntryPointLocation;
10334           
10335         * ../errors/cs0028.cs : Add test case for the above warning.              
10336
10337         * typemanager.cs:
10338           - modified method CSharpName to allow arrays of primitive type to
10339             be printed nicely (e.g. instead of System.Int32[][] it now prints
10340             int[][])
10341           - added method CSharpSignature: returns the signature of a method
10342             in string format to be used in reporting errors, warnings, etc.
10343
10344         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
10345         with String.Empty.
10346
10347 2002-04-26  Ravi Pratap  <ravi@ximian.com>
10348
10349         * delegate.cs (Define): Fix extremely silly bug where I was
10350         setting the type of the 'object' parameter of the BeginInvoke
10351         method to System.IAsyncResult instead of System.Object ;-)
10352
10353 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
10354
10355         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
10356         here. 
10357
10358         (Constructor.Emit): return if we fail to initialize the
10359         constructor.  Another door closed!  
10360
10361         * expression.cs (New.DoResolve): Improve error message (from -6 to
10362         1501).  Use DeclaredOnly lookup to find the exact constructor.
10363
10364         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
10365         loop.  This is useful.
10366
10367         * cs-parser.jay: Adjust the default parameters so that destructors
10368         have the proper signature.
10369
10370 2002-04-26  Martin Baulig  <martin@gnome.org>
10371
10372         * driver.cs (LoadAssembly): If `assembly' contains any characters
10373         which are only valid in path names and not in assembly names
10374         (currently slash, backslash and point), use Assembly.LoadFrom ()
10375         instead of Assembly.Load () on the `assembly' (before iteration
10376         over the link_paths).
10377
10378 2002-04-26  Martin Baulig  <martin@gnome.org>
10379
10380         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
10381
10382 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
10383
10384         * class.cs (Property): use the new typemanager.MemberLookup
10385
10386         (TypeContainer.MemberLookup): Implement using the
10387         TypeManager.MemberLookup now. 
10388
10389         * typemanager.cs: Make MemberLookup a function of the TypeManager,
10390         and return MemberInfos, so that these can be used without an
10391         EmitContext (what we had before).
10392
10393 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
10394
10395         * expression.cs: Fix the case where the argument to params if the
10396         type of the params.  I omitted handling this before.   Fixed
10397
10398 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
10399
10400         * driver.cs: Call BootCorlib_PopulateCoreType
10401
10402         * class.cs (Property.CheckBase): Check for properties only, not
10403         for all members. 
10404
10405         * interface.cs: Temporary hack: try/catch around the
10406         CustomAttributeBuilder, because I am getting an exception that I
10407         do not understand.
10408
10409         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
10410         types whose definitions are required to be there (attributes are
10411         defined before standard types).
10412
10413         Compute definitions as we boot the various types, as they are used
10414         immediately (value_type class will need object_type, but if we do
10415         not initialize object_type, we will pass a null, which will let
10416         the runtime pick the System.Object from the existing corlib, which
10417         is not what we want).
10418
10419 2002-04-22  Patrik Torstensson <totte@labs2.com>
10420
10421         * cs-tokenizer.cs: fixed a number of trim() issues.
10422
10423 2002-04-22  Ravi Pratap  <ravi@ximian.com>
10424
10425         * expression.cs (Argument.Type): Ensure that we return the correct
10426         type when we have out or ref parameters [in which case we 
10427         append a "&"].
10428
10429 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
10430
10431         * class.cs (Property, Indexer): Allow extern modifier in there. 
10432
10433         * typemanager.cs (InitBaseTypes): Initializes object_type and
10434         value_type, since those will be used early on during the bootstrap
10435         process to compile corlib.
10436
10437         (InitCoreTypes): Move code from here to InitBaseTypes.
10438
10439 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
10440
10441         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
10442         single-dimension arrays as using the ldlen opcode.  
10443
10444         Daniel Lewis discovered this optimization.  
10445
10446         * typemanager.cs: Add signature for System.Array::get_Length
10447
10448 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10449
10450         * statement.cs: report the error when the foreach does not apply to an
10451         array nor a collection.
10452
10453 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
10454
10455         * expression.cs: Add implicit conversions to the operator ~.
10456
10457         * constant.cs (DecimalConstant.Emit): Emit decimal value.
10458
10459         * typemanager.cs: Locate the decimal constructor.
10460
10461 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10462
10463         * attribute.cs: use the new property of TypeOf.
10464         * expression.cs: added 'get' property around typearg.
10465
10466         These changes fix a build breaker reported by NickD. Is this the
10467         correct way to fix?  If not, please, revert my changes and make it
10468         work :-).
10469
10470 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
10471
10472         * attribute.cs: Add support for typeof in attribute invocations.
10473         I am not sure that this is right though.
10474
10475 2002-04-14  Duncan Mak  <duncan@ximian.com>
10476
10477         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
10478         Binary.Operator.Division case.
10479
10480 2002-04-13  Ravi Pratap  <ravi@ximian.com>
10481
10482         * class.cs (DefineType): Ensure that we do a proper check on
10483         attribute types and also register it with the TypeManager.
10484
10485         (TypeContainer.Targets): The default for attribute types is
10486         AttributeTargets.All.
10487
10488         * attribute.cs (ApplyAttributes): Registering the attribute type
10489         is done elsewhere, not when we discover we have a Usage attribute.
10490
10491 2002-04-12  Ravi Pratap  <ravi@ximian.com>
10492
10493         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
10494         and get rid of is_delegate parameter.
10495
10496         * everywhere : update.
10497
10498 2002-04-12  Ravi Pratap  <ravi@ximian.com>
10499
10500         * cs-parser.jay (compilation_unit): Revamp completely to use
10501         some new ideas that I got from Rhys' grammar to solve the problems
10502         with assembly level attributes.
10503
10504         (outer_declaration): New grammar production.
10505
10506         (attribute_sections): Add.
10507
10508         (opt_attributes): Base on attribute_sections
10509
10510         (namespace_declaration): Allow opt_attributes to tackle the case
10511         when we have assembly level attributes - we are clever in this
10512         regard now ;-)
10513
10514         * attribute.cs (ApplyAttributes): Do not worry about assembly 
10515         attributes in the non-global context.
10516
10517         * rootcontext.cs (AddGlobalAttributes): Go back to using this
10518         instead of SetGlobalAttributes.
10519
10520         * class.cs, rootcontext.cs : Ensure we define and generate 
10521         attribute types before anything else.
10522
10523         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
10524         and flag the new error -20 for the case when the attribute type
10525         does not have valid targets specified. csc does not catch this.
10526
10527         * ../errors/errors.txt : update for error # -20
10528
10529 2002-04-11  Ravi Pratap  <ravi@ximian.com>
10530
10531         * support.cs (InternalParameters.ParameterModifier): Do some null
10532         checking and return sane values.
10533
10534         * class.cs (Method.Define): If we are a PInvoke method, ensure
10535         that we are static and extern. Report error # 601
10536
10537         * ../errors/cs0601.cs : Add test case for the above error.
10538
10539 2002-04-07  Ravi Pratap  <ravi@ximian.com>
10540
10541         * rootcontext.cs (attribute_types): We need to keep type of
10542         all attribute types separately and emit code for them first.
10543
10544         (RegisterAttribute) : Implement.
10545
10546         * class.cs (DefineType): Check if the current Type is a custom
10547         attribute type and register it accordingly.
10548
10549         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
10550         adding the first attribute twice and rename to
10551
10552         (SetGlobalAttributes): this.
10553
10554         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
10555         lookups.
10556
10557         * attribute.cs (ApplyAttributes): Take an additional argument telling us
10558         if we are processing global arguments. Hmm, I am unsure of this.
10559
10560 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10561
10562         * expression.cs: added static array of strings to avoid calling
10563         Enum.ToString () for Operator in Binary. Significant recover of
10564         performance.
10565
10566 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
10567
10568         * class.cs (FindMembers): Allow the Builders of the various
10569         members to be null.  If they are skip them.  This only happens
10570         during the PInvoke declaration.
10571
10572 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
10573
10574         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
10575         failure, so we do not keep going afterwards.
10576
10577         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
10578         wanted to pass `false' as the `is_delegate' argument.  If this is
10579         the case, why not use delegate_type == null to mean `is_delegate =
10580         false' and anything else as is_delegate = true.
10581
10582 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
10583
10584         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
10585         code for the section, not the beginning of the tests.
10586
10587 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
10588
10589         * cfold.cs: Handle operator + (Enum x, Underlying x) 
10590
10591         * expression.cs (Binary): same.  Warn about errors where we have
10592         Enum/Enum in operator + as well.
10593
10594 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
10595
10596         * statement.cs:
10597                 - added support for switch(bool)
10598                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
10599                 - add TableSwitchEmit() to handle table-based switch statements
10600
10601 2002-04-05  Ravi Pratap  <ravi@ximian.com>
10602
10603         * expression.cs (Invocation.OverloadResolve): Factor out code which
10604         does parameter compatibility checking with arguments so that we can 
10605         re-use the code even from Delegate.VerifyApplicability
10606
10607         (VerifyArgumentsCompat): Move above code here.
10608
10609         * delegate.cs (VerifyApplicability): Get rid of duplicate code
10610         and instead make a call to the above method.
10611
10612 2002-03-31  Ravi Pratap  <ravi@ximian.com>
10613
10614         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
10615         We use it to keep track of classes which are attribute types.
10616
10617 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
10618
10619         * delegate.cs (Delegate.Define): Correctly define the types in the
10620         presence of fixed and array parameters.
10621
10622         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
10623         doing FindMembers.
10624
10625         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
10626         include NonPublic after the first iteration.
10627
10628         * class.cs (Indexer.CheckBase): Only check if both parents are
10629         non-null. 
10630
10631         * cs-parser.jay (accessor_body): If empty, set to null.
10632
10633         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
10634         same code path here to resolve constants names that we did have in
10635         MemberAccess.DoResolve.  There is too much code duplicated here.
10636
10637 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
10638
10639         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
10640
10641         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
10642         to MakeUnionSet.
10643
10644         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
10645         tokens, numbers and strings.
10646
10647         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
10648         parenthesis.
10649
10650         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
10651         asyncronous parameters and the regular parameters.  
10652
10653         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
10654         specify the target directory.
10655
10656         * expression.cs: (This.DoResolve): Simplify
10657         (As.Emit): Optimize, do not generate IsInst if the expression is
10658         always of the given type.
10659
10660         (Is.DoResolve): Bug fix, we were reporting both always/never for
10661         the is expression.
10662
10663         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
10664         creating too many unnecessary arrays.
10665
10666 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
10667
10668         * class.cs (EmitFieldInitializer): Use Assign expression to assign
10669         fields instead of rolling our own initializer.   Takes care of all
10670         implicit conversions, and drops unnecessary static checks/argument.
10671
10672 2002-03-31  Dick Porter  <dick@ximian.com>
10673
10674         * driver.cs: use the GetDirectories() return values properly, and
10675         use "/" as path separator.
10676
10677 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
10678
10679         * expression.cs (Unary): Optimize - - expr into expr.
10680         (Binary): Optimize a + (-b) into a -b.
10681
10682         * codegen.cs (CodeGen): Made all methods static.
10683
10684 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
10685
10686         * rootcontext.cs: 
10687
10688         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
10689         TypeBuilder property.
10690
10691         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
10692         instead. 
10693
10694         * tree.cs: Removed the various RecordXXXX, and replaced with a
10695         single RecordDecl.  Removed all the accessor methods, and just
10696         left a single access point Type 
10697
10698         * enum.cs: Rename DefineEnum to DefineType.
10699
10700         * decl.cs: New abstract method `DefineType' used to unify the
10701         Defines for Enumerations, Interfaces, TypeContainers and
10702         Delegates.
10703
10704         (FindType): Moved LookupInterfaceOrClass here.  Moved the
10705         LookupBaseClasses method that used to live in class.cs and
10706         interface.cs here, and renamed to FindType.
10707
10708         * delegate.cs: Implement DefineType.  Take advantage of the
10709         refactored pattern for locating the parent builder without taking
10710         the parent_builder argument (which we know does not work if we are
10711         nested, and triggering a toplevel definition).
10712
10713 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
10714
10715         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
10716         accessibility of a member has changed during override and report
10717         an error if so.
10718
10719         * class.cs (Method.Define, Property.Define): Only complain on
10720         overrides if the method is private, any other accessibility is
10721         fine (and since we just checked the permission is the same, we are
10722         good to go).
10723
10724         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
10725         and elif are processed always.  The other pre-processing
10726         directives are only processed if we are "taking" the path
10727
10728 2002-03-29  Martin Baulig  <martin@gnome.org>
10729
10730         * class.cs (Method.Emit): Only emit symbolic debugging info if the
10731         current location is not Null.
10732
10733         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
10734         a separate method so we can profile it.
10735
10736         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
10737         `span.Seconds' are just seconds, but no minutes or hours.
10738         (MainDriver): Profile the CodeGen.SaveSymbols calls.
10739
10740 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
10741
10742         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
10743         Remove the gratuitous set of Final:
10744
10745                                 // If an interface implementation, then we can set Final.
10746                                 if (((flags & MethodAttributes.Abstract) == 0) &&
10747                                     implementing.DeclaringType.IsInterface)
10748                                         flags |= MethodAttributes.Final;
10749
10750         I do not know what I was smoking when I used that.
10751
10752
10753         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
10754         step into fixing the name resolution issues for delegates and
10755         unifying the toplevel name resolution.
10756
10757 2002-03-28  Martin Baulig  <martin@gnome.org>
10758
10759         * class.cs (Method.Emit): If we have a symbol writer, call its
10760         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
10761         tell it about the current method.
10762
10763         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
10764         writer that we're going to emit the first byte of IL code for a new
10765         statement (a new source line).
10766         (EmitContext.EmitTopBlock): If we have a symbol writer, call
10767         EmitContext.Mark() before emitting any code.
10768
10769         * location.cs (SymbolDocument): Return null when we're Null.
10770
10771         * statement.cs (Statement): Moved the `Location loc' variable here.
10772         (Statement.EmitBoolExpression): If we have a symbol writer, call
10773         ec.Mark() before emitting any code to tell it that we're at the
10774         beginning of a new statement.
10775         (StatementExpression): Added `Location' argument to the constructor.
10776         (Block): Added public readonly variable `StartLocation' and public
10777         variable `EndLocation'.  The latter is to be set using SetEndLocation().
10778         (Block): Added constructor which takes a start and end location.
10779         (Block.SetEndLocation): New method. This sets the end location.
10780         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
10781         local variables we create.
10782         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
10783         each statement and do also mark the begin and end of the block.
10784
10785         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
10786         tell it the current lexer.Location, use Location.Null for the end of the
10787         block.
10788         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
10789         current block, set its end location using SetEndLocation().
10790         (statement_expression): StatementExpression constructor now takes the
10791         lexer.Location as additional argument.
10792         (for_statement, declare_local_variables): Likewise.
10793         (declare_local_variables): When creating a new implicit block, use the
10794         new Block constructor and pass it the lexer.Location.
10795
10796 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
10797
10798         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
10799         members also on the parent interfaces recursively.
10800
10801 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
10802
10803         * report.cs: Use new formats, since Gonzalo finished the missing
10804         bits. 
10805
10806         * expression.cs (Binary.ResolveOperator): added missing operator|
10807         operator& and operator^ for bool/bool.
10808
10809         * cs-parser.jay: CheckDef now takes a Location argument that is
10810         used to report errors more precisly (instead of reporting the end
10811         of a definition, we try to track something which is a lot closer
10812         to the source of the problem).
10813
10814         * cs-tokenizer.cs: Track global token use, so we can properly flag
10815         the use of #define/#undef after the first token has been seen.
10816
10817         Also, rename the reportXXXX to Error_DescriptiveName
10818
10819         * decl.cs (DeclSpace.IsTopLevel): Move property here from
10820         TypeContainer, so that Enum and Interface can use this too.
10821
10822         * class.cs (TypeContainer.LookupInterfaceOrClass,
10823         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
10824         `builder' argument.  Typically this was used to pass the parent
10825         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
10826         the definition).  
10827
10828         The problem is that a nested class could trigger the definition of
10829         a toplevel class, and the builder would be obviously wrong in that
10830         case. 
10831
10832         So we drop this argument, and we compute dynamically the
10833         TypeBuilder/ModuleBuilder (the correct information was available
10834         to us anyways from DeclSpace.Parent)
10835
10836         * interface.cs (Interface.DefineInterface): Drop builder
10837         parameter cleanup like class.cs
10838
10839         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
10840         like class.cs
10841
10842         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
10843         values. 
10844
10845         (Try.Emit): Propagate the returns value from the statement.
10846
10847         (Return.Emit): Even if we are leavning 
10848
10849         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
10850
10851         * modifiers.cs: Fix the computation of MethodAttributes flags.
10852
10853 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
10854
10855         * driver.cs: allow compilation of files that start with '/'.
10856         Add a default case when checking the argument of --target.
10857
10858 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
10859
10860         * interface.cs: Implement the same search algorithm for types in
10861         the interface code.
10862
10863         * delegate.cs: Do not allow multiple definition.
10864
10865         * Recovered ChangeLog that got accidentally amputated
10866
10867         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
10868
10869         * rootcontext.cs: Load manually enum to allow core classes to
10870         contain enumerations.
10871
10872         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
10873         Update to new static methods in TypeManager.
10874
10875         * typemanager.cs (GetMethod, GetConstructor): Use our
10876         implementation of FindMembers to find the members, since during
10877         corlib compilation, the types are TypeBuilders and GetMethod and
10878         GetConstructor do not work.
10879
10880         Make all methods in TypeManager static.
10881
10882         (InitCodeHelpers): Split the functionality from
10883         the InitCodeTypes function.
10884
10885         * driver.cs: Call InitCodeHelpers after we have populated the
10886         types. 
10887
10888         * cs-parser.jay (delegate_declaration): we did not used to compute
10889         the delegate name correctly for void delegates.
10890
10891 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
10892
10893         * rootcontext.cs (RootContext): Init the interface_resolve_order
10894         and type_container_resolve_order always.
10895
10896         (ResolveCore, BootstrapCorlib_ResolveClass,
10897         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
10898         compiler when compiling with --nostdlib
10899
10900         * class.cs (TypeContainer.DefineType): Check that our parent is
10901         not null.  This test is most important when we are bootstraping
10902         the core types.
10903
10904         * codegen.cs: Split out the symbol writing code.
10905
10906 2002-03-25  Martin Baulig  <martin@gnome.org>
10907
10908         * driver.cs (-g): Made -g an alias for --debug.
10909
10910 2002-03-24  Martin Baulig  <martin@gnome.org>
10911
10912         * codegen.cs (SymbolWriter): New public variable. Returns the
10913         current symbol writer.
10914         (CodeGen): Added `bool want_debugging_support' argument to the
10915          constructor. If true, tell the ModuleBuild that we want debugging
10916         support and ask it for the ISymbolWriter.
10917         (Save): If we have a symbol writer, call it's Close() method after
10918         saving the assembly.
10919
10920         * driver.c (--debug): New command line argument to create a
10921         debugger information file.
10922
10923         * location.cs (SymbolDocument): New public property. Returns an
10924         ISymbolDocumentWriter object for the current source file or null
10925         if we don't have a symbol writer.
10926
10927 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
10928
10929         * driver.cs (LoadAssembly): Correctly return when all the paths
10930         have been tried and not before.
10931
10932         * statement.cs (Switch.Emit): return the actual coverage for this
10933         statement (returns/not-returns)
10934
10935         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
10936         switch of the statement if we are the last switch section.  That
10937         kills two problems: try/catch problems (we used to emit an empty
10938         nop at the end) and switch statements where all branches would
10939         return. 
10940
10941 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
10942
10943         * driver.cs: Add default assemblies (the equivalent to the
10944         Microsoft CSC.RSP file)
10945
10946         * cs-tokenizer.cs: When updating `cols and setting it to zero,
10947         also update tokens_seen and set it to false.
10948
10949         * driver.cs: Implement --recurse for Mike.
10950
10951         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
10952         correctly splitting out the paths.
10953
10954 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
10955
10956         * interface.cs (Interface.PopulateProperty): Instead of using
10957         `parent' as the declaration space for the set parameters, use
10958         `this' 
10959
10960         * support.cs (InternalParameters): InternalParameters constructor
10961         takes a DeclSpace instead of a TypeContainer.
10962
10963         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
10964         types are being initialized, load the address of it before calling
10965         the function.  
10966
10967         (New): Provide a mechanism to disable the generation of local
10968         value type temporaries when the caller will be providing us with
10969         an address to store it.
10970
10971         (ArrayCreation.EmitDynamicInitializers): Use it.
10972
10973 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
10974
10975         * expression.cs (Invocation.EmitArguments): Only probe for array
10976         property if there is more than one argument.  Sorry about that.
10977
10978         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
10979         empty param arrays.
10980
10981         * class.cs (Method.LabelParameters): Fix incorrect code path that
10982         prevented the `ParamArrayAttribute' from being applied to the
10983         params attribute.
10984
10985 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
10986
10987         * support.cs (ReflectionParameters): Correctly compute whether the
10988         last argument is a params array.  Fixes the problem with
10989         string.Split ('a')
10990
10991         * typemanager.cs: Make the assemblies array always be non-null
10992         (empty, but non-null)
10993
10994         * tree.cs (RecordDecl): New function that abstracts the recording
10995         of names.  This reports error 101, and provides a pointer to the
10996         previous declaration.  Fixes a crash in the compiler.
10997
10998         * cs-parser.jay (constructor_declaration): Update to new grammar,
10999         and provide a constructor_body that can be empty.
11000
11001 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
11002
11003         * driver.cs: Add support for --resources.
11004
11005         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
11006         Make all types for the various array helper methods be integer.
11007
11008         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
11009         CheckState to ConvCast.
11010
11011         (ConvCast): Now it takes a `checked' state argument, to avoid
11012         depending on the emit context for the conversion, and just using
11013         the resolve time setting.
11014
11015         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
11016         instead of Invocation.EmitArguments.  We do not emit the original
11017         arguments, instead we emit those which have been converted to
11018         unsigned int expressions.
11019
11020         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
11021
11022         * codegen.cs: ditto.
11023
11024         * expression.cs (LocalVariableReference): Drop the use of the
11025         Store function that depended on the variable index.
11026
11027         * statement.cs (VariableInfo): Drop the `Idx' property from this
11028         class, as this is not taking into account the indexes for
11029         temporaries tat we generate during the execution, getting the
11030         indexes wrong.
11031
11032         * class.cs: First emit class initializers, then call the parent
11033         constructor. 
11034
11035         * expression.cs (Binary): Fix opcode emision.
11036         (UnaryMutator.EmitCode): Support checked code generation
11037
11038         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
11039         matches for events for both the Static and Instance scans,
11040         pointing to the same element.   Fix that.
11041
11042 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * rootcontext.cs (ResolveTree): Always set the
11045         interface_resolve_order, because nested interfaces will be calling
11046         into us.
11047
11048         * class.cs (GetInterfaceOrClass): Track the same resolution
11049         process used by TypeManager.LookupType.  This fixes the nested
11050         type lookups in class declarations (separate path from
11051         LookupType). 
11052
11053         (TypeContainer.DefineType): Also define nested interfaces.
11054         (TypeContainer.RegisterOrder): New public function used to
11055         register the order in which child interfaces need to be closed.
11056
11057         Nested interfaces need to be closed after their parents have been
11058         created. 
11059
11060         * interface.cs (InterfaceAttr): Put all the logic for computing
11061         the interface attribute here. 
11062
11063         (DefineInterface): Register our interface order with the
11064         RootContext or with the TypeContainer depending on the case.
11065
11066 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11067
11068         * cs-parser.jay: rework foreach statement to work with the new
11069         changes to the policy on SimpleNames.
11070
11071         * report.cs: support Stacktrace on warnings as well.
11072
11073         * makefile: drop --unsafe and /unsafe from the compile.
11074
11075 2002-03-13  Ravi Pratap  <ravi@ximian.com>
11076
11077         * ecore.cs (StandardConversionExists): Modify to take an Expression
11078         as the first parameter. Ensure we do null -> reference type conversion
11079         checking.
11080
11081         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
11082         temporary Expression objects.
11083
11084 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
11085
11086         * interface.cs: workaround bug in method overloading resolution
11087         (there is already a bugzilla bug for it).
11088
11089 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
11090
11091         We could also solve this problem by having a separate path for
11092         performing type lookups, instead of DoResolve, we could have a
11093         ResolveType entry point, and only participating pieces of the
11094         production (simplename, deref, array) would implement this. 
11095
11096         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
11097         signal SimpleName to only resolve type names and not attempt to
11098         resolve anything else.
11099
11100         * expression.cs (Cast): Set the flag.
11101
11102         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
11103
11104         * class.cs: Only report 108 if there is no `new' modifier.
11105
11106         * cs-parser.jay: rework foreach statement to work with the new
11107         changes to the policy on SimpleNames.
11108
11109         * report.cs: support Stacktrace on warnings as well.
11110
11111         * makefile: drop --unsafe and /unsafe from the compile.
11112
11113 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
11114
11115         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11116         lookups here, instead of doing that at parse time.  This means
11117         that our grammar will not introduce `LocalVariableReferences' as
11118         expressions at this point.  That solves the problem of code like
11119         this:
11120
11121         class X {
11122            static void Main ()
11123            { int X = 1;
11124             { X x = null }}}
11125
11126         This is only half the fix.  The full fix requires parameters to
11127         also be handled in this way.
11128
11129         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
11130         makes the use more obvious of the DeclSpace.  The
11131         ec.TypeContainer.TypeBuilder is now only used to pull the
11132         TypeBuilder for it.
11133
11134         My theory is that I can get rid of the TypeBuilder completely from
11135         the EmitContext, and have typecasts where it is used (from
11136         DeclSpace to where it matters).  
11137
11138         The only pending problem is that the code that implements Aliases
11139         is on TypeContainer, and probably should go in DeclSpace.
11140
11141         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
11142         lookups here, instead of doing that at parse time.  This means
11143         that our grammar will not introduce `LocalVariableReferences' as
11144         expressions at this point.  That solves the problem of code like
11145         this:
11146
11147         class X {
11148            static void Main ()
11149            { int X = 1;
11150             { X x = null }}}
11151
11152         This is only half the fix.  The full fix requires parameters to
11153         also be handled in this way.
11154
11155         * class.cs (Property.DefineMethod): When implementing an interface
11156         method, set newslot, when implementing an abstract method, do not
11157         set the flag (before we tried never setting it, or always setting
11158         it, which is the difference).
11159         (Indexer.DefineMethod): same.
11160         (Method.DefineMethod): same.
11161
11162         * ecore.cs: Only set the status used flag if we get back a Field.
11163
11164         * attribute.cs: Temporary hack, so Paolo can keep working.
11165
11166 2002-03-08  Ravi Pratap  <ravi@ximian.com>
11167
11168         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
11169         the unmanaged type in the case we have a MarshalAs attribute.
11170
11171         (Resolve): Handle the case when we are parsing the special MarshalAs
11172         attribute [we need to store the unmanaged type to use later]
11173
11174         * typemanager.cs (marshal_as_attr_type): Built in type for the 
11175         MarshalAs Attribute.
11176
11177         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
11178         on parameters and accordingly set the marshalling info.
11179
11180 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
11181
11182         * class.cs: Optimizing slightly by removing redundant code after
11183         we switched to the `NoTypes' return value.
11184         (Property.DefineMethod): use NoTypes here too.
11185
11186         This fixes the bug I introduced in my last batch of changes.
11187
11188 2002-03-05  Ravi Pratap  <ravi@ximian.com>
11189
11190         * tree.cs (RecordEnum): Add. We now keep track of enums too.
11191
11192         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
11193         Enums since those are types too. 
11194
11195         * cs-parser.jay (enum_declaration): Record enums as we parse them.
11196
11197         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
11198         thanks to a call during the lookup process.
11199
11200 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
11201
11202         * statement.cs (Foreach): Lots of work to accomodate a particular
11203         kind of foreach statement that I had not kept in mind.  It is
11204         possible to have foreachs on classes that provide a GetEnumerator
11205         method that return objects that implement the "pattern" for using
11206         a foreach, there is no need to support GetEnumerator
11207         specifically. 
11208
11209         This is needed to compile nant.
11210
11211         * decl.cs: Only report 114 if the member is not `Finalize' and if
11212         the warning level is at least 2.
11213
11214         * class.cs: Moved the compare function from Method to
11215         MethodSignature. 
11216
11217         (MethodSignature.InheritableMemberSignatureCompare): Add new
11218         filter function that is used to extract inheritable methods from a
11219         class. 
11220
11221         (Method.Define): Use the new `inheritable_method_signature_filter'
11222         delegate
11223
11224         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
11225         command. 
11226
11227 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
11228
11229         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
11230
11231         * cs-parser.jay: Add opt_semicolon to the interface declaration.
11232
11233         * expression.cs: Pass location information to
11234         ConvertImplicitStandard. 
11235
11236         * class.cs: Added debugging code to track return values from
11237         interfaces. 
11238
11239 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
11240
11241         * expression.cs (Is.DoResolve): If either side of the `is' is an
11242         interface, do not flag the warning.
11243
11244         * ecore.cs (ImplicitReferenceConversion): We need a separate test
11245         for interfaces
11246
11247         * report.cs: Allow for --fatal to be used with --probe.
11248
11249         * typemanager.cs (NoTypes): Move the definition for the empty Type
11250         array here. 
11251
11252         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
11253         properties. 
11254         (TypeContainer.DefineProxy): New function used to proxy to parent
11255         implementations when implementing interfaces.
11256         (TypeContainer.ParentImplements): used to lookup if our parent
11257         implements a public function that is required by an interface.
11258         (TypeContainer.VerifyPendingMethods): Hook this up.
11259
11260         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
11261         `modules' and `assemblies' arraylists into arrays.  We only grow
11262         these are the very early start up of the program, so this improves
11263         the speedof LookupType (nicely measured).
11264
11265         * expression.cs (MakeByteBlob): Replaced unsafe code with
11266         BitConverter, as suggested by Paolo.
11267
11268         * cfold.cs (ConstantFold.Binary): Special case: perform constant
11269         folding of string concatenation, but if either side is a string,
11270         and the other is not, then return null, and let the runtime use
11271         the concatenation on the string plus the object (using
11272         `Object.ToString'). 
11273
11274 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
11275
11276         Constant Folding has been implemented now.
11277
11278         * expression.cs (Unary.Reduce): Do not throw an exception, catch
11279         the error instead on types that are not supported in one's
11280         complement. 
11281
11282         * constant.cs (Constant and all children): New set of functions to
11283         perform implict and explicit conversions.
11284
11285         * ecore.cs (EnumConstant): Implement the new functions to perform
11286         conversion by proxying to the child expression.
11287
11288         * codegen.cs: (ConstantCheckState): Constant evaluation has its
11289         own separate setting that can not be turned off from the command
11290         line using --unchecked or --checked and is only controlled using
11291         the checked/unchecked statements and expressions.  This setting is
11292         used by the constant folder to flag errors.
11293
11294         * expression.cs (CheckedExpr, UncheckedExpr): Set the
11295         ConstantCheckState as well.   
11296
11297         During Resolve, they also have to flag the state, because the
11298         constant folder runs completely in the Resolve phase.
11299
11300         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
11301         well.
11302
11303 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
11304
11305         * cfold.cs: New file, this file contains the constant folder.
11306
11307         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
11308         argument to track whether we are using the resulting address to
11309         load or store a value and provide better error messages. 
11310
11311         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
11312         new AddressOf arguments.
11313
11314         * statement.cs (Foreach.EmitCollectionForeach): Update
11315
11316         * expression.cs (Argument.Emit): Call AddressOf with proper
11317         arguments to track usage.
11318
11319         (New.DoEmit): Call AddressOf with new arguments.
11320
11321         (Unary.Emit): Adjust AddressOf call.
11322
11323 2002-03-01  Ravi Pratap  <ravi@ximian.com>
11324
11325         * cs-parser.jay (member_access): Change the case for pre-defined types
11326         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
11327         this suggestion.
11328
11329         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
11330         a method body.
11331
11332         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
11333         essentially like methods and apply attributes like MethodImplOptions to them too.
11334
11335         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
11336         not being null.
11337
11338         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
11339         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
11340         is the DeclSpace.
11341
11342         * Update code everywhere accordingly.
11343
11344         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
11345
11346         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
11347
11348 2002-02-28  Ravi Pratap  <ravi@ximian.com>
11349
11350         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
11351         try performing lookups against those instead of jumping straight into using
11352         the 'using' clauses.
11353
11354         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
11355
11356         (LookupType): Perform lookups in implicit parents too.
11357
11358         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
11359         sequence as RootContext.LookupType. 
11360
11361         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
11362         the various cases of namespace lookups into this method.
11363
11364 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
11365
11366         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
11367         in positional arguments)
11368
11369         * class.cs (Operator): Update the AllowedModifiers to contain
11370         extern. 
11371
11372         * cs-parser.jay: Update operator declaration to allow for the
11373         operator body to be empty.
11374
11375         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
11376         values. 
11377
11378 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
11379
11380         * class.cs (Method.Emit): Label parameters.
11381
11382         * driver.cs: Return 1 or 0 as the program exit code.
11383
11384 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
11385
11386         * expression.cs: Special case the `null' object when trying to
11387         auto-compute the type, as anything can be explicitly converted to
11388         that. 
11389
11390         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
11391         spotting this Paolo.
11392
11393         (Expression.ImplicitNumericConversion): Perform comparissions of
11394         the type using the underlying type in the case of an enumeration
11395         rather than using the enumeration type for the compare.
11396
11397         Cope with the underlying == type case, which is not possible to
11398         catch before. 
11399
11400         (Expression.ConvertNumericExplicit): Perform comparissions of
11401         the type using the underlying type in the case of an enumeration
11402         rather than using the enumeration type for the compare.
11403
11404         * driver.cs: If the user does not supply an extension, assume .exe
11405
11406         * cs-parser.jay (if_statement): Rewrote so that we can track the
11407         location for the if statement.
11408
11409         * expression.cs (Binary.ConstantFold): Only concat strings when
11410         the operation is "+", not everything ;-)
11411
11412         * statement.cs (Statement.EmitBoolExpression): Take a location
11413         argument. 
11414         (If, While, Do): Track location.
11415
11416         * expression.cs (Binary.ResolveOperator): In the object + string
11417         case, I was missing a call to ConvertImplicit
11418
11419 2002-02-25  Ravi Pratap  <ravi@ximian.com>
11420
11421         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
11422         Location arguments. Ensure we use RootContext.LookupType to do our work
11423         and not try to do a direct Type.GetType and ModuleBuilder.GetType
11424
11425         * interface.cs (PopulateMethod): Handle the type of the parameter being
11426         null gracefully.
11427
11428         * expression.cs (Invocation.BetterFunction): Handle the case when we 
11429         have a params method with no fixed arguments and a call is made with no
11430         arguments.
11431
11432 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
11433
11434         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
11435         the verbatim-string-literal
11436
11437         * support.cs (InternalParameters.ParameterModifier): handle null
11438         fixed parameters.
11439         (InternalParameters.ParameterType): ditto.
11440
11441         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
11442         duplicating the name of the variable parameter.
11443         (GetParameterByName): Fix bug where we were not looking up array
11444         paramters if they were the only present (thanks Paolo!).
11445         (GetParameterInfo): We only have an empty set of types if both
11446         fixed and array are set to null.
11447         (GetParameterInfo-idx): Handle FixedParameter == null
11448
11449         * cs-parser.jay: Handle the case where there is no catch
11450         statements (missing null test).
11451
11452 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
11453
11454         * driver.cs (MainDriver): Be conservative on our command line
11455         handling.
11456
11457         Catch DirectoryNotFoundException when calling GetFiles.
11458
11459         (SplitPathAndPattern): Used to split the input specification into
11460         a path and a pattern that we can feed to Directory.GetFiles.
11461
11462 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
11463
11464         * statement.cs (Fixed): Implement the last case of the Fixed
11465         statement (string handling).
11466
11467         * expression.cs (StringPtr): New class used to return a char * to
11468         a string;  Used by the Fixed statement.
11469
11470         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
11471
11472         * expression.cs (Binary.ResolveOperator): Remove redundant
11473         MemberLookup pn parent type.
11474         Optimize union call, we do not need a union if the types are the same.
11475         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
11476         type.
11477
11478         Specialize the use of MemberLookup everywhere, instead of using
11479         the default settings. 
11480
11481         (StackAlloc): Implement stackalloc keyword.
11482
11483         * cs-parser.jay: Add rule to parse stackalloc.
11484
11485         * driver.cs: Handle /h, /help, /?
11486
11487         * expression.cs (MakeByteBlob): Removed the hacks we had in place
11488         before we supported unsafe code.
11489
11490         * makefile: add --unsafe to the self compilation of mcs.
11491
11492 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
11493
11494         * expression.cs (PointerArithmetic): New class that is used to
11495         perform pointer arithmetic.
11496         (Binary.Resolve): Handle pointer arithmetic
11497         Handle pointer comparission.
11498         (ArrayPtr): Utility expression class that is used to take the
11499         address of an array.
11500
11501         (ElementAccess): Implement array access for pointers
11502
11503         * statement.cs (Fixed): Implement fixed statement for arrays, we
11504         are missing one more case before we are done.
11505
11506         * expression.cs (Indirection): Implement EmitAssign and set the
11507         ExprClass to Variable.  This allows pointer dereferences to be
11508         treated as variables, and to have values assigned to them.
11509
11510         * ecore.cs (Expression.StoreFromPtr): New utility function to
11511         store values dereferencing.
11512
11513 2002-02-20  Ravi Pratap  <ravi@ximian.com>
11514
11515         * expression.cs (Binary.ResolveOperator): Ensure that we are
11516         not trying to operate on a void type - this fixes the reported
11517         bug.
11518
11519         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
11520         the parent implementation is sealed.
11521
11522         * ../errors/cs0239.cs : Add.
11523
11524         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
11525
11526         * typemanager.cs (unverifiable_code_type): Corresponds to 
11527         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
11528         which have unsafe code in them.
11529
11530         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
11531         unsafe context.
11532
11533 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
11534
11535         * cs-tokenizer.cs: Add support for @"litreal strings"
11536
11537         Make tokenizer accept pre-processor directives
11538         on any column (remove the old C-like limitation). 
11539
11540         * rootcontext.cs (EmitCode): Emit any global attributes.
11541         (AddGlobalAttributes): Used to keep track of assembly attributes. 
11542
11543         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
11544
11545         * cs-parser.jay: Add support for global attributes.  
11546
11547 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
11548
11549         * expression.cs (Indirection): New helper class.  Unary will
11550         create Indirection classes to be able to implement the
11551         IMemoryLocation interface on it.
11552
11553 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
11554
11555         * cs-parser.jay (fixed_statement): reference the right statement.
11556
11557         * statement.cs (Fixed.Emit): Finish implementing the fixed
11558         statement for the &x case.
11559
11560 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
11561
11562         * class.cs (Property.Define, Method.Define): Remove newslot when
11563         `implementing'.  
11564
11565         * modifiers.cs: My use of NewSlot when `Abstract' was set was
11566         wrong.  NewSlot should only be used if the `new' keyword is present.
11567
11568         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
11569         locating our system dir.  Sorry about this.
11570
11571 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
11572
11573         * driver.cs (GetSystemDir): Compute correctly the location of our
11574         system assemblies.  I was using the compiler directory instead of
11575         the library directory.
11576
11577 2002-02-13  Ravi Pratap  <ravi@ximian.com>
11578
11579         * expression.cs (BetterFunction): Put back in what Miguel commented out
11580         since it is the correct fix. The problem is elsewhere ;-)
11581
11582         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
11583         parameters of the parms method are themselves compatible or not !
11584
11585         (StandardConversionExists): Fix very dangerous bug where we were forgetting
11586         to check that a class implements an interface before saying that an implicit
11587         conversion was allowed. Use ImplementsInterface to do the checking.
11588
11589 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
11590
11591         * class.cs (Method.Define): Track whether we are an explicit
11592         implementation or not.  And only call DefineMethodOverride if we
11593         are an explicit implementation.
11594
11595         (Property.DefineMethod): Ditto.
11596
11597 2002-02-11  Ravi Pratap  <ravi@ximian.com>
11598
11599         * expression.cs (BetterFunction): Catch hideous bug which was
11600          preventing us from detecting ambiguous calls due to implicit casts i.e
11601         cs0121.
11602
11603 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
11604
11605         * support.cs (Pair): Remove un-needed method.  I figured why I was
11606         getting the error in cs-parser.jay, the variable in a foreach loop
11607         is readonly, and the compiler does not really treat this as a variable.
11608
11609         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
11610         instead of EQUALS in grammar.  
11611
11612         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
11613
11614         * expression.cs (Unary.DoResolve): Check whether the argument is
11615         managed or not.
11616
11617 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
11618
11619         * support.cs: Api for Pair to set a value.  Despite the fact that
11620         the variables are public the MS C# compiler refuses to compile
11621         code that accesses the field if the variable is part of a foreach
11622         statement. 
11623
11624         * statement.cs (Fixed): Begin implementation of the fixed
11625         statement.
11626
11627         (Block.AddVariable): Return the VariableInfo on success and null
11628         on failure instead of true/false. 
11629
11630         * cs-parser.jay (foreach): Catch errors on variables already
11631         defined (we were ignoring this value before) and properly unwind
11632         the block hierarchy
11633
11634         (fixed_statement): grammar for the fixed statement.
11635
11636 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
11637
11638         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
11639         pointer types to be incretemented.
11640
11641         (SizeOf): Implement.
11642
11643         * cs-parser.jay (pointer_member_access): Implement
11644         expr->IDENTIFIER production.
11645
11646         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
11647         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
11648         on safe contexts.
11649
11650         (Unary): Implement indirection.
11651
11652         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
11653         use in non-unsafe context).
11654
11655         (SimpleName.DoResolve): Check for pointers in field access on safe
11656         contexts. 
11657
11658         (Expression.LoadFromPtr): Factor the load-indirect code in this
11659         function.  This was duplicated in UnboxCast and ParameterReference
11660
11661 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
11662
11663         * expression.cs (ComposedCast): report an error if a pointer cast
11664         is used in a safe region.
11665
11666         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
11667         pointer type casts in unsafe context.
11668
11669         * codegen.cs (EmitContext): Set up IsUnsafe.
11670
11671         * cs-parser.jay (non_expression_type): Add productions for pointer
11672         casts. 
11673
11674         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
11675         code.  We should not use force into static mode if the method is
11676         not virtual.  Fixes bug in MIS
11677
11678         * statement.cs (Do.Emit, While.Emit, For.Emit,
11679         Statement.EmitBoolExpression): Add support to Do and While to
11680         propagate infinite loop as `I do return' semantics.
11681
11682         Improve the For case to also test for boolean constants.
11683
11684         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
11685         to the list of attributes we can add.
11686
11687         Remove `EmitContext' argument.
11688
11689         * class.cs (Method.Define): Apply parameter attributes.
11690         (Constructor.Define): Apply parameter attributes.
11691         (MethodCore.LabelParameters): Move here the core of labeling
11692         parameters. 
11693
11694         * support.cs (ReflectionParameters.ParameterModifier,
11695         InternalParameters.ParameterModifier): Use IsByRef on the type and
11696         only return the OUT bit for these parameters instead of in/out/ref
11697         flags.
11698
11699         This is because I miss-understood things.  The ParameterInfo.IsIn
11700         and IsOut represent whether the parameter has the [In] and [Out]
11701         attributes set.  
11702
11703 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
11704
11705         * ecore.cs (FieldExpr.Emit): Release temporaries.
11706
11707         * assign.cs (LocalTemporary.Release): new function.
11708
11709         * codegen.cs (EmitContext.GetTemporaryStorage,
11710         EmitContext.FreeTemporaryStorage): Rework the way we deal with
11711         temporary storage.  Now we can "put back" localbuilders when we
11712         are done with them
11713
11714 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
11715
11716         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
11717         need to make a copy of the variable to generate verifiable code.
11718
11719 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
11720
11721         * driver.cs: Compute dynamically the system directory.
11722
11723         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
11724         Slower, but more generally useful.  Used by the abstract
11725         registering implementation. 
11726
11727         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
11728         the rules for the special rule on Type/instances.  First check if
11729         we have the same name, and if so, try that special static path
11730         rather than the instance path.
11731
11732 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
11733
11734         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
11735         for, while and if.
11736
11737         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
11738         Enum, ValueType, Delegate or Array for non-corlib compiles.
11739
11740         * cs-tokenizer.cs: Catch long identifiers (645)
11741
11742         * typemanager.cs (IndexerPropetyName): Ravi never tested this
11743         piece of code.
11744
11745         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
11746         fix, we were returning too early, so we were not registering
11747         pending methods from abstract classes.
11748
11749         Do not register pending methods if the class is abstract.
11750
11751         * expression.cs (Conditional.DoResolve): Report circular implicit
11752         conversions when we neecd to compute it for conditional
11753         expressions. 
11754
11755         (Is.DoResolve): If the expression is always of the provided type,
11756         flag warning 183.  If the expression can not ever be of the
11757         provided type flag warning 184.
11758
11759         * class.cs: Catch 169 as well.
11760
11761         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
11762         read. 
11763
11764 2002-01-18  Nick Drochak  <ndrochak@gol.com>
11765
11766         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
11767
11768 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
11769
11770         * interface.cs: (PopulateMethod): Check for pointers being defined
11771         only if the unsafe context is active.
11772         (PopulateProperty): ditto.
11773         (PopulateIndexer): ditto.
11774
11775         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
11776         specified.  If pointers are present, make sure that they are
11777         present in an unsafe context.
11778         (Constructor, Constructor.Define): ditto.
11779         (Field, Field.Define): ditto.
11780         (Property, Property.Define): ditto.
11781         (Event, Event.Define): ditto.
11782
11783         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
11784         hashtable if there are classes or structs defined.
11785
11786         * expression.cs (LocalVariableReference.DoResolve): Simplify this
11787         code, as the constant resolution moved.
11788
11789         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
11790         the metadata, so we can flag error 133. 
11791
11792         * decl.cs (MemberCore.UnsafeOK): New function to test that a
11793         pointer is being declared in an unsafe context.
11794
11795 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
11796
11797         * modifiers.cs (Modifiers.Check): Require a Location argument.
11798         Report error 227 for Unsafe use.
11799
11800         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
11801
11802         * statement.cs (For.Emit): If the test is null, then report that
11803         we do `return', as we wont reach anything afterwards.
11804
11805         (Switch.SwitchGoverningType): Track the expression that matched
11806         the conversion.
11807
11808         * driver.cs: Allow negative numbers as an error code to flag.
11809
11810         * cs-parser.jay: Handle 1551.
11811
11812         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
11813
11814 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
11815
11816         * cs-parser.jay: Report 1518 (type declaration can only contain
11817         class, struct, interface, enum or delegate)
11818
11819         (switch_label): Report 1523 (keywords `case' or `default' must
11820         preced code)
11821
11822         (opt_switch_sections): Report 1522 (empty switch)
11823
11824         * driver.cs: Report 1515 (response file specified multiple times)
11825         Report 1516 (Source file specified multiple times).
11826
11827         * expression.cs (Argument.Resolve): Signal 1510
11828
11829         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
11830         access not allowed in static code)
11831
11832 2002-01-11  Ravi Pratap  <ravi@ximian.com>
11833
11834         * typemanager.cs (IsPointerType): Utility method which we are going
11835         to need a lot.
11836
11837         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
11838         the object type, so we take care of that.
11839
11840         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
11841
11842         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
11843         added to non-params parameters :-)
11844
11845         * typemanager.cs (CSharpName): Include 'void' type too. 
11846
11847         (void_ptr_type): Include in the set of core types.
11848
11849         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
11850         duplicating code.
11851
11852         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
11853         an unsafe context.
11854
11855         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
11856         completely forgotten about it.
11857
11858 2002-01-10  Ravi Pratap  <ravi@ximian.com>
11859
11860         * cs-parser.jay (pointer_type): Add. This begins our implementation
11861         of parsing rules for unsafe code.
11862
11863         (unsafe_statement): Implement.
11864
11865         (embedded_statement): Modify to include the above.
11866
11867         * statement.cs (Unsafe): Implement new class for unsafe blocks.
11868
11869         * codegen.cs (EmitContext.InUnsafe): Add. This determines
11870         if the current context is an unsafe one.
11871
11872         * cs-parser.jay (local_variable_pointer_type): Since local variable types
11873         are handled differently, we need separate rules for them.
11874
11875         (local_variable_declaration): Update to use local_variable_pointer_type
11876         to allow variable declarations of unmanaged pointer types.
11877
11878         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
11879         in unsafe contexts.
11880
11881         * ../errors/cs0214.cs : Add.
11882
11883 2002-01-16  Nick Drochak  <ndrochak@gol.com>
11884
11885         * makefile: remove 'response' file when cleaning.
11886
11887 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
11888
11889         * cs-parser.jay: Report 1524.
11890
11891 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
11892
11893         * typemanager.cs (RegisterMethod): drop checking if we have
11894         registered this from here
11895
11896 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
11897
11898         * class.cs (Method.EmitDestructor): Implement calling our base
11899         destructor. 
11900
11901         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
11902         value of InFinally.
11903
11904         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
11905         this routine and will wrap the call in a try/catch block.  Deal
11906         with the case.
11907
11908 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
11909
11910         * ecore.cs (Expression.MemberLookup): instead of taking a
11911         parameter `same_type' that was used to tell whether we could
11912         access private members we compute our containing type from the
11913         EmitContext.
11914
11915         (FieldExpr): Added partial support for volatile fields.  This does
11916         not work for volatile fields exposed from assemblies, as I can not
11917         figure out how to extract the modreq from it.
11918
11919         Updated all the source files to use this.
11920
11921         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
11922         because it is referenced by MemberLookup very often. 
11923
11924 2002-01-09  Ravi Pratap  <ravi@ximian.com>
11925
11926         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
11927         TypeBuilder.GetCustomAttributes to retrieve what we need.
11928
11929         Get rid of redundant default_member_attr_type as this is the same as
11930         default_member_type which already exists.
11931
11932         * interface.cs, attribute.cs : Update accordingly.
11933
11934 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
11935
11936         * typemanager.cs: Enable IndexerPropertyName again.  It does not
11937         work for TYpeBuilders though.  Ravi, can you please fix this?
11938
11939         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
11940
11941         * expression.cs (Argument.Emit): Handle the case of ref objects
11942         being passed to ref functions;  
11943
11944         (ParameterReference.EmitLoad): Loads the content of the pointer
11945         without dereferencing.
11946
11947 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
11948
11949         * cs-tokenizer.cs: Implemented the pre-processing expressions.
11950
11951 2002-01-08  Ravi Pratap  <ravi@ximian.com>
11952
11953         * class.cs (Indexer.DefineMethod): Incorporate the interface
11954         type in the name of the method if we are doing explicit interface
11955         implementation.
11956
11957         * expression.cs (ConversionExists): Remove as it is completely obsolete.
11958
11959         (BetterConversion): Fix extremely trivial bug where we were referring to
11960         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
11961         again !
11962
11963         * ../errors/bug16.cs : Add although we have fixed it.
11964
11965 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
11966
11967         * expression.cs (BaseIndexer): Begin implementation.
11968
11969         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
11970
11971         * cs-parser.jay (indexer_declarator): Use qualified_identifier
11972         production directly to remove a shift/reduce, and implement
11973         explicit interface implementation.
11974
11975         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
11976         after a floating point suffix.
11977
11978         * expression.cs (DoNumericPromotions): Improved the conversion for
11979         uint/uint.  If we have a constant, we avoid doing a typecast to a
11980         larger type.
11981
11982         * class.cs (Indexer): Implement explicit interface implementation
11983         for indexers.
11984
11985 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
11986
11987         * class.cs: make the default instance constructor public and hidebysig.
11988
11989 2001-01-03  Ravi Pratap  <ravi@ximian.com>
11990
11991         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
11992         so we can call it from elsewhere.
11993
11994         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
11995         we emit it internally if the class has a defined indexer; otherwise the user
11996         emits it by decorating the class definition with the DefaultMemberAttribute.
11997
11998         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
11999         attribute is not used on a type which defines an indexer.
12000
12001         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
12002         character when we skip whitespace.
12003
12004         * ../errors/cs0646.cs : Add.
12005
12006 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
12007
12008         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
12009         again. 
12010
12011         * makefile: Add practical target `mcs3.exe' which builds the third
12012         generation compiler. 
12013
12014         * expression.cs (New): Fix structures constructor calling.
12015
12016         * class.cs (Property, Method, Indexer): Emit Final flag on the
12017         method if we are an interface implementation and we are not
12018         abstract. 
12019
12020         * ecore.cs (PropertyExpr): New public field `IsBase', tells
12021         whether this property is referencing a `base' method.
12022
12023         * expression.cs (Invocation.EmitCall): take an extra argument:
12024         is_base, this is used to determine whether the `call' or
12025         `callvirt' opcode should be used.
12026
12027
12028         * delegate.cs: update EmitCall.
12029
12030         * class.cs (Method.Define): Set NewSlot for the cases where we are
12031         not implementing an interface method.
12032
12033         (Property.Define): ditto.
12034
12035 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
12036
12037         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
12038         'r'.  Allows mcs to parse itself fully.
12039
12040 2002-01-02  Ravi Pratap  <ravi@ximian.com>
12041
12042         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
12043         of the number of initializers that require the InitializeArray method.
12044
12045         (CheckIndices): Store the Expression in all cases - not the plain value. Also
12046         update the above field where necessary.
12047
12048         (MakeByteBlob): Update accordingly.
12049
12050         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
12051         greater than 2.
12052
12053         (EmitDynamicInitializers): Update in accordance with the new optimization.
12054
12055         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
12056         same OpCode applies.
12057
12058         * cs-parser.jay : Fix some glaring errors I introduced.
12059
12060 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
12061
12062         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
12063         so that we can check for name clashes there too.
12064
12065         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
12066         for interface indexers.
12067
12068         * interfaces.cs (Define): Emit the default member attribute.
12069
12070         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
12071         variable was being referred to while setting the value ;-)
12072
12073 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
12074
12075         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
12076         byte-by-byte information when we know the data is zero.
12077
12078         Make the block always a multiple of 4, because
12079         DefineInitializedData has a bug.
12080
12081         * assign.cs: Fix, we should assign from the temporary, not from
12082         the source. 
12083
12084         * expression.cs (MakeByteBlob): Fix my incorrect code.
12085
12086 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
12087
12088         * typemanager.cs (EnumToUnderlying): This function is used to get
12089         the underlying type from an enumeration, because it does not
12090         always work. 
12091
12092         * constant.cs: Use the I4_S form for values between -128 and 127.
12093
12094         * statement.cs (Block.LookupLabel): Looks up a label.
12095         (Block): Drop support for labeled blocks.
12096
12097         (LabeledStatement): New kind of statement that represents a label
12098         only.
12099
12100         (Goto): Finally implement this bad boy.
12101
12102         * cs-parser.jay: Update to reflect new mechanism to implement
12103         labels.
12104
12105 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
12106
12107         * codegen.cs (EmitContext.This): a codegen property that keeps the
12108         a single instance of this instead of creating many different this
12109         instances. 
12110
12111         * delegate.cs (Delegate.DoResolve): Update to use the property;
12112
12113         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
12114
12115         * expression.cs (BaseAccess.DoResolve): Ditto.
12116
12117 2001-12-29  Ravi Pratap  <ravi@ximian.com>
12118
12119         * typemanager.cs (methodimpl_attr_type): Add to hold the type
12120         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
12121
12122         (InitCoreTypes): Update accordingly.
12123
12124         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
12125         so we can quickly store the state.
12126
12127         (ApplyAttributes): Set the correct implementation flags
12128         for InternalCall methods.
12129
12130 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
12131
12132         * expression.cs (EmitCall): if a method is not virtual, then do
12133         not use callvirt on it.
12134
12135         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
12136         user defined stuff) requires the use of stobj, which takes an
12137         address on the stack instead of an array and an index.  So emit
12138         the Ldelema operation for it.
12139
12140         (EmitStoreOpcode): Use stobj for valuetypes.
12141
12142         (UnaryMutator.EmitCode): Use the right 1 value depending on
12143         whether we are dealing with int64/uint64, float or doubles.
12144
12145         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
12146         constructors that I implemented last night.
12147
12148         (Constructor.IsDefault): Fix to work properly for static
12149         constructors.
12150
12151         * cs-parser.jay (CheckDef): report method signature errors.
12152         Update error number 103 to be 132.
12153
12154         * decl.cs: New AdditionResult enumeration value: MethodExists.
12155         Although we do this check for methods later on in the semantic
12156         analysis, catching repeated default constructors is so easy that
12157         we catch these here. 
12158
12159         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
12160         promotions code.
12161
12162         (ParameterReference.EmitAssign, Emit): handle
12163         bools as bytes.
12164
12165         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
12166         (ArrayAccess.EmitStoreOpcode): ditto.
12167
12168         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
12169
12170         * expression.cs (MakeByteBlob): Complete all the missing types
12171         (uint, short, ushort, byte, sbyte)
12172
12173         * class.cs: Only init instance field initializers on instance
12174         constructors. 
12175
12176         Rename `constructors' to instance_constructors. 
12177
12178         (TypeContainer.AddConstructor): Only add constructors to the list
12179         if it is not static.
12180
12181         Make sure that we handle default_static_constructor independently
12182         everywhere where we handle instance_constructors
12183
12184 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
12185
12186         * class.cs: Do not lookup or create a base initializer for a
12187         static constructor.
12188
12189         (ConstructorInitializer.Resolve): use the proper type to lookup
12190         for constructors.
12191
12192         * cs-parser.jay: Report error 1585 (modifiers between type and name).
12193
12194         * enum.cs, interface.cs: Remove CloseType, this is taken care by
12195         in DeclSpace. 
12196
12197         * decl.cs: CloseType is now an virtual method, the default
12198         implementation just closes this type.
12199
12200 2001-12-28  Ravi Pratap  <ravi@ximian.com>
12201
12202         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
12203         to PreserveSig by default. Also emit HideBySig on such methods.
12204
12205         Basically, set the defaults to standard values.
12206
12207         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
12208         argument, if candidate is better, it can't be worse than the best !
12209
12210         (Invocation): Re-write bits to differentiate between methods being
12211         applicable in their expanded form and their normal form - for params
12212         methods of course.
12213
12214         Get rid of use_standard everywhere as only standard conversions are allowed
12215         in overload resolution. 
12216
12217         More spec conformance.
12218
12219 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
12220
12221         * driver.cs: Add --timestamp, to see where the compiler spends
12222         most of its time.
12223
12224         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
12225         `this' in static code.
12226
12227         (SimpleName.DoResolve): Implement in terms of a helper function
12228         that allows static-references to be passed upstream to
12229         MemberAccess.
12230
12231         (Expression.ResolveWithSimpleName): Resolve specially simple
12232         names when called by MemberAccess to implement the special
12233         semantics. 
12234
12235         (Expression.ImplicitReferenceConversion): Handle conversions from
12236         Null to reference types before others, as Null's type is
12237         System.Object. 
12238
12239         * expression.cs (Invocation.EmitCall): Handle the special case of
12240         calling methods declared on a reference type from a ValueType
12241         (Base classes System.Object and System.Enum)
12242
12243         (MemberAccess.Resolve): Only perform lookups on Enumerations if
12244         the left hand side is a TypeExpr, not on every enumeration. 
12245
12246         (Binary.Resolve): If types are reference types, then do a cast to
12247         object on operators != and == of both arguments.
12248
12249         * typemanager.cs (FindMembers): Extract instance and static
12250         members if requested.
12251
12252         * interface.cs (PopulateProperty): Use void_type instead of null
12253         as the return type for the setter method.
12254
12255         (PopulateIndexer): ditto.
12256
12257 2001-12-27  Ravi Pratap  <ravi@ximian.com>
12258
12259         * support.cs (ReflectionParameters): Fix minor bug where we
12260         were examining the wrong parameter for the ParamArray attribute.
12261
12262         Cope with requests for the type of the parameter at position
12263         greater than the params parameter's. We now return the element
12264         type of the params array as that makes more sense.
12265
12266         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
12267         accordingly as we no longer have to extract the element type
12268         ourselves.
12269
12270         (Invocation.OverloadResolve): Update.
12271
12272 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
12273
12274         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
12275         against IEnumerator, test whether the return value is a descendant
12276         of the IEnumerator interface.
12277
12278         * class.cs (Indexer.Define): Use an auxiliary method to implement
12279         the other bits of the method definition.  Begin support for
12280         explicit interface implementation.
12281
12282         (Property.DefineMethod): Use TypeManager.void_type instead of null
12283         for an empty return value.
12284
12285 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
12286
12287         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
12288         dealing with a FieldExpr which is composed of a FieldBuilder, in
12289         the code path we did extract the constant, but we should have
12290         obtained the underlying value to be able to cast it (otherwise we
12291         end up in an infinite loop, this is what Ravi was running into).
12292
12293         (ArrayCreation.UpdateIndices): Arrays might be empty.
12294
12295         (MemberAccess.ResolveMemberAccess): Add support for section
12296         14.5.4.1 that deals with the special case of E.I when E is a type
12297         and something else, that I can be a reference to a static member.
12298
12299         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
12300         handle a particular array type to create byte blobs, it is just
12301         something we dont generate byteblobs for.
12302
12303         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
12304         arguments. 
12305
12306         * location.cs (Push): remove the key from the hashtable that we
12307         are about to add.   This happens for empty files.
12308
12309         * driver.cs: Dispose files after we have parsed them.
12310
12311         (tokenize): new function that only runs the tokenizer on its
12312         input, for speed testing.
12313
12314 2001-12-26  Ravi Pratap  <ravi@ximian.com>
12315
12316         * class.cs (Event.Define): Define the private field only if there
12317         are no accessors defined.
12318
12319         * expression.cs (ResolveMemberAccess): If there is no associated
12320         field with the event, that means we have an event defined with its
12321         own accessors and we should flag error cs0070 since transforming
12322         ourselves into a field is not valid in that case.
12323
12324         * ecore.cs (SimpleName.DoResolve): Same as above.
12325
12326         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
12327         and charset to sane values.
12328
12329 2001-12-25  Ravi Pratap  <ravi@ximian.com>
12330
12331         * assign.cs (DoResolve): Perform check on events only if they 
12332         are being accessed outside the declaring type.
12333
12334         * cs-parser.jay (event_declarations): Update rules to correctly
12335         set the type of the implicit parameter etc.
12336
12337         (add_accessor, remove_accessor): Set current local parameters.
12338
12339         * expression.cs (Binary): For delegate addition and subtraction,
12340         cast the return value from the method into the appropriate delegate
12341         type.
12342
12343 2001-12-24  Ravi Pratap  <ravi@ximian.com>
12344
12345         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
12346         of these as the workaround is unnecessary.
12347
12348         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
12349         delegate data - none of that is needed at all.
12350
12351         Re-write bits to extract the instance expression and the delegate method
12352         correctly.
12353
12354         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
12355         on delegates too.
12356
12357         * attribute.cs (ApplyAttributes): New method to take care of common tasks
12358         of attaching attributes instead of duplicating code everywhere.
12359
12360         * everywhere : Update code to do attribute emission using the above method.
12361
12362 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
12363
12364         * expression.cs (IsParamsMethodApplicable): if there are not
12365         parameters, return immediately.
12366
12367         * ecore.cs: The 0 literal can be implicity converted to an enum
12368         type. 
12369
12370         (SimpleName.DoResolve): First lookup the type, then lookup the
12371         members. 
12372
12373         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
12374         want to get its address.  If the InstanceExpression is not
12375         addressable, store the result in a temporary variable, then get
12376         the address of it.
12377
12378         * codegen.cs: Only display 219 errors on warning level or above. 
12379
12380         * expression.cs (ArrayAccess): Make it implement the
12381         IMemoryLocation interface.
12382
12383         (Binary.DoResolve): handle the operator == (object a, object b)
12384         and operator != (object a, object b) without incurring into a
12385         BoxedCast (because 5 != o should never be performed).
12386
12387         Handle binary enumerator operators.
12388
12389         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
12390         value type, otherwise use Ldelem_ref.
12391
12392         Use precomputed names;
12393
12394         (AddressOf): Implement address of
12395
12396         * cs-parser.jay (labeled_statement): Fix recursive block
12397         addition by reworking the production.
12398
12399         * expression.cs (New.DoEmit): New has a special case:
12400                 
12401                  If we are dealing with a ValueType, we have a few
12402                  situations to deal with:
12403                 
12404                     * The target of New is a ValueType variable, that is
12405                       easy, we just pass this as the variable reference
12406                 
12407                     * The target of New is being passed as an argument,
12408                       to a boxing operation or a function that takes a
12409                       ValueType.
12410                 
12411                       In this case, we need to create a temporary variable
12412                       that is the argument of New.
12413
12414
12415 2001-12-23  Ravi Pratap  <ravi@ximian.com>
12416
12417         * rootcontext.cs (LookupType): Check that current_type is not null before
12418         going about looking at nested types.
12419
12420         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
12421         not implement the IAssignMethod interface any more.
12422
12423         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
12424         where we tranform them into FieldExprs if they are being resolved from within
12425         the declaring type.
12426
12427         * ecore.cs (SimpleName.DoResolve): Do the same here.
12428
12429         * assign.cs (DoResolve, Emit): Clean up code considerably. 
12430
12431         * ../errors/bug10.cs : Add.
12432
12433         * ../errors/cs0070.cs : Add.
12434
12435         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
12436
12437         * assign.cs : Get rid of EventIsLocal everywhere.
12438
12439 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
12440
12441         * ecore.cs (ConvertIntLiteral): finished the implementation.
12442
12443         * statement.cs (SwitchLabel): Convert the value we are using as a
12444         key before looking up the table.
12445
12446 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
12447
12448         * codegen.cs (EmitTopBlock): Require a Location argument now.
12449
12450         * cs-parser.jay (constructor_declarator): We need to setup
12451         current_local_parameters before we parse the
12452         opt_constructor_initializer, to allow the variables to be bound
12453         to the constructor arguments.
12454
12455         * rootcontext.cs (LookupType): First lookup nested classes in our
12456         class and our parents before we go looking outside our class.
12457
12458         * expression.cs (ConstantFold): Extract/debox the values at the
12459         beginnning. 
12460
12461         * rootcontext.cs (EmitCode): Resolve the constants first before we
12462         resolve the types.  This is not really needed, but it helps debugging.
12463
12464         * statement.cs: report location.
12465
12466         * cs-parser.jay: pass location to throw statement.
12467
12468         * driver.cs: Small bug fix.
12469
12470         * report.cs: Updated format to be 4-zero filled digits.
12471
12472 2001-12-22  Ravi Pratap  <ravi@ximian.com>
12473
12474         * expression.cs (CheckIndices): Fix minor bug where the wrong
12475         variable was being referred to ;-)
12476
12477         (DoEmit): Do not call EmitStaticInitializers when the 
12478         underlying type is System.Object.
12479
12480 2001-12-21  Ravi Pratap  <ravi@ximian.com>
12481
12482         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
12483         and do the usual workaround for SRE.
12484
12485         * class.cs (MyEventBuilder.EventType): New member to get at the type
12486         of the event, quickly.
12487
12488         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
12489
12490         * assign.cs (Assign.DoResolve): Handle the case when the target
12491         is an EventExpr and perform the necessary checks.
12492
12493         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
12494         interface.
12495
12496         (SimpleName.MemberStaticCheck): Include check for EventExpr.
12497
12498         (EventExpr): Set the type in the constructor itself since we 
12499         are meant to be born fully resolved.
12500
12501         (EventExpr.Define): Revert code I wrote earlier.
12502                 
12503         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
12504         instance expression is null. The instance expression is a This in that case
12505         or a null, depending on whether it is a static method or not.
12506
12507         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
12508         refers to more than one method.
12509
12510         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
12511         and accordingly flag errors.
12512
12513 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
12514
12515         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
12516
12517 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
12518
12519         * location.cs (ToString): Provide useful rutine.
12520
12521 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
12522
12523         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
12524         objects, return the actual integral boxed.
12525
12526         * statement.cs (SwitchLabel): define an ILLabel for each
12527         SwitchLabel. 
12528
12529         (Switch.CheckSwitch): If the value is a Literal, extract
12530         the underlying literal.
12531
12532         Also in the unused hashtable we had, add the SwitchLabel so we can
12533         quickly look this value up.
12534
12535         * constant.cs: Implement a bunch of new constants.  Rewrite
12536         Literal based on this.  Made changes everywhere to adapt to this.
12537
12538         * expression.cs (Expression.MakeByteBlob): Optimize routine by
12539         dereferencing array only once, and also copes with enumrations.
12540
12541         bytes are two bytes wide, not one.
12542
12543         (Cast): Perform constant conversions.
12544
12545         * ecore.cs (TryImplicitIntConversion): Return literals instead of
12546         wrappers to the literals here.
12547
12548         * expression.cs (DoNumericPromotions): long literals can converted
12549         to ulong implicity (this is taken care of elsewhere, but I was
12550         missing this spot).
12551
12552         * ecore.cs (Expression.Literalize): Make the return type Literal,
12553         to improve type checking.
12554
12555         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
12556
12557 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
12558
12559         * literal.cs: Revert code from ravi that checked the bounds.  The
12560         bounds are sane by the definition of the type itself. 
12561
12562         * typemanager.cs: Fix implementation of ImplementsInterface.  We
12563         need to actually look up in our parent hierarchy for interfaces
12564         implemented. 
12565
12566         * const.cs: Use the underlying type for enumerations
12567
12568         * delegate.cs: Compute the basename for the delegate creation,
12569         that should fix the delegate test case, and restore the correct
12570         Type Lookup semantics in rootcontext
12571
12572         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
12573         referencing a nested type with the Reflection API is using the "+"
12574         sign. 
12575
12576         * cs-parser.jay: Do not require EOF token at the end.
12577
12578 2001-12-20  Ravi Pratap  <ravi@ximian.com>
12579
12580         * rootcontext.cs (LookupType): Concatenate type names with
12581         a '.' instead of a '+' The test suite passes again.
12582
12583         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
12584         field of the enumeration.
12585
12586         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
12587         the case when the member is an EventExpr.
12588
12589         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
12590         static has an associated instance expression.
12591
12592         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
12593
12594         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
12595
12596         * class.cs (Event.Define): Register event and perform appropriate checks
12597         for error #111.
12598
12599         We define the Add and Remove methods even if the use provides none because
12600         in that case, we provide default implementations ourselves.
12601
12602         Define a private field of the type of the event. This is done by the CSC compiler
12603         and we should be doing it too ;-)
12604
12605         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
12606         More methods we use in code we generate.
12607
12608         (multicast_delegate_type, delegate_type): Two separate types since the distinction
12609         is important.
12610
12611         (InitCoreTypes): Update accordingly for the above.
12612
12613         * class.cs (Event.Emit): Generate code for default accessors that we provide
12614
12615         (EmitDefaultMethod): Do the job in the above.
12616
12617         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
12618         appropriate place.
12619
12620 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
12621
12622         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
12623         builders even if we were missing one.
12624
12625         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
12626         pass the Basename as our class name instead of the Name.  The
12627         basename will be correctly composed for us.
12628
12629         * parameter.cs (Paramters): Now takes a Location argument.
12630
12631         * decl.cs (DeclSpace.LookupType): Removed convenience function and
12632         make all the code call directly LookupType in RootContext and take
12633         this chance to pass the Location information everywhere.
12634
12635         * Everywhere: pass Location information.
12636
12637 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
12638
12639         * class.cs (Constructor.Define): Updated way of detecting the
12640         length of the parameters.
12641
12642         (TypeContainer.DefineType): Use basename as the type name for
12643         nested types.
12644
12645         (TypeContainer.Define): Do not recursively define types here, as
12646         definition is taken care in order by the RootContext.
12647
12648         * tree.cs: Keep track of namespaces in a per-file basis.
12649
12650         * parameter.cs (Parameter.ComputeSignature): Update to use
12651         DeclSpace. 
12652
12653         (Parameters.GetSignature): ditto.
12654
12655         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
12656         instead of a TypeContainer.
12657
12658         (Interface.SemanticAnalysis): Use `this' instead of our parent to
12659         resolve names.  Because we need to be resolve in our context, not
12660         our parents.
12661
12662         * driver.cs: Implement response files.
12663
12664         * class.cs (TypeContainer.DefineType): If we are defined, do not
12665         redefine ourselves.
12666
12667         (Event.Emit): Emit the code for add/remove handlers.
12668         (Event.Define): Save the MethodBuilders for add/remove.
12669
12670         * typemanager.cs: Use pair here too.
12671
12672         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
12673         DictionaryEntry requires the first argument to be non-null.  
12674
12675         (enum_declaration): Compute full name for registering the
12676         enumeration.
12677
12678         (delegate_declaration): Instead of using
12679         formal_parameter_list, use opt_formal_parameter_list as the list
12680         can be empty.
12681
12682         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
12683         (EventParsing): New property that controls whether `add' and
12684         `remove' are returned as tokens or identifiers (for events);
12685
12686 2001-12-19  Ravi Pratap  <ravi@ximian.com>
12687
12688         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
12689         use MyEventBuilder only and let it wrap the real builder for us.
12690
12691         (MyEventBuilder): Revamp constructor etc.
12692
12693         Implement all operations that we perform on EventBuilder in precisely the same
12694         way here too.
12695
12696         (FindMembers): Update to use the EventBuilder member.
12697
12698         (Event.Emit): Update accordingly.
12699
12700 2001-12-18  Ravi Pratap  <ravi@ximian.com>
12701
12702         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
12703         by calling the appropriate methods.
12704
12705         (GetCustomAttributes): Make stubs as they cannot possibly do anything
12706         useful.
12707
12708         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
12709
12710 2001-12-17  Ravi Pratap  <ravi@ximian.com>
12711
12712         * delegate.cs (Delegate.Populate): Check that the return type
12713         and various parameters types are indeed accessible.
12714
12715         * class.cs (Constructor.Define): Same here.
12716
12717         (Field.Define): Ditto.
12718
12719         (Event.Define): Ditto.
12720
12721         (Operator.Define): Check that the underlying Method defined itself
12722         correctly - so it's MethodBuilder should not be null.
12723
12724         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
12725         expression happens to be null.
12726
12727         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
12728         members but as of now we don't seem to be able to do anything really useful with it.
12729
12730         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
12731         not the EventBuilder.
12732
12733 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
12734
12735         * cs-tokenizer.cs: Add support for defines.
12736         Add support for #if, #elif, #else, #endif
12737
12738         (eval_var): evaluates a variable.
12739         (eval): stubbed for evaluating functions.
12740
12741         * cs-parser.jay: Pass the defines information
12742
12743         * driver.cs: Add --define command line option.
12744
12745         * decl.cs: Move MemberCore here.
12746
12747         Make it the base class for DeclSpace.  This allows us to catch and
12748         report 108 and 109 for everything now.
12749
12750         * class.cs (TypeContainer.Define): Extract all the members
12751         before populating and emit the warning 108 (new keyword required
12752         to override) instead of having each member implement this.
12753
12754         (MemberCore.Define): New abstract method, we will be using this in
12755         the warning reporting engine in Populate.
12756
12757         (Operator.Define): Adjust to new MemberCore protocol. 
12758
12759         * const.cs (Const): This does not derive from Expression, it is a
12760         temporary object we use to create fields, it is a MemberCore. 
12761
12762         * class.cs (Method.Define): Allow the entry point to be in a
12763         specific class.
12764
12765         * driver.cs: Rewrite the argument handler to clean it up a bit.
12766
12767         * rootcontext.cs: Made it just an auxiliary namespace feature by
12768         making everything static.
12769
12770         * driver.cs: Adapt code to use RootContext type name instead of
12771         instance variable.
12772
12773         * delegate.cs: Remove RootContext argument.
12774
12775         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
12776         argument. 
12777
12778         * class.cs (Event.Define): The lookup can fail.
12779
12780         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
12781
12782         * expression.cs: Resolve the this instance before invoking the code.
12783
12784 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
12785
12786         * cs-parser.jay: Add a production in element_access that allows
12787         the thing to become a "type" reference.  This way we can parse
12788         things like "(string [])" as a type.
12789
12790         Note that this still does not handle the more complex rules of
12791         casts. 
12792
12793
12794         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
12795
12796         * ecore.cs: (CopyNewMethods): new utility function used to
12797         assemble the list of methods from running FindMembers.
12798
12799         (MemberLookup): Rework FindMembers so that 
12800
12801 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
12802
12803         * class.cs (TypeContainer): Remove Delegates who fail to be
12804         defined.
12805
12806         * delegate.cs (Populate): Verify that we dont get null return
12807         values.   TODO: Check for AsAccessible.
12808
12809         * cs-parser.jay: Use basename to emit error 574 (destructor should
12810         have the same name as container class), not the full name.
12811
12812         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
12813         possible representation.  
12814
12815         Also implements integer type suffixes U and L.
12816
12817 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
12818
12819         * expression.cs (ArrayCreation.DoResolve): We need to do the
12820         argument resolution *always*.
12821
12822         * decl.cs: Make this hold the namespace.  Hold the root context as
12823         well.
12824         (LookupType): Move here.
12825
12826         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
12827
12828         * location.cs (Row, Name): Fixed the code, it was always returning
12829         references to the first file.
12830
12831         * interface.cs: Register properties defined through interfaces.
12832
12833         * driver.cs: Add support for globbing on the command line
12834
12835         * class.cs (Field): Make it derive from MemberCore as well.
12836         (Event): ditto.
12837
12838 2001-12-15  Ravi Pratap  <ravi@ximian.com>
12839
12840         * class.cs (Event::Define): Check that the type of the event is a delegate
12841         type else flag error #66.
12842
12843         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
12844         same.
12845
12846         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
12847         values of EntryPoint, CharSet etc etc.
12848
12849         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
12850
12851         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
12852         be null and we should ignore this. I am not sure if this is really clean. Apparently,
12853         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
12854         which needs this to do its work.
12855
12856         * ../errors/cs0066.cs : Add.
12857
12858 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
12859
12860         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
12861         helper functions.
12862
12863         * class.cs: (MethodSignature.MethodSignature): Removed hack that
12864         clears out the parameters field.
12865         (MemberSignatureCompare): Cleanup
12866
12867         (MemberCore): New base class used to share code between MethodCore
12868         and Property.
12869
12870         (RegisterRequiredImplementations) BindingFlags.Public requires
12871         either BindingFlags.Instace or Static.  Use instance here.
12872
12873         (Property): Refactored code to cope better with the full spec.
12874
12875         * parameter.cs (GetParameterInfo): Return an empty array instead
12876         of null on error.
12877
12878         * class.cs (Property): Abstract or extern properties have no bodies.
12879
12880         * parameter.cs (GetParameterInfo): return a zero-sized array.
12881
12882         * class.cs (TypeContainer.MethodModifiersValid): Move all the
12883         method modifier validation to the typecontainer so we can reuse
12884         this on properties.
12885
12886         (MethodCore.ParameterTypes): return an empty sized array of types.
12887
12888         (Property.Define): Test property modifier validity.
12889
12890         Add tests for sealed/override too.
12891
12892         (Method.Emit): abstract or extern methods have no bodies.
12893
12894 2001-12-14  Ravi Pratap  <ravi@ximian.com>
12895
12896         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
12897         thing.
12898
12899         (Method::Define, ::Emit): Modify accordingly.
12900
12901         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
12902
12903         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
12904
12905         * makefile: Pass in /unsafe.
12906
12907 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
12908
12909         * class.cs (MakeKey): Kill routine.
12910
12911         * class.cs (TypeContainer.Define): Correctly define explicit
12912         method implementations (they require the full interface name plus
12913         the method name).
12914
12915         * typemanager.cs: Deply the PtrHashtable here and stop using the
12916         lame keys.  Things work so much better.
12917
12918         This of course broke everyone who depended on `RegisterMethod' to
12919         do the `test for existance' test.  This has to be done elsewhere.
12920
12921         * support.cs (PtrHashtable): A hashtable that avoid comparing with
12922         the object stupid Equals method (because, that like fails all over
12923         the place).  We still do not use it.
12924
12925         * class.cs (TypeContainer.SetRequiredInterface,
12926         TypeContainer.RequireMethods): Killed these two routines and moved
12927         all the functionality to RegisterRequiredImplementations.
12928
12929         (TypeContainer.RegisterRequiredImplementations): This routine now
12930         registers all the implementations required in an array for the
12931         interfaces and abstract methods.  We use an array of structures
12932         which can be computed ahead of time to reduce memory usage and we
12933         also assume that lookups are cheap as most classes will not
12934         implement too many interfaces.
12935
12936         We also avoid creating too many MethodSignatures.
12937
12938         (TypeContainer.IsInterfaceMethod): Update and optionally does not
12939         clear the "pending" bit if we find that there are problems with
12940         the declaration.
12941
12942         (TypeContainer.VerifyPendingMethods): Update to report errors of
12943         methods that look like implementations but are not.
12944
12945         (TypeContainer.Define): Add support for explicit interface method
12946         implementation. 
12947
12948 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
12949
12950         * typemanager.cs: Keep track of the parameters here instead of
12951         being a feature of the TypeContainer.
12952
12953         * class.cs: Drop the registration of parameters here, as
12954         InterfaceMethods are also interface declarations.
12955
12956         * delegate.cs: Register methods with the TypeManager not only with
12957         the TypeContainer.  This code was buggy.
12958
12959         * interface.cs: Full registation here.
12960
12961 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
12962
12963         * expression.cs: Remove reducer for binary expressions, it can not
12964         be done this way.
12965
12966         * const.cs: Put here the code that used to go into constant.cs
12967
12968         * constant.cs: Put here the code for constants, this is a new base
12969         class for Literals.
12970
12971         * literal.cs: Make Literal derive from Constant.
12972
12973 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
12974
12975         * statement.cs (Return.Emit): Report error 157 if the user
12976         attempts to return from a finally block.
12977
12978         (Return.Emit): Instead of emitting a return, jump to the end of
12979         the function.
12980
12981         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
12982         LocalBuilder to store the result of the function.  ReturnLabel is
12983         the target where we jump.
12984
12985
12986 2001-12-09  Radek Doulik  <rodo@ximian.com>
12987
12988         * cs-parser.jay: remember alias in current namespace
12989
12990         * ecore.cs (SimpleName::DoResolve): use aliases for types or
12991         namespaces
12992
12993         * class.cs (LookupAlias): lookup alias in my_namespace
12994
12995         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
12996         aliases hashtable
12997         (LookupAlias): lookup alias in this and if needed in parent
12998         namespaces
12999
13000 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
13001
13002         * support.cs: 
13003
13004         * rootcontext.cs: (ModuleBuilder) Made static, first step into
13005         making things static.  I need this to avoid passing the
13006         TypeContainer when calling ParameterType.
13007
13008         * support.cs (InternalParameters.ParameterType): Remove ugly hack
13009         that did string manipulation to compute the type and then call
13010         GetType.  Use Parameter.ParameterType instead.
13011
13012         * cs-tokenizer.cs: Consume the suffix for floating values.
13013
13014         * expression.cs (ParameterReference): figure out whether this is a
13015         reference parameter or not.  Kill an extra variable by computing
13016         the arg_idx during emission.
13017
13018         * parameter.cs (Parameters.GetParameterInfo): New overloaded
13019         function that returns whether a parameter is an out/ref value or not.
13020
13021         (Parameter.ParameterType): The type of the parameter (base,
13022         without ref/out applied).
13023
13024         (Parameter.Resolve): Perform resolution here.
13025         (Parameter.ExternalType): The full type (with ref/out applied).
13026
13027         * statement.cs (Using.Emit, Using.EmitExpression): Implement
13028         support for expressions on the using statement.
13029
13030 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
13031
13032         * statement.cs (Using.EmitLocalVariableDecls): Split the
13033         localvariable handling of the using statement.
13034
13035         (Block.EmitMeta): Keep track of variable count across blocks.  We
13036         were reusing slots on separate branches of blocks.
13037
13038         (Try.Emit): Emit the general code block, we were not emitting it. 
13039
13040         Check the type of the declaration to be an IDisposable or
13041         something that can be implicity converted to it. 
13042
13043         Emit conversions if required.
13044
13045         * ecore.cs (EmptyExpression): New utility class.
13046         (Expression.ImplicitConversionExists): New utility function.
13047
13048 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
13049
13050         * statement.cs (Using): Implement.
13051
13052         * expression.cs (LocalVariableReference): Support read only variables.
13053
13054         * statement.cs: Remove the explicit emit for the Leave opcode.
13055         (VariableInfo): Add a readonly field.
13056
13057 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
13058
13059         * ecore.cs (ConvCast): new class used to encapsulate the various
13060         explicit integer conversions that works in both checked and
13061         unchecked contexts.
13062
13063         (Expression.ConvertNumericExplicit): Use new ConvCast class to
13064         properly generate the overflow opcodes.
13065
13066 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13067
13068         * statement.cs: The correct type for the EmptyExpression is the
13069         element_type, not the variable type.  Ravi pointed this out.
13070
13071 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13072
13073         * class.cs (Method::Define): Handle PInvoke methods specially
13074         by using DefinePInvokeMethod instead of the usual one.
13075
13076         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
13077         above to do the task of extracting information and defining the method.
13078
13079 2001-12-04  Ravi Pratap  <ravi@ximian.com>
13080
13081         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
13082         of the condition for string type.
13083
13084         (Emit): Move that here. 
13085
13086         (ArrayCreation::CheckIndices): Keep string literals in their expression
13087         form.
13088
13089         (EmitDynamicInitializers): Handle strings appropriately.
13090
13091 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
13092
13093         * codegen.cs (EmitContext): Replace multiple variables with a
13094         single pointer to the current Switch statement.
13095
13096         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
13097         EmitContext.
13098
13099 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13100
13101         * statement.cs 
13102
13103         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
13104         default'.
13105
13106         (Foreach.Emit): Foreach on arrays was not setting
13107         up the loop variables (for break/continue).
13108
13109         (GotoCase): Semi-implented.
13110
13111 2001-12-03  Ravi Pratap  <ravi@ximian.com>
13112
13113         * attribute.cs (CheckAttribute): Handle system attributes by using
13114         Attribute.GetAttributes to examine information we need.
13115
13116         (GetValidPlaces): Same here.
13117
13118         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
13119
13120         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
13121
13122         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
13123
13124         (Method::Define): Set appropriate flags if we have a DllImport attribute.
13125
13126         (Method::Emit): Handle the case when we are a PInvoke method.
13127
13128 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
13129
13130         * expression.cs: Use ResolveWithSimpleName on compound names.
13131
13132 2001-12-02  Ravi Pratap  <ravi@ximian.com>
13133
13134         * constant.cs (EmitConstant): Make sure we resolve the associated expression
13135         before trying to reduce it.
13136
13137         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
13138
13139         * constant.cs (LookupConstantValue): Implement.
13140
13141         (EmitConstant): Use the above in emitting the constant.
13142
13143         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
13144         that are user-defined by doing a LookupConstantValue on them.
13145
13146         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
13147         too, like above.
13148
13149 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
13150
13151         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
13152
13153         (BaseAccess.DoResolve): Implement.
13154
13155         (MemberAccess.DoResolve): Split this routine into a
13156         ResolveMemberAccess routine that can be used independently
13157
13158 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
13161         As that share bits of the implementation.  Is returns a boolean,
13162         while As returns the Type that is being probed.
13163
13164 2001-12-01  Ravi Pratap  <ravi@ximian.com>
13165
13166         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
13167         instead of a Literal - much easier.
13168
13169         (EnumInTransit): Remove - utterly useless :-)
13170
13171         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
13172
13173         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
13174
13175         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
13176         chain when we have no associated expression.
13177
13178 2001-11-30  Ravi Pratap  <ravi@ximian.com>
13179
13180         * constant.cs (Define): Use Location while reporting the errror.
13181
13182         Also emit a warning when 'new' is used and there is no inherited
13183         member to hide.
13184
13185         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
13186         populated.
13187
13188         (LookupEnumValue): Implement to lookup an enum member's value and define it
13189         if necessary.
13190
13191         (Populate): Re-write accordingly to use the above routine.
13192
13193 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
13194
13195         * expression.cs (This): Fix prototype for DoResolveLValue to
13196         override the base class DoResolveLValue.
13197
13198         * cs-parser.cs: Report errors cs574 and cs575 (destructor
13199         declarations) 
13200
13201         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
13202         (we need to load the address of the field here).  This fixes
13203         test-22. 
13204
13205         (FieldExpr.DoResolveLValue): Call the DoResolve
13206         function to initialize the Instance expression.
13207
13208         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
13209         correctly the GetEnumerator operation on a value type.
13210
13211         * cs-parser.jay: Add more simple parsing error catches.
13212
13213         * statement.cs (Switch): Add support for string switches.
13214         Handle null specially.
13215
13216         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
13217
13218 2001-11-28  Ravi Pratap  <ravi@ximian.com>
13219
13220         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
13221
13222         (declare_local_constant): New helper function.
13223
13224         * statement.cs (AddConstant): Keep a separate record of constants
13225
13226         (IsConstant): Implement to determine if a variable is a constant.
13227
13228         (GetConstantExpression): Implement.
13229
13230         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
13231
13232         * statement.cs (IsVariableDefined): Re-write.
13233
13234 2001-11-27  Ravi Pratap  <ravi@ximian.com>
13235
13236         * class.cs (TypeContainer::FindMembers): Look for constants
13237         in the case when we are looking for MemberTypes.Field
13238
13239         * expression.cs (MemberAccess::DoResolve): Check that in the
13240         case we are a FieldExpr and a Literal, we are not being accessed
13241         by an instance reference.
13242
13243         * cs-parser.jay (local_constant_declaration): Implement.
13244
13245         (declaration_statement): Implement for constant declarations.
13246
13247 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
13248
13249         * statement.cs (Switch): Catch double defaults.
13250
13251         (Switch): More work on the switch() statement
13252         implementation.  It works for integral values now, need to finish
13253         string support.
13254
13255
13256 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
13257
13258         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
13259         integer literals into other integer literals.  To be used by
13260         switch. 
13261
13262 2001-11-24  Ravi Pratap  <ravi@ximian.com>
13263
13264         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
13265         some memory.
13266
13267         (EmitDynamicInitializers): Cope with the above since we extract data
13268         directly from ArrayData now.
13269
13270         (ExpectInitializers): Keep track of whether initializers are mandatory
13271         or not.
13272
13273         (Bounds): Make it a hashtable to prevent the same dimension being 
13274         recorded for every element in that dimension.
13275
13276         (EmitDynamicInitializers): Fix bug which prevented the Set array method
13277         from being found.
13278
13279         Also fix bug which was causing the indices to be emitted in the reverse
13280         order.
13281
13282 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
13283
13284         * expression.cs (ArrayCreation): Implement the bits that Ravi left
13285         unfinished.  They do not work, because the underlying code is
13286         sloppy.
13287
13288 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13289
13290         * cs-parser.jay: Remove bogus fixme.
13291
13292         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
13293         on Switch statement.
13294
13295 2001-11-23  Ravi Pratap  <ravi@ximian.com>
13296
13297         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
13298         the same. 
13299
13300         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
13301         parameter. Apparently, any expression is allowed. 
13302
13303         (ValidateInitializers): Update accordingly.
13304
13305         (CheckIndices): Fix some tricky bugs thanks to recursion.
13306
13307         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
13308         I was being completely brain-dead.
13309
13310         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
13311         and re-write acordingly.
13312
13313         (DelegateInvocation): Re-write accordingly.
13314
13315         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
13316
13317         (MakeByteBlob): Handle types more correctly.
13318
13319         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
13320         initialization from expressions but it is incomplete because I am a complete
13321         Dodo :-|
13322
13323 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13324
13325         * statement.cs (If.Emit): Fix a bug that generated incorrect code
13326         on If.  Basically, we have to return `true' (ie, we do return to
13327         our caller) only if both branches of the if return.
13328
13329         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
13330         short-circuit operators, handle them as short circuit operators. 
13331
13332         (Cast.DoResolve): Resolve type.
13333         (Cast.Cast): Take an expression as the target type.
13334
13335         * cs-parser.jay (cast_expression): Remove old hack that only
13336         allowed a limited set of types to be handled.  Now we take a
13337         unary_expression and we resolve to a type during semantic
13338         analysis.
13339
13340         Use the grammar productions from Rhys to handle casts (this is
13341         not complete like Rhys syntax yet, we fail to handle that corner
13342         case that C# has regarding (-x), but we will get there.
13343
13344 2001-11-22  Ravi Pratap  <ravi@ximian.com>
13345
13346         * class.cs (EmitFieldInitializer): Take care of the case when we have a
13347         field which is an array type.
13348
13349         * cs-parser.jay (declare_local_variables): Support array initialization too.
13350
13351         * typemanager.cs (MakeKey): Implement.
13352
13353         (everywhere): Use the above appropriately.
13354
13355         * cs-parser.jay (for_statement): Update for array initialization while
13356         declaring variables.
13357
13358         * ecore.cs : The error message was correct, it's the variable's names that
13359         were misleading ;-) Make the code more readable.
13360
13361         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
13362         the correct type etc.
13363
13364         (ConvertExplicit): Handle Enum types by examining the underlying type.
13365
13366 2001-11-21  Ravi Pratap  <ravi@ximian.com>
13367
13368         * parameter.cs (GetCallingConvention): Always return
13369         CallingConventions.Standard for now.
13370
13371 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
13372
13373         * expression.cs (Binary.ResolveOperator): Update the values of `l'
13374         and `r' after calling DoNumericPromotions.
13375
13376         * ecore.cs: Fix error message (the types were in the wrong order).
13377
13378         * statement.cs (Foreach.ProbeCollectionType): Need to pass
13379         BindingFlags.Instance as well 
13380
13381         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
13382         implicit int literal conversion in an empty cast so that we
13383         propagate the right type upstream.
13384
13385         (UnboxCast): new class used to unbox value types.
13386         (Expression.ConvertExplicit): Add explicit type conversions done
13387         by unboxing.
13388
13389         (Expression.ImplicitNumericConversion): Oops, forgot to test for
13390         the target type before applying the implicit LongLiterals to ULong
13391         literal cast.
13392
13393 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
13394
13395         * cs-parser.jay (for_statement): Reworked the way For works: now
13396         we declare manually any variables that are introduced in
13397         for_initializer to solve the problem of having out-of-band code
13398         emition (that is what got for broken).
13399
13400         (declaration_statement): Perform the actual variable declaration
13401         that used to be done in local_variable_declaration here.
13402
13403         (local_variable_declaration): Do not declare anything, just pass
13404         the information on a DictionaryEntry
13405
13406 2001-11-20  Ravi Pratap  <ravi@ximian.com>
13407
13408         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
13409         re-write of the logic to now make it recursive.
13410
13411         (UpdateIndices): Re-write accordingly.
13412
13413         Store element data in a separate ArrayData list in the above methods.
13414
13415         (MakeByteBlob): Implement to dump the array data into a byte array.
13416
13417 2001-11-19  Ravi Pratap  <ravi@ximian.com>
13418
13419         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
13420         into CheckIndices.
13421
13422         * constant.cs (Define): Implement.
13423
13424         (EmitConstant): Re-write fully.
13425
13426         Pass in location info.
13427
13428         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
13429         respectively.
13430
13431         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
13432         DictionaryEntry since we need location info too.
13433
13434         (constant_declaration): Update accordingly.
13435
13436         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
13437         code into another method : UpdateIndices.
13438
13439 2001-11-18  Ravi Pratap  <ravi@ximian.com>
13440
13441         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
13442         some type checking etc.
13443
13444 2001-11-17  Ravi Pratap  <ravi@ximian.com>
13445
13446         * expression.cs (ArrayCreation::ValidateInitializers): Implement
13447         bits to provide dimension info if the user skips doing that.
13448
13449         Update second constructor to store the rank correctly.
13450
13451 2001-11-16  Ravi Pratap  <ravi@ximian.com>
13452
13453         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
13454         and try to implement.
13455
13456         * ../errors/cs0150.cs : Add.
13457
13458         * ../errors/cs0178.cs : Add.
13459
13460 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
13461
13462         * statement.cs: Implement foreach on multi-dimensional arrays. 
13463
13464         * parameter.cs (Parameters.GetParameterByName): Also lookup the
13465         name of the params argument.
13466
13467         * expression.cs: Use EmitStoreOpcode to get the right opcode while
13468         initializing the array.
13469
13470         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
13471         we can use this elsewhere.
13472
13473         * statement.cs: Finish implementation of foreach for single
13474         dimension arrays.
13475
13476         * cs-parser.jay: Use an out-of-band stack to pass information
13477         around, I wonder why I need this.
13478
13479         foreach_block: Make the new foreach_block the current_block.
13480
13481         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
13482         function used to return a static Parameters structure.  Used for
13483         empty parameters, as those are created very frequently.
13484
13485         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
13486
13487 2001-11-15  Ravi Pratap  <ravi@ximian.com>
13488
13489         * interface.cs : Default modifier is private, not public. The
13490         make verify test passes again.
13491
13492 2001-11-15  Ravi Pratap  <ravi@ximian.com>
13493
13494         * support.cs (ReflectionParameters): Fix logic to determine
13495         whether the last parameter is a params one. Test 9 passes again.
13496
13497         * delegate.cs (Populate): Register the builders we define with
13498         RegisterParameterForBuilder. Test 19 passes again.
13499
13500         * cs-parser.jay (property_declaration): Reference $6 instead
13501         of $$ to get at the location.
13502
13503         (indexer_declaration): Similar stuff.
13504
13505         (attribute): Ditto.
13506
13507         * class.cs (Property): Register parameters for the Get and Set methods
13508         if they exist. Test 23 passes again.
13509
13510         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
13511         call to EmitArguments as we are sure there aren't any params arguments. 
13512         Test 32 passes again.
13513
13514         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
13515         IndexOutOfRangeException. 
13516
13517         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
13518         Test 33 now passes again.
13519
13520 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
13521
13522         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
13523         broke a bunch of things.  Will have to come up with a better way
13524         of tracking locations.
13525
13526         * statement.cs: Implemented foreach for single dimension arrays.
13527
13528 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
13529
13530         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
13531         an error.  This removes the lookup from the critical path.
13532
13533         * cs-parser.jay: Removed use of temporary_loc, which is completely
13534         broken. 
13535
13536 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
13537
13538         * support.cs (ReflectionParameters.ParameterModifier): Report
13539         whether the argument is a PARAMS argument or not.
13540
13541         * class.cs: Set the attribute `ParamArrayAttribute' on the
13542         parameter argument.
13543
13544         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
13545         and cons_param_array_attribute (ConstructorInfo for
13546         ParamArrayAttribute)., 
13547
13548         * codegen.cs: Emit the return using the `Return' statement, that
13549         way we can report the error correctly for missing return values. 
13550
13551         * class.cs (Method.Emit): Clean up.
13552
13553         * expression.cs (Argument.Resolve): Take another argument: the
13554         location where this argument is used.  Notice that this is not
13555         part of the "Argument" class as to reduce the size of the
13556         structure (we know the approximate location anyways).
13557
13558         Test if the argument is a variable-reference, if not, then
13559         complain with a 206.
13560
13561         (Argument.Emit): Emit addresses of variables.
13562
13563         (Argument.FullDesc): Simplify.
13564
13565         (Invocation.DoResolve): Update for Argument.Resolve.
13566
13567         (ElementAccess.DoResolve): ditto.
13568
13569         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
13570         method should be virtual, as this method is always virtual.
13571
13572         (NewDelegate.DoResolve): Update for Argument.Resolve.
13573
13574         * class.cs (ConstructorInitializer.DoResolve): ditto.
13575
13576         * attribute.cs (Attribute.Resolve): ditto.
13577
13578 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
13579
13580         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
13581
13582         * expression.cs (ParameterReference): Drop IStackStorage and implement
13583         IAssignMethod instead. 
13584
13585         (LocalVariableReference): ditto.
13586
13587         * ecore.cs (FieldExpr): Drop IStackStorage and implement
13588         IAssignMethod instead. 
13589
13590 2001-11-13  Miguel de Icaza <miguel@ximian.com>
13591
13592         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
13593         enumerations that are used in heavily used structures derive from
13594         byte in a laughable and pathetic attempt to reduce memory usage.
13595         This is the kind of pre-optimzations that you should not do at
13596         home without adult supervision.
13597
13598         * expression.cs (UnaryMutator): New class, used to handle ++ and
13599         -- separatedly from the other unary operators.  Cleans up the
13600         code, and kills the ExpressionStatement dependency in Unary.
13601
13602         (Unary): Removed `method' and `Arguments' from this class, making
13603         it smaller, and moving it all to SimpleCall, so I can reuse this
13604         code in other locations and avoid creating a lot of transient data
13605         strucutres when not required.
13606
13607         * cs-parser.jay: Adjust for new changes.
13608
13609 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
13610
13611         * enum.cs (Enum.Populate): If there is a failure during
13612         definition, return
13613
13614         * cs-parser.jay (opt_enum_base): we used to catch type errors
13615         here, but this is really incorrect.  The type error should be
13616         catched during semantic analysis.
13617
13618 2001-12-11  Ravi Pratap  <ravi@ximian.com>
13619
13620         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
13621         current_local_parameters as expected since I, in my stupidity, had forgotten
13622         to do this :-)
13623
13624         * attribute.cs (GetValidPlaces): Fix stupid bug.
13625
13626         * class.cs (Method::Emit): Perform check on applicability of attributes.
13627
13628         (Constructor::Emit): Ditto.
13629
13630         (Field::Emit): Ditto.
13631
13632         (Field.Location): Store location information.
13633
13634         (Property, Event, Indexer, Operator): Ditto.
13635
13636         * cs-parser.jay (field_declaration): Pass in location for each field.
13637
13638         * ../errors/cs0592.cs : Add.
13639
13640 2001-11-12  Ravi Pratap  <ravi@ximian.com>
13641
13642         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
13643
13644         (InitCoreTypes): Update accordingly.
13645
13646         (RegisterAttrType, LookupAttr): Implement.
13647
13648         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
13649         info about the same.
13650
13651         (Resolve): Update to populate the above as necessary.
13652
13653         (Error592): Helper.
13654
13655         (GetValidPlaces): Helper to the above.
13656
13657         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
13658
13659         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
13660
13661 2001-11-12  Ravi Pratap  <ravi@ximian.com>
13662
13663         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
13664
13665         * ../errors/cs0617.cs : Add.
13666
13667 2001-11-11  Ravi Pratap  <ravi@ximian.com>
13668
13669         * enum.cs (Emit): Rename to Populate to be more consistent with what
13670         we expect it to do and when exactly it is called.
13671
13672         * class.cs, rootcontext.cs : Update accordingly.
13673
13674         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
13675         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
13676
13677         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
13678
13679         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
13680         of a fieldinfo using the above, when dealing with a FieldBuilder.
13681
13682 2001-11-10  Ravi Pratap  <ravi@ximian.com>
13683
13684         * ../errors/cs0031.cs : Add.
13685
13686         * ../errors/cs1008.cs : Add.
13687
13688         * ../errrors/cs0543.cs : Add.
13689
13690         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
13691         enum type.
13692
13693         (FindMembers): Implement.
13694
13695         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
13696         enums and delegates too.
13697
13698         (enum_types): Rename to builder_to_enum.
13699
13700         (delegate_types): Rename to builder_to_delegate.
13701
13702         * delegate.cs (FindMembers): Implement.
13703
13704 2001-11-09  Ravi Pratap  <ravi@ximian.com>
13705
13706         * typemanager.cs (IsEnumType): Implement.
13707
13708         * enum.cs (Emit): Re-write parts to account for the underlying type
13709         better and perform checking etc.
13710
13711         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
13712         of the underlying type.
13713
13714         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
13715         value
13716
13717         * enum.cs (error31): Helper to report error #31.
13718
13719         * cs-parser.jay (enum_declaration): Store location of each member too.
13720
13721         * enum.cs (member_to_location): New hashtable. 
13722
13723         (AddEnumMember): Update location hashtable.
13724
13725         (Emit): Use the location of each member while reporting errors.
13726
13727 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
13728
13729         * cs-parser.jay: A for_initializer if is a
13730         local_variable_declaration really ammount to have an implicit
13731         block with the variable declaration and no initializer for for.
13732
13733         * statement.cs (For.Emit): Cope with null initializers.
13734
13735         This fixes the infinite loop on for initializers.
13736
13737 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
13738
13739         * enum.cs: More cleanup.
13740
13741         * ecore.cs: Remove dead code.
13742
13743         * class.cs (Property.Emit): More simplification.
13744         (Event.Emit): ditto.
13745
13746         Reworked to have less levels of indentation.
13747
13748 2001-11-08  Ravi Pratap  <ravi@ximian.com>
13749
13750         * class.cs (Property): Emit attributes.
13751
13752         (Field): Ditto.
13753
13754         (Event): Ditto.
13755
13756         (Indexer): Ditto.
13757
13758         (Operator): Ditto.
13759
13760         * enum.cs (Emit): Ditto.
13761
13762         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
13763         Enums too.
13764
13765         * class.cs (Field, Event, etc.): Move attribute generation into the
13766         Emit method everywhere.
13767
13768         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
13769         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
13770         as we had no way of defining nested enums !
13771
13772         * rootcontext.cs : Adjust code accordingly.
13773
13774         * typemanager.cs (AddEnumType): To keep track of enum types separately.
13775
13776 2001-11-07  Ravi Pratap  <ravi@ximian.com>
13777
13778         * expression.cs (EvalConstantExpression): Move into ecore.cs
13779
13780         * enum.cs (Enum): Rename some members and make them public and readonly
13781         according to our convention.
13782
13783         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
13784         nothing else.
13785
13786         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
13787
13788         (Enum::Emit): Write a simple version for now which doesn't try to compute
13789         expressions. I shall modify this to be more robust in just a while.
13790
13791         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
13792
13793         (TypeContainer::CloseType): Create the Enum types too.
13794
13795         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
13796
13797         * expression.cs (EvalConstantExpression): Get rid of completely.
13798
13799         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
13800         user-defined values and other cases.
13801
13802         (IsValidEnumLiteral): Helper function.
13803
13804         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
13805         out there in the case we had a literal FieldExpr.
13806
13807         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
13808
13809         (Literalize): Revamp a bit to take two arguments.
13810
13811         (EnumLiteral): New class which derives from Literal to wrap enum literals.
13812
13813 2001-11-06  Ravi Pratap  <ravi@ximian.com>
13814
13815         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
13816
13817         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
13818
13819         (Resolve): Use the above to ensure we have proper initializers.
13820
13821 2001-11-05  Ravi Pratap  <ravi@ximian.com>
13822
13823         * expression.cs (Expression::EvalConstantExpression): New method to 
13824         evaluate constant expressions.
13825
13826         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
13827
13828 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
13829
13830         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
13831         in an array.
13832
13833         (Binary.ResolveOperator): Handle operator != (object a, object b)
13834         and operator == (object a, object b);
13835
13836         (Binary.DoNumericPromotions): Indicate whether the numeric
13837         promotion was possible.
13838
13839         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
13840         Implement.  
13841
13842         Made the ArrayAccess implement interface IAssignMethod instead of
13843         IStackStore as the order in which arguments are passed reflects
13844         this.
13845
13846         * assign.cs: Instead of using expr.ExprClass to select the way of
13847         assinging, probe for the IStackStore/IAssignMethod interfaces.
13848
13849         * typemanager.cs: Load InitializeArray definition.
13850
13851         * rootcontext.cs (RootContext.MakeStaticData): Used to define
13852         static data that can be used to initialize arrays. 
13853
13854 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
13855
13856         * expression.cs: Handle operator== and operator!= for booleans.
13857
13858         (Conditioal.Reduce): Implement reducer for the ?: operator.
13859
13860         (Conditional.Resolve): Implement dead code elimination.
13861
13862         (Binary.Resolve): Catch string literals and return a new
13863         concatenated string.
13864
13865         (Unary.Reduce): Implement reduction of unary expressions.
13866
13867         * ecore.cs: Split out the expression core handling here.
13868
13869         (Expression.Reduce): New method used to perform constant folding
13870         and CSE.  This is needed to support constant-expressions. 
13871
13872         * statement.cs (Statement.EmitBoolExpression): Pass true and false
13873         targets, and optimize for !x.
13874
13875 2001-11-04  Ravi Pratap  <ravi@ximian.com>
13876
13877         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
13878         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
13879         set custom atttributes.
13880
13881         * literal.cs (Literal::GetValue): New abstract method to return the actual
13882         value of the literal, cast as an object.
13883
13884         (*Literal): Implement GetValue method.
13885
13886         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
13887         expressions to the arraylist but objects of type Argument.
13888
13889         * class.cs (TypeContainer::Emit): Emit our attributes too.
13890
13891         (Method::Emit, Constructor::Emit): Ditto.
13892
13893         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
13894         to be ignoring earlier.
13895
13896 2001-11-03  Ravi Pratap  <ravi@ximian.com>
13897
13898         * attribute.cs (AttributeSection::Define): Implement to do the business
13899         of constructing a CustomAttributeBuilder.
13900
13901         (Attribute): New trivial class. Increases readability of code.  
13902
13903         * cs-parser.jay : Update accordingly.
13904
13905         (positional_argument_list, named_argument_list, named_argument): New rules
13906
13907         (attribute_arguments): Use the above so that we are more correct.
13908
13909 2001-11-02  Ravi Pratap  <ravi@ximian.com>
13910
13911         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
13912         to perform all checks for a method with a params parameter.
13913
13914         (Invocation::OverloadResolve): Update to use the above method and therefore
13915         cope correctly with params method invocations.
13916
13917         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
13918         params too.
13919
13920         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
13921         constructors in our parent too because we can't afford to miss out on 
13922         protected ones ;-)
13923
13924         * attribute.cs (AttributeSection): New name for the class Attribute
13925
13926         Other trivial changes to improve readability.
13927
13928         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
13929         use the new class names.
13930
13931 2001-11-01  Ravi Pratap  <ravi@ximian.com>
13932
13933         * class.cs (Method::Define): Complete definition for params types too
13934
13935         (Indexer::Define): Ditto.
13936
13937         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
13938         Cope everywhere with a request for info about the array parameter.
13939
13940 2001-11-01  Ravi Pratap  <ravi@ximian.com>
13941
13942         * tree.cs (RecordNamespace): Fix up to check for the correct key.
13943
13944         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
13945         local_variable_type to extract the string corresponding to the type.
13946
13947         (local_variable_type): Fixup the action to use the new helper method.
13948
13949         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
13950         go.
13951
13952         * expression.cs : Clean out code which uses the above.
13953
13954 2001-10-31  Ravi Pratap  <ravi@ximian.com>
13955
13956         * typemanager.cs (RegisterMethod): Check if we already have an existing key
13957         and bale out if necessary by returning a false.
13958
13959         (RegisterProperty): Ditto.
13960
13961         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
13962         and print out appropriate error messages.
13963
13964         * interface.cs (everywhere): Ditto.
13965
13966         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
13967         location to constructor.
13968
13969         * class.cs (Property, Event, Indexer): Update accordingly.
13970
13971         * ../errors/cs111.cs : Added.
13972
13973         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
13974         of a method, as laid down by the spec.
13975
13976         (Invocation::OverloadResolve): Use the above method.
13977
13978 2001-10-31  Ravi Pratap  <ravi@ximian.com>
13979
13980         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
13981         now take a TypeContainer and a Parameters object.
13982
13983         (ParameterData): Modify return type of ParameterModifier method to be 
13984         Parameter.Modifier and not a string.
13985
13986         (ReflectionParameters, InternalParameters): Update accordingly.
13987
13988         * expression.cs (Argument::GetParameterModifier): Same here.
13989
13990         * support.cs (InternalParameters::ParameterType): Find a better way of determining
13991         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
13992         symbol in it at all so maybe this is only for now.
13993
13994 2001-10-30  Ravi Pratap  <ravi@ximian.com>
13995
13996         * support.cs (InternalParameters): Constructor now takes an extra argument 
13997         which is the actual Parameters class.
13998
13999         (ParameterDesc): Update to provide info on ref/out modifiers.
14000
14001         * class.cs (everywhere): Update call to InternalParameters to pass in
14002         the second argument too.
14003
14004         * support.cs (ParameterData): Add ParameterModifier, which is a method 
14005         to return the modifier info [ref/out etc]
14006
14007         (InternalParameters, ReflectionParameters): Implement the above.
14008
14009         * expression.cs (Argument::ParameterModifier): Similar function to return
14010         info about the argument's modifiers.
14011
14012         (Invocation::OverloadResolve): Update to take into account matching modifiers 
14013         too.
14014
14015         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
14016         a new SetFormalParameters object which we pass to InternalParameters.
14017
14018 2001-10-30  Ravi Pratap  <ravi@ximian.com>
14019
14020         * expression.cs (NewArray): Merge into the ArrayCreation class.
14021
14022 2001-10-29  Ravi Pratap  <ravi@ximian.com>
14023
14024         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
14025         NewUserdefinedArray into one as there wasn't much of a use in having
14026         two separate ones.
14027
14028         * expression.cs (Argument): Change field's name to ArgType from Type.
14029
14030         (Type): New readonly property which returns the proper type, taking into 
14031         account ref/out modifiers.
14032
14033         (everywhere): Adjust code accordingly for the above.
14034
14035         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
14036         whether we are emitting for a ref or out parameter.
14037
14038         * expression.cs (Argument::Emit): Use the above field to set the state.
14039
14040         (LocalVariableReference::Emit): Update to honour the flag and emit the
14041         right stuff.
14042
14043         * parameter.cs (Attributes): Set the correct flags for ref parameters.
14044
14045         * expression.cs (Argument::FullDesc): New function to provide a full desc.
14046
14047         * support.cs (ParameterData): Add method ParameterDesc to the interface.
14048
14049         (ReflectionParameters, InternalParameters): Implement the above method.
14050
14051         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
14052         reporting errors.
14053
14054         (Invocation::FullMethodDesc): Ditto. 
14055
14056 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
14057
14058         * cs-parser.jay: Add extra production for the second form of array
14059         creation. 
14060
14061         * expression.cs (ArrayCreation): Update to reflect the above
14062         change. 
14063
14064         * Small changes to prepare for Array initialization.
14065
14066 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
14067
14068         * typemanager.cs (ImplementsInterface): interface might be null;
14069         Deal with this problem;
14070
14071         Also, we do store negative hits on the cache (null values), so use
14072         this instead of calling t.GetInterfaces on the type everytime.
14073
14074 2001-10-28  Ravi Pratap  <ravi@ximian.com>
14075
14076         * typemanager.cs (IsBuiltinType): New method to help determine the same.
14077
14078         * expression.cs (New::DoResolve): Get rid of array creation code and instead
14079         split functionality out into different classes.
14080
14081         (New::FormArrayType): Move into NewBuiltinArray.
14082
14083         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
14084         quite useless.
14085
14086         (NewBuiltinArray): New class to handle creation of built-in arrays.
14087
14088         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
14089         account creation of one-dimensional arrays.
14090
14091         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
14092
14093         (NewUserdefinedArray::DoResolve): Implement.
14094
14095         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
14096
14097         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
14098         we maintain inside the TypeManager. This is necessary to perform lookups on the
14099         module builder.
14100
14101         (LookupType): Update to perform GetType on the module builders too.     
14102
14103         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
14104
14105         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
14106
14107 2001-10-23  Ravi Pratap  <ravi@ximian.com>
14108
14109         * expression.cs (New::DoResolve): Implement guts of array creation.
14110
14111         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
14112
14113 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
14114
14115         * expression.cs: Fix bug I introduced lsat night that broke
14116         Delegates. 
14117
14118         (Expression.Resolve): Report a 246 error (can not resolve name)
14119         if we find a SimpleName in the stream.
14120
14121         (Expression.ResolveLValue): Ditto.
14122
14123         (Expression.ResolveWithSimpleName): This function is a variant of
14124         ResolveName, this one allows SimpleNames to be returned without a
14125         warning.  The only consumer of SimpleNames is MemberAccess
14126
14127 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
14128
14129         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
14130         might arrive here.  I have my doubts that this is correct.
14131
14132         * statement.cs (Lock): Implement lock statement.
14133
14134         * cs-parser.jay: Small fixes to support `lock' and `using'
14135
14136         * cs-tokenizer.cs: Remove extra space
14137
14138         * driver.cs: New flag --checked, allows to turn on integer math
14139         checking. 
14140
14141         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
14142         Threading.Monitor.Exit 
14143
14144 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
14145
14146         * expression.cs (IndexerAccess::DoResolveLValue): Set the
14147         Expression Class to be IndexerAccess.
14148
14149         Notice that Indexer::DoResolve sets the eclass to Value.
14150
14151 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
14152
14153         * class.cs (TypeContainer::Emit): Emit code for indexers.
14154
14155         * assign.cs (IAssignMethod): New interface implemented by Indexers
14156         and Properties for handling assignment.
14157
14158         (Assign::Emit): Simplify and reuse code. 
14159
14160         * expression.cs (IndexerAccess, PropertyExpr): Implement
14161         IAssignMethod, clean up old code. 
14162
14163 2001-10-22  Ravi Pratap  <ravi@ximian.com>
14164
14165         * typemanager.cs (ImplementsInterface): New method to determine if a type
14166         implements a given interface. Provides a nice cache too.
14167
14168         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
14169         method.
14170
14171         (ConvertReferenceExplicit): Ditto.
14172
14173         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
14174         various methods, with correct names etc.
14175
14176         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
14177         Operator.UnaryNegation.
14178
14179         * cs-parser.jay (operator_declarator): Be a little clever in the case where
14180         we have a unary plus or minus operator.
14181
14182         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
14183         UnaryMinus.
14184
14185         * everywhere : update accordingly.
14186
14187         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
14188         respectively.
14189
14190         * class.cs (Method::Define): For the case where we are implementing a method
14191         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
14192         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
14193
14194 2001-10-21  Ravi Pratap  <ravi@ximian.com>
14195
14196         * interface.cs (FindMembers): Implement to work around S.R.E
14197         lameness.
14198
14199         * typemanager.cs (IsInterfaceType): Implement.
14200
14201         (FindMembers): Update to handle interface types too.
14202
14203         * expression.cs (ImplicitReferenceConversion): Re-write bits which
14204         use IsAssignableFrom as that is not correct - it doesn't work.
14205
14206         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
14207         and accordingly override EmitStatement.
14208
14209         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
14210         using the correct logic :-)
14211
14212 2001-10-19  Ravi Pratap  <ravi@ximian.com>
14213
14214         * ../errors/cs-11.cs : Add to demonstrate error -11 
14215
14216 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
14217
14218         * assign.cs (Assign::Resolve): Resolve right hand side first, and
14219         then pass this as a hint to ResolveLValue.
14220
14221         * expression.cs (FieldExpr): Add Location information
14222
14223         (FieldExpr::LValueResolve): Report assignment to readonly
14224         variable. 
14225
14226         (Expression::ExprClassFromMemberInfo): Pass location information.
14227
14228         (Expression::ResolveLValue): Add new method that resolves an
14229         LValue. 
14230
14231         (Expression::DoResolveLValue): Default invocation calls
14232         DoResolve. 
14233
14234         (Indexers): New class used to keep track of indexers in a given
14235         Type. 
14236
14237         (IStackStore): Renamed from LValue, as it did not really describe
14238         what this did.  Also ResolveLValue is gone from this interface and
14239         now is part of Expression.
14240
14241         (ElementAccess): Depending on the element access type
14242
14243         * typemanager.cs: Add `indexer_name_type' as a Core type
14244         (System.Runtime.CompilerServices.IndexerNameAttribute)
14245
14246         * statement.cs (Goto): Take a location.
14247
14248 2001-10-18  Ravi Pratap  <ravi@ximian.com>
14249
14250         * delegate.cs (Delegate::VerifyDelegate): New method to verify
14251         if two delegates are compatible.
14252
14253         (NewDelegate::DoResolve): Update to take care of the case when
14254         we instantiate a delegate from another delegate.
14255
14256         * typemanager.cs (FindMembers): Don't even try to look up members
14257         of Delegate types for now.
14258
14259 2001-10-18  Ravi Pratap  <ravi@ximian.com>
14260
14261         * delegate.cs (NewDelegate): New class to take care of delegate
14262         instantiation.
14263
14264         * expression.cs (New): Split the delegate related code out into 
14265         the NewDelegate class.
14266
14267         * delegate.cs (DelegateInvocation): New class to handle delegate 
14268         invocation.
14269
14270         * expression.cs (Invocation): Split out delegate related code into
14271         the DelegateInvocation class.
14272
14273 2001-10-17  Ravi Pratap  <ravi@ximian.com>
14274
14275         * expression.cs (New::DoResolve): Implement delegate creation fully
14276         and according to the spec.
14277
14278         (New::DoEmit): Update to handle delegates differently.
14279
14280         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
14281         because of which we were printing out arguments in reverse order !
14282
14283         * delegate.cs (VerifyMethod): Implement to check if the given method
14284         matches the delegate.
14285
14286         (FullDelegateDesc): Implement.
14287
14288         (VerifyApplicability): Implement.
14289
14290         * expression.cs (Invocation::DoResolve): Update to accordingly handle
14291         delegate invocations too.
14292
14293         (Invocation::Emit): Ditto.
14294
14295         * ../errors/cs1593.cs : Added.
14296
14297         * ../errors/cs1594.cs : Added.
14298
14299         * delegate.cs (InstanceExpression, TargetMethod): New properties.
14300
14301 2001-10-16  Ravi Pratap  <ravi@ximian.com>
14302
14303         * typemanager.cs (intptr_type): Core type for System.IntPtr
14304
14305         (InitCoreTypes): Update for the same.
14306
14307         (iasyncresult_type, asynccallback_type): Ditto.
14308
14309         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
14310         correct.
14311
14312         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
14313         too.
14314
14315         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
14316         the builders for the 4 members of a delegate type :-)
14317
14318         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
14319         type.
14320
14321         * expression.cs (New::DoResolve): Implement guts for delegate creation.
14322
14323         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
14324
14325 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
14326
14327         * statement.cs (Break::Emit): Implement.   
14328         (Continue::Emit): Implement.
14329
14330         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14331         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14332         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
14333         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
14334         end loop
14335
14336         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
14337         properties that track the label for the current loop (begin of the
14338         loop and end of the loop).
14339
14340 2001-10-15  Ravi Pratap  <ravi@ximian.com>
14341
14342         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
14343         use of emitting anything at all.
14344
14345         * class.cs, rootcontext.cs : Get rid of calls to the same.
14346
14347         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
14348
14349         (Populate): Define the constructor correctly and set the implementation
14350         attributes.
14351
14352         * typemanager.cs (delegate_types): New hashtable to hold delegates that
14353         have been defined.
14354
14355         (AddDelegateType): Implement.
14356
14357         (IsDelegateType): Implement helper method.
14358
14359         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
14360
14361         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
14362         and accordingly handle it.
14363
14364         * delegate.cs (Populate): Take TypeContainer argument.
14365         Implement bits to define the Invoke method. However, I still haven't figured out
14366         how to take care of the native int bit :-(
14367
14368         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
14369         Qualify the name of the delegate, not its return type !
14370
14371         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
14372         conversion.
14373
14374         (StandardConversionExists): Checking for array types turns out to be recursive.
14375
14376         (ConvertReferenceExplicit): Implement array conversion.
14377
14378         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
14379
14380 2001-10-12  Ravi Pratap  <ravi@ximian.com>
14381
14382         * cs-parser.jay (delegate_declaration): Store the fully qualified
14383         name as it is a type declaration.
14384
14385         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
14386         readonly.
14387
14388         (DefineDelegate): Renamed from Define. Does the same thing essentially,
14389         as TypeContainer::DefineType.
14390
14391         (Populate): Method in which all the definition of the various methods (Invoke)
14392         etc is done.
14393
14394         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
14395         see.
14396
14397         (CloseDelegate): Finally creates the delegate.
14398
14399         * class.cs (TypeContainer::DefineType): Update to define delegates.
14400         (Populate, Emit and CloseType): Do the same thing here too.
14401
14402         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
14403         delegates in all these operations.
14404
14405 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
14406
14407         * expression.cs: LocalTemporary: a new expression used to
14408         reference a temporary that has been created.
14409
14410         * assign.cs: Handle PropertyAccess back here, so that we can
14411         provide the proper semantic access to properties.
14412
14413         * expression.cs (Expression::ConvertReferenceExplicit): Implement
14414         a few more explicit conversions. 
14415
14416         * modifiers.cs: `NEW' modifier maps to HideBySig.
14417
14418         * expression.cs (PropertyExpr): Make this into an
14419         ExpressionStatement, and support the EmitStatement code path. 
14420
14421         Perform get/set error checking, clean up the interface.
14422
14423         * assign.cs: recognize PropertyExprs as targets, and if so, turn
14424         them into toplevel access objects.
14425
14426 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
14427
14428         * expression.cs: PropertyExpr::PropertyExpr: use work around the
14429         SRE.
14430
14431         * typemanager.cs: Keep track here of our PropertyBuilders again to
14432         work around lameness in SRE.
14433
14434 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
14435
14436         * expression.cs (LValue::LValueResolve): New method in the
14437         interface, used to perform a second resolution pass for LValues. 
14438
14439         (This::DoResolve): Catch the use of this in static methods.
14440
14441         (This::LValueResolve): Implement.
14442
14443         (This::Store): Remove warning, assigning to `this' in structures
14444         is 
14445
14446         (Invocation::Emit): Deal with invocation of
14447         methods on value types.  We need to pass the address to structure
14448         methods rather than the object itself.  (The equivalent code to
14449         emit "this" for structures leaves the entire structure on the
14450         stack instead of a pointer to it). 
14451
14452         (ParameterReference::DoResolve): Compute the real index for the
14453         argument based on whether the method takes or not a `this' pointer
14454         (ie, the method is static).
14455
14456         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
14457         value types returned from functions when we need to invoke a
14458         method on the sturcture.
14459
14460
14461 2001-10-11  Ravi Pratap  <ravi@ximian.com>
14462
14463         * class.cs (TypeContainer::DefineType): Method to actually do the business of
14464         defining the type in the Modulebuilder or Typebuilder. This is to take
14465         care of nested types which need to be defined on the TypeBuilder using
14466         DefineNestedMethod.
14467
14468         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
14469         methods in RootContext, only ported to be part of TypeContainer.
14470
14471         (TypeContainer::GetInterfaceOrClass): Ditto.
14472
14473         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
14474
14475         * interface.cs (Interface::DefineInterface): New method. Does exactly
14476         what RootContext.CreateInterface did earlier, only it takes care of nested types 
14477         too.
14478
14479         (Interface::GetInterfaces): Move from RootContext here and port.
14480
14481         (Interface::GetInterfaceByName): Same here.
14482
14483         * rootcontext.cs (ResolveTree): Re-write.
14484
14485         (PopulateTypes): Re-write.
14486
14487         * class.cs (TypeContainer::Populate): Populate nested types too.
14488         (TypeContainer::Emit): Emit nested members too.
14489
14490         * typemanager.cs (AddUserType): Do not make use of the FullName property,
14491         instead just use the name argument passed in as it is already fully
14492         qualified.
14493
14494         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
14495         to TypeContainer mapping to see if a type is user-defined.
14496
14497         * class.cs (TypeContainer::CloseType): Implement. 
14498
14499         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
14500         the default constructor.
14501
14502         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
14503         twice.
14504
14505         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
14506
14507         * interface.cs (CloseType): Create the type here.
14508
14509         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
14510         the hierarchy.
14511
14512         Remove all the methods which are now in TypeContainer.
14513
14514 2001-10-10  Ravi Pratap  <ravi@ximian.com>
14515
14516         * delegate.cs (Define): Re-write bits to define the delegate
14517         correctly.
14518
14519 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
14520
14521         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
14522
14523         * expression.cs (ImplicitReferenceConversion): handle null as well
14524         as a source to convert to any reference type.
14525
14526         * statement.cs (Return): Perform any implicit conversions to
14527         expected return type.  
14528
14529         Validate use of return statement.  
14530
14531         * codegen.cs (EmitContext): Pass the expected return type here.
14532
14533         * class.cs (Method, Constructor, Property): Pass expected return
14534         type to EmitContext.
14535
14536 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
14537
14538         * expression.cs: Make DoResolve take an EmitContext instead of a
14539         TypeContainer.
14540
14541         Replaced `l' and `location' for `loc', for consistency.
14542
14543         (Error, Warning): Remove unneeded Tc argument.
14544
14545         * assign.cs, literal.cs, constant.cs: Update to new calling
14546         convention. 
14547
14548         * codegen.cs: EmitContext now contains a flag indicating whether
14549         code is being generated in a static method or not.
14550
14551         * cs-parser.jay: DecomposeQI, new function that replaces the old
14552         QualifiedIdentifier.  Now we always decompose the assembled
14553         strings from qualified_identifier productions into a group of
14554         memberaccesses.
14555
14556 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
14557
14558         * rootcontext.cs: Deal with field-less struct types correctly now
14559         by passing the size option to Define Type.
14560
14561         * class.cs: Removed hack that created one static field. 
14562
14563 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
14564
14565         * statement.cs: Moved most of the code generation here. 
14566
14567 2001-10-09  Ravi Pratap  <ravi@ximian.com>
14568
14569         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
14570         seem very right.
14571
14572         (ElementAccess): Remove useless bits for now - keep checks as the spec
14573         says.
14574
14575 2001-10-08  Ravi Pratap  <ravi@ximian.com>
14576
14577         * expression.cs (ElementAccess::DoResolve): Remove my crap code
14578         and start performing checks according to the spec.
14579
14580 2001-10-07  Ravi Pratap  <ravi@ximian.com>
14581
14582         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
14583         rank_specifiers instead.
14584
14585         (rank_specifiers): Change the order in which the rank specifiers are stored
14586
14587         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
14588
14589         * expression.cs (ElementAccess): Implement the LValue interface too.
14590
14591 2001-10-06  Ravi Pratap  <ravi@ximian.com>
14592
14593         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
14594         except that user defined conversions are not included.
14595
14596         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
14597         perform the conversion of the return type, if necessary.
14598
14599         (New::DoResolve): Check whether we are creating an array or an object
14600         and accordingly do the needful.
14601
14602         (New::Emit): Same here.
14603
14604         (New::DoResolve): Implement guts of array creation.
14605
14606         (New::FormLookupType): Helper function.
14607
14608 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
14609
14610         * codegen.cs: Removed most of the code generation here, and move the
14611         corresponding code generation bits to the statement classes. 
14612
14613         Added support for try/catch/finalize and throw.
14614
14615         * cs-parser.jay: Added support for try/catch/finalize.
14616
14617         * class.cs: Catch static methods having the flags override,
14618         virtual or abstract.
14619
14620         * expression.cs (UserCast): This user cast was not really doing
14621         what it was supposed to do.  Which is to be born in fully resolved
14622         state.  Parts of the resolution were being performed at Emit time! 
14623
14624         Fixed this code.
14625
14626 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
14627
14628         * expression.cs: Implicity convert the result from UserCast.
14629
14630 2001-10-05  Ravi Pratap  <ravi@ximian.com>
14631
14632         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
14633         prevented it from working correctly. 
14634
14635         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
14636         merely ConvertImplicit.
14637
14638 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
14639
14640         * typemanager.cs: Make the LookupTypeContainer function static,
14641         and not per-instance.  
14642
14643         * class.cs: Make static FindMembers (the one that takes a Type
14644         argument). 
14645
14646         * codegen.cs: Add EmitForeach here.
14647
14648         * cs-parser.jay: Make foreach a toplevel object instead of the
14649         inline expansion, as we need to perform semantic analysis on it. 
14650
14651 2001-10-05  Ravi Pratap  <ravi@ximian.com>
14652
14653         * expression.cs (Expression::ImplicitUserConversion): Rename to
14654         UserDefinedConversion.
14655
14656         (Expression::UserDefinedConversion): Take an extra argument specifying 
14657         whether we look for explicit user conversions too.
14658
14659         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
14660
14661         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
14662
14663         (ExplicitUserConversion): Make it a call to UserDefinedConversion
14664         with the appropriate arguments.
14665
14666         * cs-parser.jay (cast_expression): Record location too.
14667
14668         * expression.cs (Cast): Record location info.
14669
14670         (Expression::ConvertExplicit): Take location argument.
14671
14672         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
14673         to determine if we are doing explicit conversions.
14674
14675         (UserCast::Emit): Update accordingly.
14676
14677         (Expression::ConvertExplicit): Report an error if everything fails.
14678
14679         * ../errors/cs0030.cs : Add.
14680
14681 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
14682
14683         * modifiers.cs: If the ABSTRACT keyword is present, also set the
14684         virtual and newslot bits. 
14685
14686         * class.cs (TypeContainer::RegisterRequiredImplementations):
14687         Record methods we need.
14688
14689         (TypeContainer::MakeKey): Helper function to make keys for
14690         MethodBases, since the Methodbase key is useless.
14691
14692         (TypeContainer::Populate): Call RegisterRequiredImplementations
14693         before defining the methods.   
14694
14695         Create a mapping for method_builders_to_methods ahead of time
14696         instead of inside a tight loop.
14697
14698         (::RequireMethods):  Accept an object as the data to set into the
14699         hashtable so we can report interface vs abstract method mismatch.
14700
14701 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
14702
14703         * report.cs: Make all of it static.
14704
14705         * rootcontext.cs: Drop object_type and value_type computations, as
14706         we have those in the TypeManager anyways.
14707
14708         Drop report instance variable too, now it is a global.
14709
14710         * driver.cs: Use try/catch on command line handling.
14711
14712         Add --probe option to debug the error reporting system with a test
14713         suite. 
14714
14715         * report.cs: Add support for exiting program when a probe
14716         condition is reached.
14717
14718 2001-10-03  Ravi Pratap  <ravi@ximian.com>
14719
14720         * expression.cs (Binary::DoNumericPromotions): Fix the case when
14721         we do a forcible conversion regardless of type, to check if 
14722         ForceConversion returns a null.
14723
14724         (Binary::error19): Use location to report error.
14725
14726         (Unary::error23): Use location here too.
14727
14728         * ../errors/cs0019.cs : Check in.
14729
14730         * ../errors/cs0023.cs : Check in.
14731
14732         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
14733         case of a non-null MethodInfo object with a length of 0 !
14734
14735         (Binary::ResolveOperator): Flag error if overload resolution fails to find
14736         an applicable member - according to the spec :-)
14737         Also fix logic to find members in base types.
14738
14739         (Unary::ResolveOperator): Same here.
14740
14741         (Unary::report23): Change name to error23 and make first argument a TypeContainer
14742         as I was getting thoroughly confused between this and error19 :-)
14743
14744         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
14745         (::FindMostEncompassedType): Implement.
14746         (::FindMostEncompassingType): Implement.
14747         (::StandardConversionExists): Implement.
14748
14749         (UserImplicitCast): Re-vamp. We now need info about most specific
14750         source and target types so that we can do the necessary conversions.
14751
14752         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
14753         mathematical union with no duplicates.
14754
14755 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
14756
14757         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
14758         in order from base classes to child classes, so that we can in
14759         child classes look up in our parent for method names and
14760         attributes (required for handling abstract, virtual, new, override
14761         constructs: we need to instrospect our base class, and if we dont
14762         populate the classes in order, the introspection might be
14763         incorrect.  For example, a method could query its parent before
14764         the parent has any methods and would determine that the parent has
14765         no abstract methods (while it could have had them)).
14766
14767         (RootContext::CreateType): Record the order in which we define the
14768         classes.
14769
14770 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
14771
14772         * class.cs (TypeContainer::Populate): Also method definitions can
14773         fail now, keep track of this.
14774
14775         (TypeContainer::FindMembers): Implement support for
14776         DeclaredOnly/noDeclaredOnly flag.
14777
14778         (Constructor::Emit) Return the ConstructorBuilder.
14779
14780         (Method::Emit) Return the MethodBuilder. 
14781         Check for abstract or virtual methods to be public.
14782
14783         * rootcontext.cs (RootContext::CreateType): Register all the
14784         abstract methods required for the class to be complete and the
14785         interface methods that must be implemented. 
14786
14787         * cs-parser.jay: Report error 501 (method requires body if it is
14788         not marked abstract or extern).
14789
14790         * expression.cs (TypeOf::Emit): Implement.
14791
14792         * typemanager.cs: runtime_handle_type, new global type.
14793
14794         * class.cs (Property::Emit): Generate code for properties.
14795
14796 2001-10-02  Ravi Pratap  <ravi@ximian.com>
14797
14798         * expression.cs (Unary::ResolveOperator): Find operators on base type
14799         too - we now conform exactly to the spec.
14800
14801         (Binary::ResolveOperator): Same here.
14802
14803         * class.cs (Operator::Define): Fix minor quirk in the tests.
14804
14805         * ../errors/cs0215.cs : Added.
14806
14807         * ../errors/cs0556.cs : Added.
14808
14809         * ../errors/cs0555.cs : Added.
14810
14811 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
14812
14813         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
14814         single integer which is really efficient
14815
14816 2001-10-01  Ravi Pratap  <ravi@ximian.com>
14817
14818         *  expression.cs (Expression::ImplicitUserConversion): Use location
14819         even in the case when we are examining True operators.
14820  
14821         * class.cs (Operator::Define): Perform extensive checks to conform
14822         with the rules for operator overloading in the spec.
14823
14824         * expression.cs (Expression::ImplicitReferenceConversion): Implement
14825         some of the other conversions mentioned in the spec.
14826
14827         * typemanager.cs (array_type): New static member for the System.Array built-in
14828         type.
14829
14830         (cloneable_interface): For System.ICloneable interface.
14831
14832         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
14833         we start resolving the tree and populating types.
14834
14835         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
14836  
14837 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
14838
14839         * expression.cs (Expression::ExprClassFromMemberInfo,
14840         Expression::Literalize): Create literal expressions from
14841         FieldInfos which are literals.
14842
14843         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
14844         type casts, because they were wrong.  The test suite in tests
14845         caught these ones.
14846
14847         (ImplicitNumericConversion): ushort to ulong requires a widening
14848         cast. 
14849
14850         Int32 constant to long requires widening cast as well.
14851
14852         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
14853         for integers because the type on the stack is not i4.
14854
14855 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
14856
14857         * expression.cs (report118): require location argument. 
14858
14859         * parameter.cs: Do not dereference potential null value.
14860
14861         * class.cs: Catch methods that lack the `new' keyword when
14862         overriding a name.  Report warnings when `new' is used without
14863         anything being there to override.
14864
14865         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
14866
14867         * class.cs: Only add constructor to hashtable if it is non-null
14868         (as now constructors can fail on define).
14869
14870         (TypeManager, Class, Struct): Take location arguments.
14871
14872         Catch field instance initialization in structs as errors.
14873
14874         accepting_filter: a new filter for FindMembers that is static so
14875         that we dont create an instance per invocation.
14876
14877         (Constructor::Define): Catch errors where a struct constructor is
14878         parameterless 
14879
14880         * cs-parser.jay: Pass location information for various new
14881         constructs. 
14882
14883         * delegate.cs (Delegate): take a location argument.
14884
14885         * driver.cs: Do not call EmitCode if there were problesm in the
14886         Definition of the types, as many Builders wont be there. 
14887
14888         * decl.cs (Decl::Decl): Require a location argument.
14889
14890         * cs-tokenizer.cs: Handle properly hex constants that can not fit
14891         into integers, and find the most appropiate integer for it.
14892
14893         * literal.cs: Implement ULongLiteral.
14894
14895         * rootcontext.cs: Provide better information about the location of
14896         failure when CreateType fails.
14897
14898 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
14899
14900         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
14901         as well.
14902
14903         * expression.cs (Binary::CheckShiftArguments): Add missing type
14904         computation.
14905         (Binary::ResolveOperator): Add type to the logical and and logical
14906         or, Bitwise And/Or and Exclusive Or code paths, it was missing
14907         before.
14908
14909         (Binary::DoNumericPromotions): In the case where either argument
14910         is ulong (and most signed types combined with ulong cause an
14911         error) perform implicit integer constant conversions as well.
14912
14913 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
14914
14915         * expression.cs (UserImplicitCast): Method should always be
14916         non-null. 
14917         (Invocation::BetterConversion): Simplified test for IntLiteral.
14918
14919         (Expression::ImplicitNumericConversion): Split this routine out.
14920         Put the code that performs implicit constant integer conversions
14921         here. 
14922
14923         (Expression::Resolve): Become a wrapper around DoResolve so we can
14924         check eclass and type being set after resolve.
14925
14926         (Invocation::Badness): Remove this dead function
14927
14928         (Binary::ResolveOperator): Do not compute the expensive argumnets
14929         unless we have a union for it.
14930
14931         (Probe::Emit): Is needs to do an isinst and then
14932         compare against null.
14933
14934         (::CanConvert): Added Location argument.  If the Location argument
14935         is null (Location.Null), then we do not report errors.  This is
14936         used by the `probe' mechanism of the Explicit conversion.  We do
14937         not want to generate an error for something that the user
14938         explicitly requested to be casted.  But the pipeline for an
14939         explicit cast first tests for potential implicit casts.
14940
14941         So for now, if the Location is null, it means `Probe only' to
14942         avoid adding another argument.   Might have to revise this
14943         strategy later.
14944
14945         (ClassCast): New class used to type cast objects into arbitrary
14946         classes (used in Explicit Reference Conversions).
14947
14948         Implement `as' as well.
14949
14950         Reverted all the patches from Ravi below: they were broken:
14951
14952                 * The use of `level' as a mechanism to stop recursive
14953                   invocations is wrong.  That was there just to catch the
14954                   bug with a strack trace but not as a way of addressing
14955                   the problem.
14956
14957                   To fix the problem we have to *understand* what is going
14958                   on and the interactions and come up with a plan, not
14959                   just get things going.
14960
14961                 * The use of the type conversion cache that I proposed
14962                   last night had an open topic: How does this work across
14963                   protection domains.  A user defined conversion might not
14964                   be public in the location where we are applying the
14965                   conversion, a different conversion might be selected
14966                   (ie, private A->B (better) but public B->A (worse),
14967                   inside A, A->B applies, but outside it, B->A will
14968                   apply).
14969
14970                 * On top of that (ie, even if the above is solved),
14971                   conversions in a cache need to be abstract.  Ie, `To
14972                   convert from an Int to a Short use an OpcodeCast', not
14973                   `To convert from an Int to a Short use the OpcodeCast on
14974                   the variable 5' (which is what this patch was doing).
14975
14976 2001-09-28  Ravi Pratap  <ravi@ximian.com>
14977
14978         * expression.cs (Invocation::ConversionExists): Re-write to use
14979         the conversion cache
14980
14981         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
14982         cache all conversions done, not just user-defined ones.
14983
14984         (Invocation::BetterConversion): The real culprit. Use ConversionExists
14985         to determine if a conversion exists instead of acutually trying to 
14986         perform the conversion. It's faster too.
14987
14988         (Expression::ConvertExplicit): Modify to use ConversionExists to check
14989         and only then attempt the implicit conversion.
14990
14991 2001-09-28  Ravi Pratap  <ravi@ximian.com>
14992
14993         * expression.cs (ConvertImplicit): Use a cache for conversions
14994         already found. Check level of recursion and bail out if necessary.
14995
14996 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
14997
14998         * typemanager.cs (string_concat_string_string, string_concat_object_object):
14999         Export standard methods that we expect for string operations.
15000
15001         * statement.cs (Block::UsageWarning): Track usage of variables and
15002         report the errors for not used variables.
15003
15004         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
15005         operator. 
15006
15007 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15008
15009         * codegen.cs: remove unnneded code 
15010
15011         * expression.cs: Removed BuiltinTypeAccess class
15012
15013         Fix the order in which implicit conversions are
15014         done.  
15015
15016         The previous fixed dropped support for boxed conversions (adding a
15017         test to the test suite now)
15018
15019         (UserImplicitCast::CanConvert): Remove test for source being null,
15020         that code is broken.  We should not feed a null to begin with, if
15021         we do, then we should track the bug where the problem originates
15022         and not try to cover it up here.
15023
15024         Return a resolved expression of type UserImplicitCast on success
15025         rather than true/false.  Ravi: this is what I was talking about,
15026         the pattern is to use a static method as a "constructor" for
15027         objects. 
15028
15029         Also, do not create arguments until the very last minute,
15030         otherwise we always create the arguments even for lookups that
15031         will never be performed. 
15032
15033         (UserImplicitCast::Resolve): Eliminate, objects of type
15034         UserImplicitCast are born in a fully resolved state. 
15035
15036         * typemanager.cs (InitCoreTypes): Init also value_type
15037         (System.ValueType). 
15038
15039         * expression.cs (Cast::Resolve): First resolve the child expression.
15040
15041         (LValue): Add new method AddressOf to be used by
15042         the `&' operator.  
15043
15044         Change the argument of Store to take an EmitContext instead of an
15045         ILGenerator, because things like FieldExpr need to be able to call
15046         their children expression to generate the instance code. 
15047
15048         (Expression::Error, Expression::Warning): Sugar functions for
15049         reporting errors.
15050
15051         (Expression::MemberLookup): Accept a TypeContainer instead of a
15052         Report as the first argument.
15053
15054         (Expression::ResolvePrimary): Killed.  I still want to improve
15055         this as currently the code is just not right.
15056
15057         (Expression::ResolveMemberAccess): Simplify, but it is still
15058         wrong. 
15059
15060         (Unary::Resolve): Catch errors in AddressOf operators.
15061
15062         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
15063         index to a byte for the short-version, or the compiler will choose
15064         the wrong Emit call, which generates the wrong data.
15065
15066         (ParameterReference::Emit, ::Store): same.
15067
15068         (FieldExpr::AddressOf): Implement.
15069
15070         * typemanager.cs: TypeManager: made public variable instead of
15071         property.
15072
15073         * driver.cs: document --fatal.
15074
15075         * report.cs (ErrorMessage, WarningMessage): new names for the old
15076         Error and Warning classes.
15077
15078         * cs-parser.jay (member_access): Turn built-in access to types
15079         into a normal simplename
15080
15081 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15082
15083         * expression.cs (Invocation::BetterConversion): Fix to cope
15084         with q being null, since this was introducing a bug.
15085
15086         * expression.cs (ConvertImplicit): Do built-in conversions first.
15087
15088 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15089
15090         * expression.cs (UserImplicitCast::Resolve): Fix bug.
15091
15092 2001-09-27  Ravi Pratap  <ravi@ximian.com>
15093
15094         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
15095         I had introduced long ago (what's new ?).
15096
15097         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
15098         the work of all the checking. 
15099         (ConvertImplicit): Call CanConvert and only then create object if necessary.
15100         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
15101
15102         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
15103         that is the right way. 
15104
15105         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
15106         overloading resolution. Use everywhere instead of cutting and pasting code.
15107
15108         (Binary::ResolveOperator): Use MakeUnionSet.
15109
15110         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
15111         we have to convert to bool types. Not complete yet.
15112
15113 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
15114
15115         * typemanager.cs (TypeManager::CSharpName): support ushort.
15116
15117         * expression.cs (Expression::TryImplicitIntConversion): Attempts
15118         to provide an expression that performsn an implicit constant int
15119         conversion (section 6.1.6).
15120         (Expression::ConvertImplicitRequired): Reworked to include
15121         implicit constant expression conversions.
15122
15123         (Expression::ConvertNumericExplicit): Finished.
15124
15125         (Invocation::Emit): If InstanceExpression is null, then it means
15126         that we perform a call on this.
15127
15128 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15129
15130         * expression.cs (Unary::Emit): Remove some dead code.
15131         (Probe): Implement Resolve and Emit for `is'.
15132         (Expression::ConvertImplicitRequired): Attempt to do constant
15133         expression conversions here.  Maybe should be moved to
15134         ConvertImplicit, but I am not sure.
15135         (Expression::ImplicitLongConstantConversionPossible,
15136         Expression::ImplicitIntConstantConversionPossible): New functions
15137         that tell whether is it possible to apply an implicit constant
15138         expression conversion.
15139
15140         (ConvertNumericExplicit): Started work on explicit numeric
15141         conversions.
15142
15143         * cs-parser.jay: Update operator constants.
15144
15145         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
15146         (Parameters::GetSignature): Hook up VerifyArgs here.
15147         (Parameters::VerifyArgs): Verifies that no two arguments have the
15148         same name. 
15149
15150         * class.cs (Operator): Update the operator names to reflect the
15151         ones that the spec expects (as we are just stringizing the
15152         operator names).
15153
15154         * expression.cs (Unary::ResolveOperator): Fix bug: Use
15155         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
15156         previous usage did only work for our methods.
15157         (Expression::ConvertImplicit): Handle decimal implicit numeric
15158         conversions as well.
15159         (Expression::InternalTypeConstructor): Used to invoke constructors
15160         on internal types for default promotions.
15161
15162         (Unary::Emit): Implement special handling for the pre/post
15163         increment/decrement for overloaded operators, as they need to have
15164         the same semantics as the other operators.
15165
15166         (Binary::ResolveOperator): ditto.
15167         (Invocation::ConversionExists): ditto.
15168         (UserImplicitCast::Resolve): ditto.
15169
15170 2001-09-26  Ravi Pratap  <ravi@ximian.com>
15171
15172         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
15173         operator, return after emitting body. Regression tests pass again !
15174
15175         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
15176         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
15177         (Invocation::OverloadResolve): Ditto.
15178         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
15179
15180         * everywhere : update calls to the above methods accordingly.
15181
15182 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
15183
15184         * assign.cs (Assign): Make it inherit from ExpressionStatement.
15185
15186         * expression.cs (ExpressionStatement): New base class used for
15187         expressions that can appear in statements, so that we can provide
15188         an alternate path to generate expression that do not leave a value
15189         on the stack.
15190
15191         (Expression::Emit, and all the derivatives): We no longer return
15192         whether a value is left on the stack or not.  Every expression
15193         after being emitted leaves a single value on the stack.
15194
15195         * codegen.cs (EmitContext::EmitStatementExpression): Use the
15196         facilties of ExpressionStatement if possible.
15197
15198         * cs-parser.jay: Update statement_expression.
15199
15200 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
15201
15202         * driver.cs: Change the wording of message
15203
15204 2001-09-25  Ravi Pratap  <ravi@ximian.com>
15205
15206         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
15207         the type of the expression to the return type of the method if
15208         we have an overloaded operator match ! The regression tests pass again !
15209         (Unary::ResolveOperator): Ditto.
15210
15211         * expression.cs (Invocation::ConversionExists): Correct the member lookup
15212         to find "op_Implicit", not "implicit" ;-)
15213         (UserImplicitCast): New class to take care of user-defined implicit conversions.
15214         (ConvertImplicit, ForceConversion): Take TypeContainer argument
15215
15216         * everywhere : Correct calls to the above accordingly.
15217
15218         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
15219         (ConvertImplicit): Do user-defined conversion if it exists.
15220
15221 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
15222
15223         * assign.cs: track location.
15224         (Resolve): Use implicit conversions on assignment.
15225
15226         * literal.cs: Oops.  Not good, Emit of short access values should
15227         pass (Bytes) or the wrong argument will be selected.
15228
15229         * expression.cs (Unary::Emit): Emit code for -expr.
15230
15231         (Unary::ResolveOperator): Handle `Substract' for non-constants
15232         (substract from zero from the non-constants).
15233         Deal with Doubles as well. 
15234
15235         (Expression::ConvertImplicitRequired): New routine that reports an
15236         error if no implicit conversion exists. 
15237
15238         (Invocation::OverloadResolve): Store the converted implicit
15239         expressions if we make them
15240
15241 2001-09-24  Ravi Pratap  <ravi@ximian.com>
15242
15243         * class.cs (ConstructorInitializer): Take a Location argument.
15244         (ConstructorBaseInitializer): Same here.
15245         (ConstructorThisInitializer): Same here.
15246
15247         * cs-parser.jay : Update all calls accordingly.
15248
15249         * expression.cs (Unary, Binary, New): Take location argument.
15250         Update accordingly everywhere.
15251
15252         * cs-parser.jay : Update all calls to the above to take a location
15253         argument.
15254
15255         * class.cs : Ditto.
15256
15257 2001-09-24  Ravi Pratap  <ravi@ximian.com>
15258
15259         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
15260         (Invocation::BetterConversion): Same here
15261         (Invocation::ConversionExists): Ditto.
15262
15263         (Invocation::ConversionExists): Implement.
15264
15265 2001-09-22  Ravi Pratap  <ravi@ximian.com>
15266
15267         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
15268         Also take an additional TypeContainer argument.
15269
15270         * All over : Pass in TypeContainer as argument to OverloadResolve.
15271
15272         * typemanager.cs (CSharpName): Update to check for the string type and return
15273         that too.
15274
15275         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
15276         a given method.
15277
15278 2001-09-21  Ravi Pratap  <ravi@ximian.com>
15279
15280         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
15281         (Invocation::BetterFunction): Implement.
15282         (Invocation::BetterConversion): Implement.
15283         (Invocation::ConversionExists): Skeleton, no implementation yet.
15284
15285         Okay, things work fine !
15286
15287 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
15288
15289         * typemanager.cs: declare and load enum_type, delegate_type and
15290         void_type. 
15291
15292         * expression.cs (Expression::Emit): Now emit returns a value that
15293         tells whether a value is left on the stack or not.  This strategy
15294         might be reveted tomorrow with a mechanism that would address
15295         multiple assignments.
15296         (Expression::report118): Utility routine to report mismatches on
15297         the ExprClass.
15298
15299         (Unary::Report23): Report impossible type/operator combination
15300         utility function.
15301
15302         (Unary::IsIncrementableNumber): Whether the type can be
15303         incremented or decremented with add.
15304         (Unary::ResolveOperator): Also allow enumerations to be bitwise
15305         complemented. 
15306         (Unary::ResolveOperator): Implement ++, !, ~,
15307
15308         (Invocation::Emit): Deal with new Emit convetion.
15309
15310         * All Expression derivatives: Updated their Emit method to return
15311         whether they leave values on the stack or not.
15312
15313         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
15314         stack for expressions that are statements. 
15315
15316 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
15317
15318         * expression.cs (LValue): New interface.  Must be implemented by
15319         LValue objects.
15320         (LocalVariableReference, ParameterReference, FieldExpr): Implement
15321         LValue interface.
15322
15323         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
15324         interface for generating code, simplifies the code.
15325
15326 2001-09-20  Ravi Pratap  <ravi@ximian.com>
15327
15328         * expression.cs (everywhere): Comment out return statements in ::Resolve
15329         methods to avoid the warnings.
15330
15331 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
15332
15333         * driver.cs (parse): Report error 2001 if we can not open the
15334         source file.
15335
15336         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
15337         not resolve it.
15338
15339         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
15340         object. 
15341
15342         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
15343         otherwise nested blocks end up with the same index.
15344
15345         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
15346
15347         * expression.cs:  Instead of having FIXMEs in the Resolve
15348         functions, throw exceptions so it is obvious that we are facing a
15349         bug. 
15350
15351         * cs-parser.jay (invocation_expression): Pass Location information.
15352
15353         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
15354         Use a basename for those routines because .NET does not like paths
15355         on them. 
15356
15357         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
15358         already defined.
15359
15360 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
15361
15362         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
15363         are loading the correct data types (throws an exception if not).
15364         (TypeManager::InitCoreTypes): Use CoreLookupType
15365
15366         * expression.cs (Unary::ResolveOperator): return the child
15367         expression for expressions which are just +expr.
15368         (Unary::ResolveOperator): Return negative literals for -LITERAL
15369         expressions (otherwise they are Unary {Literal}).
15370         (Invocation::Badness): Take into account `Implicit constant
15371         expression conversions'.
15372
15373         * literal.cs (LongLiteral): Implement long literal class.
15374         (IntLiteral): export the `Value' of the intliteral. 
15375
15376 2001-09-19  Ravi Pratap  <ravi@ximian.com>
15377
15378         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
15379
15380         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
15381         instead of 'Operator'
15382
15383         * expression.cs (Binary::ResolveOperator): Update accordingly.
15384         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
15385         and 'Minus'
15386
15387         * cs-parser.jay (unary_expression): Update to use the new names.
15388
15389         * gen-treedump.cs (GetUnary): Same here.
15390
15391         * expression.cs (Unary::Resolve): Implement.
15392         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
15393         operators are found instead of making noise ;-)
15394         (Unary::ResolveOperator): New method to do precisely the same thing which
15395         Binary::ResolveOperator does for Binary expressions.
15396         (Unary.method, .Arguments): Add.
15397         (Unary::OperName): Implement.   
15398         (Unary::ForceConversion): Copy and Paste !
15399
15400         * class.cs (Operator::Define): Fix a small bug for the case when we have 
15401         a unary operator.
15402
15403         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
15404         for the inbuilt operators. Only overloading works for now ;-)
15405
15406 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
15407
15408         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
15409         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
15410
15411         * expression.cs (This::Emit): Implement. 
15412         (This::Resolve): Implement.
15413         (TypeOf:Resolve): Implement.
15414         (Expression::ResolveSimpleName): Add an implicit this to instance
15415         field references. 
15416         (MemberAccess::Resolve): Deal with Parameters and Fields. 
15417         Bind instance variable to Field expressions.
15418         (FieldExpr::Instance): New field used to track the expression that
15419         represents the object instance.
15420         (FieldExpr::Resolve): Track potential errors from MemberLookup not
15421         binding 
15422         (FieldExpr::Emit): Implement.
15423
15424         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
15425         the last instruction contains a return opcode to avoid generating
15426         the last `ret' instruction (this generates correct code, and it is
15427         nice to pass the peverify output).
15428
15429         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
15430         initializer for static and instance variables.
15431         (Constructor::Emit): Allow initializer to be null in the case of
15432         static constructors.  Only emit initializer for instance
15433         constructors. 
15434
15435         (TypeContainer::FindMembers): Return a null array if there are no
15436         matches.
15437
15438         Also fix the code for the MemberTypes.Method branch, as it was not
15439         scanning that for operators (or tried to access null variables before).
15440
15441         * assign.cs (Assign::Emit): Handle instance and static fields. 
15442
15443         * TODO: Updated.
15444
15445         * driver.cs: Stop compilation if there are parse errors.
15446
15447         * cs-parser.jay (constructor_declaration): Provide default base
15448         initializer for non-static constructors.
15449         (constructor_declarator): Do not provide a default base
15450         initializers if none was specified.
15451         Catch the fact that constructors should not have parameters.
15452
15453         * class.cs: Do not emit parent class initializers for static
15454         constructors, that should be flagged as an error.
15455
15456 2001-09-18  Ravi Pratap  <ravi@ximian.com>
15457
15458         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
15459         Move back code into TypeContainer::Populate.
15460
15461 2001-09-18  Ravi Pratap  <ravi@ximian.com>
15462
15463         * class.cs (TypeContainer::AddConstructor): Fix the check to
15464         compare against Name, not Basename. 
15465         (Operator::OpType): Change Plus and Minus to Add and Subtract.
15466
15467         * cs-parser.jay : Update accordingly.
15468
15469         * class.cs (TypeContainer::FindMembers): For the case where we are searching
15470         for methods, don't forget to look into the operators too.
15471         (RegisterMethodBuilder): Helper method to take care of this for
15472         methods, constructors and operators.
15473         (Operator::Define): Completely revamp.
15474         (Operator.OperatorMethod, MethodName): New fields.
15475         (TypeContainer::Populate): Move the registering of builders into
15476         RegisterMethodBuilder.
15477         (Operator::Emit): Re-write.
15478
15479         * expression.cs (Binary::Emit): Comment out code path to emit method
15480         invocation stuff for the case when we have a user defined operator. I am
15481         just not able to get it right !
15482
15483 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
15484
15485         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
15486         argument. 
15487
15488         (Expression::MemberLookup): Provide a version that allows to
15489         specify the MemberTypes and BindingFlags. 
15490
15491         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
15492         so it was not fetching variable information from outer blocks.
15493
15494         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
15495         Beforefieldinit as it was buggy.
15496
15497         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
15498         that Ravi put here.  
15499
15500         * class.cs (Constructor::Emit): Only emit if block is not null.
15501         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
15502         deal with this by semantically definining it as if the user had
15503         done it.
15504
15505         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
15506         constructors as we now "emit" them at a higher level.
15507
15508         (TypeContainer::DefineDefaultConstructor): Used to define the
15509         default constructors if none was provided.
15510
15511         (ConstructorInitializer): Add methods Resolve and Emit. 
15512
15513         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
15514
15515 2001-09-17  Ravi Pratap  <ravi@ximian.com>
15516
15517         * class.cs (TypeContainer::EmitDefaultConstructor): Register
15518         the default constructor builder with our hashtable for methodbuilders
15519         to methodcores.
15520
15521         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
15522         and argument_count is 0 in which case we have a match.
15523         (Binary::ResolveOperator): More null checking and miscellaneous coding
15524         style cleanup.
15525
15526 2001-09-17  Ravi Pratap  <ravi@ximian.com>
15527
15528         * rootcontext.cs (IsNameSpace): Compare against null.
15529
15530         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
15531
15532         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
15533         and Unary::Operator.
15534
15535         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
15536         accordingly.
15537
15538         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
15539         we have overloaded operators.
15540         (Binary::ResolveOperator): Implement the part which does the operator overload
15541         resolution.
15542
15543         * class.cs (Operator::Emit): Implement.
15544         (TypeContainer::Emit): Emit the operators we have too.
15545
15546         * expression.cs (Binary::Emit): Update to emit the appropriate code for
15547         the case when we have a user-defined operator.
15548
15549 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
15550
15551         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
15552
15553 2001-09-16  Ravi Pratap  <ravi@ximian.com>
15554
15555         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
15556         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
15557         (Constructor::Emit): Implement.
15558         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
15559         if we have no work to do. 
15560         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
15561         Emit method.
15562
15563         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
15564         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
15565
15566         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
15567         of parent.parent.
15568
15569 2001-09-15  Ravi Pratap  <ravi@ximian.com>
15570
15571         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
15572         in the source.
15573         (Tree::RecordNamespace): Method to do what the name says ;-)
15574         (Tree::Namespaces): Property to get at the namespaces hashtable.
15575
15576         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
15577         keep track.
15578
15579         * rootcontext.cs (IsNamespace): Fixed it :-)
15580
15581 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
15582
15583         * class.cs (TypeContainer::FindMembers): Add support for
15584         constructors. 
15585         (MethodCore): New class that encapsulates both the shared aspects
15586         of a Constructor and a Method.  
15587         (Method, Constructor): Factored pieces into MethodCore.
15588
15589         * driver.cs: Added --fatal which makes errors throw exceptions.
15590         Load System assembly as well as part of the standard library.
15591
15592         * report.cs: Allow throwing exceptions on errors for debugging.
15593
15594         * modifiers.cs: Do not use `parent', instead use the real type
15595         container to evaluate permission settings.
15596
15597         * class.cs: Put Ravi's patch back in.  He is right, and we will
15598         have to cope with the
15599
15600 2001-09-14  Ravi Pratap  <ravi@ximian.com>
15601
15602         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
15603         FamORAssem, not FamANDAssem.
15604
15605 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
15606
15607         * driver.cs: Added --parse option that only parses its input files
15608         and terminates.
15609
15610         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
15611         incorrect.  IsTopLevel is not used to tell whether an object is
15612         root_types or not (that can be achieved by testing this ==
15613         root_types).  But to see if this is a top-level *class* (not
15614         necessarly our "toplevel" container). 
15615
15616 2001-09-14  Ravi Pratap  <ravi@ximian.com>
15617
15618         * enum.cs (Enum::Define): Modify to call the Lookup method on the
15619         parent instead of a direct call to GetType.
15620
15621 2001-09-14  Ravi Pratap  <ravi@ximian.com>
15622
15623         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
15624         Modifiers.TypeAttr. This should just be a call to that method.
15625
15626         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
15627         object so that we can determine if we are top-level or not.
15628
15629         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
15630         TypeContainer too.
15631
15632         * enum.cs (Enum::Define): Ditto.
15633
15634         * modifiers.cs (FieldAttr): Re-write.
15635
15636         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
15637         (TypeContainer::HaveStaticConstructor): New property to provide access
15638         to precisely that info.
15639
15640         * modifiers.cs (MethodAttr): Re-write.
15641         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
15642
15643         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
15644         of top-level types as claimed.
15645
15646 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
15647
15648         * expression.cs (MemberLookup): Fruitless attempt to lookup
15649         constructors.  Maybe I need to emit default constructors?  That
15650         might be it (currently .NET emits this for me automatically).
15651         (Invocation::OverloadResolve): Cope with Arguments == null.
15652         (Invocation::EmitArguments): new function, shared by the new
15653         constructor and us.
15654         (Invocation::Emit): Handle static and instance methods.  Emit
15655         proper call instruction for virtual or non-virtual invocations.
15656         (New::Emit): Implement.
15657         (New::Resolve): Implement.
15658         (MemberAccess:Resolve): Implement.
15659         (MethodGroupExpr::InstanceExpression): used conforming to the spec
15660         to track instances.
15661         (FieldExpr::Resolve): Set type.
15662
15663         * support.cs: Handle empty arguments.
15664                 
15665         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
15666         SimpleLookup): Auxiliary routines to help parse a qualifier
15667         identifier.  
15668
15669         Update qualifier_identifier rule.
15670
15671         * codegen.cs: Removed debugging messages.
15672
15673         * class.cs: Make this a global thing, this acts just as a "key" to
15674         objects that we might have around.
15675
15676         (Populate): Only initialize method_builders_to_methods once.
15677
15678         * expression.cs (PropertyExpr): Initialize type from the
15679         PropertyType. 
15680
15681         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
15682         Resolve pattern.  Attempt to implicitly convert value to boolean.
15683         Emit code.
15684
15685         * expression.cs: Set the type for the int32/int32 argument case.
15686         (Binary::ResolveOperator): Set the return type to boolean for
15687         comparission operators
15688
15689         * typemanager.cs: Remove debugging print code.
15690
15691         (Invocation::Resolve): resolve type.
15692
15693         * class.cs: Allocate a MemberInfo of the correct size, as the code
15694         elsewhere depends on the test to reflect the correct contents.
15695
15696         (Method::) Keep track of parameters, due to System.Reflection holes
15697
15698         (TypeContainer::Populate): Keep track of MethodBuilders to Method
15699         mapping here.
15700
15701         (TypeContainer::FindMembers): Use ArrayList and then copy an array
15702         of the exact size and return that.
15703
15704         (Class::LookupMethodByBuilder): New function that maps
15705         MethodBuilders to its methods.  Required to locate the information
15706         on methods because System.Reflection bit us again.
15707
15708         * support.cs: New file, contains an interface ParameterData and
15709         two implementations: ReflectionParameters and InternalParameters
15710         used to access Parameter information.  We will need to grow this
15711         as required.
15712
15713         * expression.cs (Invocation::GetParameterData): implement a cache
15714         and a wrapper around the ParameterData creation for methods. 
15715         (Invocation::OverloadResolve): Use new code.
15716
15717 2001-09-13  Ravi Pratap  <ravi@ximian.com>
15718
15719         * class.cs (TypeContainer::EmitField): Remove and move into 
15720         (Field::Define): here and modify accordingly.
15721         (Field.FieldBuilder): New member.
15722         (TypeContainer::Populate): Update accordingly.
15723         (TypeContainer::FindMembers): Implement.
15724
15725 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
15726
15727         * statement.cs: (VariableInfo::VariableType): New field to be
15728         initialized with the full type once it is resolved. 
15729
15730 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
15731
15732         * parameter.cs (GetParameterInfo): Use a type cache to compute
15733         things only once, and to reuse this information
15734
15735         * expression.cs (LocalVariableReference::Emit): Implement.
15736         (OpcodeCast::Emit): fix.
15737
15738         (ParameterReference::Resolve): Implement.
15739         (ParameterReference::Emit): Implement.
15740
15741         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
15742         that are expressions need to stay as Expressions.
15743
15744         * typemanager.cs (CSharpName): Returns the C# name of a type if
15745         possible. 
15746
15747         * expression.cs (Expression::ConvertImplicit): New function that
15748         implements implicit type conversions.
15749
15750         (Expression::ImplicitReferenceConversion): Implements implicit
15751         reference conversions.
15752
15753         (EmptyCast): New type for transparent casts.
15754
15755         (OpcodeCast): New type for casts of types that are performed with
15756         a sequence of bytecodes.
15757
15758         (BoxedCast): New type used for casting value types into reference
15759         types.  Emits a box opcode.
15760
15761         (Binary::DoNumericPromotions): Implements numeric promotions of
15762         and computation of the Binary::Type.
15763
15764         (Binary::EmitBranchable): Optimization.
15765
15766         (Binary::Emit): Implement code emission for expressions.
15767
15768         * typemanager.cs (TypeManager): Added two new core types: sbyte
15769         and byte.
15770
15771 2001-09-12  Ravi Pratap  <ravi@ximian.com>
15772
15773         * class.cs (TypeContainer::FindMembers): Method which does exactly
15774         what Type.FindMembers does, only we don't have to use reflection. No
15775         implementation yet.
15776
15777         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
15778         typecontainer objects as we need to get at them.
15779         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
15780
15781         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
15782         typecontainer object.
15783
15784         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
15785         of just a Report object.
15786
15787 2001-09-11  Ravi Pratap  <ravi@ximian.com>
15788
15789         * class.cs (Event::Define): Go back to using the prefixes "add_" and
15790         "remove_"
15791         (TypeContainer::Populate): Now define the delegates of the type too.
15792         (TypeContainer.Delegates): Property to access the list of delegates defined
15793         in the type.
15794
15795         * delegates.cs (Delegate::Define): Implement partially.
15796
15797         * modifiers.cs (TypeAttr): Handle more flags.
15798
15799 2001-09-11  Ravi Pratap  <ravi@ximian.com>
15800
15801         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
15802         and not <=
15803         (Operator::Define): Re-write logic to get types by using the LookupType method
15804         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
15805         (Indexer::Define): Ditto.
15806         (Event::Define): Ditto.
15807         (Property::Define): Ditto.
15808
15809 2001-09-10  Ravi Pratap  <ravi@ximian.com>
15810
15811         * class.cs (TypeContainer::Populate): Now define operators too. 
15812         (TypeContainer.Operators): New property to access the list of operators
15813         in a type.
15814         (Operator.OperatorMethodBuilder): New member to hold the method builder
15815         for the operator we are defining.
15816         (Operator::Define): Implement.
15817
15818 2001-09-10  Ravi Pratap  <ravi@ximian.com>
15819
15820         * class.cs (Event::Define): Make the prefixes of the accessor methods
15821         addOn_ and removeOn_ 
15822
15823         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
15824         of the location being passed in too. Ideally, this should go later since all
15825         error reporting should be done through the Report object.
15826
15827         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
15828         (Populate): Iterate thru the indexers we have and define them too.
15829         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
15830         for the get and set accessors.
15831         (Indexer::Define): Implement.
15832
15833 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
15834
15835         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
15836         my previous implementation, did not work.
15837
15838         * typemanager.cs: Add a couple of missing types (the longs).
15839
15840         * literal.cs: Use TypeManager.bool_type instead of getting it.
15841
15842         * expression.cs (EventExpr): New kind of expressions.
15843         (Expressio::ExprClassFromMemberInfo): finish
15844
15845 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
15846
15847         * assign.cs: Emit stores to static fields differently.
15848
15849 2001-09-08  Ravi Pratap  <ravi@ximian.com>
15850
15851         * Merge in changes and adjust code to tackle conflicts. Backed out my
15852         code in Assign::Resolve ;-) 
15853
15854 2001-09-08  Ravi Pratap  <ravi@ximian.com>
15855
15856         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
15857         instead Report.Error and also pass in the location.
15858         (CSharpParser::Lexer): New readonly property to return the reference
15859         to the Tokenizer object.
15860         (declare_local_variables): Use Report.Error with location instead of plain 
15861         old error.
15862         (CheckDef): Ditto.
15863
15864         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
15865         (Operator.CheckBinaryOperator): Ditto.
15866
15867         * cs-parser.jay (operator_declarator): Update accordingly.
15868
15869         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
15870         (CheckBinaryOperator): Same here.
15871
15872         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
15873         on the name without any prefixes of namespace names etc. This is because we
15874         already might have something already fully qualified like 
15875         'System.Console.WriteLine'
15876
15877         * assign.cs (Resolve): Begin implementation. Stuck ;-)
15878
15879 2001-09-07  Ravi Pratap  <ravi@ximian.com>
15880
15881         * cs-tokenizer.cs (location): Return a string which also contains
15882         the file name.
15883
15884         * expression.cs (ElementAccess): New class for expressions of the
15885         type 'element access.'
15886         (BaseAccess): New class for expressions of the type 'base access.'
15887         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
15888         respectively.
15889
15890         * cs-parser.jay (element_access): Implement action.
15891         (base_access): Implement actions.
15892         (checked_expression, unchecked_expression): Implement.
15893
15894         * cs-parser.jay (local_variable_type): Correct and implement.
15895         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
15896
15897         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
15898
15899         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
15900         name and the specifiers.
15901
15902         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
15903
15904         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
15905         making them all public ;-)
15906
15907         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
15908         class anyways.
15909
15910 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
15911
15912         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
15913         PropertyExprs.
15914         (FieldExpr, PropertyExprs): New resolved expressions.
15915         (SimpleName::MemberStaticCheck): Perform static checks for access
15916         to non-static fields on static methods. Maybe this should be
15917         generalized for MemberAccesses. 
15918         (SimpleName::ResolveSimpleName): More work on simple name
15919         resolution. 
15920
15921         * cs-parser.jay (primary_expression/qualified_identifier): track
15922         the parameter index.
15923
15924         * codegen.cs (CodeGen::Save): Catch save exception, report error.
15925         (EmitContext::EmitBoolExpression): Chain to expression generation
15926         instead of temporary hack.
15927         (::EmitStatementExpression): Put generic expression code generation.
15928
15929         * assign.cs (Assign::Emit): Implement variable assignments to
15930         local variables, parameters and fields.
15931
15932 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
15933
15934         * statement.cs (Block::GetVariableInfo): New method, returns the
15935         VariableInfo for a variable name in a block.
15936         (Block::GetVariableType): Implement in terms of GetVariableInfo
15937
15938         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
15939         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
15940
15941 2001-09-06  Ravi Pratap  <ravi@ximian.com>
15942
15943         * cs-parser.jay (operator_declaration): Continue on my quest : update
15944         to take attributes argument.
15945         (event_declaration): Ditto.
15946         (enum_declaration): Ditto.
15947         (indexer_declaration): Ditto.
15948
15949         * class.cs (Operator::Operator): Update constructor accordingly.
15950         (Event::Event): Ditto.
15951
15952         * delegate.cs (Delegate::Delegate): Same here.
15953
15954         * enum.cs (Enum::Enum): Same here.
15955
15956 2001-09-05  Ravi Pratap  <ravi@ximian.com>
15957
15958         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
15959
15960         * ../tests/cs0658.cs : New file to demonstrate error 0658.
15961
15962         * attribute.cs (Attributes): New class to encapsulate all attributes which were
15963         being passed around as an arraylist.
15964         (Attributes::AddAttribute): Method to add attribute sections.
15965
15966         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
15967         (struct_declaration): Update accordingly.
15968         (constant_declaration): Update.
15969         (field_declaration): Update.
15970         (method_header): Update.
15971         (fixed_parameter): Update.
15972         (parameter_array): Ditto.
15973         (property_declaration): Ditto.
15974         (destructor_declaration): Ditto.
15975
15976         * class.cs (Struct::Struct): Update constructors accordingly.
15977         (Class::Class): Ditto.
15978         (Field::Field): Ditto.
15979         (Method::Method): Ditto.
15980         (Property::Property): Ditto.
15981         (TypeContainer::OptAttribute): update property's return type.
15982
15983         * interface.cs (Interface.opt_attributes): New member.
15984         (Interface::Interface): Update to take the extra Attributes argument.
15985
15986         * parameter.cs (Parameter::Parameter): Ditto.
15987
15988         * constant.cs (Constant::Constant): Ditto.
15989
15990         * interface.cs (InterfaceMemberBase): New OptAttributes field.
15991         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
15992         the attributes as a parameter.
15993         (InterfaceProperty): Update constructor call.
15994         (InterfaceEvent): Ditto.
15995         (InterfaceMethod): Ditto.
15996         (InterfaceIndexer): Ditto.
15997
15998         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
15999         pass the attributes too.
16000         (interface_event_declaration): Ditto.
16001         (interface_property_declaration): Ditto.
16002         (interface_method_declaration): Ditto.
16003         (interface_declaration): Ditto.
16004
16005 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
16006
16007         * class.cs (Method::Define): Track the "static Main" definition to
16008         create an entry point. 
16009
16010         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
16011         EntryPoint if we find it. 
16012
16013         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
16014         (EmitContext::ig): Make this variable public.
16015
16016         * driver.cs: Make the default output file be the first file name
16017         with the .exe extension.  
16018
16019         Detect empty compilations
16020
16021         Handle various kinds of output targets.  Handle --target and
16022         rename -t to --dumper.
16023
16024         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
16025         methods inherited from Expression return now an Expression.  This
16026         will is used during the tree rewriting as we resolve them during
16027         semantic analysis.
16028
16029         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
16030         the spec.  Missing entirely is the information about
16031         accessability of elements of it.
16032
16033         (Expression::ExprClassFromMemberInfo): New constructor for
16034         Expressions that creates a fully initialized Expression based on
16035         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
16036         a Type.
16037
16038         (Invocation::Resolve): Begin implementing resolution of invocations.
16039
16040         * literal.cs (StringLiteral):  Implement Emit.
16041
16042 2001-09-05  Ravi Pratap  <ravi@ximian.com>
16043
16044         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
16045         member.
16046
16047 2001-09-04  Ravi Pratap  <ravi@ximian.com>
16048
16049         * cs-parser.jay (attribute_arguments): Implement actions.
16050         (attribute): Fix bug in production. Implement action.
16051         (attribute_list): Implement.
16052         (attribute_target): Implement.
16053         (attribute_target_specifier, opt_target_specifier): Implement
16054         (CheckAttributeTarget): New method to check if the attribute target
16055         is valid.
16056         (attribute_section): Implement.
16057         (opt_attributes): Implement.
16058
16059         * attribute.cs : New file to handle attributes.
16060         (Attribute): Class to hold attribute info.
16061
16062         * cs-parser.jay (opt_attribute_target_specifier): Remove production
16063         (attribute_section): Modify production to use 2 different rules to 
16064         achieve the same thing. 1 s/r conflict down !
16065         Clean out commented, useless, non-reducing dimension_separator rules.
16066
16067         * class.cs (TypeContainer.attributes): New member to hold list
16068         of attributes for a type.
16069         (Struct::Struct): Modify to take one more argument, the attribute list.
16070         (Class::Class): Ditto.
16071         (Field::Field): Ditto.
16072         (Method::Method): Ditto.
16073         (Property::Property): Ditto.
16074
16075         * cs-parser.jay (struct_declaration): Update constructor call to
16076         pass in the attributes too.
16077         (class_declaration): Ditto.
16078         (constant_declaration): Ditto.
16079         (field_declaration): Ditto.
16080         (method_header): Ditto.
16081         (fixed_parameter): Ditto.
16082         (parameter_array): Ditto.
16083         (property_declaration): Ditto.
16084
16085         * constant.cs (Constant::Constant): Update constructor similarly.
16086         Use System.Collections.
16087
16088         * parameter.cs (Parameter::Parameter): Update as above.
16089
16090 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16091
16092         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
16093         (TypeContainer.delegates): New member to hold list of delegates.
16094
16095         * cs-parser.jay (delegate_declaration): Implement the action correctly 
16096         this time as I seem to be on crack ;-)
16097
16098 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
16099
16100         * rootcontext.cs (RootContext::IsNamespace): new function, used to
16101         tell whether an identifier represents a namespace.
16102
16103         * expression.cs (NamespaceExpr): A namespace expression, used only
16104         temporarly during expression resolution.
16105         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
16106         utility functions to resolve names on expressions.
16107
16108 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
16109
16110         * codegen.cs: Add hook for StatementExpressions. 
16111
16112         * class.cs: Fix inverted test for static flag in methods.
16113
16114 2001-09-02  Ravi Pratap  <ravi@ximian.com>
16115
16116         * class.cs (Operator::CheckUnaryOperator): Correct error number used
16117         to make it coincide with MS' number.
16118         (Operator::CheckBinaryOperator): Ditto.
16119
16120         * ../errors/errors.txt : Remove error numbers added earlier.
16121
16122         * ../errors/cs1019.cs : Test case for error # 1019
16123
16124         * ../errros/cs1020.cs : Test case for error # 1020
16125
16126         * cs-parser.jay : Clean out commented cruft.
16127         (dimension_separators, dimension_separator): Comment out. Ostensibly not
16128         used anywhere - non-reducing rule.
16129         (namespace_declarations): Non-reducing rule - comment out.
16130
16131         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
16132         with TypeContainer::AddEnum.
16133
16134         * delegate.cs : New file for delegate handling classes.
16135         (Delegate): Class for declaring delegates.
16136
16137         * makefile : Update.
16138
16139         * cs-parser.jay (delegate_declaration): Implement.
16140
16141 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
16142
16143         * class.cs (Event::Define): Implement.
16144         (Event.EventBuilder): New member.
16145
16146         * class.cs (TypeContainer::Populate): Update to define all enums and events
16147         we have.
16148         (Events): New property for the events arraylist we hold. Shouldn't we move to using
16149         readonly fields for all these cases ?
16150
16151 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16152
16153         * class.cs (Property): Revamp to use the convention of making fields readonly.
16154         Accordingly modify code elsewhere.
16155
16156         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
16157         the Define method of the Property class.
16158
16159         * class.cs : Clean up applied patch and update references to variables etc. Fix 
16160         trivial bug.
16161         (TypeContainer::Populate): Update to define all the properties we have. Also
16162         define all enumerations.
16163
16164         * enum.cs (Define): Implement.
16165
16166 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
16167
16168         * cs-parser.jay (overloadable_operator): The semantic value is an
16169         enum of the Operator class.
16170         (operator_declarator): Implement actions.
16171         (operator_declaration): Implement.
16172
16173         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
16174         validity of definitions.
16175         (Operator::CheckBinaryOperator): Static method to check for binary operators
16176         (TypeContainer::AddOperator): New method to add an operator to a type.
16177
16178         * cs-parser.jay (indexer_declaration): Added line to actually call the
16179         AddIndexer method so it gets added ;-)
16180
16181         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
16182         already taken care of by the MS compiler ?  
16183
16184 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
16185
16186         * class.cs (Operator): New class for operator declarations.
16187         (Operator::OpType): Enum for the various operators.
16188
16189 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
16190
16191         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
16192         ostensibly handle this in semantic analysis.
16193
16194         * cs-parser.jay (general_catch_clause): Comment out
16195         (specific_catch_clauses, specific_catch_clause): Ditto.
16196         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
16197         (catch_args, opt_catch_args): New productions.
16198         (catch_clause): Rewrite to use the new productions above
16199         (catch_clauses): Modify accordingly.
16200         (opt_catch_clauses): New production to use in try_statement
16201         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
16202         and re-write the code in the actions to extract the specific and
16203         general catch clauses by being a little smart ;-)
16204
16205         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
16206         Hooray, try and catch statements parse fine !
16207
16208 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16209
16210         * statement.cs (Block::GetVariableType): Fix logic to extract the type
16211         string from the hashtable of variables.
16212
16213         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
16214         I end up making that mistake ;-)
16215         (catch_clauses): Fixed gross error which made Key and Value of the 
16216         DictionaryEntry the same : $1 !!
16217
16218 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16219
16220         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
16221
16222         * cs-parser.jay (event_declaration): Correct to remove the semicolon
16223         when the add and remove accessors are specified. 
16224
16225 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
16226
16227         * cs-parser.jay (IndexerDeclaration): New helper class to hold
16228         information about indexer_declarator.
16229         (indexer_declarator): Implement actions.
16230         (parsing_indexer): New local boolean used to keep track of whether
16231         we are parsing indexers or properties. This is necessary because 
16232         implicit_parameters come into picture even for the get accessor in the 
16233         case of an indexer.
16234         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
16235
16236         * class.cs (Indexer): New class for indexer declarations.
16237         (TypeContainer::AddIndexer): New method to add an indexer to a type.
16238         (TypeContainer::indexers): New member to hold list of indexers for the
16239         type.
16240
16241 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
16242
16243         * cs-parser.jay (add_accessor_declaration): Implement action.
16244         (remove_accessor_declaration): Implement action.
16245         (event_accessors_declaration): Implement
16246         (variable_declarators): swap statements for first rule - trivial.
16247
16248         * class.cs (Event): New class to hold information about event
16249         declarations.
16250         (TypeContainer::AddEvent): New method to add an event to a type
16251         (TypeContainer::events): New member to hold list of events.
16252
16253         * cs-parser.jay (event_declaration): Implement actions.
16254
16255 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
16256
16257         * cs-parser.jay (dim_separators): Implement. Make it a string
16258         concatenating all the commas together, just as they appear.
16259         (opt_dim_separators): Modify accordingly
16260         (rank_specifiers): Update accordingly. Basically do the same
16261         thing - instead, collect the brackets here.
16262         (opt_rank_sepcifiers): Modify accordingly.
16263         (array_type): Modify to actually return the complete type string
16264         instead of ignoring the rank_specifiers.
16265         (expression_list): Implement to collect the expressions
16266         (variable_initializer): Implement. We make it a list of expressions
16267         essentially so that we can handle the array_initializer case neatly too.
16268         (variable_initializer_list): Implement.
16269         (array_initializer): Make it a list of variable_initializers
16270         (opt_array_initializer): Modify accordingly.
16271
16272         * expression.cs (New::NType): Add enumeration to help us
16273         keep track of whether we have an object/delegate creation
16274         or an array creation.
16275         (New:NewType, New::Rank, New::Indices, New::Initializers): New
16276         members to hold data about array creation.
16277         (New:New): Modify to update NewType
16278         (New:New): New Overloaded contructor for the array creation
16279         case.
16280
16281         * cs-parser.jay (array_creation_expression): Implement to call
16282         the overloaded New constructor.
16283
16284 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
16285
16286         * class.cs (TypeContainer::Constructors): Return member
16287         constructors instead of returning null.
16288
16289 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
16290
16291         * typemanager.cs (InitCoreTypes): Initialize the various core
16292         types after we have populated the type manager with the user
16293         defined types (this distinction will be important later while
16294         compiling corlib.dll)
16295
16296         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
16297         on Expression Classification.  Now all expressions have a method
16298         `Resolve' and a method `Emit'.
16299
16300         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
16301         generation from working.     Also add some temporary debugging
16302         code. 
16303
16304 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
16305
16306         * codegen.cs: Lots of code generation pieces.  This is only the
16307         beginning, will continue tomorrow with more touches of polish.  We
16308         handle the fundamentals of if, while, do, for, return.  Others are
16309         trickier and I need to start working on invocations soon.
16310
16311         * gen-treedump.cs: Bug fix, use s.Increment here instead of
16312         s.InitStatement. 
16313
16314         * codegen.cs (EmitContext): New struct, used during code
16315         emission to keep a context.   Most of the code generation will be
16316         here. 
16317
16318         * cs-parser.jay: Add embedded blocks to the list of statements of
16319         this block.  So code generation proceeds in a top down fashion.
16320
16321 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
16322
16323         * statement.cs: Add support for multiple child blocks.
16324
16325 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
16326
16327         * codegen.cs (EmitCode): New function, will emit the code for a
16328         Block of code given a TypeContainer and its ILGenerator. 
16329
16330         * statement.cs (Block): Standard public readonly optimization.
16331         (Block::Block constructors): Link children. 
16332         (Block::Child): Child Linker.
16333         (Block::EmitVariables): Emits IL variable declarations.
16334
16335         * class.cs: Drop support for MethodGroups here, delay until
16336         Semantic Analysis.
16337         (Method::): Applied the same simplification that I did before, and
16338         move from Properties to public readonly fields.
16339         (Method::ParameterTypes): Returns the parameter types for the
16340         function, and implements a cache that will be useful later when I
16341         do error checking and the semantic analysis on the methods is
16342         performed.
16343         (Constructor::GetCallingConvention): Renamed from CallingConvetion
16344         and made a method, optional argument tells whether this is a class
16345         or a structure to apply the `has-this' bit.
16346         (Method::GetCallingConvention): Implement, returns the calling
16347         convention. 
16348         (Method::Define): Defines the type, a second pass is performed
16349         later to populate the methods.
16350
16351         (Constructor::ParameterTypes): implement a cache similar to the
16352         one on Method::ParameterTypes, useful later when we do semantic
16353         analysis. 
16354
16355         (TypeContainer::EmitMethod):  New method.  Emits methods.
16356
16357         * expression.cs: Removed MethodGroup class from here.
16358
16359         * parameter.cs (Parameters::GetCallingConvention): new method.
16360
16361 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
16362
16363         * class.cs (TypeContainer::Populate): Drop RootContext from the
16364         argument. 
16365
16366         (Constructor::CallingConvention): Returns the calling convention.
16367         (Constructor::ParameterTypes): Returns the constructor parameter
16368         types. 
16369
16370         (TypeContainer::AddConstructor): Keep track of default constructor
16371         and the default static constructor.
16372
16373         (Constructor::) Another class that starts using `public readonly'
16374         instead of properties. 
16375
16376         (Constructor::IsDefault): Whether this is a default constructor. 
16377
16378         (Field::) use readonly public fields instead of properties also.
16379
16380         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
16381         track of static constructors;  If none is used, turn on
16382         BeforeFieldInit in the TypeAttributes. 
16383
16384         * cs-parser.jay (opt_argument_list): now the return can be null
16385         for the cases where there are no arguments. 
16386
16387         (constructor_declarator): If there is no implicit `base' or
16388         `this', then invoke the default parent constructor. 
16389
16390         * modifiers.cs (MethodAttr): New static function maps a set of
16391         modifiers flags into a MethodAttributes enum
16392         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
16393         MethodAttr, TypeAttr to represent the various mappings where the
16394         modifiers are used.
16395         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
16396
16397 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
16398
16399         * parameter.cs (GetParameterInfo): Fix bug where there would be no
16400         method arguments.
16401
16402         * interface.cs (PopulateIndexer): Implemented the code generator
16403         for interface indexers.
16404
16405 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
16406
16407         * interface.cs (InterfaceMemberBase): Now we track the new status
16408         here.  
16409
16410         (PopulateProperty): Implement property population.  Woohoo!  Got
16411         Methods and Properties going today. 
16412
16413         Removed all the properties for interfaces, and replaced them with
16414         `public readonly' fields. 
16415
16416 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
16417
16418         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
16419         initialize their hashtables/arraylists only when they are needed
16420         instead of doing this always.
16421
16422         * parameter.cs: Handle refs and out parameters.
16423
16424         * cs-parser.jay: Use an ArrayList to construct the arguments
16425         instead of the ParameterCollection, and then cast that to a
16426         Parameter[] array.
16427
16428         * parameter.cs: Drop the use of ParameterCollection and use
16429         instead arrays of Parameters.
16430
16431         (GetParameterInfo): Use the Type, not the Name when resolving
16432         types. 
16433
16434 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
16435
16436         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
16437         and instead use public readonly fields.
16438
16439         * class.cs: Put back walking code for type containers.
16440
16441 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
16442
16443         * class.cs (MakeConstant): Code to define constants.
16444
16445         * rootcontext.cs (LookupType): New function.  Used to locate types 
16446
16447
16448 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
16449
16450         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
16451         this System.Reflection code is.  Kudos to Microsoft
16452
16453         * typemanager.cs: Implement a type cache and avoid loading all
16454         types at boot time.  Wrap in LookupType the internals.  This made
16455         the compiler so much faster.  Wow.  I rule!
16456
16457         * driver.cs: Make sure we always load mscorlib first (for
16458         debugging purposes, nothing really important).
16459
16460         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
16461         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
16462
16463         * rootcontext.cs: Lookup types on their namespace;  Lookup types
16464         on namespaces that have been imported using the `using' keyword.
16465
16466         * class.cs (TypeContainer::TypeAttr): Virtualize.
16467         (Class::TypeAttr): Return attributes suitable for this bad boy.
16468         (Struct::TypeAttr): ditto.
16469         Handle nested classes.
16470         (TypeContainer::) Remove all the type visiting code, it is now
16471         replaced with the rootcontext.cs code
16472
16473         * rootcontext.cs (GetClassBases): Added support for structs. 
16474
16475 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
16476
16477         * interface.cs, statement.cs, class.cs, parameter.cs,
16478         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
16479         Drop use of TypeRefs, and use strings instead.
16480
16481 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
16482
16483         * rootcontext.cs: 
16484
16485         * class.cs (Struct::Struct): set the SEALED flags after
16486         checking the modifiers.
16487         (TypeContainer::TypeAttr): new property, returns the
16488         TypeAttributes for a class.  
16489
16490         * cs-parser.jay (type_list): Oops, list production was creating a
16491         new list of base types.
16492
16493         * rootcontext.cs (StdLib): New property.
16494         (GetInterfaceTypeByName): returns an interface by type name, and
16495         encapsulates error handling here.
16496         (GetInterfaces): simplified.
16497         (ResolveTree): Encapsulated all the tree resolution here.
16498         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
16499         types. 
16500
16501         * driver.cs: Add support for --nostdlib, to avoid loading the
16502         default assemblies.
16503         (Main): Do not put tree resolution here. 
16504
16505         * rootcontext.cs: Beginning of the class resolution.
16506
16507 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
16508
16509         * rootcontext.cs: Provide better error reporting. 
16510
16511         * cs-parser.jay (interface_base): set our $$ to be interfaces.
16512
16513         * rootcontext.cs (CreateInterface): Handle the case where there
16514         are no parent interfaces.
16515
16516         (CloseTypes): Routine to flush types at the end.
16517         (CreateInterface): Track types.
16518         (GetInterfaces): Returns an array of Types from the list of
16519         defined interfaces.
16520
16521         * typemanager.c (AddUserType): Mechanism to track user types (puts
16522         the type on the global type hash, and allows us to close it at the
16523         end). 
16524
16525 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
16526
16527         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
16528         RecordInterface instead.
16529
16530         * cs-parser.jay: Updated to reflect changes above.
16531
16532         * decl.cs (Definition): Keep track of the TypeBuilder type that
16533         represents this type here.  Not sure we will use it in the long
16534         run, but wont hurt for now.
16535
16536         * driver.cs: Smaller changes to accomodate the new code.
16537
16538         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
16539         when done. 
16540
16541         * rootcontext.cs (CreateInterface):  New method, used to create
16542         the System.TypeBuilder type for interfaces.
16543         (ResolveInterfaces): new entry point to resolve the interface
16544         hierarchy. 
16545         (CodeGen): Property, used to keep track of the code generator.
16546
16547 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
16548
16549         * cs-parser.jay: Add a second production for delegate_declaration
16550         with `VOID'.
16551
16552         (enum_body): Put an opt_comma here instead of putting it on
16553         enum_body or enum_member_declarations so we can handle trailing
16554         commas on enumeration members.  Gets rid of a shift/reduce.
16555
16556         (type_list): Need a COMMA in the middle.
16557
16558         (indexer_declaration): Tell tokenizer to recognize get/set
16559
16560         * Remove old targets.
16561
16562         * Re-add the parser target.
16563
16564 2001-07-13  Simon Cozens <simon@simon-cozens.org>
16565
16566         * cs-parser.jay: Add precendence rules for a number of operators
16567         ot reduce the number of shift/reduce conflicts in the grammar.
16568
16569 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
16570
16571         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
16572         and put it here.
16573
16574         Get rid of old crufty code.
16575
16576         * rootcontext.cs: Use this to keep track of the parsed
16577         representation and the defined types available to the program. 
16578
16579         * gen-treedump.cs: adjust for new convention.
16580
16581         * type.cs: Split out the type manager, and the assembly builder
16582         from here. 
16583
16584         * typemanager.cs: the type manager will live here now.
16585
16586         * cil-codegen.cs: And the code generator here. 
16587
16588 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
16589
16590         * makefile: Fixed up for easy making.
16591
16592 2001-07-13  Simon Cozens <simon@simon-cozens.org>
16593
16594         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
16595         the 
16596
16597         (unary_expression): Expand pre_increment_expression and
16598         post_decrement_expression to reduce a shift/reduce.
16599
16600 2001-07-11  Simon Cozens
16601
16602         * cs-tokenizer.cs: Hex numbers should begin with a 0.
16603
16604         Improve allow_keyword_as_indent name.
16605
16606 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * Adjustments for Beta2. 
16609
16610 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
16611
16612         * decl.cs: Added `Define' abstract method.
16613         (InTransit): new property, used to catch recursive definitions. 
16614
16615         * interface.cs: Implement `Define'. 
16616
16617         * modifiers.cs: Map Modifiers.constants to
16618         System.Reflection.TypeAttribute flags.
16619
16620         * class.cs: Keep track of types and user-defined types.
16621         (BuilderInit): New method for creating an assembly
16622         (ResolveType): New function to launch the resolution process, only
16623         used by interfaces for now.
16624
16625         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
16626         that are inserted into the name space. 
16627
16628 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
16629
16630         * ARGH.  I have screwed up my tree so many times due to the use of
16631         rsync rather than using CVS.  Going to fix this at once. 
16632
16633         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
16634         load types.
16635
16636 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
16637
16638         * Experiment successful: Use System.Type rather that our own
16639         version of Type.  
16640
16641 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
16642
16643         * cs-parser.jay: Removed nsAliases from here.
16644
16645         Use new namespaces, handle `using XXX;' 
16646
16647         * namespace.cs: Reimplemented namespace handling, use a recursive
16648         definition of the class.  Now we can keep track of using clauses
16649         and catch invalid using clauses.
16650
16651 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
16652
16653         * gen-treedump.cs: Adapted for all the renaming.
16654
16655         * expression.cs (Expression): this class now has a Type property
16656         which returns an expression Type.
16657
16658         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
16659         `Type', as this has a different meaning now in the base
16660
16661 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
16662
16663         * interface.cs, class.cs: Removed from all the sources the
16664         references to signature computation, as we can not do method
16665         signature computation during the parsing time, as we are not
16666         trying to solve at that point distinguishing:
16667
16668         class X {
16669                 void a (Blah x) {}
16670                 void a (NS.Blah x) {}
16671         }
16672
16673         Which depending on the context might be valid or not, as we do not
16674         know if Blah is the same thing as NS.Blah at that point.
16675
16676         * Redid everything so the code uses TypeRefs now instead of
16677         Types.  TypeRefs are just temporary type placeholders, that need
16678         to be resolved.  They initially have a pointer to a string and the
16679         current scope in which they are used.  This is used later by the
16680         compiler to resolve the reference to an actual Type. 
16681
16682         * DeclSpace is no longer a CIR.Type, and neither are
16683         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
16684         are all DeclSpaces, but no Types. 
16685
16686         * type.cs (TypeRefManager): This implements the TypeRef manager,
16687         which keeps track of all the types that need to be resolved after
16688         the parsing has finished. 
16689
16690 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
16691
16692         * ARGH.  We are going to have to store `foreach' as a class rather
16693         than resolving it, as we need to verify error 1579 after name
16694         resolution.   *OR* we could keep a flag that says `This request to
16695         IEnumerator comes from a foreach statement' which we can then use
16696         to generate the error.
16697
16698 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
16699
16700         * class.cs (TypeContainer.AddMethod): we now add methods to the
16701         MethodGroup instead of the method hashtable.  
16702
16703         * expression.cs: Add MethodGroup abstraction, which gets us one
16704         step closer to the specification in the way we handle method
16705         declarations.  
16706
16707         * cs-parser.jay (primary_expression): qualified_identifier now
16708         tried to match up an identifier to a local variable reference or
16709         to a parameter reference.
16710
16711         current_local_parameters is now a parser global variable that
16712         points to the current parameters for the block, used during name
16713         lookup.
16714
16715         (property_declaration): Now creates an implicit `value' argument to
16716         the set accessor.
16717
16718 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
16719
16720         * parameter.cs: Do not use `param' arguments as part of the
16721         signature, per the spec.
16722
16723 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
16724
16725         * decl.cs: Base class for classes, structs and interfaces.  This
16726         is the "Declaration Space" 
16727
16728         * cs-parser.jay: Use CheckDef for checking declaration errors
16729         instead of having one on each function.
16730
16731         * class.cs: Factor out some code for handling error handling in
16732         accordance to the "Declarations" section in the "Basic Concepts"
16733         chapter in the ECMA C# spec.
16734
16735         * interface.cs: Make all interface member classes derive from
16736         InterfaceMemberBase.
16737
16738 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
16739
16740         * Many things: all interfaces are parsed and generated in
16741         gen-treedump.  Support for member variables, constructors,
16742         destructors, properties, constants is there.
16743
16744         Beginning of the IL backend, but very little done, just there for
16745         testing purposes. 
16746
16747 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
16748
16749         * cs-parser.jay: Fix labeled statement.
16750
16751         * cs-tokenizer.cs (escape): Escape " and ' always.
16752         ref_line, ref_name: keep track of the line/filename as instructed
16753         by #line by the compiler.
16754         Parse #line.
16755
16756 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
16757
16758         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
16759         to match the values in System.CodeDOM.
16760
16761         Divid renamed to Divide.
16762
16763         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
16764         statements. 
16765         (Statements.set): remove.
16766
16767         * System.CodeDOM/CodeCatchClause.cs: always have a valid
16768         statements. 
16769
16770         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
16771         falseStatements always have valid values. 
16772
16773         * cs-parser.jay: Use System.CodeDOM now.
16774